cxxtools-2.2.1/0000775000175000017500000000000012266277565010424 500000000000000cxxtools-2.2.1/include/0000775000175000017500000000000012266277564012046 500000000000000cxxtools-2.2.1/include/cxxtools/0000775000175000017500000000000012266277564013731 500000000000000cxxtools-2.2.1/include/cxxtools/hmac.h0000664000175000017500000000625012256773774014740 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* HMAC algorithm as described by RFC 2104 * http://tools.ietf.org/html/rfc2104 */ #ifndef CXXTOOLS_HMAC_H #define CXXTOOLS_HMAC_H #include #include namespace cxxtools { template void hmac_pad_key(Algo& key_hash, const std::string& key, std::string& o_key_pad, std::string& i_key_pad) { std::string _key(key); if(key.length() > Algo::blockSize) _key = key_hash.getDigest(); _key.resize(Algo::blockSize); std::string::const_iterator key_it = _key.begin(); for(std::string::iterator pad_it = o_key_pad.begin(); pad_it != o_key_pad.end(); pad_it++) *pad_it = *pad_it ^ *key_it++; key_it = _key.begin(); for(std::string::iterator pad_it = i_key_pad.begin(); pad_it != i_key_pad.end(); pad_it++) *pad_it = *pad_it ^ *key_it++; } template std::string hmac(const std::string& key, const data_type& msg) { Algo key_hash(key); std::string o_key_pad(Algo::blockSize, 0x5c); std::string i_key_pad(Algo::blockSize, 0x36); cxxtools::hmac_pad_key(key_hash, key, o_key_pad, i_key_pad); Algo inner_hash(i_key_pad + msg); Algo outer_hash(o_key_pad + inner_hash.getDigest()); return outer_hash.getHexDigest(); } template std::string hmac(const std::string& key, iterator_type from, iterator_type to) { Algo key_hash(key); std::string o_key_pad(Algo::blockSize, 0x5c); std::string i_key_pad(Algo::blockSize, 0x36); std::stringstream is; cxxtools::hmac_pad_key(key_hash, key, o_key_pad, i_key_pad); std::copy(from, to, std::ostreambuf_iterator(is)); Algo inner_hash(i_key_pad + is.str()); Algo outer_hash(o_key_pad + inner_hash.getDigest()); return outer_hash.getHexDigest(); } } #endif // CXXTOOLS_HMAC_H cxxtools-2.2.1/include/cxxtools/slot.tpp0000664000175000017500000000111712256773774015362 00000000000000// BEGIN_BasicSlot 10 /** BasicSlot is a base type for various "slot" types. */ template < typename R, typename A1 = Void, typename A2 = Void, typename A3 = Void, typename A4 = Void, typename A5 = Void, typename A6 = Void, typename A7 = Void, typename A8 = Void, typename A9 = Void, typename A10 = Void> class BasicSlot : public Slot { public: /** Creates a copy of this object and returns it. The caller owns the returned object. */ virtual Slot* clone() const = 0; }; // END_BasicSlot 10 cxxtools-2.2.1/include/cxxtools/streambuffer.h0000664000175000017500000000757712256773774016532 00000000000000/* * Copyright (C) 2005 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_System_StreamBuffer_h #define cxxtools_System_StreamBuffer_h #include #include #include #include namespace cxxtools { template class BasicStreamBuffer : public std::basic_streambuf { public: std::streamsize speekn(CharT* buffer, std::streamsize size) { return this->xspeekn(buffer, size); } std::streamsize out_avail() { if( this->pptr() ) return this->pptr() - this->pbase(); return this->showfull(); } protected: virtual std::streamsize xspeekn(CharT* buffer, std::streamsize size) { if(size == 0) return 0; buffer[0] = this->sgetc(); return 1; } virtual std::streamsize showfull() { return 0; } }; //! @brief A stream buffer for IODevices with linear buffer area class CXXTOOLS_API StreamBuffer : public BasicStreamBuffer , public Connectable { public: //! @brief Constructs an IOBuffer for an IODevice explicit StreamBuffer(IODevice& ioDevice, size_t bufferSize = 8192, bool extend = false); //! @brief Default constructor explicit StreamBuffer(size_t bufferSize = 8192, bool extend = false); ~StreamBuffer(); void attach(IODevice& ioDevice); IODevice* device(); void beginRead(); void endRead(); size_t beginWrite(); size_t endWrite(); void discard(); Signal inputReady; Signal outputReady; protected: virtual int sync(); virtual std::streamsize showfull(); virtual std::streamsize xspeekn(char* buffer, std::streamsize size); virtual int_type underflow(); virtual int_type overflow(int_type ch); virtual int_type pbackfail(int_type c); /** @brief Alters the stream positions */ virtual pos_type seekoff(off_type offset, std::ios::seekdir sd, std::ios::openmode mode); /** @brief Alters the stream positions */ virtual pos_type seekpos(pos_type p, std::ios::openmode mode ); private: void onRead(IODevice& dev); void onWrite(IODevice& dev); private: IODevice* _ioDevice; size_t _ibufferSize; char* _ibuffer; std::size_t _obufferSize; char* _obuffer; const size_t _pbmax; bool _oextend; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/directory.h0000664000175000017500000001726212256773774016041 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DIRECTORY_H #define CXXTOOLS_DIRECTORY_H #include #include #include namespace cxxtools { /** @brief Iterates over entries of a directory. A %DirectoryIterator is created by the Directory class and can be used as follows: \code cxxtools::Directory d("/usr"); for (cxxtools::DirectoryIterator it = d.begin(); it != d.end(); ++it) { std::cout << "name: " << *it << std::endl; } \endcode */ class DirectoryIterator : public std::iterator { public: //! @brief Default constructor DirectoryIterator(); //! @brief Constructs an iterator pointing at the file given by a path DirectoryIterator(const std::string& path, bool skipHiden = false); //! @brief Copy constructor DirectoryIterator(const DirectoryIterator& it); //! @brief Destructor ~DirectoryIterator(); //! @brief Advances the iterator to the next file DirectoryIterator& operator++(); //! @brief Assignment operator DirectoryIterator& operator=(const DirectoryIterator& it); //! @brief Equality comparison bool operator==(const DirectoryIterator& it) const { return _impl == it._impl; } //! @brief Inequality comparison bool operator!=(const DirectoryIterator& it) const { return _impl != it._impl; } //! @brief Returns the full path of the file the iterator points at const std::string& path() const; //! @brief Returns the name of the file the iterator points at const std::string& operator*() const; const std::string* operator->() const; private: //! @internal class DirectoryIteratorImpl* _impl; }; /** @brief Represents a single directory in the file-system. This class contains methods to create, move, delete directories and gives to possibility to iterate over the contents of the directory. Iterator Example: \code cxxtools::Directory d("/usr"); for (cxxtools::DirectoryIterator it = d.begin(); it != d.end(); ++it) { std::cout << "name: " << *it << std::endl; } \endcode */ class Directory { public: typedef DirectoryIterator const_iterator; public: //! @brief Default Constructor Directory(); /** @brief Constructs a %Directory object from the path \a path If no directory exists at \a path, an exception of type DirectoryNotFound is thrown. */ explicit Directory(const std::string& path); /** @brief Constructs a %Directory object from a FileInfo object An exception of type %DirectoryNotFound is thrown if the %FileInfo does not represent a directory. */ explicit Directory(const FileInfo& fi); //! @brief Copy constructor Directory(const Directory& dir); //! @brief Destructor ~Directory(); //! @brief Assignment operator Directory& operator=(const Directory& dir); /** @brief Returns the path of the directory This method may return a relative path, or a fully qualified one depending on how this object was constructed. */ const std::string& path() const { return _path; } //! @brief Returns the size of the directory in bytes std::size_t size() const; /** @brief Returns the parent directory path This method might return an empty string if the node was created without a complete path. If the directory is located in the root directory of a unix file system, a slash ("/") is returned. A returned directory path always ends with a trailing path separator character. (A backslash in Windows and a slash in Unix, for example.) */ std::string dirName() const; //! @brief Returns the name of the directory excluding the path. std::string name() const; /** @brief Removes the directory This object will be invalid after calling this method. */ void remove(); /** @brief Moves the directory to the location given by \a to The %Directory object will stay valid after this method was called and point to the moved directory. */ void move(const std::string& to); //! @brief Returns an iterator to the first entry in the directory. const_iterator begin(bool skipHiden = false) const; //! @brief Returns an iterator to the end of the directory entries. const_iterator end() const; public: //! @brief Creates a new directory at the path given by \a path static Directory create(const std::string& path); //! @brief Returns true if a directory exists at \a path, or false otherwise static bool exists(const std::string& path); //! @brief Changes the current directory static void chdir(const std::string& path); //! @brief Returns the current directory static std::string cwd(); //! @brief Returns the string representng the current directory in path names static std::string curdir(); //! @brief Returns the string representng the upper directory in path names static std::string updir(); /** @brief Returns the system root path Returns "/" (root) on Linux, "c:\" on Windows */ static std::string rootdir(); /** @brief Returns the systems tmp directory. The environment variables TEMP and TMP are checked first. If not set, "/tmp" is returned if it exists. If none of the environment variables are set and the default system tmp directory does not exist, the current directory is returned. */ static std::string tmpdir(); //! @brief Returns the string representng the separator in path names static std::string sep(); private: //! @internal std::string _path; }; inline bool operator<(const Directory& a, const Directory& b) { return a.path() < b.path(); } inline bool operator==(const Directory& a, const Directory& b) { return a.path() == b.path(); } inline bool operator!=(const Directory& a, const Directory& b) { return !(a == b); } } #endif cxxtools-2.2.1/include/cxxtools/queue.h0000664000175000017500000001411112256773774015147 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUEUE_H #define CXXTOOLS_QUEUE_H #include #include #include namespace cxxtools { /** @brief This class implements a thread safe queue. A queue is a container where the elements put into the queue are fetched in the same order (first-in-first-out, fifo). The class has a optional maximum size. If the size is set to 0 the queue has no limit. Otherwise putting a element to the queue may block until another thread fetches a element or increases the limit. */ template class Queue { public: typedef T value_type; typedef typename std::deque::size_type size_type; typedef typename std::deque::const_reference const_reference; private: mutable Mutex _mutex; Condition _notEmpty; Condition _notFull; std::deque _queue; size_type _maxSize; size_type _numWaiting; public: /// @brief Default Constructor. Queue() : _maxSize(0), _numWaiting(0) { } /** @brief Returns the next element. This method returns the next element. If the queue is empty, the thread will be locked until a element is available. */ value_type get(); /** @brief Returns the next element if the queue is not empty. If the queue is empty, a default constructed value_type is returned. The returned flag is set to false, if the queue was empty. */ std::pair tryGet(); /** @brief Adds a element to the queue. This method adds a element to the queue. If the queue has reached his maximum size, the method blocks until there is space available. */ void put(const_reference element, bool force = false); /// @brief Returns true, if the queue is empty. bool empty() const { MutexLock lock(_mutex); return _queue.empty(); } /// @brief Returns the number of elements currently in queue. size_type size() const { MutexLock lock(_mutex); return _queue.size(); } /** @brief sets the maximum size of the queue. Setting the maximum size of the queue may wake up another thread, if it is waiting for space to get available and the limit is increased. */ void maxSize(size_type m); /// @brief returns the maximum size of the queue. size_type maxSize() const { MutexLock lock(_mutex); return _maxSize; } /// @brief returns the number of threads blocked in the get method. size_type numWaiting() const { MutexLock lock(_mutex); return _numWaiting; } }; template typename Queue::value_type Queue::get() { MutexLock lock(_mutex); ++_numWaiting; while (_queue.empty()) _notEmpty.wait(lock); --_numWaiting; value_type element = _queue.front(); _queue.pop_front(); if (!_queue.empty()) _notEmpty.signal(); _notFull.signal(); return element; } template std::pair::value_type, bool> Queue::tryGet() { typedef typename Queue::value_type value_type; typedef typename std::pair return_type; MutexLock lock(_mutex); if (_queue.empty()) return return_type(value_type(), false); value_type element = _queue.front(); _queue.pop_front(); if (!_queue.empty()) _notEmpty.signal(); _notFull.signal(); return return_type(element, true); } template void Queue::put(typename Queue::const_reference element, bool force) { MutexLock lock(_mutex); if (!force) while (_maxSize > 0 && _queue.size() >= _maxSize) _notFull.wait(lock); _queue.push_back(element); _notEmpty.signal(); if (_maxSize > 0 && _queue.size() < _maxSize) _notFull.signal(); } template void Queue::maxSize(size_type m) { _maxSize = m; MutexLock lock(_mutex); if (_queue.size() < _maxSize) _notFull.signal(); } } #endif // CXXTOOLS_QUEUE_H cxxtools-2.2.1/include/cxxtools/convert.h0000664000175000017500000006453412256773774015521 00000000000000/* * Copyright (C) 2004-2007 by Marc Boris Duerner * Copyright (C) 2004-2007 by Stepan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CONVERT_H #define CXXTOOLS_CONVERT_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace cxxtools { // // Conversions to cxxtools::String // inline void convert(String& s, const String& str) { s = str; } CXXTOOLS_API void convert(String& s, const std::string& value); CXXTOOLS_API void convert(String& s, bool value); CXXTOOLS_API void convert(String& s, char value); CXXTOOLS_API void convert(String& s, wchar_t value); CXXTOOLS_API void convert(String& s, Char value); CXXTOOLS_API void convert(String& s, unsigned char value); CXXTOOLS_API void convert(String& s, signed char value); CXXTOOLS_API void convert(String& s, short value); CXXTOOLS_API void convert(String& s, unsigned short value); CXXTOOLS_API void convert(String& s, int value); CXXTOOLS_API void convert(String& s, unsigned int value); CXXTOOLS_API void convert(String& s, long value); CXXTOOLS_API void convert(String& s, unsigned long value); CXXTOOLS_API void convert(String& s, float value); CXXTOOLS_API void convert(String& s, double value); CXXTOOLS_API void convert(String& s, long double value); template inline void convert(String& s, const T& value) { OStringStream os; os << value; s = os.str(); } // // Conversions from cxxtools::String // CXXTOOLS_API void convert(bool& n, const String& str); CXXTOOLS_API void convert(char& n, const String& str); CXXTOOLS_API void convert(wchar_t& n, const String& str); CXXTOOLS_API void convert(Char& n, const String& str); CXXTOOLS_API void convert(unsigned char& n, const String& str); CXXTOOLS_API void convert(signed char& n, const String& str); CXXTOOLS_API void convert(short& n, const String& str); CXXTOOLS_API void convert(unsigned short& n, const String& str); CXXTOOLS_API void convert(int& n, const String& str); CXXTOOLS_API void convert(unsigned int& n, const String& str); CXXTOOLS_API void convert(long& n, const String& str); CXXTOOLS_API void convert(unsigned long& n, const String& str); #ifdef HAVE_LONG_LONG CXXTOOLS_API void convert(long long& n, const String& str); #endif #ifdef HAVE_UNSIGNED_LONG_LONG CXXTOOLS_API void convert(unsigned long long& n, const String& str); #endif CXXTOOLS_API void convert(float& n, const String& str); CXXTOOLS_API void convert(double& n, const String& str); CXXTOOLS_API void convert(long double& n, const String& str); template inline void convert(T& t, const String& str) { IStringStream is(str); Char ch; is >> t; if (is.fail() || !(is >> ch).eof()) ConversionError::doThrow(typeid(T).name(), "String"); } // // Conversions to std::string // inline void convert(std::string& s, const std::string& str) { s = str; } CXXTOOLS_API void convert(std::string& s, const String& str); CXXTOOLS_API void convert(std::string& s, bool value); CXXTOOLS_API void convert(std::string& s, char value); CXXTOOLS_API void convert(std::string& s, signed char value); CXXTOOLS_API void convert(std::string& s, unsigned char value); CXXTOOLS_API void convert(std::string& s, short value); CXXTOOLS_API void convert(std::string& s, unsigned short value); CXXTOOLS_API void convert(std::string& s, int value); CXXTOOLS_API void convert(std::string& s, unsigned int value); CXXTOOLS_API void convert(std::string& s, long value); CXXTOOLS_API void convert(std::string& s, unsigned long value); CXXTOOLS_API void convert(std::string& s, float value); CXXTOOLS_API void convert(std::string& s, double value); CXXTOOLS_API void convert(std::string& s, long double value); template inline void convert(std::string& s, const T& value) { std::ostringstream os; os << value; s = os.str(); } // // Conversions from std::string // CXXTOOLS_API void convert(bool& n, const std::string& str); CXXTOOLS_API void convert(char& n, const std::string& str); CXXTOOLS_API void convert(signed char& n, const std::string& str); CXXTOOLS_API void convert(unsigned char& n, const std::string& str); CXXTOOLS_API void convert(short& n, const std::string& str); CXXTOOLS_API void convert(unsigned short& n, const std::string& str); CXXTOOLS_API void convert(int& n, const std::string& str); CXXTOOLS_API void convert(unsigned int& n, const std::string& str); CXXTOOLS_API void convert(long& n, const std::string& str); CXXTOOLS_API void convert(unsigned long& n, const std::string& str); #ifdef HAVE_LONG_LONG CXXTOOLS_API void convert(long long& n, const std::string& str); #endif #ifdef HAVE_UNSIGNED_LONG_LONG CXXTOOLS_API void convert(unsigned long long& n, const std::string& str); #endif CXXTOOLS_API void convert(float& n, const std::string& str); CXXTOOLS_API void convert(double& n, const std::string& str); CXXTOOLS_API void convert(long double& n, const std::string& str); template inline void convert(T& t, const std::string& str) { std::istringstream is(str); char ch; is >> t; if (is.fail() || !(is >> ch).eof()) ConversionError::doThrow(typeid(T).name(), "string"); } // // Conversions from const char* (null-terminated) // CXXTOOLS_API void convert(bool& n, const char* str); CXXTOOLS_API void convert(char& n, const char* str); CXXTOOLS_API void convert(signed char& n, const char* str); CXXTOOLS_API void convert(unsigned char& n, const char* str); CXXTOOLS_API void convert(short& n, const char* str); CXXTOOLS_API void convert(unsigned short& n, const char* str); CXXTOOLS_API void convert(int& n, const char* str); CXXTOOLS_API void convert(unsigned int& n, const char* str); CXXTOOLS_API void convert(long& n, const char* str); CXXTOOLS_API void convert(unsigned long& n, const char* str); #ifdef HAVE_LONG_LONG CXXTOOLS_API void convert(long long& n, const char* str); #endif #ifdef HAVE_UNSIGNED_LONG_LONG CXXTOOLS_API void convert(unsigned long long& n, const char* str); #endif CXXTOOLS_API void convert(float& n, const char* str); CXXTOOLS_API void convert(double& n, const char* str); CXXTOOLS_API void convert(long double& n, const char* str); // // Generic stream-based conversions // template void convert(T& to, const S& from) { StringStream ss; if( !(ss << from && ss >> to) ) throw ConversionError("conversion between streamable types failed"); } template struct Convert { T operator()(const S& from) const { T value = T(); convert(value, from); return value; } }; template T convert(const S& from) { T value = T(); convert(value, from); return value; } // // number formatting // /** @brief Formats an integer in a given format format. */ template inline OutIterT putInt(OutIterT it, T i, const FormatT& fmt); /** @brief Formats an integer in a decimal format. */ template inline OutIterT putInt(OutIterT it, T i); /** @brief Formats a floating point value in a given format. */ template OutIterT putFloat(OutIterT it, T d, const FormatT& fmt, int precision); /** @brief Formats a floating point value in default format. */ template OutIterT putFloat(OutIterT it, T d); // // number parsing // /** @brief Parses an integer value in a given format. */ template InIterT getInt(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt); /** @brief Parses an integer value in decimal format. */ template InIterT getInt(InIterT it, InIterT end, bool& ok, T& n); /** @brief Parses a floating point value in a given format. */ template InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt); /** @brief Parses a floating point value. */ template InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n); template struct NumberFormat { typedef CharType CharT; static CharT plus() { return CharT('+'); } static CharT minus() { return CharT('-'); } }; template struct DecimalFormat : public NumberFormat { typedef CharType CharT; static const unsigned base = 10; static CharT toChar(unsigned char n) { return CharT(static_cast('0' + n)); } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { int cc = std::char_traits::to_int_type(ch) - 48; // let negatives overrun return static_cast(cc); } }; template struct OctalFormat : public NumberFormat { typedef CharType CharT; static const unsigned base = 8; static CharT toChar(unsigned char n) { return CharT(static_cast('0' + n)); } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { int cc = std::char_traits::to_int_type(ch) - 48; // let negatives overrun return static_cast(cc); } }; template struct HexFormat : public NumberFormat { typedef CharType CharT; static const unsigned base = 16; static CharT toChar(unsigned char n) { n &= 0x1F; // prevent overrun static const char* digtab = "0123456789abcdef"; return digtab[n]; } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { static const unsigned char chartab[64] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,10,11,12,13,14,15,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,10,11,12,13,14,15,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, }; int cc = ch - 48; // let negatives overrun unsigned uc = static_cast(cc); if(uc > 64) return 0xFF; unsigned char idx = static_cast(uc); return chartab[ idx ]; } }; template struct BinaryFormat : public NumberFormat { typedef CharType CharT; static const unsigned base = 2; static CharT toChar(unsigned char n) { return CharT(static_cast('0' + n)); } /** @brief Converts a character to a digit. Returns a number equal or less than the base on success or a number greater than base on failure. */ static unsigned char toDigit(CharT ch) { int cc = std::char_traits::to_int_type(ch) - 48; // let negatives overrun return static_cast(cc); } }; template struct FloatFormat : public DecimalFormat { typedef CharType CharT; static CharT point() { return CharT('.'); } static CharT e() { return CharT('e'); } static CharT E() { return CharT('E'); } static const CharT* nan() { static const CharT nanstr[] = { CharT('n'), CharT('a'), CharT('n'), 0 }; return nanstr; } static const CharT* inf() { static const CharT nanstr[] = { CharT('i'), CharT('n'), CharT('f'), 0 }; return nanstr; } }; //! @internal @brief Returns the absolute value of \a i inline unsigned char formatAbs(char i, bool& isNeg) { isNeg = i < 0; unsigned char u = isNeg ? -i : static_cast(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned char formatAbs(unsigned char i, bool& isNeg) { isNeg = false; return i; } //! @internal @brief Returns the absolute value of \a i inline unsigned short formatAbs(short i, bool& isNeg) { isNeg = i < 0; unsigned short u = isNeg ? -i : static_cast(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned short formatAbs(unsigned short i, bool& isNeg) { isNeg = false; return i; } //! @internal @brief Returns the absolute value of \a i inline unsigned int formatAbs(int i, bool& isNeg) { isNeg = i < 0; unsigned int u = isNeg ? -i : static_cast(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned int formatAbs(unsigned int i, bool& isNeg) { isNeg = false; return i; } //! @internal @brief Returns the absolute value of \a i inline unsigned long formatAbs(long i, bool& isNeg) { isNeg = i < 0; unsigned long u = isNeg ? -i : static_cast(i); return u; } //! @internal @brief Returns the absolute value of \a i inline unsigned long formatAbs(unsigned long i, bool& isNeg) { isNeg = false; return i; } #ifdef HAVE_LONG_LONG //! @internal @brief Returns the absolute value of \a i inline unsigned long long formatAbs(long long i, bool& isNeg) { isNeg = i < 0; unsigned long long u = isNeg ? -i : static_cast(i); return u; } #endif #ifdef HAVE_UNSIGNEDLONG_LONG //! @internal @brief Returns the absolute value of \a i inline unsigned long long formatAbs(unsigned long long i, bool& isNeg) { isNeg = false; return i; } #endif /** @brief Formats an integer in a given format. */ template inline CharT* formatInt(CharT* buf, std::size_t buflen, T si, const FormatT& fmt) { typedef typename IntTraits::Unsigned UnsignedInt; CharT* end = buf + buflen; CharT* cur = end; const unsigned base = fmt.base; bool isNeg = false; UnsignedInt u = formatAbs(si, isNeg); do { T lsd = u % base; u /= base; --cur; *cur = fmt.toChar( unsigned(lsd) ); } while(u != 0 && cur != buf); if(cur == buf) return buf; if(isNeg) { --cur; *cur = fmt.minus(); } return cur; } /** @brief Formats an integer in binary format. */ template inline CharT* formatInt(CharT* buf, std::size_t buflen, T i, const BinaryFormat& fmt) { CharT* end = buf + buflen; CharT* cur = end; T mask = 1; do { --cur; *cur = fmt.toChar( unsigned(i & mask)); i = i >> 1; } while(i != 0 && cur != buf); if(cur == buf) return buf; return cur; } template inline OutIterT putInt(OutIterT it, T i, const FormatT& fmt) { // large enough even for binary and a sign const std::size_t buflen = (sizeof(T) * 8) + 1; typename FormatT::CharT buf[buflen]; typename FormatT::CharT* p = formatInt(buf, buflen, i, fmt); typename FormatT::CharT* end = buf + buflen; for(; p != end; ++p) *it++ = *p; return it; } template inline OutIterT putInt(OutIterT it, T i) { DecimalFormat fmt; return putInt(it, i, fmt); } template inline OutIterT putFloat(OutIterT it, T d, const FormatT& fmt, int precision) { typedef typename FormatT::CharT CharT; // 1. Test for not-a-number with d != d if( d != d ) { for(const CharT* nanstr = fmt.nan(); *nanstr != 0; ++nanstr) { *it = *nanstr; ++it; } return it; } // 2. check sign if(d < 0.0) { *it = fmt.minus(); ++it; } T num = std::fabs(d); // 3. Test for infinity if( num == std::numeric_limits::infinity() ) { for(const CharT* infstr = fmt.inf(); *infstr != 0; ++infstr) { *it = *infstr; ++it; } return it; } const int bufsize = std::numeric_limits::digits10 + 1; if (precision > bufsize) precision = bufsize; CharT fract[bufsize + 1]; fract[bufsize] = CharT('\0'); int exp = static_cast(std::floor(std::log10(num))) + 1; num *= std::pow(T(10.0), static_cast(precision) - exp); num += .5; bool notZero = false; for (unsigned short d = precision; d > 0; --d) { T n = num / 10.0; T fl = std::floor(n) * 10.0; unsigned char v = static_cast(num - fl); notZero |= (v != 0); fract[d - 1] = notZero ? fmt.toChar(v) : CharT('\0'); num = n; } if (fract[0] == CharT('\0')) { *it = '0'; ++it; return it; } if (exp <= 0) { *it = '0'; ++it; *it = '.'; ++it; while (exp < 0) { *it = '0'; ++it; ++exp; } for (int d = 0; fract[d]; ++d) { *it = fract[d]; ++it; } } else { for (int d = 0; fract[d]; ++d) { if (exp-- == 0) { *it = '.'; ++it; } *it = fract[d]; ++it; } while (exp-- > 0) { *it = '0'; ++it; } } return it; } template inline OutIterT putFloat(OutIterT it, T d) { const int precision = std::numeric_limits::digits10 + 1; FloatFormat fmt; return putFloat(it, d, fmt, precision); } template InIterT getSign(InIterT it, InIterT end, bool& pos, const FormatT& fmt) { pos = true; // strip leading whitespace, parse sign while (it != end && isspace(*it)) ++it; if(*it == fmt.minus()) { pos = false; ++it; } else if( *it == fmt.plus() ) { ++it; } return it; } template InIterT getInt(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt) { typedef typename IntTraits::Unsigned UnsignedInt; typedef typename IntTraits::Signed SignedInt; n = 0; ok = false; UnsignedInt max = std::numeric_limits::max(); bool pos = false; it = getSign(it, end, pos, fmt); if (it == end) return it; bool isNeg = ! pos; if( isNeg ) { // return if minus sign was parsed for unsigned type if( isNeg != std::numeric_limits::is_signed) return it; // abs(min) is max for negative signed types SignedInt smin = std::numeric_limits::min(); max = static_cast(-smin); } // parse number UnsignedInt u = 0; const UnsignedInt base = fmt.base; unsigned char d = 0; while(it != end) { d = fmt.toDigit(*it); if(d >= base) break; if ( u != 0u && base > (max/u) ) return it; u *= base; if(d > max - u) return it; u += d; ++it; } if( isNeg ) n = static_cast(u * -1); else n = static_cast(u); ok = true; return it; } template InIterT getInt(InIterT it, InIterT end, bool& ok, T& n) { return getInt(it, end, ok, n, DecimalFormat() ); } template InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n, const FormatT& fmt) { typedef typename FormatT::CharT CharT; CharT zero = fmt.toChar(0); n = 0.0; ok = false; bool pos = false; it = getSign(it, end, pos, fmt); if (it == end) return it; // NaN, -inf, +inf bool done = false; while(it != end) { switch(std::char_traits::to_int_type(*it)) { case 'n': case 'N': if(++it == end) return it; if(*it != CharT('a') && *it != CharT('A')) return it; if(++it == end) return it; if(*it != CharT('n') && *it != CharT('N')) return it; // NaNQ, NaNS (seen on AIX/xlC) { InIterT nit = it; ++nit; if (*nit == CharT('q') || *nit == CharT('Q')) { n = std::numeric_limits::quiet_NaN(); ++it; } else if (*nit == CharT('s') || *nit == CharT('S')) { n = std::numeric_limits::signaling_NaN(); ++it; } else { n = std::numeric_limits::quiet_NaN(); } } ok = true; return ++it; break; case 'i': case 'I': if(++it == end) return it; if(*it != CharT('n') && *it != CharT('N')) return it; if(++it == end) return it; if(*it != CharT('f') && *it != CharT('F')) return it; if( ++it != end ) { if(*it != CharT('i') && *it != CharT('I')) return it; if(++it == end) return it; if(*it != CharT('n') && *it != CharT('N')) return it; if(++it == end) return it; if(*it != CharT('i') && *it != CharT('I')) return it; if(++it == end) return it; if(*it != CharT('t') && *it != CharT('T')) return it; if(++it == end) return it; if(*it != CharT('y') && *it != CharT('Y')) return it; ++it; } n = std::numeric_limits::infinity(); if(!pos) n *= -1; ok = true; return it; break; default: done = true; break; } if(done) break; ++it; } // integral part bool withFractional = false; for( ; it != end; ++it) { if( *it == fmt.point() || *it == fmt.e() || *it == fmt.E() ) { if( *it == fmt.point()) { withFractional = true; ++it; } break; } unsigned digit = fmt.toDigit(*it); if(digit >= fmt.base) return it; n *= 10; n += digit; } // it is ok, if fraction is missing if(it == end) { if( ! pos ) n *= -1; ok = true; return it; } T base = 10.0; if( withFractional) { // fractional part, ignore 0 digits after dot unsigned short fractDigits = 0; size_t maxDigits = std::numeric_limits::max() - std::numeric_limits::digits10; while(it != end && *it == zero) { if( fractDigits > maxDigits ) return it; ++fractDigits; ++it; } // fractional part, parse like integer, skip insignificant digits unsigned short significants = 0; T fraction = 0.0; for( ; it != end; ++it) { unsigned digit = fmt.toDigit(*it); if(digit >= fmt.base) break; if( significants <= std::numeric_limits::digits10 ) { fraction *= 10; fraction += digit; ++fractDigits; ++significants; } } // fractional part, scale down fraction /= std::pow(base, T(fractDigits)); n += fraction; } // exponent [e|E][+|-][0-9]* if(it != end && (*it == fmt.e() || *it == fmt.E()) ) { if(++it == end) return it; long exp = 0; it = getInt(it, end, ok, exp, fmt); if( ! ok ) return it; n *= std::pow(base, T(exp)); } if( ! pos ) n *= -1; ok = true; return it; } template InIterT getFloat(InIterT it, InIterT end, bool& ok, T& n) { return getFloat( it, end, ok, n, FloatFormat() ); } } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/singleton.h0000664000175000017500000001056512256773774016036 00000000000000/* * Copyright (C) 2005-2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Singleton_h #define cxxtools_Singleton_h #include #include #include namespace cxxtools { /** @brief Singleton class template @ingroup cxxtools @param T Type of the singleton @param A Allocator for type T The Singleton class template can be used to easily implement the Singleton design pattern. It can either be used directly or as a base class. An allocator can be used to control how the singleton instance will be allocated. The follwing example shows how to use the singleton as a base class: @code class MySingleton : public Singleton { friend class Singleton; // ... }; @endcode */ template > class Singleton : private NonCopyable { public: typedef A Allocator; public: /** @brief Returns the instance of the singleton type When called for the first time, the singleton instance will be created with the specified alloctaor. All subsequent calls wikk return a reference to the previously created instance. @return The singleton instance */ static T& instance() { if(!_instance) { try { _instance = (T*)_allocator.allocate(1); new (_instance) T(); std::atexit(&atExit); } catch( const std::bad_alloc& e ) { throw e; } catch(...) { _allocator.deallocate(_instance, 1); _instance = 0; throw; } } return *_instance; } protected: /** @brief Constructor */ Singleton() { } /** @brief Destructor */ ~Singleton() { } private: /** @brief Exit handler This function is set as the program exit handler and will destroy the singleton instance at the end of the program using the specified allocator. */ static void atExit() { _instance->~T(); _allocator.deallocate(_instance, 1); _instance = 0; } private: static A _allocator; static T* _instance; }; template A Singleton::_allocator; template T* Singleton::_instance = 0; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/atomicity.gcc.avr32.h0000664000175000017500000000276612256773774017531 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_ATMEL32_H #define CXXTOOLS_ATOMICINT_GCC_ATMEL32_H namespace cxxtools { typedef int atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/systemerror.h0000664000175000017500000000567212256773774016435 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2005-2007 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_ERROR_H #define CXXTOOLS_SYSTEM_ERROR_H #include #include namespace cxxtools { /** @brief Exception class indicating a system error. */ class SystemError : public std::runtime_error { public: SystemError(int err, const char* fn); explicit SystemError(const char* fn); SystemError(const char* fn, const std::string& msg); ~SystemError() throw(); int getErrno() const { return m_errno; } private: int m_errno; }; void throwSystemError(const char* msg); inline void throwSystemError(const std::string& msg) { throwSystemError(msg.c_str()); } void throwSystemError(int errnum, const char* msg); /** @brief Thrown, when a shared library could not be loaded */ class OpenLibraryFailed : public SystemError { std::string _library; public: //! @brief Constructs from a message string explicit OpenLibraryFailed(const std::string& library); //! @brief Destructor ~OpenLibraryFailed() throw() {} const std::string& library() const { return _library; } }; /** @brief Thrown, when a symbol is not found in a library */ class SymbolNotFound : public SystemError { std::string _symbol; public: explicit SymbolNotFound(const std::string& sym); //! @brief Destructor ~SymbolNotFound() throw() {} //! @brief Returns the symbol, which was not found const std::string& symbol() const { return _symbol; } }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/typetraits.h0000664000175000017500000001407712256773774016246 00000000000000/* * Copyright (C) 2005 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_TypeTraits_h #define cxxtools_TypeTraits_h #include #include #include #include namespace cxxtools { template struct TypeTraitsBase { typedef T Value; typedef const T ConstValue; typedef T& Reference; typedef const T& ConstReference; typedef T* Pointer; typedef const T* ConstPointer; }; /** @brief Type-traits for for non-const value types Compile time type information (CTTI) is implemented in cxxtools by the means of TypeTraits. A number of specialisations allows compile type branching in gerneric code depending on the type. */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 0; static const unsigned int isReference = 0; }; /** @brief Type-traits for for const value types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 1; static const unsigned int isPointer = 0; static const unsigned int isReference = 0; }; /** @brief Type-traits for for non-const reference types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 0; static const unsigned int isReference = 1; }; /** @brief Type-traits for for const reference types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 1; static const unsigned int isPointer = 0; static const unsigned int isReference = 1; }; /** @brief Type-traits for for non-const pointer types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 1; static const unsigned int isReference = 0; }; /** @brief Type-traits for for const pointer types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 1; static const unsigned int isPointer = 1; static const unsigned int isReference = 0; }; /** @brief Type-traits for for fixed-size array types */ template struct TypeTraits : public TypeTraitsBase { static const unsigned int isConst = 0; static const unsigned int isPointer = 1; static const unsigned int isReference = 0; }; /** @brief Type-traits for for void */ template <> struct TypeTraits { typedef void Value; typedef void ConstType; typedef void Reference; typedef void ConstReference; typedef void* Pointer; typedef void* ConstPointer; static const unsigned int isConst = 0; static const unsigned int isPointer = 0; static const unsigned int isReference = 0; }; template struct IntTraits {}; template <> struct IntTraits { typedef unsigned char Unsigned; typedef signed char Signed; }; template <> struct IntTraits { typedef unsigned char Unsigned; typedef signed char Signed; }; template <> struct IntTraits { typedef unsigned short Unsigned; typedef signed short Signed; }; template <> struct IntTraits { typedef unsigned short Unsigned; typedef signed short Signed; }; template <> struct IntTraits { typedef unsigned int Unsigned; typedef signed int Signed; }; template <> struct IntTraits { typedef unsigned int Unsigned; typedef signed int Signed; }; template <> struct IntTraits { typedef unsigned long Unsigned; typedef signed long Signed; }; template <> struct IntTraits { typedef unsigned long Unsigned; typedef signed long Signed; }; #ifdef HAVE_LONG_LONG template <> struct IntTraits { typedef unsigned long long Unsigned; typedef signed long long Signed; }; #endif #ifdef HAVE_UNSIGNED_LONG_LONG template <> struct IntTraits { typedef unsigned long long Unsigned; typedef signed long long Signed; }; #endif } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/composer.h0000664000175000017500000000412212266277345015645 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Composer_h #define cxxtools_Composer_h #include namespace cxxtools { class IComposer { IComposer(const IComposer&) { } IComposer& operator= (const IComposer&) { return *this; } public: IComposer() {} virtual ~IComposer() {} virtual void fixup(const SerializationInfo& si) = 0; }; template class Composer : public IComposer { public: Composer() : _type(0) {} void begin(T& type) { _type = &type; } virtual void fixup(const SerializationInfo& si) { si >>= *_type; } private: T* _type; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/textcodec.h0000664000175000017500000004142212256773774016012 00000000000000/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_TextCodec_h #define cxxtools_TextCodec_h #include #include #include #include #ifdef CXXTOOLS_WITH_STD_LOCALE namespace std { template<> class CXXTOOLS_API codecvt : public codecvt_base, public locale::facet { public: static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit codecvt(size_t ref = 0); virtual ~codecvt(); codecvt_base::result out(cxxtools::MBState& state, const cxxtools::Char* from, const cxxtools::Char* from_end, const cxxtools::Char*& from_next, char* to, char* to_end, char*& to_next) const { return this->do_out(state, from, from_end, from_next, to, to_end, to_next); } codecvt_base::result unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const { return this->do_unshift(state, to, to_end, to_next); } codecvt_base::result in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, cxxtools::Char* to, cxxtools::Char* to_end, cxxtools::Char*& to_next) const { return this->do_in(state, from, from_end, from_next, to, to_end, to_next); } int encoding() const { return this->do_encoding(); } bool always_noconv() const { return this->do_always_noconv(); } int length(cxxtools::MBState& state, const char* from, const char* end, size_t max) const { return this->do_length(state, from, end, max); } int max_length() const { return this->do_max_length(); } protected: virtual codecvt_base::result do_out(cxxtools::MBState& state, const cxxtools::Char* from, const cxxtools::Char* from_end, const cxxtools::Char*& from_next, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, cxxtools::Char* to, cxxtools::Char* to_end, cxxtools::Char*& to_next) const = 0; virtual int do_encoding() const throw() = 0; virtual bool do_always_noconv() const throw() = 0; virtual int do_length(cxxtools::MBState&, const char* from, const char* end, size_t max) const = 0; virtual int do_max_length() const throw() = 0; }; template<> class CXXTOOLS_API codecvt : public codecvt_base, public locale::facet { public: static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit codecvt(size_t ref = 0); virtual ~codecvt(); codecvt_base::result out(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const { return this->do_out(state, from, from_end, from_next, to, to_end, to_next); } codecvt_base::result unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const { return this->do_unshift(state, to, to_end, to_next); } codecvt_base::result in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const { return this->do_in(state, from, from_end, from_next, to, to_end, to_next); } int encoding() const { return this->do_encoding(); } bool always_noconv() const { return this->do_always_noconv(); } int length(cxxtools::MBState& state, const char* from, const char* end, size_t max) const { return this->do_length(state, from, end, max); } int max_length() const { return this->do_max_length(); } protected: virtual codecvt_base::result do_out(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_unshift(cxxtools::MBState& state, char* to, char* to_end, char*& to_next) const = 0; virtual codecvt_base::result do_in(cxxtools::MBState& state, const char* from, const char* from_end, const char*& from_next, char* to, char* to_end, char*& to_next) const = 0; virtual int do_encoding() const throw() = 0; virtual bool do_always_noconv() const throw() = 0; virtual int do_length(cxxtools::MBState&, const char* from, const char* end, size_t max) const = 0; virtual int do_max_length() const throw() = 0; }; } #else // no CXXTOOLS_WITH_STD_LOCALE namespace std { class codecvt_base { public: enum { ok, partial, error, noconv }; typedef int result; virtual ~codecvt_base() { } }; template class codecvt : public std::codecvt_base { public: typedef I InternT; typedef E ExternT; typedef S StateT; public: explicit codecvt(size_t ref = 0) {} virtual ~codecvt() { } codecvt_base::result out(StateT& state, const InternT* from, const InternT* from_end, const InternT*& from_next, ExternT* to, ExternT* to_end, ExternT*& to_next) const { return this->do_out(state, from, from_end, from_next, to, to_end, to_next); } codecvt_base::result unshift(StateT& state, ExternT* to, ExternT* to_end, ExternT*& to_next) const { return this->do_unshift(state, to, to_end, to_next); } codecvt_base::result in(StateT& state, const ExternT* from, const ExternT* from_end, const ExternT*& from_next, InternT* to, InternT* to_end, InternT*& to_next) const { return this->do_in(state, from, from_end, from_next, to, to_end, to_next); } int encoding() const { return this->do_encoding(); } bool always_noconv() const { return this->do_always_noconv(); } int length(StateT& state, const ExternT* from, const ExternT* end, size_t max) const { return this->do_length(state, from, end, max); } int max_length() const { return this->do_max_length(); } protected: virtual result do_in(StateT& s, const ExternT* fromBegin, const ExternT* fromEnd, const ExternT*& fromNext, InternT* toBegin, InternT* toEnd, InternT*& toNext) const = 0; virtual result do_out(StateT& s, const InternT* fromBegin, const InternT* fromEnd, const InternT*& fromNext, ExternT* toBegin, ExternT* toEnd, ExternT*& toNext) const = 0; virtual bool do_always_noconv() const = 0; virtual int do_length(StateT& s, const ExternT* fromBegin, const ExternT* fromEnd, size_t max) const = 0; virtual int do_max_length() const = 0; virtual std::codecvt_base::result do_unshift(StateT&, ExternT*, ExternT*, ExternT*&) const = 0; virtual int do_encoding() const = 0; }; } #endif // CXXTOOLS_WITH_STD_LOCALE namespace cxxtools { /** * @brief Generic TextCodec class/facet which may be subclassed by specific Codec classes. * * This class contains default implementations for the methods do_unshift(), do_encoding() * and do_always_noconv() so sub-classes do not have to implement this default behaviour. * * Codecs are used to convert one Text-encoding into another Text-encoding. The internal * and external data type can be specified using the template parameter 'I' (internal) and * 'E' (external). * * When used on a platform which supports locales and facets the conversion may use * locale-specific conversion of the Text. * * This class derives from facet std::codecvt. Further documentation can be found there. * * @param I The character type associated with the internal code set. * @param E The character type associated with the external code set. * * @see Utf8Codec * @see Utf16Codec * @see Utf32Codec */ template class TextCodec : public std::codecvt { public: typedef I InternT; typedef E ExternT; public: /** * @brief Constructs a new TextCodec object. * * The internal and external type are specified by the template parameters of the class. * * @param ref This parameter is passed to std::codecvt. When ref == 0 the locale takes care * of deleting the facet. If ref == 1 the locale does not destroy the facet. */ explicit TextCodec(size_t ref = 0) : std::codecvt(ref) , _refs(ref) {} public: //! Empty desctructor virtual ~TextCodec() {} size_t refs() const { return _refs; } private: size_t _refs; }; /** @brief helper template function for decoding data using a codec. This template function makes it easy to use a codec to convert a string with one encoding to another. */ template std::basic_string decode(const typename CodecType::ExternT* data, unsigned size) { CodecType codec; typename CodecType::InternT to[64]; MBState state; std::basic_string ret; const typename CodecType::ExternT* from = data; typename CodecType::result r; do { typename CodecType::InternT* to_next = to; const typename CodecType::ExternT* from_next = from; r = codec.in(state, from, from + size, from_next, to, to + sizeof(to)/sizeof(typename CodecType::InternT), to_next); if (r == CodecType::error) throw ConversionError("character conversion failed"); if (r == CodecType::partial && from_next == from) throw ConversionError("character conversion failed - unexpected end of input sequence"); ret.append(to, to_next); size -= (from_next - from); from = from_next; } while (r == CodecType::partial); return ret; } /** @brief helper template function for decoding strings using a codec. This template function makes it easy to use a codec to convert a string with one encoding to another. @code std::string utf8data = ...; cxxtools::String unicodeString = cxxtools::decode(utf8data); std::string base64data = ...; std::string data = cxxtools::decode(base64data); @endcode */ template std::basic_string decode(const std::basic_string& data) { return decode(data.data(), data.size()); } template std::basic_string encode(const typename CodecType::InternT* data, unsigned size) { CodecType codec; char to[64]; MBState state; typename CodecType::result r; const typename CodecType::InternT* from = data; std::basic_string ret; do{ const typename CodecType::InternT* from_next; typename CodecType::ExternT* to_next = to; r = codec.out(state, from, from + size, from_next, to, to + sizeof(to), to_next); if (r == CodecType::error) throw ConversionError("character conversion failed"); ret.append(to, to_next); size -= (from_next - from); from = from_next; } while (r == CodecType::partial); typename CodecType::ExternT* to_next = to; r = codec.unshift(state, to, to + sizeof(to), to_next); if (r == CodecType::error) throw ConversionError("character conversion failed"); ret.append(to, to_next); return ret; } /** @brief helper template function for encoding strings using a codec. This template function makes it easy to use a codec to convert a string with one encoding to another. @code cxxtools::String unicodeString = ...; std::string utf8data = cxxtools::encode(unicodeString); std::string base64data = cxxtools::encode("some data"); @endcode */ template std::basic_string encode(const std::basic_string& data) { return encode(data.data(), data.size()); } } #endif cxxtools-2.2.1/include/cxxtools/filedevice.h0000664000175000017500000000530712260037210016076 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_System_FileDevice_h #define cxxtools_System_FileDevice_h #include #include namespace cxxtools { class CXXTOOLS_API FileDevice : public IODevice { friend class FileDeviceImpl; private: class FileDeviceImpl* _impl; public: FileDevice(); FileDevice( const std::string& path, IODevice::OpenMode mode, bool inherit = true); ~FileDevice(); void open( const std::string& path, IODevice::OpenMode mode, bool inherit = true); const char* path() const { return _path.c_str(); } size_t size() const; protected: size_t onBeginRead(char* buffer, size_t n, bool& eof); size_t onEndRead(bool& eof); size_t onBeginWrite(const char* buffer, size_t n); size_t onEndWrite(); void onClose(); void onSetTimeout(size_t timeout); bool onSeekable() const { return true; } pos_type onSeek(off_type offset, std::ios::seekdir sd); size_t onRead(char* buffer, size_t count, bool& eof); size_t onWrite(const char* buffer, size_t count); void onCancel(); size_t onPeek(char* buffer, size_t count); void onSync() const; private: std::string _path; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/atomicity.gcc.arm.h0000664000175000017500000000307512256773774017345 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_ARM_H #define CXXTOOLS_ATOMICINT_GCC_ARM_H #include namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/mime.h0000664000175000017500000001256312256773774014763 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include namespace cxxtools { class Mimepart { friend std::ostream& operator<< (std::ostream& out, const Mimepart& mimePart); public: enum ContentTransferEncoding { quotedPrintable, base64 }; private: typedef std::map HeadersType; HeadersType headers; ContentTransferEncoding contentTransferEncoding; std::string body; public: explicit Mimepart(const std::string& contentType_ = "text/plain, charset=UTF-8", ContentTransferEncoding contentTransferEncoding_ = quotedPrintable); void setData(const std::string& data) { body = data; } void addData(const std::string& data) { body += data; } void addData(std::istream& in); const std::string& getBody() const { return body; } void setHeader(const std::string& key, const std::string& value) { headers[key] = value; } }; class Mime { friend std::ostream& operator<< (std::ostream& out, const Mime& mime); public: typedef Mimepart::ContentTransferEncoding ContentTransferEncoding; private: typedef std::map HeadersType; HeadersType headers; typedef std::vector PartsType; PartsType parts; public: /// Adds a header-line to the mime-object. void setHeader(const std::string& key, const std::string& value) { headers[key] = value; } /// Adds a part to the mime-object. Mimepart& addPart(const Mimepart& part) { parts.push_back(part); return parts.back(); } /// Adds a part to the mime-object. The data is passed as a std::string. Mimepart& addPart(const std::string& data, const std::string& contentType = "text/plain", ContentTransferEncoding contentTransferEncoding = Mimepart::quotedPrintable); /// Adds a part to the mime-object. The data is read from a input stream. Mimepart& addPart(std::istream& in, const std::string& contentType = "text/plain", ContentTransferEncoding contentTransferEncoding = Mimepart::quotedPrintable); /// Adds a text file. The data is passed as a std::string. Mimepart& addTextFile(const std::string& contentType, const std::string& filename, const std::string& data) { Mimepart& part = addPart(data, contentType, Mimepart::quotedPrintable); part.setHeader("Content-Disposition", "attachment; filename=" + filename); return part; } /// Adds a text file. The data is read from a istream Mimepart& addTextFile(const std::string& contentType, const std::string& filename, std::istream& in) { Mimepart& part = addPart(in, contentType, Mimepart::quotedPrintable); part.setHeader("Content-Disposition", "attachment; filename=" + filename); return part; } /// Adds a text file. The data is read from a file. Mimepart& addTextFile(const std::string& contentType, const std::string& filename); /// Adds a binary file. The data is passed as a std::string. Mimepart& addBinaryFile(const std::string& contentType, const std::string& filename, const std::string& data) { Mimepart& part = addPart(data, contentType, Mimepart::base64); part.setHeader("Content-Disposition", "attachment; filename=" + filename); return part; } /// Adds a binary file. The data is read from a istream Mimepart& addBinaryFile(const std::string& contentType, const std::string& filename, std::istream& in) { Mimepart& part = addPart(in, contentType, Mimepart::base64); part.setHeader("Content-Disposition", "attachment; filename=" + filename); return part; } /// Adds a binary file. The data is read from a file. Mimepart& addBinaryFile(const std::string& contentType, const std::string& filename); }; std::ostream& operator<< (std::ostream& out, const Mimepart& mimePart); std::ostream& operator<< (std::ostream& out, const Mime& mime); } cxxtools-2.2.1/include/cxxtools/md5.h0000664000175000017500000000554112256773774014517 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MD5_H #define CXXTOOLS_MD5_H #include #include #include namespace cxxtools { template std::string md5(iterator_type from, iterator_type to) { Md5stream s; std::copy(from, to, std::ostream_iterator(s)); return s.getHexDigest(); } template std::string md5(const data_type& data) { Md5stream s; s << data; return s.getHexDigest(); } template class md5_hash { std::string digest; public: explicit md5_hash(const data_type& data) { unsigned char _digest[16]; Md5stream s; s << data; s.getDigest(_digest); digest.assign(reinterpret_cast(&_digest[0]), reinterpret_cast(&_digest[0] + 16)); } md5_hash(typename data_type::const_iterator from, typename data_type::const_iterator to) { unsigned char _digest[16]; Md5stream s; std::copy(from, to, std::ostream_iterator(s)); s.getDigest(_digest); digest.assign(reinterpret_cast(&_digest[0]), reinterpret_cast(&_digest[0] + 16)); } static const unsigned short blockSize = 64; std::string getHexDigest() const { static const char hex[] = "0123456789abcdef"; std::string ret; ret.reserve(32); for (unsigned n = 0; n < 16; ++n) { ret.push_back(hex[(digest[n] >> 4) & 0xf]); ret.push_back(hex[digest[n] & 0xf]); } return ret; } std::string getDigest() const { return digest; } }; } #endif // CXXTOOLS_MD5_H cxxtools-2.2.1/include/cxxtools/remoteclient.h0000664000175000017500000000425112266277345016513 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTECLIENT_H #define CXXTOOLS_REMOTECLIENT_H #include namespace cxxtools { class IComposer; class IDecomposer; class IRemoteProcedure; class RemoteClient { public: static const std::size_t WaitInfinite = static_cast(-1); virtual ~RemoteClient() { } virtual void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) = 0; virtual void endCall() = 0; virtual void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) = 0; virtual const IRemoteProcedure* activeProcedure() const = 0; virtual void cancel() = 0; virtual void wait(std::size_t msecs = WaitInfinite) = 0; }; } #endif // CXXTOOLS_REMOTECLIENT_H cxxtools-2.2.1/include/cxxtools/time.h0000664000175000017500000002267412266277345014770 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006-2008 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TIME_H #define CXXTOOLS_TIME_H #include #include #include #include #include namespace cxxtools { class SerializationInfo; class CXXTOOLS_API InvalidTime : public std::invalid_argument { public: InvalidTime(); ~InvalidTime() throw() {} }; /** @brief %Time expressed in hours, minutes, seconds and milliseconds @ingroup DateTime */ class Time { public: static const unsigned MaxHours = 23; static const unsigned HoursPerDay = 24; static const unsigned MaxMinutes = 59; static const unsigned MinutesPerHour = 60; static const unsigned MinutesPerDay = 1440; static const unsigned MaxSeconds = 59; static const unsigned SecondsPerDay = 86400; static const unsigned SecondsPerHour = 3600; static const unsigned SecondsPerMinute = 60; static const unsigned MSecsPerDay = 86400000; static const unsigned MSecsPerHour = 3600000; static const unsigned MSecsPerMinute = 60000; static const unsigned MSecsPerSecond = 1000; /** \brief Creates a Time set to zero. */ Time() : _msecs(0) {} /** \brief Creates a Time from given values. InvalidTime is thrown if one or more of the values are out of range */ inline Time(unsigned h, unsigned m, unsigned s = 0, unsigned ms = 0) { set(h, m, s, ms); } /** \brief Returns the hour-part of the Time. */ unsigned hour() const { return _msecs / MSecsPerHour; } /** \brief Returns the minute-part of the Time. */ unsigned minute() const { return (_msecs % MSecsPerHour) / MSecsPerMinute; } /** \brief Returns the second-part of the Time. */ unsigned second() const { return (_msecs / 1000) % SecondsPerMinute; } /** \brief Returns the millisecond-part of the Time. */ unsigned msec() const { return _msecs % 1000; } unsigned totalMSecs() const { return _msecs; } void setTotalMSecs(unsigned msecs) { _msecs = msecs; } /** \brief Sets the time. Sets the time to a new hour, minute, second, milli-second. InvalidTime is thrown if one or more of the values are out of range */ void set(unsigned hour, unsigned min, unsigned sec, unsigned msec = 0) { if ( ! isValid(hour, min, sec , msec) ) { throw InvalidTime(); } _msecs = (hour*SecondsPerHour + min*SecondsPerMinute + sec) * 1000 + msec; } /** @brief Get the time values Gets the hour, minute, second and millisecond parts of the time. */ void get(unsigned& h, unsigned& m, unsigned& s, unsigned& ms) const { h = hour(); m = minute(); s = second(); ms = msec(); } /** @brief Adds seconds to the time This method does not change the time, but returns the time with the seconds added. */ Time addSecs(int secs) const { return addMSecs(secs * 1000); } /** @brief Determines seconds until another time */ int secsTo(const Time &t) const { return static_cast( msecsTo(t) / 1000 ); } /** @brief Adds milliseconds to the time This method does not change the time, but returns the time with the milliseconds added. */ inline Time addMSecs(int64_t ms) const { Time t; if (ms < 0) { int64_t negdays = (MSecsPerDay - ms) / MSecsPerDay; t._msecs = static_cast((_msecs + ms + negdays * MSecsPerDay) % MSecsPerDay); } else { t._msecs = static_cast((_msecs + ms) % MSecsPerDay); } return t; } /** @brief Determines milliseconds until another time */ int64_t msecsTo(const Time &t) const { if(t._msecs > _msecs) return t._msecs - _msecs; return MSecsPerDay - (_msecs - t._msecs); } /** @brief Assignment operator */ Time& operator=(const Time& other) { _msecs=other._msecs; return *this; } /** @brief Equal comparison operator */ bool operator==(const Time& other) const { return _msecs == other._msecs; } /** @brief Inequal comparison operator */ bool operator!=(const Time& other) const { return _msecs != other._msecs; } /** @brief Less-than comparison operator */ bool operator<(const Time& other) const { return _msecs < other._msecs; } /** @brief Less-than-or-equal comparison operator */ bool operator<=(const Time& other) const { return _msecs <= other._msecs; } /** @brief Greater-than comparison operator */ bool operator>(const Time& other) const { return _msecs > other._msecs; } /** @brief Greater-than-or-equal comparison operator */ bool operator>=(const Time& other) const { return _msecs >= other._msecs; } /** @brief Assignment by sum operator */ Time& operator+=(const Timespan& ts) { int64_t msecs = ( _msecs + ts.totalMSecs() ) % MSecsPerDay; msecs = msecs < 0 ? MSecsPerDay + msecs : msecs; _msecs = static_cast(msecs); return *this; } /** @brief Assignment by difference operator */ Time& operator-=(const Timespan& ts) { int64_t msecs = ( _msecs - ts.totalMSecs() ) % MSecsPerDay; msecs = msecs < 0 ? MSecsPerDay + msecs : msecs; _msecs = static_cast(msecs); return *this; } /** @brief Addition operator */ friend Time operator+(const Time& time, const Timespan& ts) { return time.addMSecs( ts.totalMSecs() ); } /** @brief Substraction operator */ friend Time operator-(const Time& time, const Timespan& ts) { return time.addMSecs( -ts.totalMSecs() ); } /** @brief Substraction operator */ friend Timespan operator-(const Time& a, const Time& b) { return b.msecsTo(a) * 1000; } /** \brief Returns the time in ISO-format (hh:mm:ss.hhh) */ std::string toIsoString() const; /** \brief Returns true if values are a valid time */ static bool isValid(unsigned h, unsigned m, unsigned s, unsigned ms) { return h < 24 && m < 60 && s < 60 && ms < 1000; } /** \brief Convert from an ISO time string Interprets the passed string as a time-string in ISO-format (hh:mm:ss.hhh) and returns a Time-object. If the string is not in ISO-format, InvalidTime is thrown. */ static Time fromIsoString(const std::string& s); private: //! @internal unsigned _msecs; }; CXXTOOLS_API void operator >>=(const SerializationInfo& si, Time& time); CXXTOOLS_API void operator <<=(SerializationInfo& si, const Time& time); CXXTOOLS_API void convert(std::string& str, const cxxtools::Time& time); CXXTOOLS_API void convert(cxxtools::Time& time, const std::string& s); inline std::string Time::toIsoString() const { std::string str; convert(str, *this); return str; } inline Time Time::fromIsoString(const std::string& s) { Time time; convert(time, s); return time; } } #endif // CXXTOOLS_TIME_H cxxtools-2.2.1/include/cxxtools/json/0000775000175000017500000000000012266277564014702 500000000000000cxxtools-2.2.1/include/cxxtools/json/httpclient.h0000664000175000017500000000626112266277345017153 00000000000000/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_HTTPCLIENT_H #define CXXTOOLS_JSON_HTTPCLIENT_H #include #include namespace cxxtools { class SelectorBase; namespace net { class Uri; class AddrInfo; } namespace json { class HttpClientImpl; class HttpClient : public RemoteClient { HttpClient(HttpClient&); void operator= (const HttpClient&); public: HttpClient(); HttpClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& url); HttpClient(SelectorBase& selector, const net::Uri& uri); HttpClient(const std::string& addr, unsigned short port, const std::string& url); explicit HttpClient(const net::Uri& uri); virtual ~HttpClient(); void connect(const net::AddrInfo& addrinfo, const std::string& url); void connect(const net::Uri& uri); void connect(const std::string& addr, unsigned short port, const std::string& url); void url(const std::string& url); void auth(const std::string& username, const std::string& password); void clearAuth(); void setSelector(SelectorBase& selector); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); std::size_t timeout() const; void timeout(std::size_t t); const std::string& url() const; const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(std::size_t msecs = WaitInfinite); private: HttpClientImpl* _impl; }; } } #endif cxxtools-2.2.1/include/cxxtools/json/rpcserver.h0000664000175000017500000000612512256773774017015 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCSERVER_H #define CXXTOOLS_JSON_RPCSERVER_H #include #include #include #include namespace cxxtools { class EventLoopBase; namespace json { class Responder; class RpcServerImpl; class RpcServer : public ServiceRegistry { friend class Responder; public: RpcServer(EventLoopBase& eventLoop); RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, int backlog = 64); RpcServer(EventLoopBase& eventLoop, unsigned short int port, int backlog = 64); ~RpcServer(); void listen(const std::string& ip, unsigned short int port, int backlog = 64); void listen(unsigned short int port, int backlog = 64); void addService(const std::string& praefix, const ServiceRegistry& service); unsigned minThreads() const; void minThreads(unsigned m); unsigned maxThreads() const; void maxThreads(unsigned m); // idleTimeout is the time in milliseconds of inactivity after // which a socket is moved from a worker thread to the main event loop. std::size_t idleTimeout() const; void idleTimeout(std::size_t ms); enum Runmode { Stopped, Starting, Running, Terminating, Failed }; Signal runmodeChanged; private: RpcServerImpl* _impl; }; } } #endif // CXXTOOLS_JSON_RPCSERVER_H cxxtools-2.2.1/include/cxxtools/json/httpservice.h0000664000175000017500000000356412256773774017346 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_SERVICE_H #define CXXTOOLS_JSON_SERVICE_H #include #include #include namespace cxxtools { namespace json { class HttpService : public http::Service, public ServiceRegistry { friend class Responder; public: HttpService() { } virtual ~HttpService(); protected: virtual http::Responder* createResponder(const http::Request&); virtual void releaseResponder(http::Responder* resp); }; } } #endif cxxtools-2.2.1/include/cxxtools/json/request.h0000664000175000017500000000372212256773774016472 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_REQUEST_H #define CXXTOOLS_JSON_REQUEST_H namespace cxxtools { namespace json { class Request { friend void operator<<= (SerializationInfo& si, const Request& r); friend void operator>>= (const SerializationInfo& si, Request& r); public: Request(); private: std::string _method; std::string _id; }; void operator<<= (SerializationInfo& si, const Request& r); void operator>>= (const SerializationInfo& si, Request& r); } } #endif // CXXTOOLS_JSON_REQUEST_H cxxtools-2.2.1/include/cxxtools/json/rpcclient.h0000664000175000017500000000504512266277345016757 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCCLIENT_H #define CXXTOOLS_JSON_RPCCLIENT_H #include #include namespace cxxtools { class SelectorBase; namespace json { class RpcClientImpl; class RpcClient : public RemoteClient { RpcClientImpl* _impl; RpcClient(RpcClient&); void operator= (const RpcClient&); public: RpcClient() : _impl(0) { } RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port); RpcClient(const std::string& addr, unsigned short port); virtual ~RpcClient(); void setSelector(SelectorBase& selector); void connect(const std::string& addr, unsigned short port); void close(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(std::size_t msecs = WaitInfinite); const std::string& prefix() const; void prefix(const std::string& p); }; } } #endif // CXXTOOLS_JSON_RPCCLIENT_H cxxtools-2.2.1/include/cxxtools/json/responder.h0000664000175000017500000000472412256773774017006 00000000000000/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RESPONDER_H #define CXXTOOLS_JSON_RESPONDER_H #include #include #include #include #include #include namespace cxxtools { class ServiceProcedure; class IComposer; class IDecomposer; namespace json { class ServiceRegistry; class Responder : public http::Responder { public: explicit Responder(ServiceRegistry& service); ~Responder(); void beginRequest(std::istream& in, http::Request& request); std::size_t readBody(std::istream& is); void replyError(std::ostream& os, http::Request& request, http::Reply& reply, const std::exception& ex); void reply(std::ostream& os, http::Request& request, http::Reply& reply); private: ServiceRegistry& _serviceRegistry; DeserializerBase _deserializer; JsonParser _parser; ServiceProcedure* _proc; IComposer** _args; IDecomposer* _result; RemoteException _fault; }; } } #endif cxxtools-2.2.1/include/cxxtools/fileinfo.h0000664000175000017500000001105712266277345015616 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FILEINFO_H #define CXXTOOLS_FILEINFO_H #include namespace cxxtools { class DirectoryIterator; /** @brief Provides information about a node in the file-system. */ class FileInfo { public: //! @brief File-node type enum Type { Invalid = 0, Directory = 1, File = 2, Chardev = 3, Blockdev = 4, Fifo = 5, Symlink = 6 }; public: //! @brief Default constructor FileInfo(); /** @brief Constructs a %FileInfo object from the path \a path */ explicit FileInfo(const std::string& path); explicit FileInfo(const DirectoryIterator& it); //! @brief Copy constructor FileInfo(const FileInfo& fi); //! @brief Destructor ~FileInfo(); //! @brief Assignment operator FileInfo& operator=(const FileInfo& fi); //! @brief Returns the type of the file node Type type() const; const std::string& path() const; /** @brief Returns the full path of node in the file-system This method may return a relative path, or a fully qualified one depending on how this object was constructed. */ std::string name() const; /** @brief Returns the parent directory path This method might return an empty string if the node was created without a complete path. If the directory is located in the root directory of a unix file system, a slash ("/") is returned. A returned directory path always ends with a trailing path separator character. (A backslash in Windows and a slash in Unix, for example.) */ std::string dirName() const; //! @brief Returns the size of the file in bytes std::size_t size() const; //! @brief Returns true if the node is a directory bool isDirectory() const { return _type == FileInfo::Directory; } //! @brief Returns true if the node is a file bool isFile() const { return _type == FileInfo::File; } /** @brief Removes the file node. This object will be invalid after calling this method. */ void remove(); /** @brief Moves the file node to the location given by \a to The object will stay valid after this method was called and point to the moved file node. */ void move(const std::string& to); public: //! @brief Returns true if a file or directory exists at \a path static bool exists(const std::string& path); //! @brief Returns the type of file at \a path static Type getType(const std::string& path); private: //! @internal Type _type; //! @internal std::string _path; }; inline bool operator<(const FileInfo& a, const FileInfo& b) { return a.path() < b.path(); } inline bool operator==(const FileInfo& a, const FileInfo& b) { return a.path() == b.path(); } inline bool operator!=(const FileInfo& a, const FileInfo& b) { return !(a == b); } } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/serviceregistry.h0000664000175000017500000003545012256773774017265 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SERVICEREGISTRY_H #define CXXTOOLS_SERVICEREGISTRY_H #include #include #include #include #include #include namespace cxxtools { class CXXTOOLS_API ServiceRegistry { ServiceRegistry(const ServiceRegistry&) { } ServiceRegistry& operator=(const ServiceRegistry&) { return *this; } public: ServiceRegistry() { } ~ServiceRegistry(); template void registerFunction(const std::string& name, R (*fn)()) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7, A8)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerFunction(const std::string& name, R (*fn)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { ServiceProcedure* proc = new BasicServiceProcedure(callable(fn)); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerCallable(const std::string& name, const Callable& cb) { ServiceProcedure* proc = new BasicServiceProcedure(cb); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)() ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7, A8) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } template void registerMethod(const std::string& name, C& obj, R (C::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) ) { ServiceProcedure* proc = new BasicServiceProcedure( callable(obj, method) ); this->registerProcedure(name, proc); } ServiceProcedure* getProcedure(const std::string& name) const; void releaseProcedure(ServiceProcedure* proc) const; std::vector getProcedureNames() const; protected: void registerProcedure(const std::string& name, ServiceProcedure* proc); private: typedef std::map ProcedureMap; ProcedureMap _procedures; }; } #endif // CXXTOOLS_SERVICEREGISTRY_H cxxtools-2.2.1/include/cxxtools/application.h0000664000175000017500000001031012256773774016323 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_APPLICATION_H #define CXXTOOLS_APPLICATION_H #include #include #include #include #include #include namespace cxxtools { class ApplicationImpl; /** * \brief The Application class provides an event loop for console applications * without a GUI. * * This class is used by non-GUI applications to provide the applications's event * loop. There should be only exactly one instance of Application (or one of its * subclasses) per application. This is not ensured, though. * * Application contains the main event loop, where event sources can be registered * and events from those sources are dispatched to listeners, that were registered * to the event loop. Events may for example be operating system events (timer, file * system changes). * * The application and therefore the event loop is started with a call to run() and * can be exited with a call to exit(). After calling exit() the application should * terminate. * * The event loop can be access by calling eventLoop(). Events can be committed by * calling EventLoop::commitEvent(). Long running operations can call * EventLoop::processEvents() to keep the application responsive. * * There are convenience methods available for easier access to functionality of * the underlying event loop. commitEvent() delegates to EventLoop::commitEvent(), * queueEvent() delegates to EventLoop::delegateEvent() and processEvents() delegates * to EventLoop::processEvents() without making it necessary to first obtain the * event loop manually. */ class CXXTOOLS_API Application : public Connectable { void construct(); public: Application(); Application(int argc, char** argv); Application(EventLoopBase* loop); Application(EventLoopBase* loop, int argc, char** argv); ~Application(); static Application& instance(); EventLoopBase& loop() { return *_loop; } void run() { _loop->run(); } void exit() { _loop->exit(); } bool catchSystemSignal(int sig); bool raiseSystemSignal(int sig); Signal systemSignal; int argc() const { return _argc; } char** argv() const { return _argv; } ApplicationImpl& impl() { return *_impl; } protected: void init(EventLoopBase& loop); private: ApplicationImpl* _impl; int _argc; char** _argv; EventLoopBase* _loop; EventLoop* _owner; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/smartptr.h0000664000175000017500000002566412256773774015716 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SMARTPTR_H #define CXXTOOLS_SMARTPTR_H #include namespace cxxtools { /** \param ObjectType The managed object type */ template /** \brief Reference linking. Reference linking means that no counter is required to keep track of the smart pointer objects, but all smart pointers form a linked list. When the list becomes empty the raw pointer si deleted. This Model has the advantage that it does not need to allocate memory, but is prone to circular dependencies. */ class RefLinked { mutable const RefLinked* prev; mutable const RefLinked* next; protected: RefLinked() : prev(0), next(0) { } //! \brief Unlink a smart pointer from a managed object bool unlink(ObjectType* object) { if (object) { if (next == this) { next = prev = 0; return true; } else { next->prev = prev; prev->next = next; next = prev = this; } } return false; } //! \brief Link a smart pointer to a managed object void link(const RefLinked& ptr, ObjectType* object) { if (object) { if (ptr.next) { prev = &ptr; next = ptr.next; prev->next = this; next->prev = this; } else { prev = next = this; } } } }; /** \param ObjectType The managed object type */ template /** \brief Intrusive reference counting. Intrusive reference couting means that the reference count is part of the managed heap object. Linking and unlinking will only increase and decrease this counter, but not delete it. The managed object needs to implement the methods release() and addRef(). The release must return something, that equals 0 when the last reference is released. */ class InternalRefCounted { protected: //! \brief unlink a smart pointer from a managed object bool unlink(ObjectType* object) { return object && object->release() == 0; } //! \brief link a smart pointer to a managed object void link(const InternalRefCounted& ptr, ObjectType* object) { if (object) object->addRef(); } }; /** \param ObjectType The managed object type */ template /** \brief Non-intrusive reference counting. Non-intrusive reference couting means that the reference count is not part of the managed heap object but part of the policy. Linking and unlinking will increase and decrease the policies counter and delete the managed object if it reaches zero. A small amount of memory needs to be allocated for the counter variable. */ class ExternalRefCounted { unsigned* rc; protected: ExternalRefCounted() : rc(0) { } //! \brief unlink a smart pointer from a managed object bool unlink(ObjectType* object) { if (object && --*rc <= 0) { delete rc; rc = 0; return true; } else return false; } //! \brief link a smart pointer to a managed object void link(const ExternalRefCounted& ptr, ObjectType* object) { if (object) { if (ptr.rc == 0) rc = new unsigned(1); else { rc = ptr.rc; ++*rc; } } else rc = 0; } public: unsigned refs() const { return rc ? *rc : 0; } }; template class ExternalAtomicRefCounted { volatile atomic_t* rc; protected: ExternalAtomicRefCounted() : rc(0) { } bool unlink(ObjectType* object) { if (object && atomicDecrement(*rc) <= 0) { delete rc; rc = 0; return true; } else return false; } void link(const ExternalAtomicRefCounted& ptr, ObjectType* object) { if (object) { if (ptr.rc == 0) rc = new atomic_t(1); else { rc = ptr.rc; atomicIncrement(*rc); } } else rc = 0; } public: atomic_t refs() const { return rc ? atomicGet(*rc) : 0; } }; /** \param ObjectType The managed object type */ template /** \brief old name for DeletePolicy for compatibility. The DefaultDestroyPolicy implements the method, which instructs the SmartPtr to free the object which it helds by deleting it. */ class DefaultDestroyPolicy { public: static void destroy(ObjectType* ptr) { delete ptr; } }; /** \param ObjectType The managed object type */ template /** \brief deleter policy for smart pointer. The DeletePolicy is actually an alternative name for DefaultDestroyPolicy. */ class DeletePolicy { public: static void destroy(ObjectType* ptr) { delete ptr; } }; template class FreeDestroyPolicy { public: static void destroy(T* ptr) { free(ptr); } }; template class ArrayDestroyPolicy { public: static void destroy(ObjectType* ptr) { delete[] ptr; } }; /** * Policy-based smart-pointer-class. * * This class works like a pointer, but the destructor deletes the held * object if this is the last reference. The policy specifies, how the class * counts the references. There are 4 policies: * * ExternalRefCounted: allocates a reference-count * * ExternalAtomicRefCounted: like ExternalRefCounted, but thread safe * * InternalRefCounted: the pointed object needs to have a reference-counter * with methods addRef() and release(). The release-method deletes the * object, when the reference-count drops to 0. * * RefLinked: all pointers to a object are linked * * The default policy is InternalRefCounted. Another class * cxxtools::RefCounted implements proper methods for the pointer, which * makes it straight-forward to use. * */ template class OwnershipPolicy = InternalRefCounted, template class DestroyPolicy = DefaultDestroyPolicy> class SmartPtr : public OwnershipPolicy, public DestroyPolicy { ObjectType* object; typedef OwnershipPolicy OwnershipPolicyType; typedef DestroyPolicy DestroyPolicyType; public: SmartPtr() : object(0) {} SmartPtr(ObjectType* ptr) : object(ptr) { OwnershipPolicyType::link(*this, ptr); } SmartPtr(const SmartPtr& ptr) : object(ptr.object) { OwnershipPolicyType::link(ptr, ptr.object); } template SmartPtr(const SmartPtr& ptr) : object(ptr.object) { OwnershipPolicyType::link(ptr, ptr.object); } ~SmartPtr() { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); } SmartPtr& operator= (const SmartPtr& ptr) { if (object != ptr.object) { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); object = ptr.object; OwnershipPolicyType::link(ptr, object); } return *this; } template SmartPtr& operator= (const SmartPtr& ptr) { if (object != ptr.object) { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); object = ptr.object; OwnershipPolicyType::link(ptr, object); } return *this; } SmartPtr& operator= (ObjectType* ptr) { if (object != ptr) { if (OwnershipPolicyType::unlink(object)) DestroyPolicy::destroy(object); object = ptr; OwnershipPolicyType::link(*this, ptr); } return *this; } /// The object can be dereferenced like the held object ObjectType* operator->() const { return object; } /// The object can be dereferenced like the held object ObjectType& operator*() const { return *object; } bool operator! () const { return object == 0; } operator bool () const { return object != 0; } ObjectType* getPointer() const { return object; } }; template bool operator== (const SmartPtr& p1, const T2* p2) { return p1.getPointer() == p2; } template bool operator== (const T1* p1, const SmartPtr& p2) { return p1 == p2.getPointer(); } template bool operator== (const SmartPtr& p1, const SmartPtr& p2) { return p1.getPointer() == p2.getPointer(); } template bool operator!= (const SmartPtr& p1, const T2* p2) { return p1.getPointer() != p2; } template bool operator!= (const T1* p1, const SmartPtr& p2) { return p1 != p2.getPointer(); } template bool operator!= (const SmartPtr& p1, const SmartPtr& p2) { return p1.getPointer() != p2.getPointer(); } } #endif // CXXTOOLS_SMARTPTR_H cxxtools-2.2.1/include/cxxtools/cgi.h0000664000175000017500000000473412256773774014577 00000000000000/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CGI_H #define CXXTOOLS_CGI_H #include namespace cxxtools { /** Class for easy extraction of CGI-parameters. This class reads automatically GET- and POST-parameters from stdin and the environvariable QUERY_STRING, like CGI-programs do. This eases writing CGI-programs in C++. example: \code int main() { cxxtools::Cgi q; // this parses all input-parameters std::cout << q.header << "\n" << "\n" << "
\n" << "
\n" << "
\n" << "
\n" << "
\n" << "you entered: " << q["v"] << "\n" << "" << ""; } \endcode */ class Cgi : public QueryParams { public: /// constructor reads parameters from server Cgi(); static std::string header() { return "Content-Type: text/html\r\n\r\n"; } static std::string header(const std::string& type) { return "Content-Type: " + type + "\r\n\r\n"; } }; } #endif // CXXTOOLS_CGI_H cxxtools-2.2.1/include/cxxtools/decomposer.h0000664000175000017500000000525312266277345016164 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Decomposer_h #define cxxtools_Decomposer_h #include #include #include #include #include #include namespace cxxtools { class Formatter; class CXXTOOLS_API IDecomposer { public: typedef SerializationInfo::int_type int_type; typedef SerializationInfo::unsigned_type unsigned_type; virtual ~IDecomposer() {} virtual void setName(const std::string& name) = 0; virtual void format(Formatter& formatter) = 0; static void formatEach(const SerializationInfo& si, Formatter& formatter); }; template class Decomposer : public IDecomposer { Decomposer(const Decomposer&) { } Decomposer& operator= (const Decomposer&) { return *this; } public: Decomposer() : _current(&_si) { } void begin(const T& type) { _si.clear(); _si <<= type; } virtual void setName(const std::string& name) { _si.setName(name); } virtual void format(Formatter& formatter) { formatEach( _si, formatter ); } private: SerializationInfo _si; SerializationInfo* _current; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/membar.gcc.ppc.h0000664000175000017500000000331312256773774016604 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_PPC_H #define CXXTOOLS_MEMBAR_PPC_H namespace cxxtools { inline void membar_rw() { asm volatile("lwsync \n\t" : : : "memory"); } inline void membar_write() { asm volatile("lwsync \n\t" : : : "memory"); } inline void membar_read() { asm volatile("lwsync \n\t" : : : "memory"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_PPC_H cxxtools-2.2.1/include/cxxtools/file.h0000664000175000017500000001116012266277345014735 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FILE_H #define CXXTOOLS_FILE_H #include #include #include namespace cxxtools { /** @brief Provides common operations on files. */ class File { public: /** @brief Constructs a %File object from the path \a path If no file exists at \a path, an exception of type FileNotFound is thrown. */ explicit File(const std::string& path); /** @brief Constructs a %File object from a FileInfo object An exception of type %FileNotFound is thrown if the %FileInfo does not represent a file. */ explicit File(const FileInfo& fi); //! @brief Copy constructor File(const File& file); //! @brief Destrctor ~File(); //! @brief Assignment operator File& operator=(const File& file); /** @brief Returns the full path of file in the file-system This method may return a relative path, or a fully qualified one depending on how this object was constructed. */ const std::string& path() const { return _path; } //! @brief Returns the size of the file in bytes std::size_t size() const; /** @brief Returns the parent directory path This method might return an empty string if the node was created without a complete path. If the directory is located in the root directory of a unix file system, a slash ("/") is returned. A returned directory path always ends with a trailing path separator character. (A backslash in Windows and a slash in Unix, for example.) */ std::string dirName() const; //! @brief Returns the file name including an exension std::string name() const; //! @brief Returns the file name without the exension std::string baseName() const; //! @brief Returns the file name extension or an empty string if not present std::string extension() const; //! @brief Resizes the file to a new size of \a n bytes void resize(std::size_t n); /** @brief Removes the file. This object will be invalid after calling this method. */ void remove(); /** @brief Moves the file to the location given by \a to The %File object will stay valid after this method was called and point to the moved file. */ void move(const std::string& to); void link(const std::string& newpath); void symlink(const std::string& newpath); public: //! @brief Creates a new file at the path given by \a path static File create(const std::string& path); //! @brief Returns true if a file exists at \a path, or false otherwise static bool exists(const std::string& path); protected: //! @brief Default Constructor File(); private: //! @internal std::string _path; }; inline bool operator<(const File& a, const File& b) { return a.path() < b.path(); } inline bool operator==(const File& a, const File& b) { return a.path() == b.path(); } inline bool operator!=(const File& a, const File& b) { return !(a == b); } } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/argin.h0000664000175000017500000000773312256773774015137 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STDIN_H #define CXXTOOLS_STDIN_H #include #include #include #include namespace cxxtools { /** * Helper class for redirecting input to stdin or file using command line switch. * * Using this class it is easy to provide a command line switch to the user * to read input from a file or stdin. * * Examples: * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgIn in(argc, argv, 'i'); * double d; * while (in >> d) * { * std::cout << d*2 << std::endl; * } * } * \endcode * * This program reads data from stdin or a file, when provided using the * -i option and doubles the value * * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgIn in(argc, argv); * double d; * while (in >> d) * { * std::cout << d*2 << std::endl; * } * } * \endcode * * This program reads data from stdin or a file, when provided as a * parameter and doubles the value. This is similar to the <> operator * in perl. * */ class ArgIn : public std::istream { std::ifstream _ifile; void doInit(const Arg& ifile) { std::streambuf* buf; if (ifile.isSet()) { _ifile.open(ifile); buf = _ifile.rdbuf(); } else buf = std::cin.rdbuf(); init(buf); } public: /// Constructor processes short options like: -i something. ArgIn(int& argc, char* argv[], char option) : std::istream(0) { Arg ifile(argc, argv, option); doInit(ifile); } /// Constructor processes long options like: --input something". ArgIn(int& argc, char* argv[], const char* option) : std::istream(0) { Arg ifile(argc, argv, option); doInit(ifile); } /// Constructor processes normal parameters. ArgIn(int& argc, char* argv[]) : std::istream(0) { Arg ifile(argc, argv); doInit(ifile); } /// returns true, if the input is read from a file. bool redirected() const { return rdbuf() != std::cin.rdbuf(); } }; } #endif // CXXTOOLS_STDIN_H cxxtools-2.2.1/include/cxxtools/md5stream.h0000664000175000017500000000620512256773774015731 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MD5STREAM_H #define CXXTOOLS_MD5STREAM_H #include struct cxxtools_MD5_CTX; namespace cxxtools { class Md5streambuf : public std::streambuf { public: Md5streambuf(); ~Md5streambuf(); void getDigest(unsigned char digest[16]); private: static const unsigned int bufsize = 64; char buffer[bufsize]; cxxtools_MD5_CTX* context; unsigned char digest[16]; std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; /** This is a easy and safe interface to MD5-calculation. To get a MD5-sum of data, instantiate a md5stream, copy your data into it and read the digest. After calling getDigest or getHexDigest, the class can be reused for another md5-calculation. The algorithm is automatically reinitialized when the first character is received. example: \code int main(int argc, char* argv[]) { Md5stream s; for (int i = 1; i < argc; ++i) { std::ifstream in(argv[i]); if (in) { s << in.rdbuf(); std::cout << s.getHexDigest() << " " << argv[i] << std::endl; } } } \endcode */ class Md5stream : public std::ostream { public: typedef std::ostreambuf_iterator iterator; private: Md5streambuf streambuf; char hexdigest[33]; public: /// initializes md5-calculation Md5stream() : std::ostream(0) { init(&streambuf); } /// ends md5-calculation and returns 16 bytes digest void getDigest(unsigned char digest[16]) { streambuf.getDigest(digest); } /// ends md5-calculation and digest as 32 bytes hex const char* getHexDigest(); /// returns output-iterator to Md5stream iterator begin() { return iterator(&streambuf); } }; } #endif // CXXTOOLS_MD5STREAM_H cxxtools-2.2.1/include/cxxtools/formatter.h0000664000175000017500000000630212256773774016031 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Formatter_h #define cxxtools_Formatter_h #include #include #include #include namespace cxxtools { class Formatter { public: #ifdef HAVE_LONG_LONG typedef long long int_type; #else typedef long int_type; #endif #ifdef HAVE_UNSIGNED_LONG_LONG typedef unsigned long long unsigned_type; #else typedef unsigned long unsigned_type; #endif virtual ~Formatter() { } virtual void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) = 0; virtual void addValueStdString(const std::string& name, const std::string& type, const std::string& value); virtual void addValueBool(const std::string& name, const std::string& type, bool value); virtual void addValueInt(const std::string& name, const std::string& type, int_type value); virtual void addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value); virtual void addValueFloat(const std::string& name, const std::string& type, long double value); virtual void addNull(const std::string& name, const std::string& type); virtual void beginArray(const std::string& name, const std::string& type) = 0; virtual void finishArray() = 0; virtual void beginObject(const std::string& name, const std::string& type) = 0; virtual void beginMember(const std::string& name) = 0; virtual void finishMember() = 0; virtual void finishObject() = 0; virtual void finish() = 0; protected: Formatter() {} }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/delegate.tpp0000664000175000017500000012104212256773774016153 00000000000000// BEGIN_Delegate 10 /** A Delegate is essentially a Signal with only a single target slot. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return this->call(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } }; /** DelegateSlot wraps Deletegate object so that they can behave like Slots. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class DelegateSlot : public BasicSlot { public: /** Wraps the given Delegate. */ DelegateSlot(Delegate& delegate) : _method( delegate, &Delegate::call ) {} /** Creates a copy of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new DelegateSlot(*this); } /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_method; } virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } virtual bool equals(const Slot& slot) const { const DelegateSlot* ds = dynamic_cast(&slot); return ds ? (_method == ds->_method) : false; } private: mutable ConstMethod, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10 > _method; }; /** Creates and returns a DelegateSlot for the given Delegate. */ template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> DelegateSlot slot( Delegate& delegate ) { return DelegateSlot( delegate ); } /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect( slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 9 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return this->call(a1,a2,a3,a4,a5,a6,a7,a8,a9); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect( slot ); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 8 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7,a8); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7,a8); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return this->call(a1,a2,a3,a4,a5,a6,a7,a8); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 7 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6,a7); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6,a7); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return this->call(a1,a2,a3,a4,a5,a6,a7); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6,A7)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 6 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5,a6); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5,a6); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return this->call(a1,a2,a3,a4,a5,a6); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5,A6)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 5 template < typename R,class A1, class A2, class A3, class A4, class A5> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4,a5); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4,a5); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return this->call(a1,a2,a3,a4,a5); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4,A5)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 4 template < typename R,class A1, class A2, class A3, class A4> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3, A4 a4) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3,a4); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3, A4 a4) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3,a4); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return this->call(a1,a2,a3,a4); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3,A4)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 3 template < typename R,class A1, class A2, class A3> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2, A3 a3) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2,a3); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2, A3 a3) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2,a3); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2, A3 a3) const { return this->call(a1,a2,a3); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2,A3)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 2 template < typename R,class A1, class A2> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1, A2 a2) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1,a2); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1, A2 a2) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1,a2); } /** Identical to call(...). */ R operator()(A1 a1, A2 a2) const { return this->call(a1,a2); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1,A2)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1,A2) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 1 template < typename R,class A1> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call(A1 a1) const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(a1); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke(A1 a1) const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(a1); } /** Identical to call(...). */ R operator()(A1 a1) const { return this->call(a1); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)(A1)) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1)) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)(A1) const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate // BEGIN_Delegate 0 template < typename R> class Delegate : public DelegateBase { public: typedef Callable CallableT; public: /** Does nothing. */ Delegate() { } /** Deeply copies rhs. */ Delegate(const Delegate& rhs) { DelegateBase::operator=(rhs); } /** Connects this object to the given slot and returns that Connection. */ Connection connect(const BasicSlot& slot) { return Connection(*this, slot.clone() ); } /** Passes on all arguments to the connected slot and returns the return value of that slot. If no slot is connect then an exception is thrown. */ inline R call() const { if( !_target.valid() ) { throw std::logic_error("Delegate::call(): Delegate not connected"); } const CallableT* cb = static_cast( _target.slot().callable() ); return cb->call(); } /** Passes on all arguments to the connected slot and ignores the return value. If No slot is connected, the call is silently ignored. */ inline void invoke() const { if( !_target.valid() ) { return; } const CallableT* cb = static_cast( _target.slot().callable() ); cb->call(); } /** Identical to call(...). */ R operator()() const { return this->call(); } }; /** Connect a Delegate to another Delegate. */ template Connection connect(Delegate& delegate, Delegate& receiver) { return connect( delegate, slot(receiver) ); } /** Connect a Delegate to a Slot. */ template Connection connect(Delegate& delegate, const BasicSlot& slot) { return delegate.connect(slot); } /** Connect a Delegate to a function. */ template Connection connect(Delegate& delegate, R(*func)()) { return connect( delegate, slot(func) ); } /** Connect a Delegate to a member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)()) { return connect( delegate, slot(object, memFunc) ); } /** Connect a Delegate to a const member function. */ template Connection connect(Delegate& delegate, BaseT& object, R(ClassT::*memFunc)() const) { return connect( delegate, slot(object, memFunc) ); } // END_Delegate cxxtools-2.2.1/include/cxxtools/atomicity.gcc.x86_64.h0000664000175000017500000000301512256773774017516 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_X86_64_H #define CXXTOOLS_ATOMICINT_GCC_X86_64_H #include namespace cxxtools { typedef ssize_t atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/membar.gcc.mips.h0000664000175000017500000000331012256773774016767 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_MIPS_H #define CXXTOOLS_MEMBAR_MIPS_H namespace cxxtools { inline void membar_rw() { asm volatile("sync \n\t" : : : "memory"); } inline void membar_write() { asm volatile("sync \n\t" : : : "memory"); } inline void membar_read() { asm volatile("sync \n\t" : : : "memory"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_MIPS_H cxxtools-2.2.1/include/cxxtools/config.h.in0000664000175000017500000000105212256773774015675 00000000000000 /** defines, how to implement atomic operations */ #define @CXXTOOLS_ATOMICITY@ /** defines, whether c++ locales are supported */ #define @CXXTOOLS_STD_LOCALE@ /** defines, whether type long long exists */ #define @HAVE_LONG_LONG@ /** defines, whether type unsigned long long exists */ #define @HAVE_UNSIGNED_LONG_LONG@ /* defined if std::reverse_iterator is defined */ #define @HAVE_REVERSE_ITERATOR@ /* defined if std::reverse_iterator is defined */ #define @HAVE_REVERSE_ITERATOR_4@ cxxtools-2.2.1/include/cxxtools/signal.h0000664000175000017500000001664612266277345015311 00000000000000/* * Copyright (C) 2004-2006 by Dr. Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Signal_h #define cxxtools_Signal_h #include #include #include #include #include #include #include #include namespace cxxtools { /** @internal */ class SignalBase : public Connectable { public: struct Sentry { Sentry(const SignalBase* signal); ~Sentry(); void detach(); bool operator!() const { return _signal == 0; } const SignalBase* _signal; }; SignalBase(); ~SignalBase(); SignalBase& operator=(const SignalBase& other); virtual void onConnectionOpen(const Connection& c); virtual void onConnectionClose(const Connection& c); void disconnectSlot(const Slot& slot); private: mutable Sentry* _sentry; mutable bool _sending; mutable bool _dirty; }; #include struct CompareEventTypeInfo { bool operator()( const std::type_info* t1, const std::type_info* t2 ) const; }; template <> class Signal : public Connectable , protected NonCopyable { struct Sentry { Sentry(const Signal* signal); ~Sentry(); void detach(); bool operator!() const { return _signal == 0; } const Signal* _signal; }; class IEventRoute { public: IEventRoute(Connection& target) : _target(target) { } virtual ~IEventRoute() {} virtual void route(const cxxtools::Event& ev) { typedef Invokable InvokableT; const InvokableT* invokable = static_cast( _target.slot().callable() ); invokable->invoke(ev); } Connection& connection() { return _target; } bool valid() const { return _target.valid(); } private: Connection _target; }; template class EventRoute : public IEventRoute { public: EventRoute(Connection& target) : IEventRoute(target) { } virtual void route(const cxxtools::Event& ev) { typedef Invokable InvokableT; const InvokableT* invokable = static_cast( connection().slot().callable() ); const EventT& event = static_cast(ev); invokable->invoke(event); } }; typedef std::multimap< const std::type_info*, IEventRoute*, CompareEventTypeInfo > RouteMap; public: Signal(); ~Signal(); void send(const cxxtools::Event& ev) const; template Connection connect(const BasicSlot& slot) { Connection conn( *this, slot.clone() ); this->addRoute( 0, new IEventRoute(conn) ); return conn; } template void disconnect(const BasicSlot& slot) { this->removeRoute(slot); } template void subscribe( const BasicSlot& slot ) { Connection conn( *this, slot.clone() ); const std::type_info& ti = typeid(EventT); this->addRoute( &ti, new EventRoute(conn) ); } template void unsubscribe( const BasicSlot& slot ) { const std::type_info& ti = typeid(EventT); this->removeRoute(&ti, slot); } virtual void onConnectionOpen(const Connection& c); virtual void onConnectionClose(const Connection& c); protected: void addRoute(const std::type_info* ti, IEventRoute* route); void removeRoute(const Slot& slot); void removeRoute(const std::type_info* ti, const Slot& slot); private: mutable RouteMap _routes; mutable Sentry* _sentry; mutable bool _sending; mutable bool _dirty; }; template Connection connect(Signal& signal, R(*func)(const cxxtools::Event&)) { return signal.connect( slot(func) ); } template Connection connect( Signal& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) ) { return signal.connect( slot(object, memFunc) ); } template Connection connect( Signal& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) const ) { return signal.connect( slot(object, memFunc) ); } inline Connection connect(Signal& sender, Signal& receiver) { return sender.connect( slot(receiver) ); } template void disconnect(Signal& signal, R(*func)(const cxxtools::Event&)) { signal.disconnect( slot(func) ); } template void disconnect( Signal& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) ) { signal.disconnect( slot(object, memFunc) ); } template void disconnect( Signal& signal, BaseT& object, R(ClassT::*memFunc)(const cxxtools::Event&) const ) { signal.disconnect( slot(object, memFunc) ); } inline void disconnect(Signal& sender, Signal& receiver) { sender.disconnect( slot(receiver) ); } } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/fdstream.h0000664000175000017500000000504312256773774015634 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FDSTREAM_H #define CXXTOOLS_FDSTREAM_H #include namespace cxxtools { class Fdstreambuf : public std::streambuf { std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); int fd; bool doClose; unsigned bufsize; char* buffer; public: explicit Fdstreambuf(int fd, unsigned bufsize = 8192, bool doClose = false); ~Fdstreambuf(); void setClose(bool sw = true) { doClose = sw; } bool isClose() const { return doClose; } void close(); int getFd() const { return fd; } }; class Fdiostream : public std::iostream { Fdstreambuf streambuf; public: explicit Fdiostream(int fd, unsigned bufsize = 8192, bool close = false) : std::iostream(0), streambuf(fd, bufsize, close) { init(&streambuf); } void setClose(bool sw = true) { streambuf.setClose(sw); } bool isClose() const { return streambuf.isClose(); } void close() { streambuf.close(); } int getFd() const { return streambuf.getFd(); } }; } #endif // CXXTOOLS_FDSTREAM_H cxxtools-2.2.1/include/cxxtools/membar.gcc.x86.h0000664000175000017500000000327412256773774016455 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_X86_H #define CXXTOOLS_MEMBAR_X86_H namespace cxxtools { inline void membar_rw() { asm volatile("mfence" : : : "memory"); } inline void membar_write() { asm volatile("sfence" : : : "memory"); } inline void membar_read() { asm volatile("lfence" : : : "memory"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_X86_H cxxtools-2.2.1/include/cxxtools/settings.h0000664000175000017500000000510412256773774015665 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Settings_h #define cxxtools_Settings_h #include #include #include #include #include namespace cxxtools { class SettingsError : public cxxtools::SerializationError { public: SettingsError(const std::string& what, unsigned line); //! @brief Destructor ~SettingsError() throw() {} unsigned line() const { return _line; } private: unsigned _line; }; class Settings : public cxxtools::SerializationInfo { public: Settings(); void load( std::basic_istream& is ); void save( std::basic_ostream& os ) const; template const bool getObject(T& type, const std::string& name) const { const cxxtools::SerializationInfo* si = this->findMember(name); if(si == 0) return false; *si >>= type; return true; } template const void setObject(const T& type, const std::string& name) { SerializationInfo& si = this->addMember(name); si <<= type; } }; } #endif cxxtools-2.2.1/include/cxxtools/semaphore.h0000664000175000017500000000411212256773774016006 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Semaphore_h #define cxxtools_Semaphore_h #include #include namespace cxxtools { class CXXTOOLS_API Semaphore : private NonCopyable { friend class SemaphoreImpl; public: //! @brief Construct with initial count Semaphore(unsigned int initial = 0); //! @brief Destructor. Does not signal... ~Semaphore(); //! @brief Wait for the semaphore to become signaled Semaphore& wait(); //! @brief Non-blocking wait bool tryWait(); //! @brief Signal the semaphore Semaphore& post(); private: //! @internal @brief Implementation class SemaphoreImpl* _impl; }; } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/facets.h0000664000175000017500000000621012256773774015271 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FACETS_H #define CXXTOOLS_FACETS_H #include #include #include namespace std { /** @brief Numpunct localization facet @ingroup Unicode */ template <> class CXXTOOLS_API numpunct : public locale::facet { public: typedef cxxtools::Char char_type; typedef basic_string string_type; // gcc 3.4.x violates the c++ standard by requiring a __numpunct_cache #if __GLIBCXX__ <= 20051201 && __GLIBCXX__ >= 20040419 typedef __numpunct_cache __cache_type; #endif static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit numpunct(size_t refs = 0); virtual ~numpunct(); char_type decimal_point() const; char_type thousands_sep() const; string grouping() const; string_type truename() const; string_type falsename() const; protected: virtual char_type do_decimal_point() const; virtual char_type do_thousands_sep() const; virtual string do_grouping() const; virtual string_type do_truename() const; virtual string_type do_falsename() const; }; } // namespace std namespace cxxtools { static std::ios_base::Init cxxtools_stream_init; static struct CXXTOOLS_API InitLocale { InitLocale() { std::locale::global( std::locale(std::locale(), new std::ctype) ); std::locale::global( std::locale(std::locale(), new std::numpunct) ); std::locale::global( std::locale(std::locale(), new std::num_get) ); std::locale::global( std::locale(std::locale(), new std::num_put) ); } } cxxtools_init_locale; } #endif cxxtools-2.2.1/include/cxxtools/timer.h0000664000175000017500000001115712266277345015144 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef Cxxtools_System_Timer_h #define Cxxtools_System_Timer_h #include #include #include #include #include namespace cxxtools { class SelectorBase; /** @brief Notifies clients in constant intervals Timers can be used to be notified if a time interval expires. It usually works with a Selector or event loop, where the Timer needs to be registered. Timers send the timeout signal in given intervals, to which the interested clients connect. The interval can be changed at any time and timers can switch between an active and inactive state. The following code calls the function onTimer every second: @code void onTimer() { std::cerr << "Time out!\n"; } int main() { cxxtools::Timer timer; connect(timer.timeout, onTimer); cxxtools::EventLoop loop; loop.add(timer); timer.start(1000); loop.run(); return 0; } @endcode */ class CXXTOOLS_API Timer { class Sentry; public: /** @brief Default constructor Constructs an inactive timer. */ Timer(); /** @brief Destructor The destructor sends the destroyed signal. */ ~Timer(); SelectorBase* selector() { return _selector; } void setSelector(SelectorBase* s); /** @brief Returs true if timer is active */ bool active() const; /** @brief Returns the current timer interval Returns the current interval of the timer in milliseconds. */ std::size_t interval() const; /** @brief Starts the timer Start a timer from the moment this method is called. The Timer needs to be registered with a Selector or event loop, otherwise the timeout signal will not be sent. @param interval Timeout interval in milliseconds */ void start(std::size_t interval); /** @brief Stops the timer If the Timer is registered with a Selector or an event loop, the timout signal will not be sent anymore. */ void stop(); /** @brief Update the timer This method is supposed to be called by the Selector or an event loop. If the interval timeout is passed the Timer will send the timeout signal and return true, otherwise internal times are updated and false is returned. */ bool update(); bool update(const Timespan& now); /** @brief Notifies about interval timeouts This signal is sent if the interval time has expired. */ Signal<> timeout; const Timespan& finished() const { return _finished; } private: Sentry* _sentry; SelectorBase* _selector; bool _active; std::size_t _interval; Timespan _remaining; Timespan _finished; }; } #endif cxxtools-2.2.1/include/cxxtools/uuencode.h0000664000175000017500000000537712256773774015650 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UUENCODE_H #define CXXTOOLS_UUENCODE_H #include namespace cxxtools { class Uuencode_streambuf : public std::streambuf { std::streambuf* sinksource; unsigned length; char* obuffer; bool inStream; public: Uuencode_streambuf(std::streambuf* sinksource_, unsigned length_ = 45) : sinksource(sinksource_), length(length_), obuffer(new char[length]), inStream(false) { } ~Uuencode_streambuf() { end(); delete[] obuffer; } void begin(const std::string& filename, unsigned mode = 0644); void end(); protected: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; /** * uuencoder. */ class UuencodeOstream : public std::ostream { Uuencode_streambuf streambuf; public: UuencodeOstream(std::ostream& out) : std::ostream(0), streambuf(out.rdbuf()) { init(&streambuf); } UuencodeOstream(std::streambuf* sb) : std::ostream(0), streambuf(sb) { init(&streambuf); } ~UuencodeOstream() { end(); } void begin(const std::string& filename, unsigned mode = 0644) { streambuf.begin(filename, mode); } void end() { streambuf.end(); } }; } #endif // CXXTOOLS_UUENCODE_H cxxtools-2.2.1/include/cxxtools/atomicity.gcc.ppc.h0000664000175000017500000000307512256773774017350 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_PPC_H #define CXXTOOLS_ATOMICINT_GCC_PPC_H #include namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/base64stream.h0000664000175000017500000000503612256773774016331 00000000000000/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BASE64STREAM_H #define CXXTOOLS_BASE64STREAM_H #include #include #include namespace cxxtools { /** Base64ostream is a base64-encoder. To base64-encode, instantiate a Base64ostream with an outputstream. Write the data to encode into the stream. Base64ostream writes the base64-encoded data to the outputstream. When ready call terminate() to pad and flush. The stream is also padded and flushed in the destructor, when there are characters left. */ class Base64ostream : public BasicTextOStream { public: explicit Base64ostream(std::ostream& out) : BasicTextOStream(out, new Base64Codec()) { } void end() { terminate(); } }; /** Base64istream is a base64-decoder. To base64-decode, instantiate a base64istream with an inputstream. The class reads base64-encoded data from the inputstream and you get decoded output. */ class Base64istream : public BasicTextIStream { public: explicit Base64istream(std::istream& in) : BasicTextIStream(in, new Base64Codec()) { } void reset() { terminate(); } }; } #endif // CXXTOOLS_BASE64STREAM_H cxxtools-2.2.1/include/cxxtools/connection.h0000664000175000017500000000706512256773774016174 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Connection_h #define cxxtools_Connection_h #include #include namespace cxxtools { class Connectable; /** @internal */ class ConnectionData : public RefCounted { public: ConnectionData() : _refs(1) , _valid(false) , _slot(0) , _sender(0) { } ConnectionData(Connectable& sender, Slot* slot) : _refs(1) , _valid(true) , _slot(slot) , _sender(&sender) { } ~ConnectionData() { delete _slot; } unsigned ref() { return ++_refs; } unsigned unref() { return --_refs; } unsigned refs() const { return _refs; } bool valid() const { return _valid; } void setValid(bool valid) { _valid = valid; } Connectable& sender() { return *_sender; } const Connectable& sender() const { return *_sender; } Slot& slot() { return *_slot; } const Slot& slot() const { return *_slot; } private: unsigned _refs; bool _valid; Slot* _slot; Connectable* _sender; }; /** @brief Represents a connection between a Signal/Delegate and a slot @ingroup sigslot */ class Connection { public: Connection(); Connection(Connectable& sender, Slot* slot); Connection(const Connection& connection); ~Connection(); bool valid() const { return _data->valid(); } const Connectable& sender() const { return _data->sender(); } const Slot& slot() const { return _data->slot(); } bool operator!() const { return this->valid() == false; } void close(); Connection& operator=(const Connection& connection); bool operator==(const Connection& connection) const; private: ConnectionData* _data; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/streamcounter.h0000664000175000017500000000523012256773774016720 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STREAMCOUNTER_H #define CXXTOOLS_STREAMCOUNTER_H #include namespace cxxtools { template class BasicStreamcounterBuf : public std::basic_streambuf { typedef Traits traits_type; typedef typename Traits::int_type int_type; unsigned count; public: BasicStreamcounterBuf() : count(0) { } unsigned getCount() const { return count; } void resetCount(unsigned count_) { count = count_; } private: int_type overflow(int_type ch) { ++count; return 0; } int_type underflow() { return traits_type::eof(); } int sync() { return 0; } }; template class BasicStreamcounter : public std::basic_ostream { BasicStreamcounterBuf streambuf; public: BasicStreamcounter() : std::basic_ostream(0) { std::basic_ostream::init(&streambuf); } unsigned getCount() const { return streambuf.getCount(); } void resetCount(unsigned count = 0) { streambuf.resetCount(count); } }; typedef BasicStreamcounter > Streamcounter; } #endif // CXXTOOLS_STREAMCOUNTER_H cxxtools-2.2.1/include/cxxtools/eventloop.h0000664000175000017500000001360112266277345016033 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_EVENTLOOP_H #define CXXTOOLS_SYSTEM_EVENTLOOP_H #include #include #include #include #include #include #include #include namespace cxxtools { class Selectable; /** @brief Thread-safe event loop supporting I/O multiplexing and Timers. */ class EventLoopBase : public SelectorBase , public EventSink { public: /** @brief Destructs the EventLoop */ virtual ~EventLoopBase() {} /** @brief Starts the event loop */ void run() { this->onRun(); } /** @brief Processes all events which are currently in the event queue */ void processEvents() { this->onProcessEvents(); } /** @brief Stops the %EventLoop. */ void exit() { this->onExit(); } /** @brief Sets the idle timeout */ void setIdleTimeout(size_t msecs) { _timeout = msecs; } /** @brief Returns the idle timeout */ unsigned int idleTimeout() const { return _timeout; } /** @brief Notifies about wait timeouts This signal is send when the timeout given to a wait call of the selector expires and no activity occured. */ Signal<> timeout; /** @brief Reports all events TODO: rename to eventReady */ Signal event; /** @brief Emited when the eventloop is exited */ Signal<> exited; protected: /** @brief Constructs the EventLoop */ EventLoopBase() : _timeout(WaitInfinite) {} virtual void onRun() = 0; virtual void onExit() = 0; virtual void onProcessEvents() = 0; private: size_t _timeout; }; /** @brief Thread-safe event loop supporting I/O multiplexing and Timers. The System EventLoop can be used as the central entity of a thread or process to dispatch application events and wait on multiple IODevices or Timers for activity. Events can be added to the internal event queue, even from other threads using the method EventLoop::commitEvent or EventLoop::queueEvent. The first method will add the event to the internal queue and wake the event loop, the latter allows queing multiple events and it is up to the caller to wake the event loop by calling EventLoop::wake when all events are added. When the event loop processes its event, the signal "event" is send for each processed event. Events are processes in the order they were added. To start the %EventLoop the method EventLoop::run must be executed. It blocks until the event loop is stopped. To stop the %EventLoop, EventLoop::exit must be called. The delivery of the events occurs inside the thread that started the execution of the event loop. %IODevices and %Timers can be added to an %EventLoop just as to Selector. In fact a %Selector is used internally to implement the %EventLoop. Since the %EventLoop is a Runnable, it can be easily assigned to a Thread to give it its own event loop. */ class CXXTOOLS_API EventLoop : public EventLoopBase { public: /** @brief Constructs the EventLoop */ EventLoop(); /** @brief Destructs the EventLoop */ virtual ~EventLoop(); protected: virtual void onAdd( Selectable& s ); virtual void onRemove( Selectable& s ); virtual void onReinit(Selectable& s); virtual void onChanged(Selectable& s); virtual void onRun(); virtual bool onWait(std::size_t msecs); virtual void onWake(); virtual void onExit(); virtual void onCommitEvent(const Event& event); virtual void onProcessEvents(); private: bool _exitLoop; SelectorImpl* _selector; Allocator _allocator; std::deque _eventQueue; RecursiveMutex _queueMutex; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/clock.h0000664000175000017500000000520412266277345015113 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CLOCK_H #define CXXTOOLS_CLOCK_H #include #include #include namespace cxxtools { /** @brief Measures time intervals The clock class can be used like a stop-watch by calling Clock::start() and Clock::stop(). The latter method returns the elapsed time. */ class CXXTOOLS_API Clock { public: /** @brief Constructs a Clock */ Clock(); /** @brief Destructor */ ~Clock(); /** @brief Start the clock */ void start(); /** @brief Stop the clock Returns the elapsed time since start was called. */ Timespan stop(); /** @brief Returns the system time */ static DateTime getSystemTime(); /** @brief Returns the current local time */ static DateTime getLocalTime(); /** @brief Returns the timespan since a fixed point in the past The getSystemTicks function retrieves the system ticks, in milliseconds. The system time is the time elapsed since i.e. the system was started, or the unix epoch or some other fixed point in the past. */ static Timespan getSystemTicks(); private: class ClockImpl *_impl; }; } //namespace cxxtools #endif // CXXTOOLS_CLOCK_H cxxtools-2.2.1/include/cxxtools/iconverter.h0000664000175000017500000000766012256773774016216 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ICONVERTER_H #define CXXTOOLS_ICONVERTER_H #include #include #include namespace cxxtools { /** IConverter is a simple wrapper around cxxtools::iconvstream. Often the result of a character-conversion is needed as a std::string. This can be achived to let iconvstream to a ostringstream and get the string from the ostringstream. IConverter simplify this. example: convert a UTF8-encoded string to ISO8859-1: \code cxxtools::IConverter conv("ISO8859-1", "UTF8"); std::string utf8string = getUtf8String(); std::string iso8895_1 = conv.convert(utf8string); // or functor-style: std::string iso8895_1 = conv(utf8string); \endcode */ class IConverter { std::string tocode; std::string fromcode; public: IConverter() { } IConverter(const std::string& tocode_, const std::string& fromcode_) : tocode(tocode_), fromcode(fromcode_) { } void setToCode(const std::string& tocode_) { tocode = tocode_; } void setFromCode(const std::string& fromcode_) { fromcode = fromcode_; } const std::string& getToCode() const { return tocode; } const std::string& getFromCode() const { return fromcode; } template std::string convert(objT s) const { std::ostringstream o; iconvstream conv; conv.exceptions(std::ios::failbit | std::ios::badbit); conv.open(o, tocode.c_str(), fromcode.c_str()); conv << s << std::flush; return o.str(); } std::string convert(const char* data, unsigned size) const { std::ostringstream o; iconvstream conv; conv.exceptions(std::ios::failbit | std::ios::badbit); conv.open(o, tocode.c_str(), fromcode.c_str()); conv.write(data, size); conv.flush(); return o.str(); } template std::string convertRange(iteratorT begin, iteratorT end) const { std::ostringstream o; iconvstream conv; conv.exceptions(std::ios::failbit | std::ios::badbit); conv.open(o, tocode.c_str(), fromcode.c_str()); for (iteratorT it = begin; it != end; ++it) conv << *it; conv.flush(); return o.str(); } template std::string operator() (objT s) const { return convert(s); } std::string operator() (const char* data, unsigned size) const { return convert(data, size); } }; } #endif // CXXTOOLS_ICONVERTER_H cxxtools-2.2.1/include/cxxtools/atomicity.gcc.sparc32.h0000664000175000017500000000303012256773774020032 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_SPARC32_H #define CXXTOOLS_ATOMICINT_GCC_SPARC32_H #include namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/event.h0000664000175000017500000000554312256773774015155 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_EVENT_H #define cxxtools_EVENT_H #include #include namespace cxxtools { /** \brief Base class for all event types. Specific Event objects, subclass from Event and implement the clone() and typeInfo() methods. The first is used to deep copy event objects for example in an EventLoop and the latter one is used to dispatch events by type. */ class Event { public: /** \brief Destructor. */ virtual ~Event() {} virtual Event& clone(Allocator& allocator) const = 0; virtual void destroy(Allocator& allocator) = 0; virtual const std::type_info& typeInfo() const = 0; }; template class BasicEvent : public Event { public: BasicEvent() { } BasicEvent(const BasicEvent& src) { } virtual const std::type_info& typeInfo() const { return typeid(T); } virtual Event& clone(Allocator& allocator) const { void* pEvent = allocator.allocate(sizeof(T)); return *(new (pEvent)T(*static_cast(this))); } virtual void destroy(Allocator& allocator) { this->~BasicEvent(); allocator.deallocate(this, sizeof(T)); } }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/net/0000775000175000017500000000000012266277564014517 500000000000000cxxtools-2.2.1/include/cxxtools/net/tcpserver.h0000664000175000017500000000627612256773774016643 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TcpServer_H #define CXXTOOLS_NET_TcpServer_H #include #include #include #include #include #include namespace cxxtools { namespace net { class AddressInUse : public IOError { public: AddressInUse() : IOError("address in use") { } AddressInUse(const std::string& ipaddr, unsigned short int port); }; class AcceptTerminated : public std::exception { public: const char* what() const throw () { return "accept terminated"; } }; class CXXTOOLS_API TcpServer : public Selectable { class TcpServerImpl* _impl; public: enum { INHERIT = 1, DEFER_ACCEPT = 2 }; TcpServer(); /** @brief Creates a server socket and listens on an address */ TcpServer(const std::string& ipaddr, unsigned short int port, int backlog = 5, unsigned flags = 0); ~TcpServer(); void listen(const std::string& ipaddr, unsigned short int port, int backlog = 5, unsigned flags = 0); // inherit doc virtual SelectableImpl& simpl(); /** @brief Stops a blocking accept The stopAccept method can be called from a thread to break a blocking accept call in another thread. The call to accept is terminated by a AcceptTerminated exception. */ void terminateAccept(); TcpServerImpl& impl() const; Signal connectionPending; protected: // inherit doc virtual void onClose(); // inherit doc virtual bool onWait(std::size_t msecs); // inherit doc virtual void onAttach(SelectorBase&); // inherit doc virtual void onDetach(SelectorBase&); }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_TcpServer_H cxxtools-2.2.1/include/cxxtools/net/tcpsocket.h0000664000175000017500000001006612256773774016615 00000000000000/* * Copyright (C) 2006-2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_net_TcpSocket_h #define CXXTOOLS_net_TcpSocket_h #include #include #include #include #include namespace cxxtools { namespace net { class TcpServer; class AddrInfo; class CXXTOOLS_API TcpSocket : public IODevice { class TcpSocketImpl* _impl; public: // flags for accept method enum { INHERIT = 1, DEFER_ACCEPT = 2 }; TcpSocket(); TcpSocket(const TcpServer& server, unsigned flags = 0); TcpSocket(const std::string& ipaddr, unsigned short int port); explicit TcpSocket(const AddrInfo& addrinfo); ~TcpSocket(); std::string getSockAddr() const; std::string getPeerAddr() const; void setTimeout(std::size_t msecs); std::size_t timeout() const; std::size_t getTimeout() const { return timeout(); } void accept(const TcpServer& server, unsigned flags = 0); void connect(const AddrInfo& addrinfo); void connect(const std::string& ipaddr, unsigned short int port) { connect(AddrInfo(ipaddr, port)); } bool beginConnect(const AddrInfo& addrinfo); bool beginConnect(const std::string& ipaddr, unsigned short int port) { return beginConnect(AddrInfo(ipaddr, port)); } void endConnect(); Signal connected; /** @brief Notifies when the device is closed while no reading or writing is pending */ Signal closed; bool isConnected() const; int getFd() const; short poll(short events) const; protected: TcpSocket(TcpSocketImpl* impl) : _impl(impl) { } // inherit doc virtual void onClose(); // inherit doc virtual bool onWait(std::size_t msecs); // inherit doc virtual void onAttach(SelectorBase&); // inherit doc virtual void onDetach(SelectorBase&); // inherit doc virtual size_t onBeginRead(char* buffer, size_t n, bool& eof); // inherit doc virtual size_t onEndRead(bool& eof); // inherit doc virtual size_t onRead(char* buffer, size_t count, bool& eof); // inherit doc virtual size_t onBeginWrite(const char* buffer, size_t n); // inherit doc virtual size_t onEndWrite(); // inherit doc virtual size_t onWrite(const char* buffer, size_t count); virtual void onCancel(); public: // inherit doc virtual SelectableImpl& simpl(); // inherit doc virtual IODeviceImpl& ioimpl(); }; } // namespace net } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/net/udp.h0000664000175000017500000000556412256773774015415 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_UDP_H #define CXXTOOLS_NET_UDP_H #include #include #include #include namespace cxxtools { namespace net { class UdpSender : public Socket { bool connected; public: typedef size_t size_type; UdpSender() : connected(false) { } UdpSender(const std::string& ipaddr, unsigned short int port, bool bcast = false); void connect(const std::string& ipaddr, unsigned short int port, bool bcast = false); bool isConnected() const { return connected; } size_type send(const void* message, size_type length, int flags = 0) const; size_type send(const std::string& message, int flags = 0) const; size_type recv(void* buffer, size_type length, int flags = 0) const; std::string recv(size_type length, int flags = 0) const; }; class UdpReceiver : public Socket { struct sockaddr_storage peeraddr; socklen_t peeraddrLen; public: typedef size_t size_type; UdpReceiver(); UdpReceiver(const std::string& ipaddr, unsigned short int port); void bind(const std::string& ipaddr, unsigned short int port); size_type recv(void* buffer, size_type length, int flags = 0); std::string recv(size_type length, int flags = 0); size_type send(const void* message, size_type length, int flags = 0) const; size_type send(const std::string& message, int flags = 0) const; }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_UDP_H cxxtools-2.2.1/include/cxxtools/net/tcpstream.h0000664000175000017500000001343312256773774016621 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TCPSTREAM_H #define CXXTOOLS_NET_TCPSTREAM_H #include #include #include #include #include namespace cxxtools { namespace net { class TcpStream : public IOStream, public Connectable { void init(std::size_t timeout); public: explicit TcpStream(unsigned bufsize = 8192, std::size_t timeout = Selectable::WaitInfinite) : IOStream(bufsize) { init(timeout); } TcpStream(const std::string& ipaddr, unsigned short int port, unsigned bufsize = 8192, std::size_t timeout = Selectable::WaitInfinite) : IOStream(bufsize) , _socket(ipaddr, port) { init(timeout); } explicit TcpStream(const AddrInfo& addrinfo, unsigned bufsize = 8192, std::size_t timeout = Selectable::WaitInfinite) : IOStream(bufsize) , _socket(addrinfo) { init(timeout); } TcpStream(const char* ipaddr, unsigned short int port, unsigned bufsize = 8192, std::size_t timeout = Selectable::WaitInfinite) : IOStream(bufsize) , _socket(ipaddr, port) { init(timeout); } explicit TcpStream(TcpServer& server, unsigned bufsize = 8192, unsigned flags = 0, std::size_t timeout = Selectable::WaitInfinite) : IOStream(bufsize) , _socket(server, flags) { init(timeout); } /// Set timeout to the given value in milliseconds. void setTimeout(std::size_t timeout) { _socket.setTimeout(timeout); } /// Returns the current value for timeout in milliseconds. std::size_t getTimeout() const { return _socket.getTimeout(); } void close() { _socket.close(); } bool beginConnect(const AddrInfo& addrinfo) { return _socket.beginConnect(addrinfo); } bool beginConnect(const std::string& ipaddr, unsigned short int port) { return _socket.beginConnect(ipaddr, port); } void endConnect() { _socket.endConnect(); } void connect(const AddrInfo& addrinfo) { _socket.connect(addrinfo); } void connect(const std::string& ipaddr, unsigned short int port) { _socket.connect(ipaddr, port); } void accept(const TcpServer& server, unsigned flags = 0) { _socket.accept(server, flags); } std::string getSockAddr() const { return _socket.getSockAddr(); } std::string getPeerAddr() const { return _socket.getPeerAddr(); } bool isConnected() const { return _socket.isConnected(); } int getFd() const { return _socket.getFd(); } TcpSocket& socket() { return _socket; } /** @brief Notifies about available data This signal is send when the Socket is monitored in a Selector or EventLoop and data becomes available. The system must call beginRead() to monitor the tcpstream for reading. After the signal is received, data is available in the stream or in case of disconnection, reading fails. */ Signal inputReady; /** @brief Notifies when data can be written This signal is send when the Socket is monitored in a Selector or EventLoop and the device is ready to write data. */ Signal outputReady; /** @brief Notifies when the device is connected after beginConnect */ Signal connected; /** @brief Notifies when the device is closed while no reading or writing is pending */ Signal closed; private: TcpSocket _socket; void onInput(IODevice&); void onOutput(IODevice&); void onConnected(TcpSocket&); void onClosed(TcpSocket&); }; typedef TcpStream iostream; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_TCPSTREAM_H cxxtools-2.2.1/include/cxxtools/net/uri.h0000664000175000017500000000561212266277345015410 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { namespace net { class CXXTOOLS_API Uri { bool _ipv6; std::string _protocol; std::string _user; std::string _password; std::string _host; unsigned short int _port; std::string _path; std::string _query; std::string _fragment; public: Uri() { } Uri(const std::string& str); void protocol(const std::string& protocol) { _protocol = protocol; } const std::string& protocol() const { return _protocol; } void user(const std::string& user) { _user = user; } const std::string& user() const { return _user; } void password(const std::string& password) { _password = password; } const std::string& password() const { return _password; } void host(const std::string& host) { _host = host; } const std::string& host() const { return _host; } void port(unsigned short int p) { _port = p; } unsigned short int port() const { return _port; } void path(const std::string& path) { _path = path; } const std::string& path() const { return _path; } void query(const std::string& query) { _query = query; } const std::string& query() const { return _query; } void fragment(const std::string& fragment) { _fragment = fragment; } const std::string& fragment() const { return _fragment; } std::string str() const; }; } } cxxtools-2.2.1/include/cxxtools/net/addrinfo.h0000664000175000017500000000435412256773774016407 00000000000000/* * Copyright (C) 2005,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_ADDRINFO_H #define CXXTOOLS_NET_ADDRINFO_H #include #include namespace cxxtools { namespace net { class AddrInfoImpl; class CXXTOOLS_API AddrInfo { public: AddrInfo() : _impl(0) { } explicit AddrInfo(AddrInfoImpl* impl); AddrInfo(const std::string& host, unsigned short port, bool listen = false); AddrInfo(const AddrInfo& src); ~AddrInfo(); AddrInfo& operator= (const AddrInfo& src); const std::string& host() const; unsigned short port() const; AddrInfoImpl* impl() { return _impl; } const AddrInfoImpl* impl() const { return _impl; } private: AddrInfoImpl* _impl; }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_ADDRINFO_H cxxtools-2.2.1/include/cxxtools/net/net.h0000664000175000017500000000635112256773774015406 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_NET_H #define CXXTOOLS_NET_NET_H #include #include namespace cxxtools { namespace net { ////////////////////////////////////////////////////////////////////// /** * Wrapper for BSD sockets. */ class Socket : private NonCopyable { public: /// A socket is created. On error a net::Exception is thrown. Socket(int domain, int type, int protocol); /// A socket is initialized with a existing socket descriptor. /// Ownership is transfered to this class. explicit Socket(int fd = -1) : m_sockFd(fd), m_timeout(-1) { } /// The socket is released. /// Errors are printed on stderr. virtual ~Socket(); /// Returns true, if a socket is held. bool good() const { return m_sockFd >= 0; } /// Returns true, if no socket is held. bool bad() const { return m_sockFd < 0; } /// Returns true, if a socket is held. operator bool() const { return m_sockFd >= 0; } /// Creates a new socket. If a socket is already associated with this /// class, it is closed. void create(int domain, int type, int protocol); /// Closes the socket, if a socket is held. void close(); /// Returns the socket handle. int getFd() const { return m_sockFd; } /// wrapper around getsockname(2) std::string getSockAddr() const; /// Set timeout in milliseconds. void setTimeout(int t); /// Returns timeout in milliseconds. int getTimeout() const { return m_timeout; } /// execute poll(2) - throws Timeout-exception, when no data available /// after timeout short poll(short events) const; protected: void setFd(int sockFd); private: int m_sockFd; int m_timeout; }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_NET_H cxxtools-2.2.1/include/cxxtools/net/udpstream.h0000664000175000017500000000552312256773774016624 00000000000000/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UDPSTREAM_H #define CXXTOOLS_UDPSTREAM_H #include #include namespace cxxtools { namespace net { class UdpStreambuf : public std::streambuf { char* message; unsigned msgsize; UdpSender& sender; int flags; void sendBuffer(); public: explicit UdpStreambuf(UdpSender& sender_, int flags_ = 0, unsigned msgsize_ = 1024) : message(new char[msgsize_]), msgsize(msgsize_), sender(sender_), flags(flags_) { } ~UdpStreambuf() { delete[] message; } protected: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; class UdpOStream : public std::ostream { UdpSender* sender; UdpStreambuf streambuf; public: explicit UdpOStream(UdpSender& sender_, int flags = 0) : std::ostream(0), sender(0), streambuf(sender_, flags) { init(&streambuf); } UdpOStream(const char* ipaddr, unsigned short int port, bool bcast = false, int flags = 0) : std::ostream(0), sender(new UdpSender(ipaddr, port, bcast)), streambuf(*sender, flags) { init(&streambuf); } ~UdpOStream() { delete sender; } }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_UDPSTREAM_H cxxtools-2.2.1/include/cxxtools/membar.sun.h0000664000175000017500000000323412256773774016076 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_SUN_H #define CXXTOOLS_MEMBAR_SUN_H #include namespace cxxtools { inline void membar_rw() { ::membar_enter(); } inline void membar_write() { ::membar_producer(); } inline void membar_read() { ::membar_consumer(); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_SUN_H cxxtools-2.2.1/include/cxxtools/conversionerror.h0000664000175000017500000000357112256773774017272 00000000000000/* * Copyright (C) 2004-2007 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CONVERSINERROR_H #define CXXTOOLS_CONVERSINERROR_H #include #include #include namespace cxxtools { class CXXTOOLS_API ConversionError : public std::runtime_error { public: explicit ConversionError(const std::string& msg); ~ConversionError() throw() {} static void doThrow(const char* typeto, const char* typefrom); static void doThrow(const char* typeto, const char* typefrom, const char* valuefrom); }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/function.tpp0000664000175000017500000005663012256773774016240 00000000000000// BEGIN_Function 10 /** The Function class wraps free functions in the form of a Callable, for use with the signals/slots framework. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** FunctionSlot wraps Function objects so that they can act as Slots. */ template < typename R,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class FunctionSlot : public BasicSlot { public: FunctionSlot(const Function& func) : _func( func ) {} /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_func; } /** Creates a copy of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new FunctionSlot(*this); } virtual void onConnect(const Connection& c) { } virtual void onDisconnect(const Connection& c) { } virtual bool equals(const Slot& slot) const { const FunctionSlot* fs = dynamic_cast(&slot); return fs ? (_func == fs->_func) : false; } private: Function _func; }; // FunctionSlot /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) ) { return FunctionSlot( callable(func) ); } // END_Function 10 // BEGIN_Function 9 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) ) { return FunctionSlot( callable(func) ); } // END_Function 9 // BEGIN_Function 8 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7,A8); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7,a8); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) ) { return FunctionSlot( callable(func) ); } // END_Function 8 // BEGIN_Function 7 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6,A7); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6,a7); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) ) { return FunctionSlot( callable(func) ); } // END_Function 7 // BEGIN_Function 6 template < typename R,class A1, class A2, class A3, class A4, class A5, class A6> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5,A6); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return (*_funcPtr)(a1,a2,a3,a4,a5,a6); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) ) { return FunctionSlot( callable(func) ); } // END_Function 6 // BEGIN_Function 5 template < typename R,class A1, class A2, class A3, class A4, class A5> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4,A5); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return (*_funcPtr)(a1,a2,a3,a4,a5); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) ) { return FunctionSlot( callable(func) ); } // END_Function 5 // BEGIN_Function 4 template < typename R,class A1, class A2, class A3, class A4> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3,A4); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return (*_funcPtr)(a1,a2,a3,a4); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3, A4 a4)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3, A4 a4) ) { return FunctionSlot( callable(func) ); } // END_Function 4 // BEGIN_Function 3 template < typename R,class A1, class A2, class A3> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2,A3); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2, A3 a3) const { return (*_funcPtr)(a1,a2,a3); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2, A3 a3)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2, A3 a3) ) { return FunctionSlot( callable(func) ); } // END_Function 3 // BEGIN_Function 2 template < typename R,class A1, class A2> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1,A2); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1, A2 a2) const { return (*_funcPtr)(a1,a2); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1, A2 a2)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1, A2 a2) ) { return FunctionSlot( callable(func) ); } // END_Function 2 // BEGIN_Function 1 template < typename R,class A1> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(A1); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()(A1 a1) const { return (*_funcPtr)(a1); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)(A1 a1)) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)(A1 a1) ) { return FunctionSlot( callable(func) ); } // END_Function 1 // BEGIN_Function 0 template < typename R> class Function : public Callable { public: /** The function signature wrapped by this class. */ typedef R (*FuncT)(); /** Wraps func. */ Function(FuncT func) : _funcPtr(func) { } /** Deeply copies f. */ Function(const Function& f) { this->operator=(f); } /** Call the wrapped function, passing it the arguments as-is and returning its return value. */ R operator()() const { return (*_funcPtr)(); } /** Creates a clone of this object and returns it. The caller owns the returned object. */ Function* clone() const { return new Function(*this); } #if 0 /** Deeply copies function and returns this object. */ Function& operator=(const Function& function) { if( this != &function ) { _funcPtr = function._funcPtr; } return (*this); } #endif /** Returns true if rhs and this object point to the same function. */ bool operator==(const Function& rhs) const { return (_funcPtr == rhs._funcPtr); } private: FuncT _funcPtr; }; /** Creates and returns a Function wrapper for the given free/static function. */ template Function callable(R (*func)()) { return Function(func); } /** Creates and returns a FunctionSlot object for the given free/static function. */ template FunctionSlot slot( R (*func)() ) { return FunctionSlot( callable(func) ); } // END_Function 0 cxxtools-2.2.1/include/cxxtools/properties.h0000664000175000017500000001161712266277345016221 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIES_H #define CXXTOOLS_PROPERTIES_H #include #include #include #include #include namespace cxxtools { class Properties { typedef std::map ValuesType; ValuesType values; public: explicit Properties(const std::string& filename); explicit Properties(std::istream& in); void setValue(const String& key, const String& value) { values[key] = value; } void removeValue(const String& key) { values.erase(key); } bool hasValue(const String& key) const { return values.find(key) != values.end(); } String getValue(const String& key, const String& def = String()) const { ValuesType::const_iterator it = values.find(key); return it == values.end() ? def : it->second; } template void getKeys(OutputIterator oi) const { for (ValuesType::const_iterator it = values.begin(); it != values.end(); ++it) { *oi = it->first; ++oi; } } template void getKeys(const String& praefix, OutputIterator oi) const { for (ValuesType::const_iterator it = values.begin(); it != values.end(); ++it) { String key = it->first; if (key.size() > praefix.size() && key.at(praefix.size()) == L'.' && key.compare(0, praefix.size(), praefix) == 0 && key.find(L'.', praefix.size() + 2) == String::npos) { *oi = key.substr(praefix.size() + 1); ++oi; } } } template void getKeysLong(const String& praefix, OutputIterator oi) const { for (ValuesType::const_iterator it = values.begin(); it != values.end(); ++it) { String key = it->first; if (key.size() > praefix.size() && key.at(praefix.size()) == '.' && key.compare(0, praefix.size(), praefix) == 0 && key.find('.', praefix.size() + 2) == String::npos) { *oi = key; ++oi; } } } }; class PropertiesParser { public: class Event { public: virtual ~Event() { } // return true, if parser should stop virtual bool onKeyPart(const String& key) = 0; virtual bool onKey(const String& key) = 0; virtual bool onValue(const String& value) = 0; }; private: Event& event; String key; String keypart; String value; Char::value_type unicode; unsigned unicodeCount; unsigned lineNo; enum { state_0, state_key, state_key_esc, state_key_unicode, state_key_sp, state_value, state_value_esc, state_unicode, state_comment } state; public: PropertiesParser(Event& event_) : event(event_), lineNo(1), state(state_0) { } void parse(TextIStream& in); void parse(std::istream& in, TextCodec* codec = 0); bool parse(Char ch); void end(); }; class PropertiesParserError : public SerializationError { public: explicit PropertiesParserError(const std::string& msg) : SerializationError(msg) { } PropertiesParserError(const std::string& msg, unsigned lineNo); }; } #endif // CXXTOOLS_PROPERTIES_H cxxtools-2.2.1/include/cxxtools/eventsink.h0000664000175000017500000000431512256773774016036 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_EVENTSINK_H #define CXXTOOLS_EVENTSINK_H #include #include #include #include namespace cxxtools { class EventSource; class CXXTOOLS_API EventSink : protected NonCopyable { friend class EventSource; public: EventSink(); virtual ~EventSink(); void commitEvent(const Event& event); protected: virtual void onCommitEvent(const Event& event) = 0; private: void onConnect(EventSource& source); void onDisconnect(EventSource& source); void onUnsubscribe(EventSource& source); private: mutable RecursiveMutex _mutex; std::list _sources; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/split.h0000664000175000017500000001311312266277345015151 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SPLIT_H #define CXXTOOLS_SPLIT_H #include #include namespace cxxtools { /** @brief Splits a std::string into tokens using a delimiter character This is a little helper functions, which splits a string into tokens. A delimiter character is passed as a character and the resulting tokens are written to a output iterator. The most common output iterator is a std::back_inserter. Example (prints username and uid on a unix system: \code std::ifstream passwd("/etc/passwd"); std::string line; while (std::getline(passwd, line)) { std::vector tokens; cxxtools::split(':', line, std::back_inserter(tokens)); if (tokens.size() > 2) std::cout << "username: " << tokens[0] << " uid=" << tokens[2] << std::endl; } \endcode */ template void split(characterType ch, const std::basic_string& line, outputIterator it) { std::basic_string s(line); typename std::basic_string::size_type pos; while ((pos = s.find(ch)) != std::basic_string::npos) { *it = s.substr(0, pos); ++it; s.erase(0, pos + 1); } *it = s; ++it; } /** @brief Splits a std::string into tokens using a set of delimiter characters This is a little helper functions, which splits a string into tokens. A set of delimiter characters is passed as a zero terminated char array and the resulting tokens are written to a output iterator. The most common output iterator is a std::back_inserter. Example (splits a line on white space): \code std::string line = ...; std::vector tokens; cxxtools::split("[ \t]+", line, std::back_inserter(tokens)); \endcode */ template void split(const characterType* chars, const std::basic_string& line, outputIterator it) { std::basic_string s(line); typename std::basic_string::size_type pos; while ((pos = s.find_first_of(chars)) != std::basic_string::npos) { *it = s.substr(0, pos); ++it; s.erase(0, pos + 1); } *it = s; ++it; } /** @brief Splits a std::string into tokens using a set of delimiter characters This is a little helper functions, which splits a string into tokens. A set of delimiter characters is passed as a string and the resulting tokens are written to a output iterator. The most common output iterator is a std::back_inserter. Example (splits a line on white space): \code std::string line = ...; std::vector tokens; cxxtools::split("[ \t]+", line, std::back_inserter(tokens)); \endcode */ template void split(const std::basic_string& chars, const std::basic_string& line, outputIterator it) { std::basic_string s(line); typename std::basic_string::size_type pos; while ((pos = s.find_first_of(chars)) != std::basic_string::npos) { *it = s.substr(0, pos); ++it; s.erase(0, pos + 1); } *it = s; ++it; } /** @brief Splits a std::string into tokens using a regular expression. This function is much like the other split function, but uses a regular expression to find a delimiter. This is useful e.g. to split a string using white space: Example (splits a line on white space): \code std::string line = ...; std::vector tokens; cxxtools::split(cxxtools::Regex("[ \t]+"), line, std::back_inserter(tokens)); \endcode */ template void split(const Regex& re, const std::string& line, outputIterator it) { std::string s(line); RegexSMatch sm; while (re.match(s, sm)) { *it = s.substr(0, sm.offsetBegin(0)); ++it; s.erase(0, sm.offsetEnd(0)); } *it = s; ++it; } } #endif // CXXTOOLS_SPLIT_H cxxtools-2.2.1/include/cxxtools/mutex.h0000664000175000017500000003165312256773774015177 00000000000000/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Mutex_h #define cxxtools_Mutex_h #include #include #include #include namespace cxxtools { /** @brief Mutual exclusion device. A Mutex is a mutual exclusion device. It is used to synchronize the access to data which is accessed by more than one thread or process at the same time. Mutexes are not recursive, that is the same thread can not lock a mutex multiple times without deadlocking. */ class CXXTOOLS_API Mutex : private NonCopyable { private: class MutexImpl* _impl; public: //! @brief Default constructor. Mutex(); /** @brief Destructor. The destructor destroys the mutex. The mutex must be in unlocked state when the destructor is called. */ ~Mutex(); /** @brief Lock the mutex. If the mutex is currently locked by another thread, the calling thread suspends until no other thread holds a lock on it. If the mutex is already locked by the calling thread a deadlock occurs. */ void lock(); bool tryLock(); //! @brief Unlocks the mutex. void unlock(); /** @brief Unlocks the mutex. This method does not throw an exception if unlocking the mutex fails but simply returns false. */ bool unlockNoThrow(); //! @internal @brief Access to platform specific implementation MutexImpl& impl() { return *_impl; } }; /** @brief MutexLock class for Mutex. The MutexLock class adds functionality for scoped locking. In the constructor of a MutexLock, the mutex is locked and in the destructor it is unlocked. This way if for example an exception occures in the protected section the Mutex will be unlocked during stack unwinding when the MutexLock is destructed. @code // example how to make a member function thread-safe #include class MyClass { public: void function() { MutexLock lock(_mtx); // // protected operations // // dtor of MutexLock unlocks _mtx } private: cxxtools::System::Mutex _mtx; }; @endcode */ class MutexLock : private NonCopyable { public: /** @brief Construct to guard a %Mutex Constructs a MutexLock object and locks the enclosing mutex if \a doLock is true. If \a isLocked is true, the %MutexLock will only unlock the given mutex in the destructor, but not lock it in the constructor. */ MutexLock(Mutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _isLocked(isLocked) { if(doLock) this->lock(); } //! @brief Unlocks the mutex unless %unlock() was called ~MutexLock() { if(_isLocked) _mutex.unlockNoThrow(); } void lock() { if(!_isLocked) { _mutex.lock(); _isLocked = true; } } //! @brief Unlock so that the destructor does not unlock void unlock() { if(_isLocked) { _mutex.unlock(); _isLocked = false; } } //! @brief Returns the guarded the mutex object Mutex& mutex() { return _mutex; } //! @brief Returns the guarded the mutex object const Mutex& mutex() const { return _mutex; } private: Mutex& _mutex; bool _isLocked; }; /** @brief Recursive mutual exclusion device */ class CXXTOOLS_API RecursiveMutex : private NonCopyable { private: class MutexImpl* _impl; public: RecursiveMutex(); ~RecursiveMutex(); void lock(); bool tryLock(); /** @brief Unlocks the mutex. If the mutex was locked more than one time by the same thread unlock decrements the lock-count. The mutex is actually unlocked when the lock-count is zero. **/ void unlock(); bool unlockNoThrow(); }; /** @brief Lock class for recursive mutexes. */ class RecursiveLock : private NonCopyable { public: /** @brief Construct to guard a %RecursiveMutex Constructs a %RecursiveLock object and locks the enclosing recursive mutex if \a doLock is true. If \a isLocked is true, the %RecursiveLock will only unlock the given mutex in the destructor, but not lock it in the constructor. */ RecursiveLock(RecursiveMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _isLocked(isLocked) { if(doLock) this->lock(); } //! @brief Unlocks the mutex unless %unlock() was called ~RecursiveLock() { if(_isLocked) _mutex.unlockNoThrow(); } void lock() { if(!_isLocked) { _mutex.lock(); _isLocked = true; } } //! @brief Unlock so that the destructor does not unlock void unlock() { if(_isLocked) { _mutex.unlock(); _isLocked = false; } } //! @brief Returns the guarded the mutex object RecursiveMutex& mutex() { return _mutex; } //! @brief Returns the guarded the mutex object const RecursiveMutex& mutex() const { return _mutex; } private: RecursiveMutex& _mutex; bool _isLocked; }; /** @brief Synchronisation device similar to a POSIX rwlock A %ReadWriteMutex allows multiple concurrent readers or one exclusive writer to access a resource. */ class CXXTOOLS_API ReadWriteMutex : private NonCopyable { public: //! @brief Creates the Reader/Writer lock. ReadWriteMutex(); //! @brief Destroys the Reader/Writer lock. ~ReadWriteMutex(); void readLock(); /** @brief Acquires a read lock. If another thread currently holds a write lock, this method waits until the write lock is released. */ bool tryReadLock(); /** @brief Acquires a write lock. If one or more other threads currently hold locks, this method waits until all locks are released. The results are undefined if the same thread already holds a read or write lock. */ void writeLock(); /** @brief Tries to acquire a write lock. Immediately returns true if successful, or false if one or more other threads currently hold locks. The result is undefined if the same thread already holds a read or write lock. */ bool tryWriteLock(); //! @brief Releases the read or write lock. void unlock(); bool unlockNoThrow(); private: //! @internal class ReadWriteMutexImpl* _impl; }; class ReadLock : private NonCopyable { public: ReadLock(ReadWriteMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _locked(isLocked) { if(doLock) this->lock(); } ~ReadLock() { if(_locked) _mutex.unlockNoThrow(); } void lock() { if( ! _locked ) { _mutex.readLock(); _locked = true; } } void unlock() { if( _locked) { _mutex.unlock(); _locked = false; } } ReadWriteMutex& mutex() { return _mutex; } private: ReadWriteMutex& _mutex; bool _locked; }; class WriteLock : private NonCopyable { public: WriteLock(ReadWriteMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _locked(isLocked) { if(doLock) this->lock(); } ~WriteLock() { if(_locked) _mutex.unlockNoThrow(); } void lock() { if( ! _locked ) { _mutex.writeLock(); _locked = true; } } void unlock() { if( _locked) { _mutex.unlock(); _locked = false; } } ReadWriteMutex& mutex() { return _mutex; } private: ReadWriteMutex& _mutex; bool _locked; }; /** @brief Spinmutex class. The most lightweight synchronisation object is the Spinlock. It is usually implemented with a status variable that can be set to Locked and Unlocked and atomic operations to change and inspect the status. When Spinlock::lock is called, the status is changed to Locked. Subsequent calls of Spinlock::lock from other threads will block until the first thread has called Spinlock::unlock and the state of the Spinlock has changed to Unlocked. Note that Spinlocks are not recursive. When a Spinlock::lock blocks a busy-wait happens, therefore a Spinlock is only usable in cases where resources need to be locked for a very short time, but in these cases a higher performance can be achieved. */ class SpinMutex : private NonCopyable { public: //! @brief Default Constructor. SpinMutex() : _count(0) {} //! @brief Destructor. ~SpinMutex() {} /** @brief Lock. Locks the Spinlock. If the Spinlock is currently locked by another thread, the calling thread suspends until no other thread holds a lock on it. This happens performing a busy-wait. Spinlocks are not recursive locking it multiple times before unlocking it is undefined. */ inline void lock() { // busy loop until unlock while( atomicCompareExchange(_count, 1, 0) ) { Thread::yield(); } } bool tryLock() { return ! atomicCompareExchange(_count, 1, 0); } //! @brief Unlocks the Spinlock. void unlock() { // set unlocked atomicExchange(_count, 0); } //! @internal for unit test only bool testIsLocked() const { return _count != 0; } private: volatile cxxtools::atomic_t _count; }; class SpinLock : private NonCopyable { public: SpinLock(SpinMutex& m, bool doLock = true, bool isLocked = false) : _mutex(m) , _locked(isLocked) { if(doLock) this->lock(); } ~SpinLock() { if(_locked) this->unlock(); } void lock() { if( ! _locked ) { _mutex.lock(); _locked = true; } } void unlock() { if( _locked) { _mutex.unlock(); _locked = false; } } private: SpinMutex& _mutex; bool _locked; }; } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/slot.h0000664000175000017500000000354012256773774015010 00000000000000/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Slot_h #define cxxtools_Slot_h #include namespace cxxtools { class Connection; class Slot { public: virtual ~Slot() {} virtual Slot* clone() const = 0; virtual const void* callable() const = 0; virtual void onConnect(const Connection& c) = 0; virtual void onDisconnect(const Connection& c) = 0; virtual bool equals(const Slot& slot) const = 0; }; #include } #endif cxxtools-2.2.1/include/cxxtools/arg.h0000664000175000017500000003231712266277345014576 00000000000000/* * Copyright (C) 2003,2004,2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ARG_H #define CXXTOOLS_ARG_H #include #include namespace cxxtools { class ArgBase { protected: bool m_isset; static void removeArg(int& argc, char* argv[], int pos, int n) { for ( ; pos < argc - n; ++pos) argv[pos] = argv[pos + n]; argc -= n; argv[argc] = 0; } public: ArgBase() : m_isset(false) { } /** * returns true if the option was found and the default value was not used */ bool isSet() const { return m_isset; } }; template class ArgBaseT : public ArgBase { T m_value; protected: explicit ArgBaseT(const T& def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { std::istringstream s(str); s >> m_value; if (!s.fail()) { m_isset = true; removeArg(argc, argv, i, n); return true; } return false; } public: /** returns the value. */ const T& getValue() const { return m_value; } /** @brief Read and extract commandline parameters from argc/argv. Programs usually need some parameters. Usually they start with a '-' followed by a single character and optionally a value. Arg extracts these and other parameters. This default class processes paramters with a value, which defines a input-extractor-operator operator>> (istream&, T&). Options are removed from the option-list, so programs can easily check after all options are extracted, if there are parameters left. example: \code int main(int argc, char* argv[]) { cxxtools::Arg option_n(argc, argv, 'n', 0); std::cout << "value for -n: " << option_n << endl; } \endcode */ operator T() const { return m_value; } ArgBaseT& operator= (const T& value) { m_value = value; return *this; } }; template <> class ArgBaseT : public ArgBase { const char* m_value; protected: explicit ArgBaseT(const char* def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { m_value = str; m_isset = true; removeArg(argc, argv, i, n); return true; } public: /// returns the extracted value. const char* getValue() const { return m_value; } /// class is convertible to "const char*" operator const char*() const { return m_value; } ArgBaseT& operator= (const char* value) { m_value = value; return *this; } }; template <> class ArgBaseT : public ArgBase { std::string m_value; protected: explicit ArgBaseT(const std::string& def) : m_value(def) { } bool extract(const char* str, int& argc, char* argv[], int i, int n) { m_value = str; m_isset = true; removeArg(argc, argv, i, n); return true; } public: /// returns the extracted value. const std::string& getValue() const { return m_value; } /// class is convertible to "const std::string&" operator const std::string&() const { return m_value; } ArgBaseT& operator= (const std::string& value) { m_value = value; return *this; } }; /** @brief Read and extract commandline parameters from argc/argv. Programs usually need some parameters. Usually they start with a '-' followed by a single character and optionally a value. Arg extracts these and other parameters. This default class processes paramters with a value, which defines a input-extractor-operator operator>> (istream&, T&). Options are removed from the option-list, so programs can easily check after all options are extracted, if there are parameters left. example: \code int main(int argc, char* argv[]) { cxxtools::Arg option_n(argc, argv, 'n', 0); std::cout << "value for -n: " << option_n << endl; } \endcode */ template class Arg : public ArgBaseT { public: /** default constructor. Initializes value. \param def initial value */ explicit Arg(const T& def = T()) : ArgBaseT(def) { } /** extract parameter. \param argc 1. parameter of main \param argv 2. of main \param ch optioncharacter \param def default-value example: \code cxxtools::Arg offset(argc, argv, 'o', 0); unsigned value = offset.getValue(); \endcode */ Arg(int& argc, char* argv[], char ch, const T& def = T()) : ArgBaseT(def) { set(argc, argv, ch); } /** GNU defines long options starting with "--". This (and more) is supported here. Instead of giving a single option-character, you specify a string. example: \code cxxtools::Arg option_number(argc, argv, "--number", 0); std::cout << "number =" << option_number.getValue() << std::endl; \endcode */ Arg(int& argc, char* argv[], const char* str, const T& def = T()) : ArgBaseT(def) { this->m_isset = set(argc, argv, str); } Arg(int& argc, char* argv[]) : ArgBaseT(T()) { this->m_isset = set(argc, argv); } /** extract parameter. \param argc 1. parameter of main \param argv 2. of main \param ch optioncharacter example: \code cxxtools::Arg offset; offset.set(argc, argv, 'o'); unsigned value = offset.getValue(); \endcode */ bool set(int& argc, char* argv[], char ch) { // don't extract value, when already found if (this->m_isset) return false; for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-' && argv[i][1] == ch) { if (argv[i][2] == '\0' && i < argc - 1) { // -O foo if (this->extract(argv[i + 1], argc, argv, i, 2)) return true; } // -Ofoo if (this->extract(argv[i] + 2, argc, argv, i, 1)) return true; } } return false; } /** GNU defines long options starting with "--". This (and more) is supported here. Instead of giving a single option-character, you specify a string. example: \code cxxtools::Arg option_number; number.set(argc, argv, "--number"); std::cout << "number =" << option_number.getValue() << std::endl; \endcode */ bool set(int& argc, char* argv[], const char* str) { // don't extract value, when already found if (this->m_isset) return false; unsigned n = strlen(str); for (int i = 1; i < argc; ++i) { if (strncmp(argv[i], str, n) == 0) { if (i < argc - 1 && argv[i][n] == '\0') { // --option value if (this->extract(argv[i + 1], argc, argv, i, 2)) return true; } if (argv[i][n] == '=') { // --option=vlaue if (this->extract(argv[i] + n + 1, argc, argv, i, 1)) return true; } } } return false; } /** Reads next parameter and removes it. */ bool set(int& argc, char* argv[]) { // don't extract value, when already found if (this->m_isset) return false; if (argc > 1) this->extract(argv[1], argc, argv, 1, 1); return this->m_isset; } }; //////////////////////////////////////////////////////////////////////// /** specialization for bool. Often programs need some switches, which are switched on or off. Users just enter a option without parameter. example: \code cxxtools::Arg debug(argc, argv, 'd'); if (debug) std::cout << "debug-mode is set" << std::endl; \endcode */ template <> class Arg : public ArgBase { public: /** default constructor. Initializes value. \param def initial value */ Arg(bool def = false) : m_value(def) { } /** Use this constructor to extract a bool-parameter. As a special case options can be grouped. The parameter is recognized also in a argument, which starts with a '-' and contains somewhere the given character. example: \code cxxtools::Arg debug(argc, argv, 'd'); cxxtools::Arg ignore(argc, argv, 'i'); \endcode Arguments debug and ignore are both set when the program is called with: \code prog -id prog -i -d \endcode Options can also switched off with a following '-' like this: \code prog -d- \endcode In the program use: \code Arg debug(argc, argv, 'd'); if (debug.isSet()) { if (debug) std::cout << "you entered -d" << std::endl; else std::cout << "you entered -d-" << std::endl; } else std::cout << "no -d option given" << std::endl; \endcode This is useful, if a program defaults to some enabled feature, which can be disabled. */ Arg(int& argc, char* argv[], char ch, bool def = false) : m_value(def) { m_isset = set(argc, argv, ch); } Arg(int& argc, char* argv[], const char* str, bool def = false) : m_value(def) { m_isset = set(argc, argv, str); } bool set(int& argc, char* argv[], char ch) { // don't extract value, when already found if (m_isset) return false; for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-' && argv[i][1] != '-') { // starts with a '-', but not with "--" if (argv[i][1] == ch && argv[i][2] == '\0') { // single option found m_value = true; m_isset = true; removeArg(argc, argv, i, 1); return true; } else if (argv[i][1] == ch && argv[i][2] == '-' && argv[i][3] == '\0') { // Option was explicitly disabled with -x- m_value = false; m_isset = true; removeArg(argc, argv, i, 1); return true; } else { // look, if we find the option in an optiongroup for (char* p = argv[i] + 1; *p != '\0'; ++p) if (*p == ch) { // here it is - extract it m_value = true; m_isset = true; do { *p = *(p + 1); } while (*p++ != '\0'); return true; } } } } return false; } /** Setter for long-options. The option-parameter is defined with a string. This can extract long-options like: \code prog --debug \endcode with \code Arg debug(argc, argv, "--debug"); \endcode */ bool set(int& argc, char* argv[], const char* str) { // don't extract value, when already found if (m_isset) return false; for (int i = 1; i < argc; ++i) { if (strcmp(argv[i], str) == 0) { m_value = true; m_isset = true; removeArg(argc, argv, i, 1); return true; } } return false; } /** returns true, if options is set. */ bool isTrue() const { return m_value; } /** returns true, if options is not set. */ bool isFalse() const { return !m_value; } /** convertable to bool. */ operator bool() const { return m_value; } private: bool m_value; }; template std::ostream& operator<< (std::ostream& out, const ArgBaseT arg) { return out << arg.getValue(); } } #endif // CXXTOOLS_ARG_H cxxtools-2.2.1/include/cxxtools/constmethod.tpp0000664000175000017500000007236612256773774016746 00000000000000// BEGIN_ConstMethod 10 /** The ConstMethod class wraps const member functions as Callable objects so that they can be used with the signals/slots framework. */ template < typename R,typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const ) { return ConstMethod(obj,ptr); } /** ConstMethodSlot is a wrapper which allows ConstMethod objects to behave like Slot objects. */ template < typename R, typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class ConstMethodSlot : public BasicSlot { public: /** Wraps the given ConstMethod object. */ ConstMethodSlot(const ConstMethod& method) : _method( method ) {} /** Creates a copy of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new ConstMethodSlot(*this); } /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_method; } virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } virtual bool equals(const Slot& slot) const { const ConstMethodSlot* ms = dynamic_cast(&slot); return ms ? (_method == ms->_method) : false; } private: ConstMethod _method; }; /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 10 // BEGIN_ConstMethod 9 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 9 // BEGIN_ConstMethod 8 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7,a8); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 8 // BEGIN_ConstMethod 7 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6,a7); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 7 // BEGIN_ConstMethod 6 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return (_object->*_method)(a1,a2,a3,a4,a5,a6); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 6 // BEGIN_ConstMethod 5 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return (_object->*_method)(a1,a2,a3,a4,a5); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 5 // BEGIN_ConstMethod 4 template < typename R, typename ClassT,class A1, class A2, class A3, class A4> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return (_object->*_method)(a1,a2,a3,a4); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 4 // BEGIN_ConstMethod 3 template < typename R, typename ClassT,class A1, class A2, class A3> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2, A3 a3) const { return (_object->*_method)(a1,a2,a3); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 3 // BEGIN_ConstMethod 2 template < typename R, typename ClassT,class A1, class A2> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1,A2) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1, A2 a2) const { return (_object->*_method)(a1,a2); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 2 // BEGIN_ConstMethod 1 template < typename R, typename ClassT,class A1> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)(A1) const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()(A1 a1) const { return (_object->*_method)(a1); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)(A1 a1) const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)(A1) const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 1 // BEGIN_ConstMethod 0 template < typename R, typename ClassT> class ConstMethod : public Callable { public: /** Convenience typedef for the wrapped member function type. */ typedef R (ClassT::*MemFuncT)() const; /** Wraps the given member function of the given object. */ ConstMethod(ClassT& object, MemFuncT ptr) : _object(&object), _method(ptr) { } /** Deeply copies rhs. */ ConstMethod(const ConstMethod& rhs) : Callable() { this->operator=(rhs); } /** Returns a reference to this object's bound ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's bound ClassT object. */ const ClassT& object() const { return *_object;} /** Calls the bound member function of the bound object, passing all parameters to that member function. Returns the value of that member. */ R operator()() const { return (_object->*_method)(); } /** Creates a copy of this object and returns it. Caller owns the returned object. */ ConstMethod* clone() const { return new ConstMethod(*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const ConstMethod& rhs) const { return (_object == rhs._object) && (_method == rhs._method); } private: ClassT* _object; MemFuncT _method; }; /** Creates and returns a ConstMethod object from the given object and method pair. */ template ConstMethod callable( ClassT & obj, R (BaseT::*ptr)() const ) { return ConstMethod(obj,ptr); } /** Creates and returns a ConstMethodSlot for the given object/method pair. */ template ConstMethodSlot slot( ClassT & obj, R (BaseT::*memFunc)() const ) { return ConstMethodSlot( callable( obj, memFunc ) ); } // END_ConstMethod 0 cxxtools-2.2.1/include/cxxtools/callable.tpp0000664000175000017500000003010412256773774016136 00000000000000// BEGIN_Callable 10 /** Callable represents a "callable" type, which is fundamentally similar to an Invokable but is semantically richer. */ template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 10 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } }; // END_Callable 10 // BEGIN_Callable 9 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 9 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { this->operator()(a1,a2,a3,a4,a5,a6,a7,a8,a9); } }; // END_Callable 9 // BEGIN_Callable 8 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 8 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7,a8); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { this->operator()(a1,a2,a3,a4,a5,a6,a7,a8); } }; // END_Callable 8 // BEGIN_Callable 7 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 7 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return this->operator()(a1,a2,a3,a4,a5,a6,a7); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { this->operator()(a1,a2,a3,a4,a5,a6,a7); } }; // END_Callable 7 // BEGIN_Callable 6 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 6 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return this->operator()(a1,a2,a3,a4,a5,a6); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { this->operator()(a1,a2,a3,a4,a5,a6); } }; // END_Callable 6 // BEGIN_Callable 5 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 5 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return this->operator()(a1,a2,a3,a4,a5); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { this->operator()(a1,a2,a3,a4,a5); } }; // END_Callable 5 // BEGIN_Callable 4 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 4 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3, A4 a4) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3, A4 a4) const { return this->operator()(a1,a2,a3,a4); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3, A4 a4) const { this->operator()(a1,a2,a3,a4); } }; // END_Callable 4 // BEGIN_Callable 3 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 3 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2, A3 a3) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2, A3 a3) const { return this->operator()(a1,a2,a3); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2, A3 a3) const { this->operator()(a1,a2,a3); } }; // END_Callable 3 // BEGIN_Callable 2 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 2 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1, A2 a2) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1, A2 a2) const { return this->operator()(a1,a2); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1, A2 a2) const { this->operator()(a1,a2); } }; // END_Callable 2 // BEGIN_Callable 1 // specialization template class Callable : public Invokable { public: typedef R ReturnT; enum { NumArgs = 1 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()(A1 a1) const = 0; /** Same as calling this->operator()(...). */ ReturnT call(A1 a1) const { return this->operator()(a1); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke(A1 a1) const { this->operator()(a1); } }; // END_Callable 1 // BEGIN_Callable 0 // specialization template class Callable : public Invokable<> { public: typedef R ReturnT; enum { NumArgs = 0 }; public: /** Creates a copy of this object and returns it. Caller owns the returned object. */ virtual Callable* clone() const = 0; /** Exact behaviour is defined by subclass implementations. */ virtual ReturnT operator()() const = 0; /** Same as calling this->operator()(...). */ ReturnT call() const { return this->operator()(); } /** Same as calling this->operator()(...), except that the return value of that method is ignored. */ void invoke() const { this->operator()(); } }; // END_Callable 0 cxxtools-2.2.1/include/cxxtools/atomicity.windows.h0000664000175000017500000000317312256773774017524 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICITY_WINDOWS_H #define CXXTOOLS_ATOMICITY_WINDOWS_H #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ #include namespace cxxtools { typedef LONG atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/membar.windows.h0000664000175000017500000000334412256773774016765 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_WINDOWS_H #define CXXTOOLS_MEMBAR_WINDOWS_H #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ #include namespace cxxtools { inline void membar_rw() { MemoryBarrier(); } inline void membar_write() { _WriteBarrier(); } inline void membar_read() { _ReadBarrier(); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_WINDOWS_H cxxtools-2.2.1/include/cxxtools/remoteresult.h0000664000175000017500000000526212266277345016556 00000000000000/* * Copyright (C) 2011 by Dr. Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTERESULT_H #define CXXTOOLS_REMOTERESULT_H #include #include #include namespace cxxtools { class IRemoteResult { public: IRemoteResult() : _failed(false) { } void setFault(int rc, const std::string& msg) { _failed = true; _rc = rc; _msg = msg; } void clearFault() { _failed = false; _rc = 0; _msg.clear(); } bool failed() const { return _failed; } protected: void checkFault() const { if (_failed) throw RemoteException(_msg, _rc); } private: bool _failed; int _rc; std::string _msg; }; template class RemoteResult : public IRemoteResult { public: explicit RemoteResult(RemoteClient& client) : _client(client) { } R& value() { return _result; } const R& get() const { _client.endCall(); checkFault(); return _result; } RemoteClient& client() { return _client; } private: RemoteClient& _client; R _result; }; } #endif cxxtools-2.2.1/include/cxxtools/iniparser.h0000664000175000017500000000450012256773774016020 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include namespace cxxtools { /** * Parser for files in ini-format */ class IniParser { public: class Event { protected: virtual ~Event() { } public: // events return true, if parsing should be stopped virtual bool onSection(const std::string& section); virtual bool onKey(const std::string& key); virtual bool onValue(const std::string& key); virtual bool onComment(const std::string& comment); virtual bool onError(); }; private: Event& event; std::string data; enum { state_0, state_section, state_key, state_key_sp, state_value0, state_value, state_comment } state; public: IniParser(Event& event_) : event(event_), state(state_0) { } bool parse(char ch); void end(); void parse(std::istream& in); }; } cxxtools-2.2.1/include/cxxtools/selectable.h0000664000175000017500000000646412266277345016134 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SELECTABLE_H #define CXXTOOLS_SELECTABLE_H #include #include #include #include namespace cxxtools { class SelectableImpl; class CXXTOOLS_API Selectable : protected NonCopyable { public: static const std::size_t WaitInfinite = Selector::WaitInfinite; enum State { Disabled = 0, Idle = 1, Busy = 2, Avail = 3 }; public: //! @brief Destructor virtual ~Selectable(); void setSelector(SelectorBase* parent); SelectorBase* selector(); const SelectorBase* selector() const; //! @brief Closes the I/O device /*! Frees any resources associated with this object, like I/O handles. */ void close(); bool wait(std::size_t msecs = WaitInfinite); //! @brief Test if the I/O device object is enabled /*! Test if the I/O device object is enabled i.e. open and ready to perform I/O operations \return true if the I/O device is usable, false otherwise. */ bool enabled() const; bool idle() const; bool busy() const; bool avail() const; virtual SelectableImpl& simpl() = 0; protected: //! @brief Default Constructor Selectable(); //! @brief Sets or unsets the device enabled void setEnabled(bool isEnabled); //TODO: tell Selector more specifically what changed // add onReinit() to Selector: // pass old state as second arg with onChanged() void setState(State state); //! @brief Closes the Selector virtual void onClose() = 0; virtual bool onWait(std::size_t msecs) = 0; virtual void onAttach(SelectorBase&) = 0; virtual void onDetach(SelectorBase&) = 0; private: SelectorBase* _parent; State _state; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/atomicity.gcc.x86.h0000664000175000017500000000307712256773774017215 00000000000000/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_X86_H #define CXXTOOLS_ATOMICINT_GCC_X86_H #include namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/serializationerror.h0000664000175000017500000000464612256773774017766 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SerializationError_h #define cxxtools_SerializationError_h #include #include #include namespace cxxtools { /** @brief Error during serialization of a type This Exception indicates a error during serialization caused by missing or invalid object attributes. */ class CXXTOOLS_API SerializationError : public std::runtime_error { public: /** @brief Construct with a message */ explicit SerializationError(const std::string& msg); /** @brief throws Serialization error * This saves some bytes in library size when using this function instead of throwing directly. */ static void doThrow(const std::string& msg); }; class CXXTOOLS_API SerializationMemberNotFound : public SerializationError { std::string _member; public: SerializationMemberNotFound(const std::string& member); ~SerializationMemberNotFound() throw() { } const std::string& member() const { return _member; } }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/base64codec.h0000664000175000017500000001010212256773774016101 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Base64Codec_h #define cxxtools_Base64Codec_h #include #include #include namespace cxxtools { class Base64Codec : public TextCodec { public: explicit Base64Codec(size_t ref = 0) : TextCodec(ref) {} virtual ~Base64Codec() {} protected: result do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; result do_out(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; result do_unshift(MBState& state, char* toBegin, char* toEnd, char*& toNext) const; bool do_always_noconv() const throw() { return false; } int do_length(MBState& s, const char* fromBegin, const char* fromEnd, size_t max) const { const int from = (fromEnd - fromBegin) / 4; const int to = max / 3; return to > from ? from * 4 : to * 4; } int do_encoding() const throw() { // stateful encoding return -1; } int do_max_length() const throw() { //worst case: XX== -> x return 4; } public: /** @brief shortcut for converting base64 encoded data to std::string Example: @code std::string data = cxxtools::Base64Codec::decode(base64dataptr, base64datasize); @endcode */ static std::string decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } /** @brief shortcut for converting base64 encoded std::string to std::string */ static std::string decode(const std::string& data) { return cxxtools::decode(data); } /** @brief shortcut for converting data to base64 encoded std::string */ static std::string encode(const char* data, unsigned size) { return cxxtools::encode(data, size); } /** @brief shortcut for converting std::string to base64 encoded std::string */ static std::string encode(const std::string& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/iodevice.h0000664000175000017500000002414212256773774015617 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 PTV AG * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_IODevice_h #define CXXTOOLS_IODevice_h #include #include #include #include #include #include namespace cxxtools { enum IOS_OpenMode { IOS_Sync = 0, IOS_Async = 1L << 0, IOS_Read = 1L << 1, IOS_Write = 1L << 2, IOS_AtEnd = 1L << 3, IOS_Append = 1L << 4, IOS_Trunc = 1L << 5, IOS_OpenModeEnd = 1L << 16 }; inline IOS_OpenMode operator&(IOS_OpenMode a, IOS_OpenMode b) { return IOS_OpenMode(static_cast(a) & static_cast(b)); } inline IOS_OpenMode operator|(IOS_OpenMode a, IOS_OpenMode b) { return IOS_OpenMode(static_cast(a) | static_cast(b)); } inline IOS_OpenMode operator^(IOS_OpenMode a, IOS_OpenMode b) { return IOS_OpenMode(static_cast(a) ^ static_cast(b)); } inline IOS_OpenMode& operator|=(IOS_OpenMode& a, IOS_OpenMode b) { return a = a | b; } inline IOS_OpenMode& operator&=(IOS_OpenMode& a, IOS_OpenMode b) { return a = a & b; } inline IOS_OpenMode& operator^=(IOS_OpenMode& a, IOS_OpenMode b) { return a = a ^ b; } inline IOS_OpenMode operator~(IOS_OpenMode a) { return IOS_OpenMode(~static_cast(a)); } class IODeviceImpl; /** @brief Endpoint for I/O operations This class serves as the base class for all kinds of I/O devices. The interface supports synchronous and asynchronous I/O operations, peeking and seeking. I/O buffers and I/O streams within the cxxtools framework use IODevices as endpoints and therefore fully feaured standard C++ compliant IOStreams can be constructed at runtime. Examples of %IODevices are the SerialDevice, the endpoints of a Pipe or the FileDevice. A Selector can be used to wait on activity on an %IODevice, which will send the %Signal inputReady or outputReady of the %IODevice that is ready to perform I/O. */ class CXXTOOLS_API IODevice : public Selectable { public: typedef std::char_traits::pos_type pos_type; typedef std::char_traits::off_type off_type; typedef std::ios_base::seekdir SeekDir; typedef IOS_OpenMode OpenMode; static const OpenMode Sync = IOS_Sync; static const OpenMode Async = IOS_Async; static const OpenMode Read = IOS_Read; static const OpenMode Write = IOS_Write; static const OpenMode AtEnd = IOS_AtEnd; static const OpenMode Append = IOS_Append; static const OpenMode Trunc = IOS_Trunc; public: //! @brief Destructor virtual ~IODevice(); void beginRead(char* buffer, size_t n); size_t endRead(); //! @brief Read data from I/O device /*! Reads up to n bytes and stores them in buffer. Returns the number of bytes read, which may be less than requested and even 0 if the device operates in asynchronous (non-blocking) mode. In case of EOF the IODevice is set to eof. \param buffer buffer where to place the data to be read. \param n number of bytes to read \return number of bytes read, which may be less than requested. \throw IOError */ size_t read(char* buffer, size_t n); size_t beginWrite(const char* buffer, size_t n); size_t endWrite(); //! @brief Write data to I/O device /** Writes n bytes from buffer to this I/O device. Returns the number of bytes written, which may be less than requested and even 0 if the device operates in asynchronous (non-blocking) mode. In case of EOF the IODevice is set to eof. \param buffer buffer containing the data to be written. \param n number of bytes that should be written. \return number of bytes written, which may be less than requested. \throw IOError */ size_t write(const char* buffer, size_t n); /** @brief Cancels asynchronous reading and writing */ void cancel(); //! @brief Returns true if device is seekable /** Tests if the device is seekable. \return true if the device is seekable, false otherwise. */ bool seekable() const; //! @brief Move the next read position to the given offset /** Tries to move the current read position to the given offset. SeekMode determines the relative starting point of offset. \param offset the offset the pointer should be moved by. \param mode determines the relative starting offset. \return the new abosulte read positing. \throw IOError */ pos_type seek(off_type offset, std::ios::seekdir sd); //! @brief Read data from I/O device without consuming them /** Tries to extract up to n bytes from this object without consuming them. The bytes are stored in buffer, and the number of bytes peeked is returned. \param buffer buffer where to place the data to be read. \param n number of bytes to peek \return number of bytes peek. \throw IOError */ size_t peek(char* buffer, size_t n); //! @brief Synchronize device /** Commits written data to physical device. \throw IOError */ void sync(); //! @brief Returns the current I/O position /** The current I/O position is returned or an IOError is thrown if the device is not seekable. Seekability can be tested with BasicIODevice::seekable(). \throw IOError */ pos_type position(); //! @brief Returns if the device has reached EOF /*! Test if the I/O device has reached eof. \return true if the I/O device has reached eof, false otherwise. */ bool eof() const; /** @brief Returns true if the device operates in asynchronous mode */ bool async() const; /** @brief Notifies about available data This signal is send when the IODevice is monitored in a Selector or EventLoop and data becomes available. */ Signal inputReady; /** @brief Notifies when data can be written This signal is send when the IODevice is monitored in a Selector or EventLoop and the device is ready to write data. */ Signal outputReady; virtual IODeviceImpl& ioimpl() = 0; bool reading() const { return _rbuf != 0; } bool writing() const { return _wbuf != 0; } char* rbuf() const { return _rbuf; } size_t rbuflen() const { return _rbuflen; } size_t ravail() const { return _ravail; } const char* wbuf() const { return _wbuf; } size_t wbuflen() const { return _wbuflen; } size_t wavail() const { return _wavail; } protected: //! @brief Default Constructor IODevice(); virtual size_t onBeginRead(char* buffer, size_t n, bool& eof) = 0; virtual size_t onEndRead(bool& eof) = 0; //! @brief Read bytes from device virtual size_t onRead(char* buffer, size_t count, bool& eof) = 0; virtual size_t onBeginWrite(const char* buffer, size_t n) = 0; virtual size_t onEndWrite() = 0; //! @brief Write bytes to device virtual size_t onWrite(const char* buffer, size_t count) = 0; virtual void onCancel() = 0; //! @brief Read data from I/O device without consuming them virtual size_t onPeek(char*, size_t) { return 0; } //! @brief Returns true if device is seekable virtual bool onSeekable() const { return false; } //! @brief Move the next read position to the given offset virtual pos_type onSeek(off_type, std::ios::seekdir) { throw IOError("Could not seek on device."); } //! @brief Synchronize device virtual void onSync() const { } //! @brief Returns the size of the device virtual size_t onSize() const { return 0; } //! @brief Sets or unsets the device to eof void setEof(bool eof); //! @brief Sets or unsets the device to async void setAsync(bool async); private: bool _eof; bool _async; protected: char* _rbuf; size_t _rbuflen; size_t _ravail; const char* _wbuf; size_t _wbuflen; size_t _wavail; void* _reserved; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/log.h0000664000175000017500000000267512256773774014620 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LOG_H #define CXXTOOLS_LOG_H #include #endif // CXXTOOLS_LOG_H cxxtools-2.2.1/include/cxxtools/invokable.h0000664000175000017500000000301412256773774015775 00000000000000/* * Copyright (C) 2005-2007 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Invokable_h #define cxxtools_Invokable_h #include namespace cxxtools { #include } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/bin/0000775000175000017500000000000012266277564014501 500000000000000cxxtools-2.2.1/include/cxxtools/bin/serializer.h0000664000175000017500000001374512266277345016752 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_SERIALIZER_H #define CXXTOOLS_BIN_SERIALIZER_H #include #include #include namespace cxxtools { namespace bin { class Serializer : private NonCopyable { public: enum TypeCode { TypeEmpty = 0x00, TypeBool = 0x01, TypeChar = 0x02, TypeString = 0x03, TypeInt = 0x04, TypeBinary2 = 0x06, // followed by zero terminated, 2 byte length field + data TypeBinary4 = 0x07, // followed by zero terminated, 4 byte length field + data TypeInt8 = 0x10, TypeInt16 = 0x11, TypeInt32 = 0x12, TypeInt64 = 0x13, TypeUInt8 = 0x18, TypeUInt16 = 0x19, TypeUInt32 = 0x1a, TypeUInt64 = 0x1b, TypeBcdFloat = 0x20, TypeShortFloat = 0x21, // 1 bit sign, 7 bit exponent, 16 bit mantissa (3 byte) TypeMediumFloat = 0x22, // 1 bit sign, 7 bit exponent, 32 bit mantissa (5 byte) TypeLongFloat = 0x23, // 1 bit sign, 15 bit exponent, 64 bit mantissa (10 byte) TypePair = 0x30, TypeArray = 0x31, TypeVector = 0x32, TypeList = 0x33, TypeDeque = 0x34, TypeSet = 0x35, TypeMultiset = 0x36, TypeMap = 0x37, TypeMultimap = 0x38, TypeOther = 0x3f, // followed by zero terminated type name, data is zero terminated TypePlainEmpty = 0x40, TypePlainBool = 0x41, TypePlainChar = 0x42, TypePlainString = 0x43, TypePlainInt = 0x44, TypePlainBinary2 = 0x46, TypePlainBinary4 = 0x47, TypePlainInt8 = 0x50, TypePlainInt16 = 0x51, TypePlainInt32 = 0x52, TypePlainInt64 = 0x53, TypePlainUInt8 = 0x58, TypePlainUInt16 = 0x59, TypePlainUInt32 = 0x5a, TypePlainUInt64 = 0x5b, TypePlainBcdFloat = 0x60, TypePlainShortFloat = 0x61, // 1 bit sign, 7 bit exponent, 16 bit mantissa TypePlainMediumFloat = 0x62, // 1 bit sign, 7 bit exponent, 32 bit mantissa TypePlainLongFloat = 0x63, // 1 bit sign, 15 bit exponent, 64 bit mantissa TypePlainPair = 0x70, TypePlainArray = 0x71, TypePlainVector = 0x72, TypePlainList = 0x73, TypePlainDeque = 0x74, TypePlainSet = 0x75, TypePlainMultiset = 0x76, TypePlainMap = 0x77, TypePlainMultimap = 0x78, TypePlainOther = 0x7f, // followed by zero terminated type name, data is zero terminated CategoryObject = 0xa0, CategoryArray = 0xa1, CategoryReference = 0xa2, RpcRequest = 0xc0, RpcResponse = 0xc1, RpcException = 0xc2, Eod = 0xff }; Serializer() { } explicit Serializer(std::ostream& out) { _formatter.begin(out); } Serializer& begin(std::ostream& out) { _formatter.begin(out); return *this; } template Serializer& serialize(const T& v, const std::string& name) { Decomposer s; s.begin(v); s.setName(name); s.format(_formatter); return *this; } template Serializer& serialize(const T& v) { Decomposer s; s.begin(v); s.format(_formatter); return *this; } void finish() { } private: Formatter _formatter; }; } } #endif // CXXTOOLS_BIN_SERIALIZER_H cxxtools-2.2.1/include/cxxtools/bin/formatter.h0000664000175000017500000000641612256773774016607 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_FORMATTER_H #define CXXTOOLS_BIN_FORMATTER_H #include #include namespace cxxtools { namespace bin { class Formatter : public cxxtools::Formatter { public: Formatter(); explicit Formatter(std::ostream& out); void begin(std::ostream& out); void finish(); virtual void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value); virtual void addValueStdString(const std::string& name, const std::string& type, const std::string& value); virtual void addValueBool(const std::string& name, const std::string& type, bool value); virtual void addValueInt(const std::string& name, const std::string& type, int_type value); virtual void addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value); virtual void addValueFloat(const std::string& name, const std::string& type, long double value); virtual void addNull(const std::string& name, const std::string& type); virtual void beginArray(const std::string& name, const std::string& type); virtual void finishArray(); virtual void beginObject(const std::string& name, const std::string& type); virtual void beginMember(const std::string& name); virtual void finishMember(); virtual void finishObject(); private: std::ostream* _out; TextOStream _ts; }; } } #endif // CXXTOOLS_BIN_FORMATTER_H cxxtools-2.2.1/include/cxxtools/bin/valueparser.h0000664000175000017500000000635412256773774017136 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_VALUEPARSER_H #define CXXTOOLS_BIN_VALUEPARSER_H #include namespace cxxtools { class DeserializerBase; namespace bin { class ValueParser { ValueParser(const ValueParser&) { } ValueParser& operator= (const ValueParser&) { return *this; } public: ValueParser() : _next(0) { } ~ValueParser() { delete _next; } void begin(DeserializerBase& handler); void beginSkip(); bool advance(char ch); // returns true, if number is read completely DeserializerBase* current() { return _deserializer; } private: bool processFloatBase(char ch, unsigned shift, unsigned expOffset); enum State { state_type, state_name, state_value_type_other, state_value_intsign, state_value_int, state_value_uint, state_value_bool, state_value_bcd0, state_value_bcd, state_value_binary_length, state_value_binary, state_value_value, state_sfloat_exp, state_sfloat_base, state_mfloat_exp, state_mfloat_base, state_lfloat_exp, state_lfloat_base, state_object_type, state_object_type_other, state_object_member, state_object_member_value, state_array_type, state_array_type_other, state_array_member, state_array_member_value, state_array_member_value_next, state_end } _state, _nextstate; std::string _token; unsigned _count; uint64_t _int; int _exp; bool _isNeg; DeserializerBase* _deserializer; ValueParser* _next; }; } } #endif // CXXTOOLS_BIN_VALUEPARSER_H cxxtools-2.2.1/include/cxxtools/bin/rpcserver.h0000664000175000017500000000622112256773774016611 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RPCSERVER_H #define CXXTOOLS_BIN_RPCSERVER_H #include #include #include #include namespace cxxtools { class EventLoopBase; namespace bin { class Responder; class RpcServerImpl; class RpcServer : public ServiceRegistry { friend class Responder; public: RpcServer(EventLoopBase& eventLoop); RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, int backlog = 64); RpcServer(EventLoopBase& eventLoop, unsigned short int port, int backlog = 64); ~RpcServer(); void listen(const std::string& ip, unsigned short int port, int backlog = 64); void listen(unsigned short int port, int backlog = 64); void addService(const ServiceRegistry& service); void addService(const std::string& domain, const ServiceRegistry& service); unsigned minThreads() const; void minThreads(unsigned m); unsigned maxThreads() const; void maxThreads(unsigned m); // idleTimeout is the time in milliseconds of inactivity after // which a socket is moved from a worker thread to the main event loop. std::size_t idleTimeout() const; void idleTimeout(std::size_t ms); enum Runmode { Stopped, Starting, Running, Terminating, Failed }; Signal runmodeChanged; private: RpcServerImpl* _impl; }; } } #endif // CXXTOOLS_BIN_RPCSERVER_H cxxtools-2.2.1/include/cxxtools/bin/deserializer.h0000664000175000017500000000361112256773774017260 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_DESERIALIZER_H #define CXXTOOLS_BIN_DESERIALIZER_H #include #include namespace cxxtools { namespace bin { class CXXTOOLS_API Deserializer : public cxxtools::Deserializer { public: typedef bin::Serializer::TypeCode TypeCode; Deserializer(std::istream& in) : _in(in) { } protected: void doDeserialize(); private: std::istream& _in; }; } } #endif // CXXTOOLS_BIN_DESERIALIZER_H cxxtools-2.2.1/include/cxxtools/bin/rpcclient.h0000664000175000017500000000523712266277345016561 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_CLIENT_H #define CXXTOOLS_BIN_CLIENT_H #include #include namespace cxxtools { class SelectorBase; namespace bin { class RpcClientImpl; class RpcClient : public RemoteClient { RpcClientImpl* _impl; RpcClient(RpcClient&) { } void operator= (const RpcClient&) { } public: RpcClient() : _impl(0) { } RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& domain = std::string()); RpcClient(const std::string& addr, unsigned short port, const std::string& domain = std::string()); virtual ~RpcClient(); void setSelector(SelectorBase& selector); void connect(const std::string& addr, unsigned short port, const std::string& domain = std::string()); void close(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); const IRemoteProcedure* activeProcedure() const; void wait(std::size_t msecs = WaitInfinite); void cancel(); const std::string& domain() const; void domain(const std::string& p); }; } } #endif // CXXTOOLS_BIN_CLIENT_H cxxtools-2.2.1/include/cxxtools/date.h0000664000175000017500000002577512266277345014754 00000000000000/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DATE_H #define CXXTOOLS_DATE_H #include #include #include namespace cxxtools { class SerializationInfo; class CXXTOOLS_API InvalidDate : public std::invalid_argument { public: InvalidDate(); ~InvalidDate() throw() {} }; CXXTOOLS_API void greg2jul(unsigned& jd, int y, int m, int d); CXXTOOLS_API void jul2greg(unsigned jd, int& y, int& m, int& d); /* Notes: - Henry F. Fliegel and Thomas C. Van Flandern, "A Machine Algorithm for Processing Calendar Dates". CACM, Vol. 11, No. 10, October 1968, pp 657. */ /** @brief %Date expressed in year, month, and day @ingroup DateTime */ class Date { public: enum Month { Jan = 1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec }; enum WeekDay { Sun = 0, Mon, Tue, Wed, Thu, Fri, Sat }; /** * @brief The number of days of an ordinary year. */ static const unsigned DaysPerYear = 365; /** * @brief The number of days of a leap year. */ static const unsigned DaysPerLeapYear = 366; /** * @brief The number of days of a January. */ static const unsigned DaysOfJan = 31; /** * @brief The number of days of a February. */ static const unsigned DaysOfFeb = 28; /** * @brief The number of days of a February in a leap year. */ static const unsigned DaysOfLeapFeb = 29; /** * @brief The number of days of a March. */ static const unsigned DaysOfMar = 31; /** * @brief The number of days of a April. */ static const unsigned DaysOfApr = 30; /** * @brief The number of days of a May. */ static const unsigned DaysOfMay = 31; /** * @brief The number of days of a June. */ static const unsigned DaysOfJun = 30; /** * @brief The number of days of a July. */ static const unsigned DaysOfJul = 31; /** * @brief The number of days of a August. */ static const unsigned DaysOfAug = 31; /** * @brief The number of days of a September. */ static const unsigned DaysOfSep = 30; /** * @brief The number of days of a October. */ static const unsigned DaysOfOct = 31; /** * @brief The number of days of a November. */ static const unsigned DaysOfNov = 30; /** * @brief The number of days of a December. */ static const unsigned DaysOfDec = 31; public: /** \brief Default constructor. The default constructed date is undefined. */ Date() : _julian(0) {} /** \brief Copy constructor. */ Date(const Date& date) : _julian(date._julian) {} /** \brief Constructs a Date from given values Sets the date to a new year, month and day. InvalidDate is thrown if any of the values is out of range */ Date(int y, unsigned m, unsigned d) { greg2jul(_julian, y, m, d); } /** \brief Constructs a Date from a julian day */ explicit Date(unsigned julianDays) : _julian(julianDays) {} /** @brief Sets the Date to a julian day */ void setJulian(unsigned d) { _julian=d; } /** @brief Returns the Date as a julian day */ unsigned julian() const { return _julian; } /** \brief Sets the date to a year, month and day Sets the date to a new year, month and day. InvalidDate is thrown if any of the values is out of range */ void set(int year, unsigned month, unsigned day) { greg2jul(_julian, year, month, day); } /** @brief Gets the year, month and day */ void get(int& year, unsigned& month, unsigned& day) const; /** \brief Returns the day-part of the date. */ unsigned day() const; /** \brief Returns the month-part of the date. */ unsigned month() const; /** \brief Returns the year-part of the date. */ int year() const; /** @brief Return day of the week, starting with sunday */ unsigned dayOfWeek() const; /** @brief Returns the days of the month of the date */ unsigned daysInMonth() const; /** @brief Returns the day of the year */ unsigned dayOfYear() const; /** @brief Returns true if the date is in a leap year */ bool leapYear() const; // TODO: move to cxxtools:.System //static Date localDate(); // TODO: move to cxxtools:.System //static Date universalDate(); /** @brief Assignment operator */ Date& operator=(const Date& date) { _julian = date._julian; return *this; } /** @brief Add days to the date */ Date& operator+=(int days) { _julian += days; return *this; } /** @brief Substract days from the date */ Date& operator-=(int days) { _julian -= days; return *this; } /** @brief Increments the date by one day */ Date& operator++() { _julian++; return *this; } /** @brief Decrements the date by one day */ Date& operator--() { _julian--; return *this; } /** @brief Returns true if the dates are equal */ bool operator==(const Date& date) const { return _julian==date._julian; } /** @brief Returns true if the dates are not equal */ bool operator!=(const Date& date) const { return _julian!=date._julian; } /** @brief Less-than comparison operator */ bool operator<(const Date& date) const { return _julian(const Date& date) const { return _julian>date._julian; } /** @brief Greater-than-equal comparison operator */ bool operator>=(const Date& date) const { return _julian>=date._julian; } friend inline Date operator+(const Date& d, int days); friend inline Date operator+(int days, const Date& d); friend inline int operator-(const Date& a, const Date& b); /** \brief Returns the date in ISO-format Converts the date in ISO-format (yyyy-mm-dd). \return Date as iso formated string. */ std::string toIsoString() const; /** \brief Interprets a string as a date-string in ISO-format Interprets a string as a date-string in ISO-format (yyyy-mm-dd) and returns a Date-object. When the string is not in ISO-format, an exception is thrown. \param s Iso formated date string. \return Date result \throw IllegalArgument */ static Date fromIsoString(const std::string& s); public: /** \brief Returns true if values describe a valid date */ static bool isValid(int y, int m, int d); /** @brief Returns true if the year is in a leap year */ static bool leapYear(int year); private: //! @internal unsigned _julian; }; CXXTOOLS_API void operator >>=(const SerializationInfo& si, Date& date); CXXTOOLS_API void operator <<=(SerializationInfo& si, const Date& date); CXXTOOLS_API void convert(std::string& str, const Date& date); CXXTOOLS_API void convert(Date& date, const std::string& s); inline void Date::get(int& y, unsigned& m, unsigned& d) const { int mon, day; jul2greg(_julian, y, mon, day); m = mon; d = day; } inline bool Date::leapYear(int y) { return ((y%4==0) && (y%100!=0)) || (y%400==0); } inline unsigned Date::day() const { int d,m,y; jul2greg(_julian, y ,m, d); return d; } inline unsigned Date::month() const { int d,m,y; jul2greg(_julian, y, m, d); return m; } inline int Date::year() const { int d,m,y; jul2greg(_julian, y, m, d); return y; } inline unsigned Date::dayOfWeek() const { return (_julian+1) % 7; } inline unsigned Date::daysInMonth() const { static const unsigned char monthDays[13]= { 0,31,28,31,30,31,30,31,31,30,31,30,31 }; int y, m, d; jul2greg(_julian, y, m, d); if( m==2 && leapYear(y) ) return 29; return monthDays[m]; } inline unsigned Date::dayOfYear() const { int y,m,d; unsigned jd; jul2greg(_julian,y,m,d); greg2jul(jd,y,1,1); return _julian-jd+1; } inline bool Date::leapYear() const { int d,m,y; jul2greg(_julian,y,m,d); return leapYear(y); } inline bool Date::isValid(int y, int m, int d) { if(m<1 || m>12 || d<1 || d>31) { return false; } return true; } inline std::string Date::toIsoString() const { std::string str; convert(str, *this); return str; } inline Date Date::fromIsoString(const std::string& s) { Date date; convert(date, s); return date; } inline Date operator+(const Date& d, int days) { return Date(d._julian + days); } inline Date operator+(int days, const Date& d) { return Date(days + d._julian); } inline int operator-(const Date& a, const Date& b) { return a._julian - b._julian; } } #endif cxxtools-2.2.1/include/cxxtools/deserializer.h0000664000175000017500000000631312256773774016512 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DESERIALIZER_H #define CXXTOOLS_DESERIALIZER_H #include #include #include namespace cxxtools { /** * convert format to SerializationInfo */ class CXXTOOLS_API Deserializer : public DeserializerBase { // make non copyable Deserializer(const Deserializer&) { } Deserializer& operator= (const Deserializer&) { return *this; } public: Deserializer() { } virtual ~Deserializer() { } /** @brief Deserialize an object This method will deserialize the object \a type from an input format. The type \a type must be serializable. */ template void deserialize(T& type) { if (current() == 0) { begin(); doDeserialize(); } Composer composer; composer.begin(type); composer.fixup(*si()); } template void deserialize(T& type, const std::string& name) { if (current() == 0) { begin(); doDeserialize(); } SerializationInfo* p = current()->findMember(name); if( !p ) throw SerializationMemberNotFound(name); Composer composer; composer.begin(type); composer.fixup(*p); } void deserialize() { begin(); doDeserialize(); } private: virtual void doDeserialize() = 0; }; } #endif // CXXTOOLS_DESERIALIZER_H cxxtools-2.2.1/include/cxxtools/allocator.h0000664000175000017500000000352212256773774016007 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ALLOCATOR_H #define CXXTOOLS_ALLOCATOR_H #include namespace cxxtools { class Allocator { public: Allocator() {} virtual ~Allocator() {} virtual void* allocate(std::size_t size) { return operator new(size); } virtual void deallocate(void* p, std::size_t size) { operator delete(p); } }; } #endif cxxtools-2.2.1/include/cxxtools/hdstream.h0000664000175000017500000000607112256773774015640 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HDSTREAM_H #define CXXTOOLS_HDSTREAM_H #include #include #include namespace cxxtools { class Hdstreambuf : public std::streambuf { static const unsigned BUFFERSIZE = 16; std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); char Buffer[BUFFERSIZE]; std::streambuf* Dest; unsigned offset; public: Hdstreambuf(std::streambuf* dest) : Dest(dest), offset(0) { setp(Buffer, Buffer + BUFFERSIZE); } unsigned getOffset() const { return offset; } void setOffset(unsigned offset_) { offset = offset_; } }; /** hexdumper as a outputstream. Data written to a hdostream are passed as a hexdump to the given sink. */ class Hdostream : public std::ostream { typedef std::ostream base_class; Hdstreambuf streambuf; public: Hdostream() : base_class(0), streambuf(std::cout.rdbuf()) { init(&streambuf); } Hdostream(std::ostream& out) : base_class(0), streambuf(out.rdbuf()) { init(&streambuf); } unsigned getOffset() const { return streambuf.getOffset(); } void setOffset(unsigned offset_) { streambuf.setOffset(offset_); } }; template void hexDump(std::ostream& out, const T& t) { Hdostream hd(out); hd << t << std::flush; } template std::string hexDump(const T& t) { std::ostringstream out; Hdostream hd(out); hd << t << std::flush; return out.str(); } inline std::string hexDump(const char* p, unsigned n) { std::ostringstream out; Hdostream hd(out); hd.write(p, n); hd.flush(); return out.str(); } } #endif // CXXTOOLS_HDSTREAM_H cxxtools-2.2.1/include/cxxtools/datetime.h0000664000175000017500000002137412266277345015622 00000000000000/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DATETIME_H #define CXXTOOLS_DATETIME_H #include #include #include #include #include #include namespace cxxtools { class SerializationInfo; /** @brief Combined %Date and %Time value @ingroup DateTime */ class DateTime { public: DateTime() { } DateTime(int year, unsigned month, unsigned day, unsigned hour = 0, unsigned minute = 0, unsigned second = 0, unsigned msec = 0) : _date(year, month, day) , _time(hour, minute, second, msec) { } DateTime(const DateTime& dateTime) : _date( dateTime.date() ) , _time( dateTime.time() ) { } DateTime& operator=(const DateTime& dateTime); ~DateTime() {} static DateTime fromJulianDays(unsigned julianDays) { return DateTime(julianDays); } /** @brief Creates a DateTime object relative to the Unix epoch. The DateTime will be relative to the unix-epoch (Jan 1st 1970) by the milli-seconds specified by \a msecsSinceEpoch. The construction does not take care of any time zones. I.e. the milliseconds will be treated as if they were in the same time zone as the reference (January 1st 1970). Thus specifying a "time-zoned" millisecond value will lead to a "time-zoned" DateTime. And accordingly a "GMT" millisecond value will lead to a "GMT" DateTime. */ static inline DateTime fromMSecsSinceEpoch(const int64_t msecsSinceEpoch) { static const DateTime dt(1970, 1, 1); Timespan ts(msecsSinceEpoch*1000); return dt + ts; } //DateTime& operator=(const DateTime& dateTime); DateTime& operator=(unsigned julianDay); void set(int year, unsigned month, unsigned day, unsigned hour = 0, unsigned min = 0, unsigned sec = 0, unsigned msec = 0); void get(int& year, unsigned& month, unsigned& day, unsigned& hour, unsigned& min, unsigned& sec, unsigned& msec) const; const Date& date() const { return _date; } const Date& date() { return _date; } DateTime& setDate(const Date& date) { _date = date; return *this; } const Time& time() const { return _time; } const Time& time() { return _time; } DateTime& setTime(const Time& time) { _time = time; return *this; } /** @brief Returns the day-part of the date. */ unsigned day() const { return date().day(); } /** @brief Returns the month-part of the date. */ unsigned month() const { return date().month(); } /** @brief Returns the year-part of the date. */ int year() const { return date().year(); } /** \brief Returns the hour-part of the Time. */ unsigned hour() const { return time().hour(); } /** \brief Returns the minute-part of the Time. */ unsigned minute() const { return time().minute(); } /** \brief Returns the second-part of the Time. */ unsigned second() const { return time().second(); } /** \brief Returns the millisecond-part of the Time. */ unsigned msec() const { return time().msec(); } /** @brief Returns the milliseconds relative to the Unix-epoch. The calculation does currently not take care of any time zones. I.e. the milliseconds will be calculated as if they were in the same time zone as the reference (January 1st 1970). Thus calling this API on a "time-zoned" DateTime will lead to a "time-zoned" millisecond value. And accordingly calling this API on a "GMT" DateTime will lead to a "GMT" millisecond value. */ int64_t msecsSinceEpoch() const; std::string toIsoString() const; static DateTime fromIsoString(const std::string& s); static bool isValid(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec); bool operator==(const DateTime& rhs) const { return _date == rhs._date && _time == rhs._time ; } bool operator!=(const DateTime& rhs) const { return !operator==(rhs); } /** @brief Assignment by sum operator */ DateTime& operator+=(const Timespan& ts); /** @brief Assignment by difference operator */ DateTime& operator-=(const Timespan& ts); friend Timespan operator-(const DateTime& first, const DateTime& second); friend DateTime operator+(const DateTime& dt, const Timespan& ts); friend DateTime operator-(const DateTime& dt, const Timespan& ts); bool operator< (const DateTime& dt) const { return _date < dt._date || (_date == dt._date && _time < dt._time); } bool operator<= (const DateTime& dt) const { return _date < dt._date || (_date == dt._date && _time <= dt._time); } bool operator> (const DateTime& dt) const { return _date > dt._date || (_date == dt._date && _time > dt._time); } bool operator>= (const DateTime& dt) const { return _date > dt._date || (_date == dt._date && _time >= dt._time); } private: DateTime(unsigned jd) : _date(jd) {} private: Date _date; Time _time; }; CXXTOOLS_API void operator >>=(const SerializationInfo& si, DateTime& dt); CXXTOOLS_API void operator <<=(SerializationInfo& si, const DateTime& dt); CXXTOOLS_API void convert(DateTime& dt, const std::string& s); CXXTOOLS_API void convert(std::string& str, const DateTime& dt); inline DateTime DateTime::fromIsoString(const std::string& s) { DateTime dt; convert(dt, s); return dt; } inline std::string DateTime::toIsoString() const { std::string str; convert(str, *this); return str; } inline DateTime& DateTime::operator=(const DateTime& dateTime) { _date = dateTime.date(); _time = dateTime.time(); return *this; } inline DateTime& DateTime::operator=(unsigned julianDay) { _time = Time(0, 0, 0, 0); _date.setJulian(julianDay); return *this; } inline void DateTime::set(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec) { _date.set(year, month, day); _time.set(hour, minute, second, msec); } inline void DateTime::get(int& y, unsigned& month, unsigned& d, unsigned& h, unsigned& min, unsigned& s, unsigned& ms) const { _date.get(y, month, d); _time.get(h, min, s, ms); } inline bool DateTime::isValid(int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned msec) { return Date::isValid(year, month, day) && Time::isValid(hour, minute, second, msec); } } #endif // CXXTOOLS_DATETIME_H cxxtools-2.2.1/include/cxxtools/char.h0000664000175000017500000004777712266277345014762 00000000000000/* * Copyright (C) 2005-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CHAR_H #define CXXTOOLS_CHAR_H #include #include #include #include #include namespace cxxtools { /** * @brief A lightweight Character class (32 bits). * * Unicode characters are 32-bit entities. This class represents such an entity. It is lightweight, so it * can be used everywhere. Most compilers treat it like an unsigned int of 32 bits. * * This class provides methods for testing/classification, converting to and from other formats, comparing * and case-converting. To convert a character or number to a instance of this class use one of the * constructors provided. To check the type of the character use one of the method starting with "is", like * isLetter() or isDigit(). To compare lower- or upper-case use isUpper() and isLower(). To compare two * characters the corresponding operators are overloaded accordingly. Addition and substraction is supported * as well. Comparison of numeric values (>, <, ==) is supported when using these operators. * * The classification methods operate on the full range of Unicode characters. All methods return $true$ * if the character is a certain type of character. These methods are are wrappers around category() which * return the Unicode-defined category of each character. * * Comparison is critical in Unicode as it covers the characters of the entire world where characters which * look the same may be different in the thinking of numeric values (aka positions in the Unicode table) * Comparing characters will compare based purely on the numeric Unicode value (code point) of the characters. * Upper- and lower-casing using upper() and lower() will only work if the character has a well-defined * upper/lower-case equivalent. * * @see Category */ class Char { public: typedef int32_t value_type; //! Constructs a character with a value of 0. Char() : _value(0) {} //! Constructs a character using the given char as base for the character value. Char(char ch) : _value(value_type(static_cast(ch))) {} //! Constructs a character using the given char as base for the character value. Char(unsigned char ch) : _value( value_type(ch) ) {} //! Constructs a character using the given char as base for the character value. Char(wchar_t ch) : _value( value_type(static_cast(ch)) ) {} //! Constructs a character using the given unsigned 32-bit as base for the character value. explicit Char(value_type ch) : _value(ch) {} /** * @brief Narrows this character into an 8-bit char if possible. * * If the character can not be converted into an 8-bit char because its value is * greater than 255, the defaultCharacter which is passed to this method is returned. * * If this character is equal or lower than 255 the character is cast to char. * * @param def The default character which is returned if this character can not be narrowed * @return An 8-bit char which is a narrowed representation of this character object or * the default character if this character object's value is out of range (>255). */ char narrow(char def = '?') const; wchar_t toWchar() const { return wchar_t(value()); } static Char null() { return Char(0); } Char& operator=(const Char& ch) { _value = ch._value; return *this; } /** * @brief Returns the internal value (unsigned 32 bits) of this character. * @return The 32-bit-value of this character. */ value_type value() const { return _value; } /** * @brief This conversion operator converts the internal value of this character to unsigned 32 bits. * * As the internal value also is an unsigned 32-bit value, the internal value of this character * ist returned. * * @return The character converted to unsigned 32-bit. */ operator value_type() const { return _value; } //! @brief Returns $true$ if the a and b are the same character; $false$ otherwise. //! @return $true$ if the a and b are the same character; $false$ otherwise. friend bool operator==(const Char& a, const Char& b) { return a.value() == b.value(); } friend bool operator==(const Char& a, wchar_t b) { return a.value() == b; } friend bool operator==(wchar_t a, const Char& b) { return a == b.value(); } friend bool operator==(const Char& a, char b) { return a.value() == b; } friend bool operator==(char a, const Char& b) { return a == b.value(); } //! @brief Returns $true$ if the a and b are not the same character; $false$ otherwise. //! @return $true$ if the a and b are not the same character; $false$ otherwise. friend bool operator!=(const Char& a, const Char& b) { return a.value() != b.value(); } friend bool operator!=(const Char& a, wchar_t b) { return a.value() != b; } friend bool operator!=(wchar_t a, const Char& b) { return a != b.value(); } friend bool operator!=(const Char& a, char b) { return a.value() != b; } friend bool operator!=(char a, const Char& b) { return a != b.value(); } //! @brief Returns $true$ if the numeric value of a is less than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is less than the numeric value of b; $false$ otherwise. friend bool operator<(const Char& a, const Char& b) { return a.value() < b.value(); } friend bool operator<(const Char& a, wchar_t b) { return a.value() < b; } friend bool operator<(wchar_t a, const Char& b) { return a < b.value(); } friend bool operator<(const Char& a, char b) { return a.value() < b; } friend bool operator<(char a, const Char& b) { return a < b.value(); } //! @brief Returns $true$ if the numeric value of a is greater than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is greater than the numeric value of b; $false$ otherwise. friend bool operator>(const Char& a, const Char& b) { return a.value() > b.value(); } friend bool operator>(const Char& a, wchar_t b) { return a.value() > b; } friend bool operator>(wchar_t a, const Char& b) { return a > b.value(); } friend bool operator>(const Char& a, char b) { return a.value() > b; } friend bool operator>(char a, const Char& b) { return a > b.value(); } //! @brief Returns $true$ if the numeric value of a is equal or less than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is equal or less than the numeric value of b; $false$ otherwise. friend bool operator<=(const Char& a, const Char& b) { return a.value() <= b.value(); } friend bool operator<=(const Char& a, wchar_t b) { return a.value() <= b; } friend bool operator<=(wchar_t a, const Char& b) { return a <= b.value(); } friend bool operator<=(const Char& a, char b) { return a.value() <= b; } friend bool operator<=(char a, const Char& b) { return a <= b.value(); } //! @brief Returns $true$ if the numeric value of a is equals or greater than the numeric value of b; $false$ otherwise. //! @return $true$ if the numeric value of a is equals or greater than the numeric value of b; $false$ otherwise. friend bool operator>=(const Char& a, const Char& b) { return a.value() >= b.value(); } friend bool operator>=(const Char& a, wchar_t b) { return a.value() >= b; } friend bool operator>=(wchar_t a, const Char& b) { return a >= b.value(); } friend bool operator>=(const Char& a, char b) { return a.value() >= b; } friend bool operator>=(char a, const Char& b) { return a >= b.value(); } private: value_type _value; }; struct MBState { MBState() : n(0) {} int n; union { Char::value_type wchars[4]; char mbytes[16]; } value; }; CXXTOOLS_API std::ostream& operator<< (std::ostream& out, Char ch); } // namespace cxxtools namespace std { /// @cond INTERNAL template<> struct char_traits { typedef cxxtools::Char char_type; typedef cxxtools::Char::value_type int_type; typedef std::streamoff off_type; typedef std::streampos pos_type; typedef cxxtools::MBState state_type; inline static void assign(char_type& c1, const char_type& c2); inline static bool eq(const char_type& c1, const char_type& c2); inline static bool lt(const char_type& c1, const char_type& c2); inline static int compare(const char_type* c1, const char_type* c2, size_t n); inline static size_t length(const char_type* s); inline static const char_type* find(const char_type* s, size_t n, const char_type& a); inline static char_type* move(char_type* s1, const char_type* s2, int_type n); inline static char_type* copy(char_type* s1, const char_type* s2, size_t n); inline static char_type* assign(char_type* s, size_t n, char_type a); inline static char_type to_char_type(const int_type& c); inline static int_type to_int_type(const char_type& c); inline static bool eq_int_type(const int_type& c1, const int_type& c2); inline static int_type eof(); inline static int_type not_eof(const int_type& c); }; inline void char_traits::assign(char_type& c1, const char_type& c2) { c1 = c2; } inline bool char_traits::eq(const char_type& c1, const char_type& c2) { return c1 == c2; } inline bool char_traits::lt(const char_type& c1, const char_type& c2) { return c1 < c2; } inline int char_traits::compare(const char_type* s1, const char_type* s2, size_t n) { while(n-- > 0) { if( !eq(*s1, *s2) ) return lt(*s1, *s2) ? -1 : +1; ++s1; ++s2; } return 0; } inline size_t char_traits::length(const char_type* s) { static const cxxtools::Char term(0); std::size_t n = 0; while( !eq(s[n], term) ) ++n; return n; } inline const char_traits::char_type* char_traits::find(const char_type* s, size_t n, const char_type& a) { while(n-- > 0) { if (*s == a) return s; ++s; } return 0; } inline char_traits::char_type* char_traits::move(char_type* s1, const char_type* s2, int_type n) { return (cxxtools::Char*)std::memmove(s1, s2, n * sizeof(cxxtools::Char)); } inline char_traits::char_type* char_traits::copy(char_type* s1, const char_type* s2, size_t n) { return (cxxtools::Char*)std::memcpy(s1, s2, n * sizeof(cxxtools::Char)); } inline char_traits::char_type* char_traits::assign(char_type* s, size_t n, char_type a) { while(n-- > 0) { *(s++) = a; } return s; } inline char_traits::char_type char_traits::to_char_type(const int_type& c) { return char_type(c); } inline char_traits::int_type char_traits::to_int_type(const char_type& c) { return c.value(); } inline bool char_traits::eq_int_type(const int_type& c1, const int_type& c2) { return c1 == c2; } inline char_traits::int_type char_traits::eof() { return static_cast::int_type>( cxxtools::Char::value_type(-1) ); } inline char_traits::int_type char_traits::not_eof(const int_type& c) { return eq_int_type(c, eof()) ? 0 : c; } } // namespace std namespace cxxtools { inline char Char::narrow(char def) const { if( _value == std::char_traits::eof() ) { return std::char_traits::eof(); } if( _value <= 0xff ) { return (char)_value; } return def; } } // namespace cxxtools #ifdef CXXTOOLS_WITH_STD_LOCALE #include namespace std { #if (defined _MSC_VER || defined __QNX__ || defined __xlC__) /** @brief Ctype localization facet @ingroup Unicode */ template <> class CXXTOOLS_API ctype< cxxtools::Char > : public ctype_base { #else /** @brief Ctype localization facet @ingroup Unicode */ template <> class CXXTOOLS_API ctype : public ctype_base, public locale::facet { #endif public: typedef ctype_base::mask mask; static locale::id id; virtual locale::id& __get_id (void) const { return id; } public: explicit ctype(size_t refs = 0); virtual ~ctype(); bool is(mask m, cxxtools::Char c) const { return this->do_is(m, c); } const cxxtools::Char* is(const cxxtools::Char *lo, const cxxtools::Char *hi, mask *vec) const { return this->do_is(lo, hi, vec); } const cxxtools::Char* scan_is(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const { return this->do_scan_is(m, lo, hi); } const cxxtools::Char* scan_not(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const { return this->do_scan_not(m, lo, hi); } cxxtools::Char toupper(cxxtools::Char c) const { return this->do_toupper(c); } const cxxtools::Char* toupper(cxxtools::Char *lo, const cxxtools::Char* hi) const { return this->do_toupper(lo, hi); } cxxtools::Char tolower(cxxtools::Char c) const { return this->do_tolower(c); } const cxxtools::Char* tolower(cxxtools::Char* lo, const cxxtools::Char* hi) const { return this->do_tolower(lo, hi); } cxxtools::Char widen(char c) const { return this->do_widen(c); } const char* widen(const char* lo, const char* hi, cxxtools::Char* to) const { return this->do_widen(lo, hi, to); } char narrow(cxxtools::Char c, char dfault) const { return this->do_narrow(c, dfault); } const cxxtools::Char* narrow(const cxxtools::Char* lo, const cxxtools::Char* hi, char dfault, char *to) const { return this->do_narrow(lo, hi, dfault, to); } protected: virtual bool do_is(mask m, cxxtools::Char c) const; virtual const cxxtools::Char* do_is(const cxxtools::Char* lo, const cxxtools::Char* hi, mask* vec) const; virtual const cxxtools::Char* do_scan_is(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual const cxxtools::Char* do_scan_not(mask m, const cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual cxxtools::Char do_toupper(cxxtools::Char) const; virtual const cxxtools::Char* do_toupper(cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual cxxtools::Char do_tolower(cxxtools::Char) const; virtual const cxxtools::Char* do_tolower(cxxtools::Char* lo, const cxxtools::Char* hi) const; virtual cxxtools::Char do_widen(char) const; virtual const char* do_widen(const char* lo, const char* hi, cxxtools::Char* dest) const; virtual char do_narrow(cxxtools::Char, char dfault) const; virtual const cxxtools::Char* do_narrow(const cxxtools::Char* lo, const cxxtools::Char* hi, char dfault, char* dest) const; }; } // namespace std #else namespace std { class ctype_base { public: enum { alpha = 1 << 5, cntrl = 1 << 2, digit = 1 << 6, lower = 1 << 4, print = 1 << 1, punct = 1 << 7, space = 1 << 0, upper = 1 << 3, xdigit = 1 << 8, alnum = alpha | digit, graph = alnum | punct }; typedef unsigned short mask; ctype_base(size_t _refs = 0) { } }; } #endif namespace cxxtools { CXXTOOLS_API std::ctype_base::mask ctypeMask(const Char& ch); inline int isalpha(const Char& ch) { return ctypeMask(ch) & std::ctype_base::alpha; } inline int isalnum(const Char& ch) { return ctypeMask(ch) & std::ctype_base::alnum; } inline int ispunct(const Char& ch) { return ctypeMask(ch) & std::ctype_base::punct; } inline int iscntrl(const Char& ch) { return ctypeMask(ch) & std::ctype_base::cntrl; } inline int isdigit(const Char& ch) { return ctypeMask(ch) & std::ctype_base::digit; } inline int isxdigit(const Char& ch) { return ctypeMask(ch) & std::ctype_base::xdigit; } inline int isgraph(const Char& ch) { return ctypeMask(ch) & std::ctype_base::graph; } inline int islower(const Char& ch) { return ctypeMask(ch) & std::ctype_base::lower; } inline int isupper(const Char& ch) { return ctypeMask(ch) & std::ctype_base::upper; } inline int isprint(const Char& ch) { return ctypeMask(ch) & std::ctype_base::print; } inline int isspace(const Char& ch) { return ctypeMask(ch) & std::ctype_base::space; } CXXTOOLS_API Char tolower(const Char& ch); CXXTOOLS_API Char toupper(const Char& ch); } // namespace cxxtools #ifdef CXXTOOLS_WITH_STD_LOCALE #include #endif #endif cxxtools-2.2.1/include/cxxtools/http/0000775000175000017500000000000012266277564014710 500000000000000cxxtools-2.2.1/include/cxxtools/http/server.h0000664000175000017500000000577012256773774016323 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Server_h #define cxxtools_Http_Server_h #include #include #include #include #include namespace cxxtools { class EventLoopBase; class Regex; namespace http { class Request; class Service; class ServerImplBase; class CXXTOOLS_HTTP_API Server : private cxxtools::NonCopyable { public: explicit Server(EventLoopBase& eventLoop); Server(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, int backlog = 64); Server(EventLoopBase& eventLoop, unsigned short int port, int backlog = 64); ~Server(); void listen(const std::string& ip, unsigned short int port, int backlog = 64); void listen(unsigned short int port, int backlog = 64); void addService(const std::string& url, Service& service); void addService(const Regex& url, Service& service); void removeService(Service& service); std::size_t readTimeout() const; std::size_t writeTimeout() const; std::size_t keepAliveTimeout() const; void readTimeout(std::size_t ms); void writeTimeout(std::size_t ms); void keepAliveTimeout(std::size_t ms); unsigned minThreads() const; void minThreads(unsigned m); unsigned maxThreads() const; void maxThreads(unsigned m); enum Runmode { Stopped, Starting, Running, Terminating, Failed }; Signal runmodeChanged; private: ServerImplBase* _impl; }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/client.h0000664000175000017500000001176012266277345016261 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Client_h #define cxxtools_Http_Client_h #include #include #include #include #include #include namespace cxxtools { class SelectorBase; namespace net { class AddrInfo; class Uri; } namespace http { class ClientImpl; class ReplyHeader; class Request; class CXXTOOLS_HTTP_API Client : private NonCopyable { ClientImpl* _impl; public: Client(); Client(const std::string& host, unsigned short int port); explicit Client(const net::AddrInfo& addr); explicit Client(const net::Uri& uri); Client(SelectorBase& selector, const std::string& host, unsigned short int port); Client(SelectorBase& selector, const net::AddrInfo& addrinfo); Client(SelectorBase& selector, const net::Uri& uri); ~Client(); // Sets the host and port. No actual network connect is done. void connect(const net::AddrInfo& addrinfo); void connect(const std::string& host, unsigned short int port); // Sends the passed request to the server and parses the headers. // The body must be read with readBody. // This method blocks or times out until the body is parsed. const ReplyHeader& execute(const Request& request, std::size_t timeout = Selectable::WaitInfinite); const ReplyHeader& header(); // Reads the http body after header read with execute. // This method blocks until the body is received. void readBody(std::string& s); // Reads the http body after header read with execute. // This method blocks until the body is received. std::string readBody() { std::string ret; readBody(ret); return ret; } // Combines the execute and readBody methods in one call. // This method blocks until the reply is recieved. std::string get(const std::string& url, std::size_t timeout = Selectable::WaitInfinite); // Starts a new request. // This method does not block. To actually process the request, the // event loop must be executed. The state of the request is signaled // with the corresponding signals and delegates. // The delegate "bodyAvailable" must be connected, if a body is // received. void beginExecute(const Request& request); void endExecute(); void setSelector(SelectorBase& selector); SelectorBase* selector(); // Executes the underlying selector until a event occures or the // specified timeout is reached. bool wait(std::size_t msecs); // Returns the underlying stream, where the reply may be read from. std::istream& in(); const std::string& host() const; unsigned short int port() const; // Sets the username and password for all subsequent requests. void auth(const std::string& username, const std::string& password); void clearAuth(); void cancel(); // Signals that the request is sent to the server. Signal requestSent; // Signals that the header is received. Signal headerReceived; // This delegate is called, when data is arrived while reading the // body. The connected functor must return the number of bytes read. cxxtools::Delegate bodyAvailable; // Signals that the reply is completely processed. Signal replyFinished; }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/messageheader.h0000664000175000017500000001214212256773774017601 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_MessageHeader_h #define cxxtools_Http_MessageHeader_h #include #include #include #include namespace cxxtools { namespace http { class CXXTOOLS_HTTP_API MessageHeader { public: static const unsigned MAXHEADERSIZE = 4096; private: char _rawdata[MAXHEADERSIZE]; // key_1\0value_1\0key_2\0value_2\0...key_n\0value_n\0\0 unsigned _endOffset; char* eptr() { return _rawdata + _endOffset; } unsigned _httpVersionMajor; unsigned _httpVersionMinor; public: typedef std::pair value_type; class const_iterator : public std::iterator { friend class MessageHeader; value_type current_value; void fixup() { if (*current_value.first) current_value.second = current_value.first + std::strlen(current_value.first) + 1; else current_value.first = current_value.second = 0; } void moveForward() { current_value.first = current_value.second + std::strlen(current_value.second) + 1; fixup(); } public: const_iterator() : current_value(0, 0) { } explicit const_iterator(const char* p) : current_value(p, p) { fixup(); } bool operator== (const const_iterator& it) const { return current_value.first == it.current_value.first; } bool operator!= (const const_iterator& it) const { return current_value.first != it.current_value.first; } const_iterator& operator++() { moveForward(); return *this; } const_iterator operator++(int) { const_iterator ret = *this; moveForward(); return ret; } const value_type& operator* () const { return current_value; } const value_type* operator-> () const { return ¤t_value; } }; MessageHeader() : _endOffset(0), _httpVersionMajor(1), _httpVersionMinor(1) { _rawdata[0] = _rawdata[1] = '\0'; } virtual ~MessageHeader() {} void clear(); void setHeader(const char* key, const char* value, bool replace = true); void addHeader(const char* key, const char* value) { setHeader(key, value, false); } void removeHeader(const char* key); const char* getHeader(const char* key) const; bool hasHeader(const char* key) const { return getHeader(key) != 0; } bool isHeaderValue(const char* key, const char* value) const; const_iterator begin() const { return const_iterator(_rawdata); } const_iterator end() const { return const_iterator(); } unsigned httpVersionMajor() const { return _httpVersionMajor; } unsigned httpVersionMinor() const { return _httpVersionMinor; } void httpVersion(unsigned major, unsigned minor) { _httpVersionMajor = major; _httpVersionMinor = minor; } bool chunkedTransferEncoding() const; std::size_t contentLength() const; bool keepAlive() const; /// Returns a properly formatted current time-string, as needed in http. /// The buffer must have at least 30 bytes. static char* htdateCurrent(char* buffer); }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/service.h0000664000175000017500000000655712256773774016461 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Service_h #define cxxtools_Http_Service_h #include #include #include #include #include namespace cxxtools { namespace http { class Responder; class Request; class Authenticator { protected: virtual ~Authenticator() { } public: virtual bool checkAuth(const Request&) const = 0; }; class CXXTOOLS_HTTP_API Service { std::vector _authenticators; std::string _realm; std::string _authContent; unsigned _responderCount; Mutex _mutex; Condition _isIdle; public: Service() : _responderCount(0) { } virtual ~Service() { } Responder* doCreateResponder(const Request&); void doReleaseResponder(Responder*); bool checkAuth(const Request& request); void setRealm(const std::string& realm, const std::string& content = std::string()) { _realm = realm; _authContent = content; } const std::string& realm() const { return _realm; } const std::string& authContent() const { return _authContent; } void addAuthenticator(const Authenticator* auth) { _authenticators.push_back(auth); } void waitIdle(); protected: virtual Responder* createResponder(const Request&) = 0; virtual void releaseResponder(Responder*) = 0; }; class CachedServiceBase : public Service { typedef std::vector Responders; Responders responders; public: ~CachedServiceBase(); protected: virtual Responder* newResponder() = 0; Responder* createResponder(const Request& request); void releaseResponder(Responder* resp); }; template class CachedService : public CachedServiceBase { virtual Responder* newResponder() { return new ResponderType(*this); } }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/reply.h0000664000175000017500000000617012256773774016143 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Reply_h #define cxxtools_Http_Reply_h #include #include #include #include namespace cxxtools { namespace http { class Request; class Reply { ReplyHeader _header; std::ostringstream _body; public: Reply() { } ReplyHeader& header() { return _header; } const ReplyHeader& header() const { return _header; } void setHeader(const char* key, const char* value) { _header.setHeader(key, value); } void addHeader(const char* key, const char* value) { _header.addHeader(key, value); } void removeHeader(const char* key) { _header.removeHeader(key); } const char* getHeader(const char* key) const { return _header.getHeader(key); } bool hasHeader(const char* key) const { return _header.hasHeader(key); } void clear() { _header.clear(); _body.clear(); _body.str(std::string()); } unsigned httpReturnCode() const { return _header.httpReturnCode(); } const std::string& httpReturnText() const { return _header.httpReturnText(); } void httpReturn(unsigned c, const std::string& t) { _header.httpReturn(c, t); } std::string bodyStr() const { return _body.str(); } std::ostream& body() { return _body; } std::size_t bodySize() const { return _body.str().size(); } void sendBody(std::ostream& out) const { out << _body.str(); } }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/replyheader.h0000664000175000017500000000445112256773774017314 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_ReplyHeader_h #define cxxtools_Http_ReplyHeader_h #include #include namespace cxxtools { namespace http { class RequestHeader; class ReplyHeader : public MessageHeader { unsigned _httpReturnCode; std::string _httpReturnText; public: ReplyHeader() : _httpReturnCode(200), _httpReturnText("OK") { } void clear() { MessageHeader::clear(); _httpReturnCode = 200; _httpReturnText = "OK"; } unsigned httpReturnCode() const { return _httpReturnCode; } const std::string& httpReturnText() const { return _httpReturnText; } void httpReturn(unsigned c, const std::string& t) { _httpReturnCode = c; _httpReturnText = t; } }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/request.h0000664000175000017500000000675712256773774016513 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Request_h #define cxxtools_Http_Request_h #include #include #include #include namespace cxxtools { namespace http { class Request { RequestHeader _header; std::ostringstream _body; public: struct Auth { std::string user; std::string password; }; explicit Request(const std::string& url = std::string()) : _header(url) { } RequestHeader& header() { return _header; } const RequestHeader& header() const { return _header; } void setHeader(const char* key, const char* value) { _header.setHeader(key, value); } void addHeader(const char* key, const char* value) { _header.addHeader(key, value); } void removeHeader(const char* key) { _header.removeHeader(key); } const char* getHeader(const char* key) const { return _header.getHeader(key); } bool hasHeader(const char* key) const { return _header.hasHeader(key); } void clear() { _header.clear(); _body.clear(); _body.str(std::string()); } const std::string& url() const { return _header.url(); } void url(const std::string& u) { _header.url(u); } const std::string& method() const { return _header.method(); } void method(const std::string& m) { _header.method(m); } const std::string& qparams() const { return _header.qparams(); } void qparams(const std::string& q) { _header.qparams(q); } std::string bodyStr() const { return _body.str(); } std::ostream& body() { return _body; } std::size_t bodySize() const { return _body.str().size(); } void sendBody(std::ostream& out) const { out << _body.str(); } Auth auth() const; }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/api.h0000664000175000017500000000333612256773774015562 00000000000000/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_API_H #define CXXTOOLS_HTTP_API_H #include #if defined(CXXTOOLS_HTTP_API_EXPORT) # define CXXTOOLS_HTTP_API CXXTOOLS_EXPORT # else # define CXXTOOLS_HTTP_API CXXTOOLS_IMPORT # endif namespace cxxtools { /** @namespace cxxtools::http @brief HTTP Parsing and Generation */ namespace http { } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/responder.h0000664000175000017500000000437412256773774017015 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Responder_h #define cxxtools_Http_Responder_h #include #include #include #include namespace cxxtools { namespace http { class Request; class Reply; class CXXTOOLS_HTTP_API Responder { public: explicit Responder(Service& service) : _service(service) { } virtual ~Responder() { } virtual void beginRequest(std::istream& in, Request& request); virtual std::size_t readBody(std::istream&); virtual void reply(std::ostream&, Request& request, Reply& reply) = 0; virtual void replyError(std::ostream&, Request& request, Reply& reply, const std::exception& ex); void release() { _service.doReleaseResponder(this); } private: Service& _service; Request* _request; }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/http/requestheader.h0000664000175000017500000000506012256773774017646 00000000000000/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_RequestHeader_h #define cxxtools_Http_RequestHeader_h #include #include #include namespace cxxtools { namespace http { class RequestHeader : public MessageHeader { std::string _url; std::string _method; std::string _qparams; public: explicit RequestHeader(const std::string& url = std::string()) : _url(url), _method("GET") { } virtual ~RequestHeader() {} void clear() { MessageHeader::clear(); _method = "GET"; _qparams.clear(); } const std::string& url() const { return _url; } void url(const std::string& u) { _url = u; } const std::string& method() const { return _method; } void method(const std::string& m) { _method = m; } const std::string& qparams() const { return _qparams; } void qparams(const std::string& q) { _qparams = q; } std::string query() const { return _qparams.empty() ? _url : _url + '?' + _qparams; } }; } // namespace http } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/trim.h0000664000175000017500000000445712256773774015012 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TRIM_H #define CXXTOOLS_TRIM_H #include namespace cxxtools { template StringType ltrim(const StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type p = s.find_first_not_of(ws); return p == StringType::npos ? StringType() : s.substr(p); } template StringType rtrim(const StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type p = s.find_last_not_of(ws); return p == StringType::npos ? StringType() : s.substr(0, p + 1); } template StringType trim(const StringType& s, const StringType& ws = StringType(" \t\r\n")) { typename StringType::size_type pl = s.find_first_not_of(ws); if (pl == StringType::npos) return StringType(); typename StringType::size_type pr = s.find_last_not_of(ws); return s.substr(pl, pr - pl + 1); } } #endif // CXXTOOLS_TRIM_H cxxtools-2.2.1/include/cxxtools/byteorder.h0000664000175000017500000001022112266277345016012 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BYTEORDER_H #define CXXTOOLS_BYTEORDER_H #include #include #if __BYTE_ORDER == __LITTLE_ENDIAN #define CXXTOOLS_LITTLE_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN #define CXXTOOLS_BIG_ENDIAN #endif namespace cxxtools { template class Reverser; template class Reverser { public: T operator() (T value) { return value >> 8 & 0xff | value << 8 & 0xff00; } }; template class Reverser { public: T operator() (T value) { return value >> 24 & 0xff | value >> 8 & 0xff00 | value << 8 & 0xff0000 | value << 24 & 0xff000000; } }; template class Reverser { public: T operator() (T value) { return value >> 56 & 0xffll | value >> 40 & 0xff00ll | value >> 24 & 0xff0000ll | value >> 8 & 0xff000000ll | value << 8 & 0xff00000000ll | value << 24 & 0xff0000000000ll | value << 40 & 0xff000000000000ll | value << 56 & 0xff00000000000000ll; } }; template T reverse(T value) { return Reverser() (value); } /// Returns true, if machine is big-endian (high byte first). /// e.g. PowerPC inline bool isBigEndian() { const int i = 1; return *reinterpret_cast(&i) == 0; } /// Returns true, if machine is little-endian (low byte first). /// e.g. x86 inline bool isLittleEndian() { const int i = 1; return *reinterpret_cast(&i) == 1; } /// Converts a native value in little endian. template T hostToLe(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return reverse(value); #elif defined(CXXTOOLS_LITTLE_ENDIAN) return value; #else return isBigEndian() ? reverse(value) : value; #endif } /// Converts a little endian value to native. template T leToHost(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return reverse(value); #elif defined(CXXTOOLS_LITTLE_ENDIAN) return value; #else return isBigEndian() ? reverse(value) : value; #endif } /// Converts a native value in big endian. template T hostToBe(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return value; #elif defined(CXXTOOLS_LITTLE_ENDIAN) return reverse(value); #else return isBigEndian() ? value : reverse(value); #endif } /// Converts a big endian value to native. template T beToHost(T value) { #if defined(CXXTOOLS_BIG_ENDIAN) return value; #elif defined(CXXTOOLS_LITTLE_ENDIAN) return reverse(value); #else return isBigEndian() ? value : reverse(value); #endif } } #endif // CXXTOOLS_BYTEORDER_H cxxtools-2.2.1/include/cxxtools/membar.gcc.sparc64.h0000664000175000017500000000344412256773774017311 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_SPARC64_H #define CXXTOOLS_MEMBAR_SPARC64_H namespace cxxtools { inline void membar_rw() { asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" : : : "memory"); } inline void membar_write() { asm volatile("membar #StoreStore | #StoreLoad" : : : "memory"); } inline void membar_read() { asm volatile("membar #LoadLoad | #LoadStore" : : : "memory"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_SPARC64_H cxxtools-2.2.1/include/cxxtools/atomicity.generic.h0000664000175000017500000000310212256773774017436 00000000000000/* * Copyright (C) 2006-2007 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GENERIC_H #define CXXTOOLS_ATOMICINT_GENERIC_H #include namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/eventsource.h0000664000175000017500000000633512256773774016376 00000000000000/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_EVENTSOURCE_H #define CXXTOOLS_EVENTSOURCE_H #include #include #include #include #include #include #include namespace cxxtools { class EventSink; /** @brief Sends Events to receivers in other threads The Signal class is not thread-safe and can only be used for intra-thread communication. To pass Events between different threads use an %EventSource instead. Thread-safety only refers to the usage of the %EventSource itself (connection, disconnecting...) and not the slot. Construction and destruction must always occur in isolation. */ class CXXTOOLS_API EventSource : protected NonCopyable { friend class EventSink; public: EventSource(); ~EventSource(); void send(const cxxtools::Event& ev); void connect(EventSink& sink); void disconnect(EventSink& sink); template void subscribe(EventSink& sink) { subscribe( sink, typeid(EventT) ); } template void unsubscribe(EventSink& sink) { unsubscribe( sink, typeid(EventT) ); } private: bool tryDisconnect(EventSink& sink); void subscribe(EventSink& sink, const std::type_info& ti); void unsubscribe(EventSink& sink, const std::type_info& ti); private: struct Sentry; typedef std::multimap< const std::type_info*, EventSink*, CompareEventTypeInfo > SinkMap; mutable RecursiveMutex _mutex; mutable RecursiveMutex* _dmutex; mutable SinkMap _sinks; mutable Sentry* _sentry; mutable bool _dirty; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/csvdeserializer.h0000775000175000017500000000512512266277345017223 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVDESERIALIZER_H #define CXXTOOLS_CSVDESERIALIZER_H #include #include #include #include #include #include namespace cxxtools { class CXXTOOLS_API CsvDeserializer : public Deserializer { public: CsvDeserializer(std::istream& in, TextCodec* codec = new Utf8Codec()); CsvDeserializer(TextIStream& in); ~CsvDeserializer(); Char delimiter() const { return _parser.delimiter(); } void delimiter(Char ch) { _parser.delimiter(ch); } bool readTitle() const { return _parser.readTitle(); } void readTitle(bool sw) { _parser.readTitle(sw); } static const Char autoDelimiter; template static void toObject(std::istream& in, T& type) { CsvDeserializer d(in); d.deserialize(type); } private: void doDeserialize(); TextIStream* _ts; TextIStream& _in; CsvParser _parser; }; } #endif // CXXTOOLS_CSVDESERIALIZER_H cxxtools-2.2.1/include/cxxtools/pipe.h0000664000175000017500000000601712256773774014766 00000000000000/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PIPE_H #define CXXTOOLS_PIPE_H #include #include #include #include namespace cxxtools { class PipeImpl; class CXXTOOLS_API Pipe : private NonCopyable { private: class PipeImpl* _impl; protected: PipeImpl* impl() { return _impl; } const PipeImpl* impl() const { return _impl; } public: typedef int OpenMode; static const int Sync = 0; static const int Async = 1; /** @brief Creates the pipe with two IODevices The default constructor will create the pipe and the appropriate IODevices to read and write to the pipe. */ explicit Pipe(OpenMode mode = Sync); /** @brief Destructor Destroys the pipe and closes the internal IODevices. */ ~Pipe(); /** @brief Endpoint of the pipe to read from @return An IODevice used to read from the pipe */ IODevice& out(); const IODevice& out() const; /** @brief Endpoint of the pipe to write to @return An IODevice used to write to the pipe */ IODevice& in(); const IODevice& in() const; size_t write(const char* buf, size_t count) { return in().write(buf, count); } void write(char ch) { in().write(&ch, 1); } size_t read(char* buf, size_t count) { return out().read(buf, count); } char read() { char ch; out().read(&ch, 1); return ch; } }; } #endif // CXXTOOLS_PIPE_H cxxtools-2.2.1/include/cxxtools/noncopyable.h0000664000175000017500000000323512256773774016341 00000000000000/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NONCOPYABLE_H #define CXXTOOLS_NONCOPYABLE_H namespace cxxtools { class NonCopyable { private: NonCopyable(const NonCopyable&); // no implementation NonCopyable& operator=(const NonCopyable&); // no implementation public: NonCopyable() { } }; } #endif // CXXTOOLS_NONCOPYABLE_H cxxtools-2.2.1/include/cxxtools/membar.h0000664000175000017500000000724612256773774015301 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_H #define CXXTOOLS_MEMBAR_H #include #if defined(CXXTOOLS_ATOMICITY_SUN) #include #elif defined(CXXTOOLS_ATOMICITY_WINDOWS) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_ARM) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_MIPS) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_AVR32) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_SPARC32) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_SPARC) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_X86_64) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_X86) #include #elif defined(CXXTOOLS_ATOMICITY_GCC_PPC) #include #elif defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE) #include #elif defined(__sun) #include #elif defined(__GNUC__) || defined(__xlC__) || \ defined(__SUNPRO_CC) || defined(__SUNPRO_C) #if defined (i386) || defined(__i386) || defined (__i386__) || \ defined(_X86_) || defined(sun386) || defined (_M_IX86) || \ defined(__x86_64__) || defined(__amd64__) #include #elif defined (ARM) || defined(__arm__) || defined(_M_ARM) || defined(_M_ARMT) #include #elif defined (AVR) || defined(__AVR__) #include #elif defined( _M_PPC ) || defined( PPC ) || \ defined( ppc ) || defined( __powerpc__ ) || \ defined( __ppc__ ) #include #elif defined(__mips__) || defined(MIPSEB) || defined(_MIPSEB) || \ defined(MIPSEL) || defined(_MIPSEL) #include #elif defined(__sparcv9) #include #elif defined(__sparc__) || defined(sparc) || defined(__sparc) || \ defined(__sparcv8) #include #else #include #endif #else #error "unknown architecture" #endif #endif // CXXTOOLS_MEMBAR_H cxxtools-2.2.1/include/cxxtools/string.tpp0000664000175000017500000002613712256773774015720 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace std { inline basic_string::basic_string(const allocator_type& a) : _data(a) { } inline basic_string::basic_string(const cxxtools::Char* str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const wchar_t* str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const wchar_t* str, size_type length, const allocator_type& a) : _data(a) { assign(str, length); } inline basic_string::basic_string(const std::string& str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const basic_string& str) : _data(str.get_allocator()) { assign(str); } inline basic_string::basic_string(const char* str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const char* str, size_type length, const allocator_type& a) : _data(a) { assign(str, length); } inline basic_string::basic_string(const cxxtools::Char* str, size_type n, const allocator_type& a) : _data(a) { assign(str, n); } inline basic_string::basic_string(size_type n, cxxtools::Char c, const allocator_type& a) : _data(a) { assign(n, c); } inline basic_string::basic_string(const basic_string& str, const allocator_type& a) : _data(a) { assign(str); } inline basic_string::basic_string(const basic_string& str, size_type pos, const allocator_type& a) : _data(a) { assign(str, pos, str.length() - pos); } inline basic_string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator_type& a) : _data(a) { assign(str, pos, n); } inline basic_string::basic_string(const cxxtools::Char* begin, const cxxtools::Char* end, const allocator_type& a) : _data(a) { assign(begin, end); } template basic_string::basic_string(InputIterator begin, InputIterator end, const allocator_type& a) : _data(a) { assign(begin, end); } inline basic_string::~basic_string() { if (!isShortString()) { _data.deallocate(longStringData(), longStringCapacity() + 1); } } inline basic_string& basic_string::assign(const basic_string& str, size_type pos, size_type n) { return this->assign( str.data() + pos, n ); } inline basic_string& basic_string::assign(const cxxtools::Char* str) { return assign(str, traits_type::length(str)); } template basic_string& basic_string::assign(InputIterator begin, InputIterator end) { clear(); append(begin, end); return *this; } inline basic_string& basic_string::append(const cxxtools::Char* str) { return append( str, traits_type::length(str) ); } inline basic_string& basic_string::append(const basic_string& str) { return this->append( str.data(), str.length() ); } inline basic_string& basic_string::append(const basic_string& str, size_type pos, size_type n) { return this->append( str.data() + pos, n ); } template basic_string& basic_string::append(InputIterator begin, InputIterator end) { while (begin != end) { append(1, *begin++); } return *this; } inline basic_string& basic_string::append(const cxxtools::Char* begin, const cxxtools::Char* end) { return this->append( begin, end-begin ); } inline basic_string& basic_string::insert(size_type pos, const cxxtools::Char* str) { return this->insert( pos, str, traits_type::length(str) ); } inline basic_string& basic_string::insert(size_type pos, const basic_string& str) { return insert(pos, str.privdata_ro(), str.length()); } inline basic_string& basic_string::insert(size_type pos, const basic_string& str, size_type pos2, size_type n) { return insert(pos, str.privdata_ro() + pos2, n > str.length() ? str.length() : n); } inline basic_string& basic_string::insert(iterator p, cxxtools::Char ch) { return insert(p - begin(), 1, ch); } inline basic_string& basic_string::insert(iterator p, size_type n, cxxtools::Char ch) { return insert(p - begin(), n, ch); } inline basic_string::iterator basic_string::erase(iterator it) { size_type pos = it - begin(); erase(pos, 1); return begin() + pos; } inline basic_string::iterator basic_string::erase(iterator first, iterator last) { size_type pos = first - begin(); erase(pos, last - first); return begin() + pos; } inline basic_string& basic_string::replace(size_type pos, size_type n, const cxxtools::Char* str) { return replace(pos, n, str, traits_type::length(str)); } inline basic_string& basic_string::replace(size_type pos, size_type n, const basic_string& str) { return replace(pos, n, str.privdata_ro(), str.length()); } inline basic_string& basic_string::replace(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2) { return replace(pos, n, str.privdata_ro() + pos2, n2); } inline basic_string& basic_string::replace(iterator i1, iterator i2, const cxxtools::Char* str) { size_type pos = i1 - begin(); size_type n = i2 - i1; return replace(pos, n, str); } inline basic_string& basic_string::replace(iterator i1, iterator i2, const cxxtools::Char* str, size_type n) { size_type pos = i1 - begin(); size_type n1 = i2 - i1; return replace(pos, n1, str, n); } inline basic_string& basic_string::replace(iterator i1, iterator i2, size_type n, cxxtools::Char ch) { size_type pos = i1 - begin(); size_type n1 = i2 - i1; return replace(pos, n1, n, ch); } inline basic_string& basic_string::replace(iterator i1, iterator i2, const basic_string& str) { size_type pos = i1 - begin(); size_type n = i2 - i1; return replace(pos, n, str); } inline int basic_string::compare(const cxxtools::Char* str) const { return compare(str, traits_type::length(str)); } inline int basic_string::compare(size_type pos, size_type n, const basic_string& str) const { return compare(pos, n, str, 0, str.length()); } inline int basic_string::compare(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2) const { return compare(pos, n, str.privdata_ro() + pos2, n2); } inline int basic_string::compare(size_type pos, size_type n, const cxxtools::Char* str) const { return compare(pos, n, str, traits_type::length(str)); } inline basic_string::size_type basic_string::find(const basic_string& str, size_type pos) const { return this->find( str.privdata_ro(), pos, str.size() ); } inline basic_string::size_type basic_string::rfind(const basic_string& str, size_type pos) const { return this->rfind( str.privdata_ro(), pos, str.size() ); } inline basic_string::size_type basic_string::find(const cxxtools::Char* str, size_type pos) const { return this->find( str, pos, traits_type::length(str) ); } inline basic_string::size_type basic_string::rfind(const cxxtools::Char* str, size_type pos) const { return this->rfind( str, pos, traits_type::length(str) ); } template basic_string basic_string::fromUtf16(InIterT from, InIterT fromEnd) { std::basic_string ret; for( ; from != fromEnd; ++from) { unsigned ch = *from; // high surrogate if (ch >= 0xD800 && ch <= 0xDBFF) { // invalid or missing low surrogate if(++from == fromEnd || *from < 0xDC00 || *from > 0xDFFF) { ret += cxxtools::Char(0xFFFD); break; } const unsigned lo = *from; ch = ((ch - 0xD800) << 10) + (lo - 0xDC00) + 0x0010000U; ret += cxxtools::Char(static_cast(ch)); } // not a surrogate else if(ch < 0xDC00 || ch > 0xDFFF) { ret += cxxtools::Char(static_cast(ch)); } // not a valid unicode point else { ret += cxxtools::Char(static_cast(0xFFFD)); } } return ret; } template OutIterT basic_string::toUtf16(OutIterT to) const { const_iterator from = this->begin(); const_iterator fromEnd = this->end(); for( ; from != fromEnd; ++from) { const int ch = *from; if( ch < 0xD800 || (ch > 0xDFFF && ch <= 0xFFFF) ) { *to++ = *from; } else if(ch > 0xFFFF && ch <= 0x0010FFFF) { const int n = (ch - 0x0010000UL); *to++ = ((n >> 10) + 0xD800); *to++ = ((n & 0x3FFU) + 0xDC00); } else { *to++ = 0xFFFD; } } return to; } } cxxtools-2.2.1/include/cxxtools/delegate.h0000664000175000017500000000562512256773774015607 00000000000000/* * Copyright (C) 2004-2007 by Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Delegate_h #define cxxtools_Delegate_h #include #include #include #include #include #include namespace cxxtools { /** @internal */ class DelegateBase : public Connectable { public: DelegateBase() { } DelegateBase(const DelegateBase& rhs) { DelegateBase::operator=(rhs); } DelegateBase& operator=(const DelegateBase& other) { _target.close(); if( !other._target ) return *this; const Slot& slot = other._target.slot(); _target = Connection( *this, slot.clone() ); return *this; } virtual void onConnectionOpen(const Connection& c) { const Connectable& sender = c.sender(); if( &sender == this ) { _target.close(); _target = c; } Connectable::onConnectionOpen(c); } virtual void onConnectionClose(const Connection& c) { Connectable::onConnectionClose(c); } bool isConnected() const { return _target.valid(); } protected: Connection _target; }; #include } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/tee.h0000664000175000017500000000527612256773774014614 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_TEE_H #define CXXTOOLS_TEE_H #include namespace cxxtools { class Teestreambuf : public std::streambuf { public: Teestreambuf(std::streambuf* buf1 = 0, std::streambuf* buf2 = 0) : streambuf1(buf1), streambuf2(buf2) { setp(0, 0); } void tie(std::streambuf* buf1, std::streambuf* buf2 = 0) { streambuf1 = buf1; streambuf2 = buf2; } private: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); std::streambuf* streambuf1; std::streambuf* streambuf2; }; ///////////////////////////////////////////////////////////////////////////// class Tee : public std::ostream { typedef std::ostream base_class; Teestreambuf streambuf; public: Tee() : std::ostream(0), streambuf(std::cout.rdbuf()) { init(&streambuf); } Tee(std::ostream& s1, std::ostream& s2) : std::ostream(0), streambuf(s1.rdbuf(), s2.rdbuf()) { init(&streambuf); } Tee(std::ostream& s) : std::ostream(0), streambuf(s.rdbuf(), std::cout.rdbuf()) { init(&streambuf); } void assign(std::ostream& s1, std::ostream& s2); void assign(std::ostream& s) { assign(s, std::cout); } void assign_single(std::ostream& s); }; } #endif // CXXTOOLS_TEE_H cxxtools-2.2.1/include/cxxtools/xml/0000775000175000017500000000000012266277564014531 500000000000000cxxtools-2.2.1/include/cxxtools/xml/xmlwriter.h0000664000175000017500000000666412256773774016676 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlWriter_h #define cxxtools_Xml_XmlWriter_h #include #include #include #include namespace cxxtools { namespace xml { class Attribute; class CXXTOOLS_XML_API XmlWriter { public: XmlWriter(); XmlWriter(std::ostream& os, int format = UseXmlDeclaration | UseIndent | UseEndl); ~XmlWriter(); void begin(std::ostream& os); void writeStartElement(const cxxtools::String& prefix, const cxxtools::String& localName, const cxxtools::String& ns); void writeStartElement(const cxxtools::String& localName); void writeStartElement(const cxxtools::String& localName, const Attribute* attr, size_t attrCount); void writeEndElement(); void writeElement(const cxxtools::String& localName, const cxxtools::String& content); void writeElement(const cxxtools::String& localName, const Attribute* attr, size_t attrCount, const cxxtools::String& content); void writeCharacters(const cxxtools::String& text); void flush(); void endl(); enum FormatFlags { UseXmlDeclaration = 1, UseIndent = 2, UseEndl = 4 }; void setFormat(int f) { _flags = f; } void setFormatFlags(int f, bool sw = true) { if (sw) _flags |= f; else _flags &= ~f; } int format() const { return _flags; } bool useXmlDeclaration() const { return _flags & UseXmlDeclaration; } void useXmlDeclaration(bool sw) { setFormatFlags(UseXmlDeclaration, sw); } bool useIndent() const { return _flags & UseIndent; } void useIndent(bool sw) { setFormatFlags(UseIndent, sw); } bool useEndl() const { return _flags & UseEndl; } void useEndl(bool sw) { setFormatFlags(UseEndl, sw); } private: TextOStream _tos; std::stack _elements; int _flags; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/xmldeserializer.h0000664000175000017500000000764412256773774020043 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef xis_cxxtools_XmlDeserializer_h #define xis_cxxtools_XmlDeserializer_h #include #include #include "cxxtools/xml/xmlreader.h" #include namespace cxxtools { namespace xml { class XmlReader; class Node; /** @brief Deserialize objects or object data to XML Thic class performs XML deserialization of a single object or object data. */ class XmlDeserializer : public Deserializer { public: XmlDeserializer(cxxtools::xml::XmlReader& reader); XmlDeserializer(std::istream& is); cxxtools::xml::XmlReader& reader() { return *_reader; } template static void toObject(const std::string& str, T& type) { std::istringstream in(str); XmlDeserializer d(in); d.deserialize(type); } template static void toObject(XmlReader& in, T& type) { XmlDeserializer d(in); d.deserialize(type); } template static void toObject(std::istream& in, T& type) { XmlDeserializer d(in); d.deserialize(type); } protected: void doDeserialize(); //! @internal void beginDocument(const cxxtools::xml::Node& node); //! @internal void onRootElement(const cxxtools::xml::Node& node); //! @internal void onStartElement(const cxxtools::xml::Node& node); //! @internal void onWhitespace(const cxxtools::xml::Node& node); //! @internal void onContent(const cxxtools::xml::Node& node); //! @internal void onEndElement(const cxxtools::xml::Node& node); private: //! @internal cxxtools::xml::XmlReader* _reader; //! @internal std::auto_ptr _deleter; //! @internal typedef void (XmlDeserializer::*ProcessNode)(const cxxtools::xml::Node&); //! @internal ProcessNode _processNode; size_t _startDepth; //! @internal cxxtools::String _nodeName; cxxtools::String _nodeId; cxxtools::String _nodeType; cxxtools::String _nodeCategory; SerializationInfo::Category nodeCategory() const; }; } // namespace xml } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/xml/characters.h0000664000175000017500000001332412256773774016747 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_Characters_h #define cxxtools_xml_Characters_h #include #include #include namespace cxxtools { namespace xml { /** * @brief A Character element (Node) of an XML document, containing the body's Text of a tag. * * A Character element stores the data of a tag's body. The data is interpreted before it * is set as content of a Character element. This means that entities were translated into * their corresponding character sequence, ... * * Use content() to get the content of the CDATA element. * * When parsing a tag $<a>This is the body's Text</a>$ the following content will be * returned by content(): $This is the body's Text$ * * @see Node */ class CXXTOOLS_XML_API Characters : public Node { public: /** * @brief Constructs a new Character object with the given (optional) string as content. * * @param content The content of the Character object. This is an optional parameter. * Default is an empty string. */ explicit Characters( const String& content = String() ) : Node(Node::Characters), _content(content) { } /** * @brief Clones this Character object by creating a duplicate on the heap and returning it. * @return A cloned version of this Character object. */ Characters* clone() const { return new Characters(*this); } /** * @brief Returns $true$ if the content of this Character object is empty; $false$ otherwise. * @return $true$ if the content of this Character object is empty; $false$ otherwise. */ bool empty() const { return _content.empty(); } void clear() { _content.clear(); } /** * @brief Returns the content of this Character object. * * The content includes the Text inside a tag's body. The Text is interpreted before it * is returned, this means that for example entities are translated into their corresponding * character sequence. When parsing a tag $This is the body's Text$ the followin * content will be returned: $This is the body's Text$ * * @return The content of this Character object. */ String& content() { return _content; } /** * @brief Returns the content of this Character object. * * The content includes the Text inside a tag's body. The Text is interpreted before it * is returned, this means that for example entities are translated into their corresponding * character sequence. When parsing a tag $This is the body's Text$ the followin * content will be returned: $This is the body's Text$ * * @return The content of this Character object. */ const String& content() const { return _content; } /** * @brief Sets the content of this Character object. * @param content The new content for this Character object. */ void setContent(const String& content) { _content = content; } /** * @brief Compares this Character object with the given node. * * This method returns $true$ if the given node also is a Character object and * the content of both Character objects is the same. Otherwise it returns $false$. * * @param node This Node object is compared to the current Character node object. * @return $true if this Character object is the same as the given node. */ virtual bool operator==(const Node& node) const; private: //! The content of this Character object. String _content; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/entityresolver.h0000664000175000017500000001047512256773774017732 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_EntityResolver_h #define cxxtools_xml_EntityResolver_h #include #include #include namespace cxxtools { namespace xml { /** * @brief Entity resolver class which associates entities to resolved entity values. * * Entities can be added to this class using the method addEntity(). This method takes * the entity and the resolved entity value. To resolve the resolves value for an entity * the method resolveEntity() can be used. */ class CXXTOOLS_XML_API EntityResolver { public: /** * @brief Constructs a new Resolver object and initializes the entity list using the XML default entities. * * The constructor calls clear() which clears the entity list and adds the XML default entities. */ EntityResolver() { } /** * @brief Resets the entity list to the XML default entities. * * The default entities are all entities from HTML4 */ void clear() { _entityMap.clear(); } /** * @brief Adds the given entity and the given resolved entity value (token) to the entity list. * * To determine the resolved entity value of a entity the method resolveEntity() can be used. * * @param entity A list entry for this entity is created and associated with the also given token. * @param token The resolved entity value that is associated with the also given entity. */ void addEntity(const String& entity, const String& token) { _entityMap.insert( std::pair(entity, token) ); } /** * @brief Returns the resolved entity value (token) for the given entity. * * If the entity is not in the list or an dec or hex entity is invalid an exception is thrown. * * @param entity The resolved entity value for this entity is returned. * @return The resolved entity. * @throws XmlError if the entity is not in the list. * */ String resolveEntity(const String& entity) const; /** * @brief Returns the entity value (token) of the given character. * * Returns the entity of the given char. If there is no entity found, either the * given character as a string or a numeric entity is returned depending of the * passed flag. */ String getEntity(Char ch) const; /** * @brief Outputs the entity value (token) of the given character. * * Returns the entity of the given char. If there is no entity found, either the * given character as a string or a numeric entity is returned depending of the * passed flag. */ void getEntity(std::basic_ostream& os, Char ch) const; private: //! Entity map containing entities which are associated to their resolved entity value. typedef std::map EntityMap; EntityMap _entityMap; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/node.h0000664000175000017500000001263612256773774015562 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_Node_h #define cxxtools_Xml_Node_h #include namespace cxxtools { namespace xml { /** * @brief The super-class for all specific Node type of an XML document. * * A Node may for example be a opening tag, a closing tag, a comment or a doctype declaration. * The supported node types are contained in the enum Type. To determine the type of a Node the * method type() can be used. * * For every supported node type (except "Unknown") a specialized class exists that is derived * from this Node class. Those classes contain more data and access methods to allow the user * to determine the information specific to the node, for example the tag name for a StartElement. * * This class mainly provides the method type() to determine the type of the Node. The user * may use this information to determine to which specialized class that is associated * with the type this object can be cast; for the Node::StartElement type the Node object can be * cast to StartElement, for example. * * @see Type */ class CXXTOOLS_XML_API Node { public: enum Type { //! Unknown Node type (may not currently be supported) Unknown = 0, //! Xml declaration (see class XmlDeclaration) StartDocument = 1, //! Doctype (see class DocType) DocType = 2, //! End of the document (see EndDocument) EndDocument = 3, //! Start element aka opening tag (see StartElement) StartElement = 4, //! End element aka closing tag (see EndElement) EndElement = 5, //! Parsed content of a tag's body (see Characters) Characters = 6, //! Comment (see Comment) Comment, //! Processing instruction (see ProcessingInstruction) ProcessingInstruction }; public: /** * @brief Constructs a new Node object with the specified node type * @see Type */ Node(Type type) : _type(type) { } //! Empty destructor virtual ~Node() { } /** * @brief Returns the type of this Node that can be used to determine what specific * Node this object is. * * This information may be used to determine to which specialized Node class that is associated * with the type, this Node object can be cast; for the Node::StartElement type the Node object * can be cast to StartElement, for example. * * @return The type of this node. */ Type type() const {return _type;} /** * @brief Compares this Node object with the given node. * * The return value of the generic operator== method is always false. Class which derive * from this class should always override this method and provide a useful comparison, for * example by comparing the node type and contents of the current and given Node object * * @param node In subclasses this Node object is compared to the current Node object. * @return In sub-classes $true is returned if this Node object is the same as the given * Node object. In this generic class $false$ is always returned. */ virtual bool operator==(const Node& node) const { return false; } virtual Node* clone() const = 0; private: //! The type of this Node. Type _type; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/endelement.h0000664000175000017500000001300012256773774016737 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_EndElement_h #define cxxtools_xml_EndElement_h #include #include #include namespace cxxtools { namespace xml { /** * @brief An end element (Node) which represents a closing tag of an XML document. * * An end element is created when the parser reaches an end tag, for example $</a>$. * An EndElement object only stores the name of the tag. To access the attributes of the tag the * start tag has to be read. The body of the tag can be accessed by reading the previous * Character node(s). * * Use name() to get the name of the tag which was closed. * * When parsing $test$ a StartElement, a Character and finally an EndElement node is * created. If an empty tag is parsed, like for example $$, a StartElement and an EndElement * is created. * * @see StartElement * @see Node */ class CXXTOOLS_XML_API EndElement : public Node { public: /** * @brief Constructs a new EndElement object with the given (optional) string as tag name. * * @param name The name of the EndElement object. This is an optional parameter. * Default is an empty string. */ explicit EndElement(const String& name = String()) : Node(Node::EndElement), _name(name) { } /** * @brief Clones this EndElement object by creating a duplicate on the heap and returning it. * @return A cloned version of this EndElement object. */ EndElement* clone() const {return new EndElement(*this);} void clear() { _name.clear(); } /** * @brief Returns the tag name of the closing tag for which this EndElement object was created. * * When parsing test a StartElement, a Character and finally an EndElement node is * created. The EndElement has the name "a". If an empty tag is parsed, like for example , * a StartElement and an EndElement ("a") is created. * * @return The tag name of the closing tag for which this EndElement object was created. */ String& name() { return _name; } /** * @brief Returns the tag name of the closing tag for which this EndElement object was created. * * When parsing test a StartElement, a Character and finally an EndElement node is * created. The EndElement has the name "a". If an empty tag is parsed, like for example , * a StartElement and an EndElement ("a") is created. * * @return The tag name of the closing tag for which this EndElement object was created. */ const String& name() const { return _name; } /** * @brief Sets the tag name of the end tag for which this EndElement object was created. * @param name The new name for this EndElement object. */ void setName(const String& name) { _name = name; } /** * @brief Compares this EndElement object with the given node. * * This method returns $true$ if the given node also is a EndElement object and * the name of both EndElement objects is the same. Otherwise it returns $false$. * * @param node This Node object is compared to the current EndElement node object. * @return $true if this EndElement object is the same as the given node. */ virtual bool operator==(const Node& node) const; private: //! The tag name of this end tag. String _name; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/processinginstruction.h0000664000175000017500000001123312256773774021303 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_xml_ProcessingInstruction_h #define CXXTOOLS_xml_ProcessingInstruction_h #include #include #include namespace cxxtools { namespace xml { /** * @brief A ProcessingInstruction (PI) element (Node) of an XML document. * * A processing instruction can be used to add instructions to an XML document which is needed * and can be used by specific XML processing software. The data of a processing instruction * has no particular format and can contain plain Text or XML-like attribute/value-associations. * * To access the target, which may for example be a identifier for a specific XML processor, * the method target() can be used. To access the data for this processor the method data() * can be used. * * @see Node */ class CXXTOOLS_XML_API ProcessingInstruction : public Node { public: //! Constructs a new ProcessingInstruction. ProcessingInstruction() : Node(Node::ProcessingInstruction) { } void clear() { _target.clear(); _data.clear(); } /** * @brief Clones this CData object by creating a duplicate on the heap and returning it. * @return A cloned version of this CData object. */ ProcessingInstruction* clone() const {return new ProcessingInstruction(*this);} /** * @brief Returns the processor instruction's target. * * The target may be the XML processor for which this PI was added to the XML document. * * @return The target of this processing instruction. */ const String& target() const { return _target; } String& target() { return _target; } /** * @brief Sets the processor instruction's target. * * @param target The target for this processing instruction. */ void setTarget(const String& target) { _target = target; } /** * @brief Returns the processor instruction's data. * * The precise nature of the PI data depends on the XML processor for which this PI * was added to the XML document. It usually contains special instructions for this processor. * * @return The data of this processing instruction. */ const String& data() const { return _data; } String& data() { return _data; } /** * @brief Sets the processor instruction's data. * * @param data The data for this processing instruction. */ void setData(const String& data) { _data = data; } private: //! The target of this processing instruction. String _target; //! The data of this processing instruction. String _data; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/doctypedeclaration.h0000664000175000017500000000627612256773774020515 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_DocTypeDeclaration_h #define cxxtools_xml_DocTypeDeclaration_h #include #include #include namespace cxxtools { namespace xml { /** * @brief A DocType element (Node) of an XML document. * * A DocType element stores the document type of the document and contains an URI to a * file which contains the document type definition. * * Use content() to get the content of the DocType element. * * @see Node */ class CXXTOOLS_XML_API DocTypeDeclaration : public Node { public: /** * @brief Constructs a new DocTypeDeclaration object with the given string as content. */ DocTypeDeclaration() : Node(Node::DocType) { } void clear() { _content.clear(); } /** * @brief Clones this DocTypeDeclaration object by creating a duplicate on the heap and returning it. * @return A cloned version of this DocTypeDeclaration object. */ DocTypeDeclaration* clone() const { return new DocTypeDeclaration(*this); } /** * @brief Returns the content of this DocTypeDeclaration object. * @return The content of this DocTypeDeclaration object. */ const String& content() const { return _content; } String& content() { return _content; } /** * @brief Sets the content of this DocTypeDeclaration object. * @param content The new content for this DocTypeDeclaration object. */ void setContent(const String& content) { _content = content; } private: //! The content of this DocTypeDeclaration object. String _content; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/xmlformatter.h0000664000175000017500000001261612256773774017357 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlFormatter_h #define cxxtools_Xml_XmlFormatter_h #include #include #include namespace cxxtools { namespace xml { /** @brief Serialize objects or object data to XML Thic class performs XML serialization of a single object or object data. */ class XmlFormatter : public cxxtools::Formatter { public: /** @brief Construct a serializer without initializing the serializer for writing. The serializer can be "opened" for writing by calling method attach(). */ XmlFormatter(); /** @brief Construct a serializer writing to a byte stream The serializer will write the objects as XML with UTF-8 encoding to the output stream. */ XmlFormatter(std::ostream& os); /** @brief Construct a serializer writing to the given XmlWriter object The serializer will write the objects to the given XmlWriter object. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ XmlFormatter(cxxtools::xml::XmlWriter* writer); //! @brief Destructor ~XmlFormatter(); /** @brief Opens this serializer for writing into the given stream. The serializer will write the objects as XML with UTF-8 encoding to the output stream. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. */ void attach(std::ostream& os); /** @brief Opens this serializer for writing into the given XmlWriter object. The serializer will write the objects to the given XmlWriter object. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ void attach(cxxtools::xml::XmlWriter& writer); /** @brief Detaches the currently set writer from this object. Before detaching the writer, the underlaying stream is flushed. If there is no currently set writer, nothing happens. */ void detach(); //! @internal void flush(); void useXmlDeclaration(bool sw) { _writer->useXmlDeclaration(sw); } bool useXmlDeclaration() const { return _writer->useXmlDeclaration(); } void useIndent(bool sw) { _writer->useIndent(sw); } bool useIndent() const { return _writer->useIndent(); } void useEndl(bool sw) { _writer->useEndl(sw); } bool useEndl() const { return _writer->useEndl(); } void useAttributes(bool sw) { _useAttributes = sw; } bool useAttributes() const { return _useAttributes; } void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value); void beginArray(const std::string& name, const std::string& type); void finishArray(); void beginObject(const std::string& name, const std::string& type); void beginMember(const std::string& name); void finishMember(); void finishObject(); void finish(); private: void beginComplexElement(const std::string& name, const std::string& type, const String& category); //! @internal cxxtools::xml::XmlWriter* _writer; //! @internal std::auto_ptr _deleter; bool _useAttributes; }; } // namespace xml } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/xml/namespace.h0000664000175000017500000001071512256773774016565 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_Namespace_h #define cxxtools_Xml_Namespace_h #include #include #include namespace cxxtools { namespace xml { /** * @brief A Namespace element (Node) of an XML document. * * A namespace element stores a namespace uri which describes the namespace URI and a locally * usable prefix which can be added before a tag name to specify that this particular tag * is part of that namespace. * * Use namespaceUri() to get the namespace URI. Use prefix() to get the prefix. * * @see Node * @see NamespaceContext */ class CXXTOOLS_XML_API Namespace { public: /** * @brief Constructs a new Namespace object with the given namespace URI and prefix. * * @param namespaceURI The unique URI of this namespace. * @param prefix The namespace prefix which can be added to a tag name to specify that * this tag belongs to that namespace. */ Namespace(const String& namespaceUri, const String& prefix) : _prefix(prefix), _namespaceUri(namespaceUri) { } /** * @brief Returns the prefix of this namespace. * * The namespace prefix can be added to a tag name to specify that this tag belongs * to that namespace. * * @return The namespace prefix of this Namespace object. */ const String& prefix() const { return _prefix; } /** * @brief Sets the prefix of this namespace. * * The namespace prefix can be added to a tag name to specify that this tag belongs * to that namespace. * * @param prefix The namespace prefix for this Namespace object. */ void setPrefix(const String& prefix) { _prefix = prefix; } /** * @brief Returns the URI of this namespace. * * The URI is unique and identifies the namespace. * * @return The namespace URI of this Namespace object. */ const String& namespaceUri() const { return _namespaceUri; } /** * @brief Sets the URI of this namespace. * * The URI is unique and identifies the namespace. * * @param namespaceUri The namespace URI for this Namespace object. */ void setNamespaceUri(const String& namespaceUri) { _namespaceUri = namespaceUri; } /** * @brief Returns $true$ if this is the default namespace in the current XML document. Otherwise * $false$ is returned. * * @return $true$ if this is the default namespace; $false$ otherwise. */ bool isDefaultNamespaceDeclaration(); private: //! The prefix of this namespace. String _prefix; //! The namespace URI of this namespace. String _namespaceUri; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/xmlerror.h0000664000175000017500000000401612256773774016500 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlError_h #define cxxtools_Xml_XmlError_h #include #include namespace cxxtools { namespace xml { //! Exception that is thrown when a parse error occured. class CXXTOOLS_XML_API XmlError : public std::runtime_error { public: /** * @brief Creates a new ParseError object using the given reason and source info. * * @param what The reason of the parse error. * @param info Source info containing information about where the exception occured. */ XmlError(const std::string& what, unsigned line); unsigned line() const { return _line; } private: unsigned _line; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/xmlserializer.h0000664000175000017500000001350012266277345017510 00000000000000/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlSerializer_h #define cxxtools_Xml_XmlSerializer_h #include #include #include namespace cxxtools { namespace xml { /** @brief Serialize objects or object data to XML Thic class performs XML serialization of a single object or object data. */ class XmlSerializer { public: /** @brief Construct a serializer without initializing the serializer for writing. The serializer can be "opened" for writing by calling method attach(). */ XmlSerializer(); /** @brief Construct a serializer writing to a byte stream The serializer will write the objects as XML with UTF-8 encoding to the output stream. */ XmlSerializer(std::ostream& os); /** @brief Construct a serializer writing to the given XmlWriter object The serializer will write the objects to the given XmlWriter object. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ XmlSerializer(cxxtools::xml::XmlWriter* writer); //! @brief Destructor ~XmlSerializer(); /** @brief Opens this serializer for writing into the given stream. The serializer will write the objects as XML with UTF-8 encoding to the output stream. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. */ void attach(std::ostream& os); /** @brief Opens this serializer for writing into the given XmlWriter object. The serializer will write the objects to the given XmlWriter object. This method does not have to be called if this XmlSerializer object was constructed using the constructor that takes an ostream or XmlWriter object. If this method is called anyway or called twice an std::logic_error is thrown. This class will not free the given XmlWriter object. The caller is responsible to free it if needed. */ void attach(cxxtools::xml::XmlWriter& writer); /** @brief Detaches the currently set writer from this object. Before detaching the writer, the underlaying stream is flushed. If there is no currently set writer, nothing happens. */ void detach(); void useXmlDeclaration(bool sw) { _formatter.useXmlDeclaration(sw); } bool useXmlDeclaration() const { return _formatter.useXmlDeclaration(); } void useIndent(bool sw) { _formatter.useIndent(sw); } bool useIndent() const { return _formatter.useIndent(); } void useEndl(bool sw) { _formatter.useEndl(sw); } bool useEndl() const { return _formatter.useEndl(); } void useAttributes(bool sw) { _formatter.useAttributes(sw); } bool useAttributes() const { return _formatter.useAttributes(); } /** @brief Serialize an object to XML The serializer will serialize the object \a type as XML to the assigned stream. The string \a name will be used as the instance name of \a type and appear as the name of the XML element. The type must be serializable. */ template void serialize(const T& type, const std::string& name) { Decomposer decomposer; decomposer.begin(type); decomposer.setName(name); decomposer.format(_formatter); _formatter.finish(); _formatter.flush(); } void finish() { } template static std::string toString(const T& type, const std::string& name, bool beautify = false) { std::ostringstream os; XmlWriter writer(os, beautify ? XmlWriter::UseXmlDeclaration | XmlWriter::UseIndent | XmlWriter::UseEndl : XmlWriter::UseXmlDeclaration); XmlSerializer s(&writer); s.serialize(type, name); s.finish(); return os.str(); } private: XmlFormatter _formatter; }; } // namespace xml } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/xml/namespacecontext.h0000664000175000017500000001070712256773774020173 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_NamespaceContext_h #define cxxtools_xml_NamespaceContext_h #include #include #include #include namespace cxxtools { namespace xml { /** * @brief Manages all namespaces which are valid for a specific XML document. * * Namespaces can be added using the method addNamespace() and can be removed using * the method removeNamespace(). * * To get the namespace URI for a prefix the method namespaceUri() can be used. To * determine the prefix for a namespace the method prefix() can be used. * * @see Namespace */ class CXXTOOLS_XML_API NamespaceContext { public: //! Creates a new NamespaceContext object which manages the namespaces of an XML document. NamespaceContext() { } /** * @brief Returns the namespace URI of the namespace which has the prefix that is passed to * this method. * * If no namespace with the given prefix exists, an empty String is returned. * * @param prefix The namespace URI for the namespace with this prefix is returned. * @return The namespace URI for the prefix or an empty String if the prefix was not found. */ const String& namespaceUri(const String& prefix) const; /** * @brief Returns the prefix for the namespace which has the URI that is passed to this method. * * If no namespace with this URI exists, an empty String is returned. * * @param namespaceUri The prefix of the namespace with this namespace URI is returned. * @return The namespace URI for the prefix or an empty String if the prefix was not found. */ const String& prefix(const String& namespaceUri) const ; /** * @brief Associates the element name (elementName) with the given namespace (ns). * * The stored namespace can be retrieved by calling namespaceUri() or prefix(). To * remove the association between the element name and namespace again, the method * removeNamespace() can be used. * * @param elementName Associates this element name with the also given namespace (ns). * @param ns Associates this namespace with the also given element name (elementName). */ void addNamespace(const String& elementName, const Namespace& ns); /** * @brief Removes the associates of the given element name (elementName) to the namespace. * * @param elementName The associates for this element name is removed. */ void removeNamespace(const String& elementName) { _namespaceScopes.erase(elementName); } private: //! Multimap that stores the assocations between an element name and its namespace. typedef std::multimap ScopeMap; std::multimap _namespaceScopes; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/api.h0000664000175000017500000000334312256773774015401 00000000000000/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_XML_API_H #define CXXTOOLS_XML_API_H #include #if defined(CXXTOOLS_XML_API_EXPORT) # define CXXTOOLS_XML_API CXXTOOLS_EXPORT # else # define CXXTOOLS_XML_API CXXTOOLS_IMPORT # endif namespace cxxtools { /** @namespace cxxtools::xml @brief XML Parsing and Generation */ namespace xml { } // namespace xml } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/xml/xmlreader.h0000664000175000017500000001414112256773774016611 00000000000000/* * Copyright (C) 2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_XmlReader_h #define cxxtools_Xml_XmlReader_h #include #include #include #include #include #include namespace cxxtools { namespace xml { class Node; class StartElement; class EntityResolver; /** @brief Reads XML as a Stream of XML Nodes. This class operates on an input stream from which XML character data is read and parsed. The parser will only parse the XML document as far as the user read data from it. To read the current element (Node) the method get() can be used. To parse and read the next element the method next() can be used. Only when next() or any corresponding method or operator is called, the next chunk of XML input data is parsed. To parse a XML-document, a XmlReader constructed with an input stream from which the XML document is to be read. The current XML element (Node) can be read using get(). Every call to next() will parse the next element, position the cursor to the next element and return the parsed element. The returned element is of type Node, which is the super-class for all XML element classes. The class Node has a method type() which returns the type of the read element. Depending on the type the generic Node object may be cast to the more concrete element object. For example a Node object with a node type of Node::StartElement can be cast to StartElement. Parsing using next() will continue until the end of the document is reached which will resultin a EndDocument element to be returned by next() and get(). This class also provides the method current() to obtain an iterator which basically works the same way like using using get() and next() directly. The iterator can be set to the next element by using the ++ operator. The current element can be accessed by dereferencing the iterator. @see Node */ class CXXTOOLS_XML_API XmlReader { public: class Iterator { public: Iterator() : _stream(0) , _node(0) { } Iterator(XmlReader& xis) : _stream(&xis) , _node(0) { _node = &_stream->get(); } Iterator(const Iterator& it) : _stream(it._stream), _node(it._node) { } ~Iterator() { } Iterator& operator=(const Iterator& it) { _stream = it._stream; _node = it._node; return *this; } inline const Node& operator*() const { return *_node; } inline const Node* operator->() const { return _node; } Iterator& operator++() { if(_node->type() == Node::EndDocument) _node = 0; else _node = &_stream->next(); return *this; } inline bool operator==(const Iterator& it) const { return _node == it._node; } inline bool operator!=(const Iterator& it) const { return _node != it._node; } private: XmlReader* _stream; const Node* _node; }; public: /* TODO: Consider the following processing flags: - ReportProcessingInstructions - IgnoreWhitespace - ReportComments - ReportDocumentStart */ XmlReader(std::istream& is, int flags = 0); XmlReader(std::basic_istream& is, int flags = 0); ~XmlReader(); void reset(std::basic_istream& is, int flags = 0); void reset(std::istream& is, int flags = 0); const cxxtools::String& documentVersion() const; const cxxtools::String& documentEncoding() const; bool standaloneDocument() const; EntityResolver& entityResolver(); const EntityResolver& entityResolver() const; size_t depth() const; Iterator current() { return Iterator(*this); } Iterator end() const { return Iterator(); } //! @brief Get current element const Node& get(); //! @brief Get next element from stream const Node& next(); bool advance(); const StartElement& nextElement(); const Node& nextTag(); std::size_t line() const; private: class XmlReaderImpl* _impl; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/comment.h0000664000175000017500000001037612256773774016276 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_Xml_Comment_h #define CXXTOOLS_Xml_Comment_h #include #include #include namespace cxxtools { namespace xml { /** * @brief A Comment element (Node) of an XML document, containing the comment's content. * * A Comment element stores the content of a comment. There is no interpretation of the * comment's Text before it is stored. * * Use Text() to get the content/Text of the comment element without the <!-- and -->. * * When parsing a comment %<!-- This is a comment -->$ the following Text will be * returned by Text(): $This is a comment$ * * @see Node */ class CXXTOOLS_XML_API Comment : public Node { public: /** * @brief Constructs a new Comment object with the given string as content/Text. * * @param Text The content/Text of the Comment object. */ explicit Comment(const String& text) : Node(Node::Comment) , _text(text) { } /** * @brief Clones this Comment object by creating a duplicate on the heap and returning it. * @return A cloned version of this Comment object. */ Comment* clone() const {return new Comment(*this);} /** * @brief Returns the content/Text of this Comment object. * * The content includes everything that is between the start and end "tags" of the comment * without being parsed. When parsing a comment %<!-- This is a comment -->$ the following * Text will be returned: $This is a comment$ * * @return The Text of this Comment object. */ String& text() { return _text; } /** * @brief Returns the content/Text of this Comment object. * * The content includes everything that is between the start and end "tags" of the comment * without being parsed. When parsing a comment %<!-- This is a comment -->$ the following * Text will be returned: $This is a comment$ * * @return The Text of this Comment object. */ const String& text() const { return _text; } /** * @brief Sets the Text of this Comment object. * @param text The new Text for this Comment object. */ void setText(const String& text) { _text = text; } private: //! The Text of this Comment object. String _text; }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/enddocument.h0000664000175000017500000000465012256773774017137 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Xml_EndDocument_h #define cxxtools_Xml_EndDocument_h #include #include namespace cxxtools { namespace xml { /** * @brief A Node which represents the end of the XML document. * * The last Node/Element which is read from a document is the EndDocument-node. It is read after * the last tag, Text or comment was read from the XML document. This is similar to an eof character * at the end of a file read. * * @see Node */ class CXXTOOLS_XML_API EndDocument : public Node { public: //! Creates an EndDocument object. EndDocument() : Node(Node::EndDocument) { } /** * @brief Clones this EndDocument object by creating a duplicate on the heap and returning it. * @return A cloned version of this EndDocument object. */ EndDocument* clone() const { return new EndDocument(*this); } }; } } #endif cxxtools-2.2.1/include/cxxtools/xml/startelement.h0000664000175000017500000003002312256773774017332 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xml_StartElement_h #define cxxtools_xml_StartElement_h #include #include #include #include #include #include namespace cxxtools { namespace xml { /** * @brief A class representing a single attribute of a tag from an XML document. * * An XML attribute consists of the attribute's name and the attribute's value. * The name can be retrieved using the method name(). The value can be retrieved * using the method value(). * * The attributes of a tag are retrieved from the document when the opening tag * is parsed. The attributes are stored in a StartElement object from where they * can be retrieved. */ class CXXTOOLS_XML_API Attribute { public: //! Constructs a new Attribute object with an empty name and value. Attribute() { } /** * @brief Constructs a new Attribute using the given name and value. * * @param name The name of the XML attribute. * @param value The value of the XML attribute. */ Attribute(const String& name, const String& value) : _name(name), _value(value) { } /** * @brief Returns the name of this attribute. * @return The attribute's name. */ const String& name() const { return _name; } String& name() { return _name; } /** * @brief Sets the name of this attribute. * @param name The new name of this attribute. */ void setName(const String& name) { _name = name; } /** * @brief Returns the value of this attribute. * @return The attribute's value. */ const String& value() const { return _value; } String& value() { return _value; } /** * @brief Sets the value of this attribute. * @param value The new value of this attribute. */ void setValue(const String& value) { _value = value; } void clear() { _name.clear(); _value.clear(); } private: //! The name of this attribute. String _name; //! The value of this attribute. String _value; }; /** * @brief A start element (Node) which represents an opening tag of an XML document. * * A start element is created when the parser reaches a start tag, for example $<a>$. * A StartElement object not only stores the name of the tag and its namespace information, * but also stores the attributes of the tag. These attributes can be accessed by calling * attributes(), attribute() and hasAttribute(). * * Use name() to get the name of the tag which was closed. * * When parsing $test$ a StartElement, a Character and finally an EndElement node is * created. If an empty tag is parsed, like for example $$, a StartElement and an EndElement * is created. * * @see EndElement * @see Node * @see Attribute */ class CXXTOOLS_XML_API StartElement : public Node { public: //! Constructs a new StartElement object with no name and an empty attribute list. StartElement() : Node(Node::StartElement) { } /** * @brief Constructs a new StartElement object with the given string as tag name. * * @param name The name of the EndElement object. This is an optional parameter. * Default is an empty string. */ StartElement(const String& name) : Node(Node::StartElement), _name(name) { } /** * @brief Clones this StartElement object by creating a duplicate on the heap and returning it. * @return A cloned version of this StartElement object. */ StartElement* clone() const {return new StartElement(*this);} void clear() { _name.clear(); _attributes.clear(); } /** * @brief Returns the tag name of the opening tag for which this StartElement object was created. * * When parsing test a StartElement, a Character and finally an EndElement node is * created. The StartElement has the name "a". If an empty tag is parsed, like for example , * only a StartElement and an EndElement ("a") is created. * * @return The tag name of the opening tag for which this StartElement object was created. */ String& name() {return _name;} /** * @brief Returns the tag name of the opening tag for which this StartElement object was created. * * When parsing test a StartElement, a Character and finally an EndElement node is * created. The StartElement has the name "a". If an empty tag is parsed, like for example , * only a StartElement and an EndElement ("a") is created. * * @return The tag name of the opening tag for which this StartElement object was created. */ const String& name() const {return _name;} /** * @brief Sets the tag name of the end start for which this StartElement object was created. * @param name The new name for this StartElement object. */ void setName(const String& name) {_name = name;} /** * @brief Add the given attribute to the attribute list of this start tag. * * This StartElement object holds a list of attributes, which consist of the attribute name * and the attribute value. The attributes can be read using attributes() or attribute(). * * @param attribute The attribute which is added to this object's attribute list. */ void addAttribute(const Attribute& attribute) {_attributes.push_back(attribute);} /** * @brief Returns the attribute list of this StartElement which contains all attributes of the tag. * * This StartElement object holds a list of attributes, which consist of the attribute name * and the attribute value. This method returns all attributes of the represented tag. The list * can be iterated using a iterator. To access a specific attribute the method attribute() can be * used. * * @return A list containing all attributes of the tag this StartElement represents. */ const std::list& attributes() const {return _attributes;} /** * @brief Returns the value of the attribute with the given name. * * This StartElement object holds a list of attributes, which consist of the attribute name * and the attribute value. This methods returns the value of a single attribute. To access * all attributes of this StartElement the method attributes() can be used. * * If no attribute with the given name exists, an empty string is returned. * * @param attributeName The value of the attribute with this name is returned. * @return The value of the request attribute; or an empty string if there is no attribute * with this name. */ const String& attribute(const String& attributeName) const; /** * @return Checks if the StartElement has an attribute with the given name. * * This method returns $true$ if an attribute with the given name exists in this * StartElement. If no attribute with this name exist $false$ is returned. * * @param attributeName It is checked if an attribute with this attribute name exists. * @return $true$ if an attribute with this name exists; $false$ otherwise. */ bool hasAttribute(const String& attributeName) const; /** * @brief Returns the namespace conText of this StartElement. * * @return NamespaceContext The namespace conText of this StartElment. * @see NamespaceContext */ const NamespaceContext& namespaceContext() const {return _namespaceContext;} /** * @brief Sets the namespace conText for this StartElement. * * @param conText The new namespace conText for this StartElment. * @see NamespaceContext */ void setNamespaceContext(const NamespaceContext& conText) {_namespaceContext = conText;} /** * @brief Returns the namespace uri for the given tag prefix in this StartElments namespace conText. * * The namespace uri is determined using the method NamespaceContext::namespaceUri(). * If no namespace uri exists for this prefix an empty string is returned. * * @param prefix The prefix for which the namespace uri is returned. * @return The namespace uri for the given prefix; or an empty string if no namespace uri exists * for this prefix. */ const String& namespaceUri(const String& prefix) const {return _namespaceContext.namespaceUri(prefix);} /** * @brief Compares this StartElement object with the given node. * * This method returns $true$ if the given node also is a StartElement object and * the content of both StartElement objects is the same. Otherwise it returns $false$. * * @param node This Node object is compared to the current StartElement node object. * @return $true if this StartElement object is the same as the given node. */ virtual bool operator==(const Node& node) const; private: //! The name of the underlying tag. String _name; //! The list which contains all attributes of the underlying tag. std::list _attributes; //! The namespace conText of this StartElement. NamespaceContext _namespaceContext; }; } } #endif cxxtools-2.2.1/include/cxxtools/function.h0000664000175000017500000000311212256773774015647 00000000000000/* * Copyright (C) 2005 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Function_h #define cxxtools_Function_h #include #include #include namespace cxxtools { #include } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/ioerror.h0000664000175000017500000000725512256773774015517 00000000000000/* * Copyright (C) 2004-2006 Marc Boris Duerner * Copyright (C) 2005 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_IOERROR_H #define CXXTOOLS_IOERROR_H #include #include #include namespace cxxtools { class CXXTOOLS_API IOError : public std::ios::failure { public: explicit IOError(const std::string& what); ~IOError() throw() {} }; class CXXTOOLS_API IOTimeout : public IOError { public: IOTimeout(); ~IOTimeout() throw() {} }; class CXXTOOLS_API AccessFailed : public IOError { public: explicit AccessFailed(const std::string& what); ~AccessFailed() throw() {} }; class CXXTOOLS_API PermissionDenied : public AccessFailed { public: explicit PermissionDenied(const std::string& resource); ~PermissionDenied() throw() {} }; class CXXTOOLS_API DeviceNotFound : public AccessFailed { public: explicit DeviceNotFound(const std::string& device); ~DeviceNotFound() throw() {} }; class CXXTOOLS_API FileNotFound : public AccessFailed { public: explicit FileNotFound(const std::string& path); ~FileNotFound() throw() {} }; /** @brief A directory could not be found at a given path */ class CXXTOOLS_API DirectoryNotFound : public AccessFailed { public: /** @brief Construct from path and source info Constructs the exception from the path where the directory could not be found and the location in the source code where he exception was thrown. */ explicit DirectoryNotFound(const std::string& path); //! @brief Destructor ~DirectoryNotFound() throw() {} }; class CXXTOOLS_API IOPending : public IOError { public: explicit IOPending(const std::string& what); ~IOPending() throw() {} }; class CXXTOOLS_API DeviceClosed : public IOError { public: explicit DeviceClosed(const std::string& what); DeviceClosed(const char* what); ~DeviceClosed() throw() {} }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/csvserializer.h0000664000175000017500000000600512256773774016713 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVSERIALIZER_H #define CXXTOOLS_CSVSERIALIZER_H #include #include namespace cxxtools { class CsvSerializer { CsvSerializer(const CsvSerializer&); CsvSerializer& operator= (const CsvSerializer&); public: CsvSerializer(std::ostream& os, TextCodec* codec = new Utf8Codec()) : _formatter(new CsvFormatter(os, codec)) { } CsvSerializer(TextOStream& os) : _formatter(new CsvFormatter(os)) { } ~CsvSerializer() { delete _formatter; } void selectColumn(const std::string& title) { _formatter->selectColumn(title); } void selectColumn(const std::string& memberName, const std::string& title) { _formatter->selectColumn(memberName, title); } void delimiter(Char delimiter) { _formatter->delimiter(delimiter); } void quote(Char quote) { _formatter->quote(quote); } void lineEnding(const String& le) { _formatter->lineEnding(le); } template void serialize(const T& type) { Decomposer decomposer; decomposer.begin(type); decomposer.format(*_formatter); _formatter->finish(); } private: CsvFormatter* _formatter; }; } #endif // CXXTOOLS_CSVSERIALIZER_H cxxtools-2.2.1/include/cxxtools/iconvwrap.h0000664000175000017500000000473112256773774016042 00000000000000/* * Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. */ #ifndef CXXTOOLS_ICONVWRAP_H #define CXXTOOLS_ICONVWRAP_H #include namespace cxxtools { /** Wraps iconv. */ class iconvwrap { public: /** Create iconvwrap object. */ iconvwrap(); /** Create iconvwrap object and initializes it. * * @param tocode destination encoding name * @param fromcode source encoding name */ iconvwrap(const char *tocode, const char *fromcode); /** Close iconvwrap object, release resouces. * * @return true on succes, otherwise return false and set errno. */ bool close(); /** Recode input string into output buffer. * * @param inbuf * @param inbytesleft * @param outbuf * @param outbytesleft * @return true if all succesfully converted, on error returns false * and se errno */ bool convert(char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); /** Return true if IConv is open, false otherwise. */ bool is_open(); /** (Re)initializes iconvwrap object. * * @param tocode target encoding name * @param fromcode source encoding name * @return true on succes, on error return false and set errno */ bool open(const char *tocode, const char *fromcode); /** Destroy iconvwrap object. */ ~iconvwrap(); protected: iconv_t cd; }; } #endif cxxtools-2.2.1/include/cxxtools/jsonparser.h0000664000175000017500000000670512266277345016215 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONPARSER_H #define CXXTOOLS_JSONPARSER_H #include #include namespace cxxtools { class DeserializerBase; class CXXTOOLS_API JsonParser { class JsonStringParser { String _str; unsigned _count; unsigned short _value; enum { state_0, state_esc, state_hex } _state; public: JsonStringParser() : _state(state_0) { } bool advance(Char ch); void clear() { _state = state_0; _str.clear(); } const String& str() const { return _str; } }; public: JsonParser(); void begin(DeserializerBase& handler) { _state = state_0; _token.clear(); _deserializer = &handler; } int advance(Char ch); // 1: end character detected; -1: end but char not consumed; 0: no end void finish(); private: enum { state_0, state_object, state_object_name, state_object_after_name, state_object_value, state_object_e, state_object_next_member, state_array, state_array_value, state_array_e, state_string, state_number, state_float, state_token, state_comment0, state_commentline, state_comment, state_comment_e, state_end } _state, _nextState; String _token; DeserializerBase* _deserializer; JsonStringParser _stringParser; JsonParser* _next; }; } #endif // CXXTOOLS_JSONPARSER_H cxxtools-2.2.1/include/cxxtools/iostream.h0000664000175000017500000001613612256773774015657 00000000000000/* * Copyright (C) 2005-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_System_IOStream_h #define cxxtools_System_IOStream_h #include #include #include #include namespace cxxtools { //! @brief An istream with peeking capability. template class BasicIStream : public std::basic_istream { public: explicit BasicIStream(BasicStreamBuffer* buffer = 0) : std::basic_istream( buffer ), _buffer(buffer) { } ~BasicIStream() { } //! @brief Access to the underlying buffer. BasicStreamBuffer* attachedBuffer() { return _buffer; } BasicStreamBuffer* attachBuffer(BasicStreamBuffer* buffer) { BasicStreamBuffer* tmp = _buffer; _buffer = buffer; this->rdbuf(buffer); return tmp; } //! @brief Peeks bytes in the stream buffer. /** The number of bytes that can be peeked depends on the current stream buffer get area and maybe less than requested, similar to istream::readsome(). */ std::streamsize peeksome(CharT* buffer, std::streamsize n) { if(this->rdbuf() == _buffer) return _buffer->speekn(buffer, n); if(n > 0) { buffer[0] = this->peek(); return 1; } return 0; } private: BasicStreamBuffer* _buffer; }; //! @brief An ostream with peeking capability. template class BasicOStream : public std::basic_ostream { public: explicit BasicOStream(BasicStreamBuffer* buffer = 0) : std::basic_ostream( buffer ), _buffer(buffer) { } ~BasicOStream() {} //! @brief Access to the underlying buffer. BasicStreamBuffer* attachedBuffer() { return _buffer; } BasicStreamBuffer* attachBuffer(BasicStreamBuffer* buffer) { BasicStreamBuffer* tmp = _buffer; _buffer = buffer; this->rdbuf(buffer); return tmp; } std::streamsize writesome(CharT* buffer, std::streamsize n) { std::basic_streambuf* current = std::basic_ios::rdbuf(); if(current != _buffer) return 0; std::streamsize avail = _buffer->out_avail(); if(avail == 0) { return 0; } n = std::min(avail, n); return _buffer->sputn(buffer, n); } private: BasicStreamBuffer* _buffer; }; //! @brief An iostream with peeking capability. template class BasicIOStream : public std::basic_iostream { public: explicit BasicIOStream(BasicStreamBuffer* buffer = 0) : std::basic_iostream( buffer ), _buffer(buffer) { } ~BasicIOStream() { } //! @brief Access to the underlying buffer. BasicStreamBuffer* attachedBuffer() { return _buffer; } BasicStreamBuffer* attachBuffer(BasicStreamBuffer* buffer) { BasicStreamBuffer* tmp = _buffer; _buffer = buffer; this->rdbuf(buffer); return tmp; } //! @brief Peeks bytes in the stream buffer. /** The number of bytes that can be peeked depends on the current stream buffer get area and maybe less than requested, similar to istream::readsome(). */ std::streamsize peeksome(CharT* buffer, std::streamsize n) { if(this->rdbuf() == _buffer) return _buffer->speekn(buffer, n); if(n > 0) { buffer[0] = this->peek(); return 1; } return 0; } std::streamsize writesome(CharT* buffer, std::streamsize n) { std::basic_streambuf* current = std::basic_ios::rdbuf(); if(current != _buffer) return 0; std::streamsize avail = _buffer->out_avail(); if(avail == 0) { return 0; } n = std::min(avail, n); return _buffer->sputn(buffer, n); } private: BasicStreamBuffer* _buffer; }; class CXXTOOLS_API IStream : public BasicIStream { public: explicit IStream(size_t bufferSize = 8192, bool extend = false); ~IStream(); explicit IStream(IODevice& device, size_t bufferSize = 8192, bool extend = false); StreamBuffer& buffer(); IODevice* attachDevice(IODevice& device); IODevice* attachedDevice(); private: StreamBuffer _buffer; }; class CXXTOOLS_API OStream : public BasicOStream { public: explicit OStream(size_t bufferSize = 8192, bool extend = false); explicit OStream(IODevice& device, size_t bufferSize = 8192, bool extend = false); ~OStream(); StreamBuffer& buffer(); IODevice* attachDevice(IODevice& device); IODevice* attachedDevice(); private: StreamBuffer _buffer; }; class CXXTOOLS_API IOStream : public BasicIOStream { public: explicit IOStream(size_t bufferSize = 8192, bool extend = false); explicit IOStream(IODevice& device, size_t bufferSize = 8192, bool extend = false); ~IOStream(); StreamBuffer& buffer(); IODevice* attachDevice(IODevice& device); IODevice* attachedDevice(); private: StreamBuffer _buffer; }; } // !namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/multifstream.h0000664000175000017500000000656312256773774016553 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MULTIFSTREAM_H #define CXXTOOLS_MULTIFSTREAM_H #include #include #include #include namespace cxxtools { /** Read multiple files as one stream. Multiple files are */ class multifstreambuf : public std::streambuf { glob_t mglob; unsigned current; std::filebuf file; char ch; typedef std::queue > patterns_type; patterns_type patterns; public: multifstreambuf(); explicit multifstreambuf(const char* pattern, int flags = 0); ~multifstreambuf(); bool open_next(); int_type overflow(int_type c); int_type underflow(); int sync(); const char* current_filename() const { return mglob.gl_pathv[current]; } void add_pattern(const std::string& pattern, int flags = 0) { patterns.push(patterns_type::value_type(pattern, flags)); } }; class multi_ifstream : public std::istream { multifstreambuf buffer; public: multi_ifstream() : std::istream(0) { init(&buffer); } multi_ifstream(const char* pattern, int flags = 0) : std::istream(0), buffer(pattern, flags) { init(&buffer); } const char* current_filename() const { return buffer.current_filename(); } void add_pattern(const std::string& pattern, int flags = 0) { buffer.add_pattern(pattern, flags); } /// stl-compatible inserter class pattern_inserter : public std::iterator { multi_ifstream& m; public: pattern_inserter(multi_ifstream& m_) : m(m_) { } pattern_inserter& operator= (const std::string& p) { m.add_pattern(p); return *this; } pattern_inserter& operator* () { return *this; } pattern_inserter& operator++ () { return *this; } pattern_inserter& operator++ (int) { return *this; } }; pattern_inserter back_inserter() { return pattern_inserter(*this); } }; } #endif // CXXTOOLS_MULTIFSTREAM_H cxxtools-2.2.1/include/cxxtools/timespan.h0000664000175000017500000002440712266277345015646 00000000000000/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Timespan_h #define cxxtools_Timespan_h #include #include #include namespace cxxtools { /** @brief Represents time spans up to microsecond resolution. @ingroup DateTime */ class Timespan { public: //! @brief Creates a zero Timespan. Timespan() : _span(0) {} //! @brief Creates a Timespan. Timespan(int64_t microseconds) : _span(microseconds) { } /** @brief Creates a Timespan. Useful for creating a Timespan from a struct timeval. */ Timespan(long seconds, long microseconds) : _span(int64_t(seconds)*Seconds + microseconds) { } //! @brief Creates a Timespan. Timespan(int days, int hours, int minutes, int seconds, int microseconds); //! @brief Creates a Timespan from another one. Timespan(const Timespan& timespan); //! @brief Destroys the Timespan. ~Timespan() {} //! @brief Assignment operator. Timespan& operator=(const Timespan& timespan); //! @brief Assignment operator. Timespan& operator=(int64_t microseconds); //! @brief Assigns a new span. Timespan& set(int days, int hours, int minutes, int seconds, int microseconds); /** @brief Assigns a new span. Useful for assigning from a struct timeval. */ Timespan& set(long seconds, long microseconds); //! @brief Swaps the Timespan with another one. void swap(Timespan& timespan); bool operator==(const Timespan& ts) const; bool operator!=(const Timespan& ts) const; bool operator>(const Timespan& ts) const; bool operator>=(const Timespan& ts) const; bool operator<(const Timespan& ts) const; bool operator<=(const Timespan& ts) const; bool operator==(int64_t microseconds) const; bool operator!=(int64_t microseconds) const; bool operator>(int64_t microseconds) const; bool operator>=(int64_t microseconds) const; bool operator<(int64_t microseconds) const; bool operator<=(int64_t microseconds) const; Timespan operator+(const Timespan& d) const; Timespan operator-(const Timespan& d) const; Timespan& operator+=(const Timespan& d); Timespan& operator-=(const Timespan& d); Timespan operator+(int64_t microseconds) const; Timespan operator-(int64_t microseconds) const; Timespan& operator+=(int64_t microseconds); Timespan& operator-=(int64_t microseconds); //! @brief Returns the number of days. int days() const; //! @brief Returns the number of hours (0 to 23). int hours() const; //! @brief Returns the total number of hours. int totalHours() const; //! @brief Returns the number of minutes (0 to 59). int minutes() const; //! @brief Returns the total number of minutes. int totalMinutes() const; //! @brief Returns the number of seconds (0 to 59). int seconds() const; //! @brief Returns the total number of seconds. int totalSeconds() const; //! @brief Returns the number of milliseconds (0 to 999). int msecs() const; //! @brief Returns the total number of milliseconds. int64_t totalMSecs() const; //! @brief Returns the total number of microseconds. int64_t totalUSecs() const { return _span; } /** @brief Returns the fractions of a millisecond in microseconds (0 to 999). */ int microseconds() const; /** @brief Returns the fractions of a second in microseconds (0 to 999). */ int useconds() const; //! @brief Returns the total number of microseconds. int64_t toUSecs() const; //! @brief The number of microseconds in a millisecond. //static const int64_t Milliseconds; //! @brief The number of microseconds in a second. //static const int64_t Seconds; //! @brief The number of microseconds in a minute. //static const int64_t Minutes; //! @brief The number of microseconds in a hour. //static const int64_t Hours; //! @brief The number of microseconds in a day. //static const int64_t Days; static const int64_t Milliseconds = 1000; static const int64_t Seconds = 1000 * Timespan::Milliseconds; static const int64_t Minutes = 60 * Timespan::Seconds; static const int64_t Hours = 60 * Timespan::Minutes; static const int64_t Days = 24 * Timespan::Hours; //! @brief returns the current time as a timespan value. static Timespan gettimeofday(); private: int64_t _span; }; inline int Timespan::days() const { return int(_span/Days); } inline int Timespan::hours() const { return int((_span/Hours) % 24); } inline int Timespan::totalHours() const { return int(_span/Hours); } inline int Timespan::minutes() const { return int((_span/Minutes) % 60); } inline int Timespan::totalMinutes() const { return int(_span/Minutes); } inline int Timespan::seconds() const { return int((_span/Seconds) % 60); } inline int Timespan::totalSeconds() const { return int(_span/Seconds); } inline int Timespan::msecs() const { return int((_span/Milliseconds) % 1000); } inline int64_t Timespan::totalMSecs() const { return _span/Milliseconds; } inline int Timespan::microseconds() const { return int(_span % 1000); } inline int Timespan::useconds() const { return int(_span % 1000000); } inline int64_t Timespan::toUSecs() const { return _span; } inline bool Timespan::operator == (const Timespan& ts) const { return _span == ts._span; } inline bool Timespan::operator != (const Timespan& ts) const { return _span != ts._span; } inline bool Timespan::operator > (const Timespan& ts) const { return _span > ts._span; } inline bool Timespan::operator >= (const Timespan& ts) const { return _span >= ts._span; } inline bool Timespan::operator < (const Timespan& ts) const { return _span < ts._span; } inline bool Timespan::operator <= (const Timespan& ts) const { return _span <= ts._span; } inline bool Timespan::operator == (int64_t microseconds) const { return _span == microseconds; } inline bool Timespan::operator != (int64_t microseconds) const { return _span != microseconds; } inline bool Timespan::operator > (int64_t microseconds) const { return _span > microseconds; } inline bool Timespan::operator >= (int64_t microseconds) const { return _span >= microseconds; } inline bool Timespan::operator < (int64_t microseconds) const { return _span < microseconds; } inline bool Timespan::operator <= (int64_t microseconds) const { return _span <= microseconds; } inline void swap(Timespan& s1, Timespan& s2) { s1.swap(s2); } inline Timespan::Timespan(int days, int hours, int minutes, int seconds, int microseconds) : _span( int64_t(microseconds) + int64_t(seconds)*Seconds + int64_t(minutes)*Minutes + int64_t(hours)*Hours + int64_t(days)*Days ) { } inline Timespan::Timespan(const Timespan& timespan) : _span(timespan._span) { } inline Timespan& Timespan::operator=(const Timespan& timespan) { _span = timespan._span; return *this; } inline Timespan& Timespan::operator=(int64_t microseconds) { _span = microseconds; return *this; } inline Timespan& Timespan::set(int days, int hours, int minutes, int seconds, int microseconds) { _span = int64_t(microseconds) + int64_t(seconds)*Seconds + int64_t(minutes)*Minutes + int64_t(hours)*Hours + int64_t(days)*Days; return *this; } inline Timespan& Timespan::set(long seconds, long microseconds) { _span = int64_t(seconds)*Seconds + int64_t(microseconds); return *this; } inline void Timespan::swap(Timespan& timespan) { std::swap(_span, timespan._span); } inline Timespan Timespan::operator + (const Timespan& d) const { return Timespan(_span + d._span); } inline Timespan Timespan::operator - (const Timespan& d) const { return Timespan(_span - d._span); } inline Timespan& Timespan::operator += (const Timespan& d) { _span += d._span; return *this; } inline Timespan& Timespan::operator -= (const Timespan& d) { _span -= d._span; return *this; } inline Timespan Timespan::operator + (int64_t microseconds) const { return Timespan(_span + microseconds); } inline Timespan Timespan::operator - (int64_t microseconds) const { return Timespan(_span - microseconds); } inline Timespan& Timespan::operator += (int64_t microseconds) { _span += microseconds; return *this; } inline Timespan& Timespan::operator -= (int64_t microseconds) { _span -= microseconds; return *this; } std::ostream& operator<< (std::ostream& out, const Timespan& ht); } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/argout.h0000664000175000017500000000650512256773774015334 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STDOUT_H #define CXXTOOLS_STDOUT_H #include #include #include namespace cxxtools { /** * Helper class for redirecting output to stdout or file using command line switch. * * Using this class it is easy to provide a command line switch to the user * to redirect output to a file. * * Examples: * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgOut out(argc, argv, 'o'); * out << "this is printed to std::cout or to a file when a file name with the -o option is passed" << std::endl; * } * \endcode * * \code * int main(int argc, char* argv[]) * { * cxxtools::ArgOut out(argc, argv); * out << "this is printed to std::cout or to a file when a file name is passed as a parameter" << std::endl; * } * \endcode * */ class ArgOut : public std::ostream { std::ofstream _ofile; void doInit(const Arg& arg) { std::streambuf* buf; if (arg.isSet()) { _ofile.open(arg); buf = _ofile.rdbuf(); } else buf = std::cout.rdbuf(); init(buf); } public: ArgOut(int& argc, char* argv[], char option) { Arg ofile(argc, argv, option); doInit(ofile); } ArgOut(int& argc, char* argv[], const char* option) { Arg ofile(argc, argv, option); doInit(ofile); } ArgOut(int& argc, char* argv[]) { Arg ofile(argc, argv); doInit(ofile); } bool redirected() const { return rdbuf() != std::cout.rdbuf(); } }; } #endif // CXXTOOLS_STDOUT_H cxxtools-2.2.1/include/cxxtools/jsonformatter.h0000664000175000017500000000761412256773774016732 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONFORMATTER_H #define CXXTOOLS_JSONFORMATTER_H #include #include namespace cxxtools { class JsonFormatter : public Formatter { public: JsonFormatter() : _ts(0), _level(1), _lastLevel(0), _beautify(false) { } explicit JsonFormatter(std::basic_ostream& ts) : _ts(0), _level(1), _lastLevel(0), _beautify(false) { begin(ts); } void begin(std::basic_ostream& ts); void finish(); virtual void addValueString(const std::string& name, const std::string& type, const String& value); virtual void addValueStdString(const std::string& name, const std::string& type, const std::string& value); virtual void addValueBool(const std::string& name, const std::string& type, bool value); virtual void addValueInt(const std::string& name, const std::string& type, int_type value); virtual void addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value); virtual void addValueFloat(const std::string& name, const std::string& type, long double value); virtual void addNull(const std::string& name, const std::string& type); virtual void beginArray(const std::string& name, const std::string& type); virtual void finishArray(); virtual void beginObject(const std::string& name, const std::string& type); virtual void beginMember(const std::string& name); virtual void finishMember(); virtual void finishObject(); bool beautify() const { return _beautify; } void beautify(bool sw) { _beautify = sw; } void beginValue(const std::string& name); void finishValue(); private: void indent(); void stringOut(const std::string& str); void stringOut(const cxxtools::String& str); std::basic_ostream* _ts; unsigned _level; unsigned _lastLevel; bool _beautify; }; } #endif // CXXTOOLS_JSONFORMATTER_H cxxtools-2.2.1/include/cxxtools/api.h0000664000175000017500000000461012256773774014577 00000000000000/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Api_h #define cxxtools_Api_h #include #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) // suppress min/max macros from win32 headers #ifndef NOMINMAX #define NOMINMAX #endif // Use of features specific Windows versions #ifndef WINVER #define WINVER 0x0501 #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #ifndef _WIN32_WINDOWS #define _WIN32_WINDOWS 0x0410 #endif #endif #if defined(WIN32) || defined(_WIN32) #define CXXTOOLS_EXPORT __declspec(dllexport) #define CXXTOOLS_IMPORT __declspec(dllimport) #else #define CXXTOOLS_EXPORT #define CXXTOOLS_IMPORT #endif #if defined(CXXTOOLS_API_EXPORT) #define CXXTOOLS_API CXXTOOLS_EXPORT #else #define CXXTOOLS_API CXXTOOLS_IMPORT #endif #if !defined(__NOLOCK_ON_INPUT) // disable locking of iostreams on xlC #define __NOLOCK_ON_INPUT #endif #if !defined(__NOLOCK_ON_OUTPUT) // disable locking of iostreams on xlC #define __NOLOCK_ON_OUTPUT #endif #endif cxxtools-2.2.1/include/cxxtools/sourceinfo.h0000664000175000017500000001055412256773774016206 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2006 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SourceInfo_h #define cxxtools_SourceInfo_h #include // GNU C++ compiler #ifdef __GNUC__ #define CXXTOOLS_FUNCTION __PRETTY_FUNCTION__ // Borland C++ #elif defined(__BORLANDC__) #define CXXTOOLS_FUNCTION __FUNC__ // Microsoft C++ compiler #elif defined(_MSC_VER) // .NET 2003 support's demangled function names #if _MSC_VER >= 1300 #define CXXTOOLS_FUNCTION __FUNCDNAME__ #else #define CXXTOOLS_FUNCTION __FUNCTION__ #endif // otherwise use standard macro #else #define CXXTOOLS_FUNCTION "unknown symbol" #endif #define CXXTOOLS_STRINGIFY(x) #x #define CXXTOOLS_TOSTRING(x) CXXTOOLS_STRINGIFY(x) #define CXXTOOLS_SOURCEINFO_STR __FILE__ ":" CXXTOOLS_TOSTRING(__LINE__) /** @brief Construct a SourceInfo object */ #define CXXTOOLS_SOURCEINFO cxxtools::SourceInfo(__FILE__, CXXTOOLS_TOSTRING(__LINE__), CXXTOOLS_FUNCTION) namespace cxxtools { /** @brief Source code info class @ingroup cxxtools This class is used to store information about a location in the source code. The CXXTOOLS_SOURCEINFO macro can be used to construct a cxxtools::SourceInfo object conveniently. @code cxxtools::SourceInfo si(CXXTOOLS_SOURCEINFO); // print file, line and function std::cout << si.file() << std::endl; std::cout << si.line() << std::endl; std::cout << si.func() << std::endl; // print combined string std::cout << si.where() << std::endl; @endcode */ class SourceInfo { public: /** @brief Constructor Do not use the constructor directly, but the CXXTOOLS_SOURCEINFO macro to take advantage of compiler specific macros to indicate the source file name, position and function name. */ inline SourceInfo(const char* file, const char* line, const char* func) : _file(file), _line(line), _func(func) { } /** @brief Returns the filename */ inline const char* file() const { return _file; } /** @brief Returns the line number */ inline const char* line() const { return _line; } /** @brief Returns the function signature */ inline const char* func() const { return _func; } private: const char* _file; const char* _line; const char* _func; }; inline std::string operator+(const std::string& what, const SourceInfo& info) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } inline std::string operator+(const char* what, const SourceInfo& info) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } inline std::string operator+( const SourceInfo& info, const std::string& what) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } inline std::string operator+(const SourceInfo& info, const char* what) { return std::string( info.file() ) + ':' + info.line() + ": " += what; } } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/main.h0000664000175000017500000000446012256773774014755 00000000000000/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MAIN_H #define CXXTOOLS_MAIN_H #ifdef _WIN32_WCE #include int main(int, char**); /** @brief A wmain function for wince that calls a regular main function Include this header in your main.cpp so it can be compiled with visual studio for Windows CE, which has only unicode support. This function simply converts the wide string arguments to 8 bit strings and calls a regular main function. */ int wmain(int argc, wchar_t* wargv[]) { char** argv = 0; argv = new char*[argc]; // convert arguments to char* for (int i = 0; i < argc; ++i) { char line[256]; wcstombs(line, wargv[i], 256); char* line2 = new char[ strlen(line) + 1 ]; strcpy(line2, line); argv[i] = line2; } // call the "regular" main function int ret = main(argc, argv); for (int n = 0; n < argc; ++n) { delete argv[n]; } delete argv; return ret; } #endif #endif cxxtools-2.2.1/include/cxxtools/membar.gcc.nosmp.h0000664000175000017500000000326012256773774017157 00000000000000/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_NOSMP_H #define CXXTOOLS_MEMBAR_NOSMP_H namespace cxxtools { inline void membar_rw() { asm volatile("" : : : "memory"); } inline void membar_write() { asm volatile("" : : : "memory"); } inline void membar_read() { asm volatile("" : : : "memory"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_NOSMP_H cxxtools-2.2.1/include/cxxtools/textbuffer.h0000664000175000017500000003440612256773774016212 00000000000000/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_TextBuffer_h #define cxxtools_TextBuffer_h #include #include #include #include #include #include namespace cxxtools { /** @brief Converts character sequences with different encodings. This class derives from std::basic_streambuf which is the super-class of all stream buffer classes. Stream buffer classes are used to connect to an external device, transport characters from and to this external device and buffer the characters in an internal buffer. The internal character set can be specified using the template parameters 'char_type_', the external character set using 'extern_type_'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be completely managed by this class and also be deleted by this class when it's destructed! @see std::basic_streambuf */ template class BasicTextBuffer : public std::basic_streambuf { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef TextCodec CodecType; typedef MBState state_type; private: static const int _pbmax = 4; static const int _ebufmax = 256; extern_type _ebuf[_ebufmax]; int _ebufsize; static const int _ibufmax = 256; intern_type _ibuf[_ibufmax]; //! Contains the state of conversion. state_type _state; //! The codec which is used to convert character data from or to the external device. CodecType* _codec; std::basic_ios* _target; public: /** @brief Creates a BasicTextBuffer using the given stream buffer and codec. The given stream buffer @a target is used as external device, buffered by this Text buffer and all input from and output to the external device is converted using the codec @a codec. Note: The Codec object which is passed as pointer will be managed by this class and also be deleted by this class on destruction. */ BasicTextBuffer(std::basic_ios* target, CodecType* codec) : _ebufsize(0) , _codec(codec) , _target(target) { this->setg(0, 0, 0); this->setp(0, 0); } ~BasicTextBuffer() throw() { try { this->terminate(); } catch(...) {} if(_codec && _codec->refs() == 0) delete _codec; } void attach(std::basic_ios& target) { this->terminate(); _target = ⌖ } void detach() { this->terminate(); _target = 0; } int terminate() { if( this->pptr() ) { if( -1 == this->sync() ) return -1; if( _codec && ! _codec->always_noconv() ) { typename CodecType::result res = CodecType::error; do { extern_type* next = 0; res = _codec->unshift(_state, _ebuf, _ebuf + _ebufmax, next); _ebufsize = next - _ebuf; if(res == CodecType::error) { throw ConversionError("character conversion failed"); } else if(res == CodecType::ok || res == CodecType::partial) { if(_ebufsize > 0) { _ebufsize -= _target->rdbuf()->sputn(_ebuf, _ebufsize); if(_ebufsize) return -1; } } } while(res == CodecType::partial); } } this->setp(0, 0); this->setg(0, 0, 0); _ebufsize = 0; _state = state_type(); return 0; } std::streamsize import() { if( _target ) { std::streamsize n = _target->rdbuf()->in_avail(); return do_underflow(n).second; } return this->in_avail(); } protected: // inheritdoc virtual int sync() { if( this->pptr() ) { // Try to write out the whole buffer to the underlying stream. // Fail if we can not make progress, because more characters // are needed to continue a multi-byte sequence. while( this->pptr() > this->pbase() ) { const char_type* p = this->pptr(); if( this->overflow( traits_type::eof() ) == traits_type::eof() ) return -1; if( p == this->pptr() ) throw ConversionError("character conversion failed"); } } return 0; } virtual std::streamsize showmanyc() { return 0; } // inheritdoc virtual int_type overflow( int_type ch = traits_type::eof() ) { if( ! _target || this->gptr() ) return traits_type::eof(); if( ! this->pptr() ) { this->setp( _ibuf, _ibuf + _ibufmax ); } while( this->pptr() > this->pbase() ) { const char_type* fromBegin = _ibuf; const char_type* fromEnd = this->pptr(); const char_type* fromNext = fromBegin; extern_type* toBegin = _ebuf + _ebufsize; extern_type* toEnd = _ebuf + _ebufmax; extern_type* toNext = toBegin; typename CodecType::result res = CodecType::noconv; if(_codec) res = _codec->out(_state, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); if(res == CodecType::noconv) { size_t fromSize = fromEnd - fromBegin; size_t toSize = toEnd - toBegin; size_t size = toSize < fromSize ? toSize : fromSize; this->copyChars( toBegin, fromBegin, size ); fromNext += size; toNext += size; } _ebufsize += toNext - toBegin; size_t leftover = fromEnd - fromNext; if(leftover && fromNext > fromBegin) { std::char_traits::move(_ibuf, fromNext, leftover); } this->setp( _ibuf, _ibuf + _ibufmax ); this->pbump( leftover ); if(res == CodecType::error) throw ConversionError("character conversion failed"); if(res == CodecType::partial && _ebufsize == 0) break; _ebufsize -= _target->rdbuf()->sputn(_ebuf, _ebufsize); if(_ebufsize) return traits_type::eof(); } if( ! traits_type::eq_int_type(ch, traits_type::eof()) ) { *( this->pptr() ) = traits_type::to_char_type(ch); this->pbump(1); } return traits_type::not_eof(ch); } // inheritdoc virtual int_type underflow() { if( ! _target ) return traits_type::eof(); if( this->gptr() < this->egptr() ) return traits_type::to_int_type( *this->gptr() ); return do_underflow(_ebufmax).first; } std::pair do_underflow(std::streamsize size) { typedef std::pair ret_type; std::streamsize n = 0; if( this->pptr() ) { if( -1 == this->terminate() ) return ret_type(traits_type::eof(), 0); } if( ! this->gptr() ) { this->setg(_ibuf, _ibuf, _ibuf); } if( this->gptr() - this->eback() > _pbmax) { std::streamsize movelen = this->egptr() - this->gptr() + _pbmax; std::char_traits::move( _ibuf, this->gptr() - _pbmax, movelen ); this->setg(_ibuf, _ibuf + _pbmax, _ibuf + movelen); } bool atEof = false; const std::streamsize bufavail = _ebufmax - _ebufsize; size = bufavail < size ? bufavail : size; if(size) { n = _target->rdbuf()->sgetn( _ebuf + _ebufsize, size ); _ebufsize += n; if(n == 0) atEof = true; } const extern_type* fromBegin = _ebuf; const extern_type* fromEnd = _ebuf + _ebufsize; const extern_type* fromNext = fromBegin; char_type* toBegin = this->egptr(); char_type* toEnd = _ibuf + _ibufmax; char_type* toNext = toBegin; typename CodecType::result r = CodecType::noconv; if(_codec) r = _codec->in(_state, fromBegin, fromEnd, fromNext, toBegin, toEnd, toNext); if(r == CodecType::noconv) { // copy characters and advance fromNext and toNext int n =_ebufsize > _ibufmax ? _ibufmax : _ebufsize ; this->copyBytes(toBegin, fromBegin, n); _ebufsize -= n; fromNext += n; toNext += n; } std::streamsize consumed = fromNext - fromBegin; if(consumed) { std::char_traits::move( _ebuf, _ebuf + consumed, _ebufsize ); _ebufsize -= consumed; } std::streamsize generated = toNext - toBegin; if(generated) { this->setg(this->eback(), // start of read buffer this->gptr(), // gptr position this->egptr() + generated ); // end of read buffer } if(r == CodecType::error) throw ConversionError("character conversion failed"); if( this->gptr() < this->egptr() ) return ret_type(traits_type::to_int_type( *this->gptr() ), n); // fail if partial charactes are at the end of the stream if(r == CodecType::partial && atEof) throw ConversionError("character conversion failed"); return ret_type(traits_type::eof(), 0); } static void copyChars(extern_type* s1, const char_type* s2, size_t n) { while(n-- > 0) { *s1 = std::char_traits::to_int_type(*s2); ++s1; ++s2; } } static void copyBytes(char_type* s1, const extern_type* s2, size_t n) { while(n-- > 0) { *s1 = std::char_traits::to_char_type(*s2); ++s1; ++s2; } } }; /** @brief Buffers the conversion of 8-bit character sequences to unicode. The internal type is cxxtools::Char. The external type is $char$. See BasicTextBuffer for a more detailed description. */ class CXXTOOLS_API TextBuffer : public BasicTextBuffer { public: typedef TextCodec Codec; public: /** @brief Constructs a new TextBuffer See BasicTextBuffer::BasicTextBuffer() for a more detailed description. @param buffer The buffer (external device) which is wrapped by this object. @param codec The codec which is used to convert data from and to the external device. */ TextBuffer(std::ios* buffer, Codec* codec); }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/serializationinfo.h0000664000175000017500000006166312266277345017564 00000000000000/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SerializationInfo_h #define cxxtools_SerializationInfo_h #include #include #include #include #include #include #include #include #include #include #include #include namespace cxxtools { /** @brief Represents arbitrary types during serialization. */ class CXXTOOLS_API SerializationInfo { typedef std::vector Nodes; public: enum Category { Void = 0, Value = 1, Object = 2, Array = 6 }; class Iterator; class ConstIterator; #ifdef HAVE_LONG_LONG typedef long long int_type; #else typedef long int_type; #endif #ifdef HAVE_UNSIGNED_LONG_LONG typedef unsigned long long unsigned_type; #else typedef unsigned long unsigned_type; #endif public: SerializationInfo(); SerializationInfo(const SerializationInfo& si); ~SerializationInfo() { _releaseValue(); } void reserve(size_t n); Category category() const { return _category; } void setCategory(Category cat) { _category = cat; } SerializationInfo* parent() { return _parent; } const SerializationInfo* parent() const { return _parent; } const std::string& typeName() const { return _type; } void setTypeName(const std::string& type) { _type = type; } const std::string& name() const { return _name; } void setName(const std::string& name) { _name = name; } /** @brief Serialization of flat data-types */ void setValue(const String& value) { _setString(value); } void setValue(const std::string& value) { _setString8(value); } void setValue(const char* value) { _setString8(value); } void setValue(Char value) { _setString(String(1, value)); } void setValue(wchar_t value) { _setString(String(1, value)); } void setValue(bool value) { _setBool(value) ; } void setValue(char value) { _setChar(value) ; } void setValue(unsigned char value) { _setUInt(value) ; } void setValue(short value) { _setInt(value) ; } void setValue(unsigned short value) { _setUInt(value) ; } void setValue(int value) { _setInt(value) ; } void setValue(unsigned int value) { _setUInt(value) ; } void setValue(long value) { _setInt(value) ; } void setValue(unsigned long value) { _setUInt(value) ; } #ifdef HAVE_LONG_LONG void setValue(long long value) { _setInt(value) ; } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void setValue(unsigned long long value) { _setUInt(value) ; } #endif void setValue(float value) { _setFloat(value); } void setValue(double value) { _setFloat(value); } void setValue(long double value) { _setFloat(value); } void setNull(); /** @brief Deserialization of flat data-types */ void getValue(String& value) const; void getValue(std::string& value) const; void getValue(Char& value) const { value = _getWChar(); } void getValue(wchar_t& value) const { value = _getWChar(); } void getValue(bool& value) const { value = _getBool(); } void getValue(char& value) const { value = _getChar(); } void getValue(signed char& value) const { value = static_cast(_getInt("signed char", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned char& value) const { value = static_cast(_getUInt("unsigned char", std::numeric_limits::max())); } void getValue(short& value) const { value = static_cast(_getInt("short", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned short& value) const { value = static_cast(_getUInt("unsigned short", std::numeric_limits::max())); } void getValue(int& value) const { value = static_cast(_getInt("int", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned int& value) const { value = static_cast(_getUInt("unsigned int", std::numeric_limits::max())); } void getValue(long& value) const { value = static_cast(_getInt("long", std::numeric_limits::min(), std::numeric_limits::max())); } void getValue(unsigned long& value) const { value = static_cast(_getUInt("unsigned long", std::numeric_limits::max())); } #ifdef HAVE_LONG_LONG void getValue(long long& value) const { value = static_cast(_getInt("long long", std::numeric_limits::min(), std::numeric_limits::max())); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void getValue(unsigned long long& value) const { value = static_cast(_getUInt("unsigned long long", std::numeric_limits::max())); } #endif void getValue(float& value) const { value = static_cast(_getFloat("float", std::numeric_limits::max())); } void getValue(double& value) const { value = static_cast(_getFloat("double", std::numeric_limits::max())); } void getValue(long double& value) const { value = static_cast(_getFloat("long double", std::numeric_limits::max())); } /** @brief Serialization of flat member data-types */ template SerializationInfo& addValue(const std::string& name, const T& value) { SerializationInfo& info = this->addMember(name); info.setValue(value); return info; } /** @brief Serialization of member data */ SerializationInfo& addMember(const std::string& name); /** @brief Deserialization of member data @throws SerializationError when member is not found. */ const SerializationInfo& getMember(const std::string& name) const; /** @brief Deserialization of member data @throws std::range_error when index is too large */ const SerializationInfo& getMember(unsigned idx) const; /** @brief Deserialization of member data. @return true if member is found, false otherwise. The passed value is not modified when the member was not found. */ template bool getMember(const std::string& name, T& value) const { const SerializationInfo* si = findMember(name); if (si == 0) return false; *si >>= value; return true; } /** @brief Find member data by name This method returns the data for an object with the name \a name. or null if it is not present. */ const SerializationInfo* findMember(const std::string& name) const; /** @brief Find member data by name This method returns the data for an object with the name \a name. or null if it is not present. */ SerializationInfo* findMember(const std::string& name); size_t memberCount() const { return _nodes.size(); } Iterator begin(); Iterator end(); ConstIterator begin() const; ConstIterator end() const; SerializationInfo& operator =(const SerializationInfo& si); void clear(); void swap(SerializationInfo& si); bool isNull() const { return _t == t_none && _category == Void; } bool isString() const { return _t == t_string; } bool isString8() const { return _t == t_string8; } bool isChar() const { return _t == t_char; } bool isBool() const { return _t == t_bool; } bool isInt() const { return _t == t_int; } bool isUInt() const { return _t == t_uint; } bool isFloat() const { return _t == t_float; } void dump(std::ostream& out, const std::string& praefix = std::string()) const; protected: void setParent(SerializationInfo& si) { _parent = &si; } private: SerializationInfo* _parent; Category _category; std::string _name; std::string _type; void _releaseValue(); void _setString(const String& value); void _setString8(const std::string& value); void _setString8(const char* value); void _setChar(char value); void _setBool(bool value); void _setInt(int_type value); void _setUInt(unsigned_type value); void _setFloat(long double value); bool _getBool() const; wchar_t _getWChar() const; char _getChar() const; int_type _getInt(const char* type, int_type min, int_type max) const; unsigned_type _getUInt(const char* type, unsigned_type max) const; long double _getFloat(const char* type, long double max) const; union U { char _s[sizeof(String) >= sizeof(std::string) ? sizeof(String) : sizeof(std::string)]; char _c; bool _b; int_type _i; unsigned_type _u; long double _f; } _u; String* _StringPtr() { return reinterpret_cast(_u._s); } String& _String() { return *_StringPtr(); } const String* _StringPtr() const { return reinterpret_cast(_u._s); } const String& _String() const { return *_StringPtr(); } std::string* _String8Ptr() { return reinterpret_cast(_u._s); } std::string& _String8() { return *_String8Ptr(); } const std::string* _String8Ptr() const { return reinterpret_cast(_u._s); } const std::string& _String8() const { return *_String8Ptr(); } enum T { t_none, t_string, t_string8, t_char, t_bool, t_int, t_uint, t_float } _t; Nodes _nodes; // objects/arrays }; class SerializationInfo::Iterator { public: Iterator(); Iterator(const Iterator& other); Iterator(SerializationInfo* info); Iterator& operator=(const Iterator& other); Iterator& operator++(); SerializationInfo& operator*(); SerializationInfo* operator->(); bool operator!=(const Iterator& other) const; bool operator==(const Iterator& other) const; private: SerializationInfo* _info; }; class SerializationInfo::ConstIterator { public: ConstIterator(); ConstIterator(const ConstIterator& other); ConstIterator(const SerializationInfo* info); ConstIterator& operator=(const ConstIterator& other); ConstIterator& operator++(); const SerializationInfo& operator*() const; const SerializationInfo* operator->() const; bool operator!=(const ConstIterator& other) const; bool operator==(const ConstIterator& other) const; private: const SerializationInfo* _info; }; inline SerializationInfo::Iterator::Iterator() : _info(0) {} inline SerializationInfo::Iterator::Iterator(const Iterator& other) : _info(other._info) {} inline SerializationInfo::Iterator::Iterator(SerializationInfo* info) : _info(info) {} inline SerializationInfo::Iterator& SerializationInfo::Iterator::operator=(const Iterator& other) { _info = other._info; return *this; } inline SerializationInfo::Iterator& SerializationInfo::Iterator::operator++() { ++_info; return *this; } inline SerializationInfo& SerializationInfo::Iterator::operator*() { return *_info; } inline SerializationInfo* SerializationInfo::Iterator::operator->() { return _info; } inline bool SerializationInfo::Iterator::operator!=(const Iterator& other) const { return _info != other._info; } inline bool SerializationInfo::Iterator::operator==(const Iterator& other) const { return _info == other._info; } inline SerializationInfo::ConstIterator::ConstIterator() : _info(0) {} inline SerializationInfo::ConstIterator::ConstIterator(const ConstIterator& other) : _info(other._info) {} inline SerializationInfo::ConstIterator::ConstIterator(const SerializationInfo* info) : _info(info) {} inline SerializationInfo::ConstIterator& SerializationInfo::ConstIterator::operator=(const ConstIterator& other) { _info = other._info; return *this; } inline SerializationInfo::ConstIterator& SerializationInfo::ConstIterator::operator++() { ++_info; return *this; } inline const SerializationInfo& SerializationInfo::ConstIterator::operator*() const { return *_info; } inline const SerializationInfo* SerializationInfo::ConstIterator::operator->() const { return _info; } inline bool SerializationInfo::ConstIterator::operator!=(const ConstIterator& other) const { return _info != other._info; } inline bool SerializationInfo::ConstIterator::operator==(const ConstIterator& other) const { return _info == other._info; } inline void operator >>=(const SerializationInfo& si, SerializationInfo& ssi) { ssi = si; } inline void operator <<=(SerializationInfo& si, const SerializationInfo& ssi) { si = ssi; } inline void operator >>=(const SerializationInfo& si, bool& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, bool n) { si.setValue(n); si.setTypeName("bool"); } inline void operator >>=(const SerializationInfo& si, signed char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, signed char n) { si.setValue(n); si.setTypeName("char"); } inline void operator >>=(const SerializationInfo& si, unsigned char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned char n) { si.setValue(n); si.setTypeName("char"); } inline void operator >>=(const SerializationInfo& si, char& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, char n) { si.setValue(n); si.setTypeName("char"); } inline void operator >>=(const SerializationInfo& si, short& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, short n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, unsigned short& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned short n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, int& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, int n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, unsigned int& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned int n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, long n) { si.setValue(n); si.setTypeName("int"); } inline void operator >>=(const SerializationInfo& si, unsigned long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned long n) { si.setValue(n); si.setTypeName("int"); } #ifdef HAVE_LONG_LONG inline void operator >>=(const SerializationInfo& si, long long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, long long n) { si.setValue(n); si.setTypeName("int"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG inline void operator >>=(const SerializationInfo& si, unsigned long long& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, unsigned long long n) { si.setValue(n); si.setTypeName("int"); } #endif inline void operator >>=(const SerializationInfo& si, float& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, float n) { si.setValue(n); si.setTypeName("double"); } inline void operator >>=(const SerializationInfo& si, double& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, double n) { si.setValue(n); si.setTypeName("double"); } inline void operator >>=(const SerializationInfo& si, std::string& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, const std::string& n) { si.setValue(n); si.setTypeName("string"); } inline void operator <<=(SerializationInfo& si, const char* n) { si.setValue(n); si.setTypeName("string"); } inline void operator >>=(const SerializationInfo& si, cxxtools::String& n) { si.getValue(n); } inline void operator <<=(SerializationInfo& si, const cxxtools::String& n) { si.setValue(n); si.setTypeName("string"); } template inline void operator >>=(const SerializationInfo& si, std::vector& vec) { vec.clear(); vec.reserve(si.memberCount()); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { vec.resize( vec.size() + 1 ); *it >>= vec.back(); } } template inline void operator <<=(SerializationInfo& si, const std::vector& vec) { typename std::vector::const_iterator it; si.reserve(vec.size()); for(it = vec.begin(); it != vec.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("array"); si.setCategory(SerializationInfo::Array); } inline void operator >>=(const SerializationInfo& si, std::vector& vec) { vec.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { vec.resize( vec.size() + 1 ); *it >>= vec.back(); } } inline void operator <<=(SerializationInfo& si, const std::vector& vec) { std::vector::const_iterator it; for(it = vec.begin(); it != vec.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("array"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::list& list) { list.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { list.resize( list.size() + 1 ); *it >>= list.back(); } } template inline void operator <<=(SerializationInfo& si, const std::list& list) { typename std::list::const_iterator it; for(it = list.begin(); it != list.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("list"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::deque& deque) { deque.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { deque.resize( deque.size() + 1 ); *it >>= deque.back(); } } template inline void operator <<=(SerializationInfo& si, const std::deque& deque) { typename std::deque::const_iterator it; for(it = deque.begin(); it != deque.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("deque"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::set& set) { set.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { T t; *it >>= t; set.insert(t); } } template inline void operator <<=(SerializationInfo& si, const std::set& set) { typename std::set::const_iterator it; for(it = set.begin(); it != set.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("set"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::multiset& multiset) { multiset.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { T t; *it >>= t; multiset.insert(t); } } template inline void operator <<=(SerializationInfo& si, const std::multiset& multiset) { typename std::multiset::const_iterator it; for(it = multiset.begin(); it != multiset.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("multiset"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::pair& p) { si.getMember("first") >>= p.first; si.getMember("second") >>= p.second; } template inline void operator <<=(SerializationInfo& si, const std::pair& p) { si.setTypeName("pair"); si.addMember("first") <<= p.first; si.addMember("second") <<= p.second; } template inline void operator >>=(const SerializationInfo& si, std::map& map) { map.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { typename std::pair v; *it >>= v; map.insert(v); } } template inline void operator <<=(SerializationInfo& si, const std::map& map) { typename std::map::const_iterator it; for(it = map.begin(); it != map.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("map"); si.setCategory(SerializationInfo::Array); } template inline void operator >>=(const SerializationInfo& si, std::multimap& multimap) { multimap.clear(); for(SerializationInfo::ConstIterator it = si.begin(); it != si.end(); ++it) { typename std::pair v; *it >>= v; multimap.insert(v); } } template inline void operator <<=(SerializationInfo& si, const std::multimap& multimap) { typename std::multimap::const_iterator it; for(it = multimap.begin(); it != multimap.end(); ++it) { SerializationInfo& newSi = si.addMember(std::string()); newSi <<= *it; } si.setTypeName("multimap"); si.setCategory(SerializationInfo::Array); } inline std::ostream& operator<< (std::ostream& out, const SerializationInfo& si) { si.dump(out); return out; } } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/library.h0000664000175000017500000001153712256773774015500 00000000000000/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LIBRARY_H #define CXXTOOLS_LIBRARY_H #include namespace cxxtools { class Symbol; /** @brief Shared library loader This class can be used to dynamically load shared libraries and resolve symbols from it. The example below shows how to retrieve the address of the function 'myProcedure' in library 'MyLibrary': @code Library shlib("MyLibrary.dll"); void* procAddr = shlib["myProcedure"]; typedef int (*MyProcType)(); MyProcType proc =(MyProcType)procAddr; int result = proc(); @endcode */ class Library { public: /** @brief Default Constructor which does not load a library. */ Library(); /** @brief Loads a shared library. If a file could not be found at the given path, the path will be extended by the platform-specific shared library extension first and then also by the shared library prefix. If still no file can be found an exception is thrown. The library is loaded immediately. */ explicit Library(const std::string& path); Library(const Library& other); Library& operator=(const Library& other); /** @brief The destructor unloads the shared library from memory. */ ~Library(); /** @brief Loads a shared library. If a file could not be found at the given path, the path will be extended by the platform-specific shared library extension first and then also by the shared library prefix. If still no file can be found an exception is thrown. Calling this method twice might close the previously loaded library. */ Library& open(const std::string& path); void close(); /** @brief Resolves the symbol \a symbol from the shared library Returns the address of the symbol or 0 if it was not found. */ void* operator[](const char* symbol) const { return this->resolve(symbol); } /** @brief Resolves the symbol \a symbol from the shared library Returns the address of the symbol or 0 if it was not found. */ void* resolve(const char* symbol) const; /** @brief Returns null if invalid */ operator const void*() const; Symbol getSymbol(const char* symbol) const; /** @brief Returns true if invalid */ bool operator!() const; /** @brief Returns the path to the shared library image */ const std::string& path() const; /** @brief Returns the extension for shared libraries Returns ".so" on Linux, ".dll" on Windows. */ static std::string suffix(); /** @brief Returns the prefix for shared libraries Returns "lib" on Linux, "" on Windows */ static std::string prefix(); protected: void detach(); private: //! @internal class LibraryImpl* _impl; //! @internal std::string _path; }; /** @brief Symbol resolved from a shared library */ class Symbol { public: Symbol() : _sym(0) { } Symbol(const Library& lib, void* sym) : _lib(lib), _sym(sym) { } void* sym() const { return _sym; } const Library& library() const { return _lib; } operator void*() const { return _sym; } private: Library _lib; void* _sym; }; } // namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/jsonserializer.h0000664000175000017500000001111512266277345017061 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONSERIALIZER_H #define CXXTOOLS_JSONSERIALIZER_H #include #include #include #include #include #include namespace cxxtools { class JsonSerializer : private NonCopyable { public: JsonSerializer() : _ts(0), _inObject(false) { } explicit JsonSerializer(std::basic_ostream& ts) : _ts(0), _inObject(false) { _formatter.begin(ts); } explicit JsonSerializer(std::ostream& os, TextCodec* codec = 0); ~JsonSerializer() { delete _ts; } JsonSerializer& begin(std::basic_ostream& ts) { _formatter.begin(ts); return *this; } JsonSerializer& begin(std::ostream& os, TextCodec* codec = 0); void finish() { if (_inObject) { _formatter.finishObject(); _inObject = false; } _formatter.finish(); if (_ts) _ts->flush(); } template JsonSerializer& serialize(const T& v, const std::string& name) { Decomposer s; s.begin(v); s.setName(name); if (!_inObject) { _formatter.beginObject(std::string(), std::string()); _inObject = true; } s.format(_formatter); return *this; } template JsonSerializer& serialize(const T& v) { if (_inObject) throw std::logic_error("can't serialize object without name into another object"); Decomposer s; s.begin(v); s.format(_formatter); _ts->flush(); return *this; } void setObject() { _formatter.beginObject(std::string(), std::string()); _inObject = true; } bool object() const { return _inObject; } bool beautify() const { return _formatter.beautify(); } void beautify(bool sw) { _formatter.beautify(sw); } template static std::string toString(const T& type, const std::string& name, bool beautify = false) { std::ostringstream os; JsonSerializer s; if (beautify) s.beautify(true); s.begin(os); s.serialize(type, name); s.finish(); return os.str(); } private: JsonFormatter _formatter; std::basic_ostream* _ts; bool _inObject; }; } #endif // CXXTOOLS_JSONSERIALIZER_H cxxtools-2.2.1/include/cxxtools/serviceprocedure.h0000664000175000017500000005701312266277345017376 00000000000000/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SERVICEPROCEDURE_H #define CXXTOOLS_SERVICEPROCEDURE_H #include #include #include #include #include namespace cxxtools { class ServiceProcedure { public: ServiceProcedure() {} virtual ~ServiceProcedure() {} virtual ServiceProcedure* clone() const = 0; virtual IComposer** beginCall() = 0; virtual IDecomposer* endCall() = 0; }; // BasicServiceProcedure with 10 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = &_a8; _args[8] = &_a9; _args[9] = &_a10; _args[10] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); _a8.begin(_v8); _a9.begin(_v9); _a10.begin(_v10); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value V5; typedef typename TypeTraits::Value V6; typedef typename TypeTraits::Value V7; typedef typename TypeTraits::Value V8; typedef typename TypeTraits::Value V9; typedef typename TypeTraits::Value V10; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; V8 _v8; V9 _v9; V10 _v10; IComposer* _args[11]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Composer _a5; Composer _a6; Composer _a7; Composer _a8; Composer _a9; Composer _a10; Decomposer _r; }; // BasicServiceProcedure with 9 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = &_a8; _args[8] = &_a9; _args[9] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); _a8.begin(_v8); _a9.begin(_v9); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value V5; typedef typename TypeTraits::Value V6; typedef typename TypeTraits::Value V7; typedef typename TypeTraits::Value V8; typedef typename TypeTraits::Value V9; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; V8 _v8; V9 _v9; IComposer* _args[10]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Composer _a5; Composer _a6; Composer _a7; Composer _a8; Composer _a9; Decomposer _r; }; // BasicServiceProcedure with 8 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = &_a8; _args[8] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); _a8.begin(_v8); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value V5; typedef typename TypeTraits::Value V6; typedef typename TypeTraits::Value V7; typedef typename TypeTraits::Value V8; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; V8 _v8; IComposer* _args[9]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Composer _a5; Composer _a6; Composer _a7; Composer _a8; Decomposer _r; }; // BasicServiceProcedure with 7 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = &_a7; _args[7] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); _a7.begin(_v7); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value V5; typedef typename TypeTraits::Value V6; typedef typename TypeTraits::Value V7; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; V7 _v7; IComposer* _args[8]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Composer _a5; Composer _a6; Composer _a7; Decomposer _r; }; // BasicServiceProcedure with 6 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = &_a6; _args[6] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); _a6.begin(_v6); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value V5; typedef typename TypeTraits::Value V6; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; V6 _v6; IComposer* _args[7]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Composer _a5; Composer _a6; Decomposer _r; }; // BasicServiceProcedure with 5 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = &_a5; _args[5] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); _a5.begin(_v5); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4, _v5); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value V5; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; V5 _v5; IComposer* _args[6]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Composer _a5; Decomposer _r; }; // BasicServiceProcedure with 4 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = &_a4; _args[4] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); _a4.begin(_v4); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3, _v4); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value V4; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; V4 _v4; IComposer* _args[5]; Composer _a1; Composer _a2; Composer _a3; Composer _a4; Decomposer _r; }; // BasicServiceProcedure with 3 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = &_a3; _args[3] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); _a3.begin(_v3); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2, _v3); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value V3; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; V3 _v3; IComposer* _args[4]; Composer _a1; Composer _a2; Composer _a3; Decomposer _r; }; // BasicServiceProcedure with 2 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = &_a2; _args[2] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); _a2.begin(_v2); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1, _v2); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value V2; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; V2 _v2; IComposer* _args[3]; Composer _a1; Composer _a2; Decomposer _r; }; // BasicServiceProcedure with 1 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = &_a1; _args[1] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { _a1.begin(_v1); return _args; } IDecomposer* endCall() { _rv = _cb->call(_v1); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value V1; typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; V1 _v1; IComposer* _args[2]; Composer _a1; Decomposer _r; }; // BasicServiceProcedure with 0 arguments template class BasicServiceProcedure : public ServiceProcedure { public: BasicServiceProcedure( const Callable& cb ) : ServiceProcedure() , _cb(0) { _cb = cb.clone(); _args[0] = 0; } ~BasicServiceProcedure() { delete _cb; } ServiceProcedure* clone() const { return new BasicServiceProcedure(*_cb); } IComposer** beginCall() { return _args; } IDecomposer* endCall() { _rv = _cb->call(); _r.begin(_rv); return &_r; } private: typedef typename TypeTraits::Value RV; Callable* _cb; RV _rv; IComposer* _args[1]; Decomposer _r; }; } #endif // CXXTOOLS_SERVICEPROCEDURE_H cxxtools-2.2.1/include/cxxtools/xmltag.h0000664000175000017500000000560512256773774015327 00000000000000/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_XMLTAG_H #define CXXTOOLS_XMLTAG_H #include #include namespace cxxtools { /** This class outputs xml-tags and end-tags. When the class is put on the stack it prints the start-tag to the outputstream and when leaving scope prints end-tag. The end-tag is the start tag with '/' inserted at the second position. Tags are specified by text including or not including '<' and '>'. These brackets are recognized and printed also when not passed. Parameters in the tag can be passed as a separate parameter or delimited by space. After the first space everything is parameter and not repeated in the closing tag. Tags are closed in the destructor, if not already closed explicitely by calling the close()-method. */ class Xmltag { std::string tag; std::ostream& out; static std::ostream* default_out; public: /// prints start-tag and remember tag Xmltag(const std::string& tag, std::ostream& out = *default_out); /// prints start-tag with parameters and remember tag Xmltag(const std::string& tag, const std::string& parameter, std::ostream& out = *default_out); /// closes tag ~Xmltag() { close(); } static void setDefaultOutstream(std::ostream& out) { default_out = &out; } static std::ostream& getDefaultOutstream() { return *default_out; } const std::string& get() const { return tag; } void close(); void clear() { tag.clear(); } }; } #endif // CXXTOOLS_XMLTAG_H cxxtools-2.2.1/include/cxxtools/utf8codec.h0000664000175000017500000001211512256773774015711 00000000000000/* * Copyright (C) 2005 by Marc Boris Duerner * Copyright (C) 2005 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Utf8Codec_h #define cxxtools_Utf8Codec_h #include #include #include #include #include namespace cxxtools { /** * @brief This Codec class is able to convert from UTF-8 to UTF-32 and from UTF-32 to UTF-8. * * The method do_in() converts an array of char containing UTF-8-encoded data into an array * of cxxtools::Char which is UTF-32-encoded, which means that the data is a direct readable * 32-bit representation of the character. * * The method do_out() converts an array of cxxtools::Char objects (UTF-32/Unicode) into an * array of char which contains the same sequence of characters in UTF-8-encoding. */ class CXXTOOLS_API Utf8Codec : public TextCodec { public: /** * @brief Constructs a new Utf8Codec object which converts UTF-8 to UTF-32 and UTF-32 to UTF-8. * * The internal type is cxxtools::Char and external type is $char$ * * @param ref This optional parameter is passed to std::codecvt. When ref == 0 the locale takes * care of deleting the facet. If ref == 1 the locale does not destroy the facet. Default value is 0. */ explicit Utf8Codec(size_t ref = 0); //! Empty destructor virtual ~Utf8Codec() {} protected: //! @brief Decodes UTF-8 to UTF-32. virtual result do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, Char* toBegin, Char* toEnd, Char*& toNext) const; //! @brief Encodes UTF-32 to UTF-8. virtual result do_out(MBState& s, const Char* fromBegin, const Char* fromEnd, const Char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const; // inheritdoc virtual bool do_always_noconv() const throw(); // inheritdoc virtual int do_length(MBState& s, const char* fromBegin, const char* fromEnd, size_t max) const; // inheritdoc virtual int do_max_length() const throw(); // inheritdoc std::codecvt_base::result do_unshift(cxxtools::MBState&, char*, char*, char*&) const { return std::codecvt_base::noconv; } // inheritdoc int do_encoding() const throw() { return 0; } public: /** @brief shortcut for converting utf-8 encoded data to unicode string Example: @code std::string data = cxxtools::Utf8Codec::decode(utfdataptr, utfdatasize); @endcode */ static String decode(const char* data, unsigned size) { return cxxtools::decode(data, size); } /** @brief shortcut for converting utf-8 encoded std::string to unicode string */ static String decode(const std::string& data) { return cxxtools::decode(data); } /** @brief shortcut for converting unicode data to utf-8 encoded std::string */ static std::string encode(const Char* data, unsigned size) { return cxxtools::encode(data, size); } /** @brief shortcut for converting unicode string to utf-8 encoded std::string */ static std::string encode(const String& data) { return cxxtools::encode(data); } }; } //namespace cxxtools #endif cxxtools-2.2.1/include/cxxtools/cache.h0000664000175000017500000002731212266277345015067 00000000000000/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CACHE_H #define CXXTOOLS_CACHE_H #include #include #ifdef DEBUG #include #endif namespace cxxtools { /** Implements a container for caching elements. The cache holds a list of key-value-pairs. There are 2 main operations for accessing the cache: put and get. Put takes a key and a value and puts the element into the list. Get takes a key and optional a value. If the value for the key is found, it is returned. The passed value otherwise. By default the value is constructed with the empty ctor of the value-type. The cache has a maximum size, after which key-value-pairs are dropped, when a new item is put into the cache. The algorithm for this cache is as follows: - when the cache is not full, new elements are appended - new elements are put into the middle of the list otherwise - the last element of the list is then dropped - when getting a value and the value is found, it is put to the beginning of the list When elements are searched, a linear search is done using the ==-operator of the key type. The caching algorithm keeps elements, which are fetched more than once in the first half of the list. In the second half the elements are either new or the elements are pushed from the first half to the second half by other elements, which are found in the cache. You should be aware, that the key type should be simple. Comparing keys must be cheap. Copying elements (both key and value) must be possible and should be cheap, since they are moved in the underlying container. */ template class Cache { struct Data { bool winner; unsigned serial; Value value; Data() { } Data(bool winner_, unsigned serial_, const Value& value_) : winner(winner_), serial(serial_), value(value_) { } }; typedef std::map DataType; DataType data; typename DataType::size_type maxElements; unsigned serial; unsigned hits; unsigned misses; unsigned _nextSerial() { if (serial == std::numeric_limits::max()) { for (typename DataType::iterator it = data.begin(); it != data.end(); ++it) it->second.serial = 0; serial = 1; } return serial++; } typename DataType::iterator _getOldest(bool winner) { typename DataType::iterator foundElement = data.begin(); typename DataType::iterator it = data.begin(); for (++it; it != data.end(); ++it) if (it->second.winner == winner && (foundElement->second.winner != winner || it->second.serial < foundElement->second.serial)) foundElement = it; return foundElement; } typename DataType::iterator _getNewest(bool winner) { typename DataType::iterator foundElement = data.begin(); typename DataType::iterator it = data.begin(); for (++it; it != data.end(); ++it) if (it->second.winner == winner && (foundElement->second.winner != winner || it->second.serial > foundElement->second.serial)) foundElement = it; return foundElement; } // drop one element void _dropLooser() { // look for the oldest element in the list of loosers to drop it data.erase(_getOldest(false)); } void _makeLooser() { // look for the oldest element in the list of winners to make it a looser typename DataType::iterator it = _getOldest(true); it->second.winner = false; it->second.serial = _nextSerial(); } public: typedef typename DataType::size_type size_type; typedef Value value_type; explicit Cache(size_type maxElements_) : maxElements(maxElements_ + (maxElements_ & 1)), serial(0), hits(0), misses(0) { } /// returns the number of elements currently in the cache size_type size() const { return data.size(); } /// returns the maximum number of elements in the cache size_type getMaxElements() const { return maxElements; } void setMaxElements(size_type maxElements_) { size_type numWinners = winners(); maxElements_ += (maxElements_ & 1); if (maxElements_ > maxElements) { while (numWinners < maxElements_ / 2) { _getNewest(false)->second.winner = true; ++numWinners; } } else { while (size() > maxElements_) _dropLooser(); numWinners = winners(); while (numWinners > maxElements_ / 2) { _makeLooser(); --numWinners; } } maxElements = maxElements_; } /// removes a element from the cache and returns true, if found bool erase(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) return false; if (it->second.winner) _getNewest(false)->second.winner = true; data.erase(it); return true; } /// clears the cache. void clear(bool stats = false) { data.clear(); if (stats) hits = misses = 0; } /// puts a new element in the cache. If the element is already found in /// the cache, it is considered a cache hit and pushed to the top of the /// list. Value& put(const Key& key, const Value& value) { typename DataType::iterator it = data.find(key); if (it == data.end()) { if (data.size() < maxElements) { it = data.insert(data.begin(), typename DataType::value_type(key, Data(data.size() < maxElements / 2, _nextSerial(), value))); } else { // element not found _dropLooser(); it = data.insert(data.begin(), typename DataType::value_type(key, Data(false, _nextSerial(), value))); } } else { // element found it->second.serial = _nextSerial(); if (!it->second.winner) { // move element to the winner part it->second.winner = true; _makeLooser(); } } return it->second.value; } /// puts a new element on the top of the cache. If the element is already /// found in the cache, it is considered a cache hit and pushed to the /// top of the list. This method actually overrides the need, that a element /// needs a hit to get to the top of the cache. void put_top(const Key& key, const Value& value) { typename DataType::iterator it; if (data.size() < maxElements) { if (data.size() >= maxElements / 2) _makeLooser(); data.insert(data.begin(), typename DataType::value_type(key, Data(true, _nextSerial(), value))); } else if ((it = data.find(key)) == data.end()) { // element not found _dropLooser(); _makeLooser(); data.insert(data.begin(), typename DataType::value_type(key, Data(true, _nextSerial(), value))); } else { // element found it->second.serial = _nextSerial(); if (!it->second.winner) { // move element to the winner part it->second.winner = true; _makeLooser(); } } } Value* getptr(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) { ++misses; return 0; } it->second.serial = _nextSerial(); if (!it->second.winner) { // move element to the winner part it->second.winner = true; _makeLooser(); } ++hits; return &it->second.value; } /// returns a pair of values - a flag, if the value was found and the /// value if found or the passed default otherwise. If the value is /// found it is a cache hit and pushed to the top of the list. std::pair getx(const Key& key, Value def = Value()) { Value* v = getptr(key); return v ? std::pair(true, *v) : std::pair(false, def); } /// returns the value to a key or the passed default value if not found. /// If the value is found it is a cahce hit and pushed to the top of the /// list. Value get(const Key& key, Value def = Value()) { return getx(key, def).second; } /// returns the number of hits. unsigned getHits() const { return hits; } /// returns the number of misses. unsigned getMisses() const { return misses; } /// returns the cache hit ratio between 0 and 1. double hitRatio() const { return hits+misses > 0 ? static_cast(hits)/static_cast(hits+misses) : 0; } /// returns the ratio, between held elements and maximum elements. double fillfactor() const { return static_cast(data.size()) / static_cast(maxElements); } unsigned winners() const { unsigned w = 0; for (typename DataType::const_iterator it = data.begin(); it != data.end(); ++it) if (it->second.winner) ++w; return w; } unsigned loosers() const { unsigned l = 0; for (typename DataType::const_iterator it = data.begin(); it != data.end(); ++it) if (!it->second.winner) ++l; return l; } #ifdef DEBUG void dump(std::ostream& out) const { out << "cache max size=" << maxElements << " current size=" << size() << '\n'; for (typename DataType::const_iterator it = data.begin(); it != data.end(); ++it) { out << "\tkey=\"" << it->first << "\" value=\"" << it->second.value << "\" serial=" << it->second.serial << " winner=" << it->second.winner << '\n'; } out << "--------\n"; } #endif }; } #endif // CXXTOOLS_CACHE_H cxxtools-2.2.1/include/cxxtools/string.h0000664000175000017500000005315612256773774015345 00000000000000/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STRING_H #define CXXTOOLS_STRING_H #include #include #include #include #include #include #include namespace std { /** @brief Unicode capable strings @ingroup Unicode */ template <> class CXXTOOLS_API basic_string< cxxtools::Char > { public: typedef cxxtools::Char value_type; typedef size_t size_type; typedef char_traits< cxxtools::Char > traits_type; typedef std::allocator allocator_type; typedef allocator_type::difference_type difference_type; typedef allocator_type::reference reference; typedef allocator_type::const_reference const_reference; typedef allocator_type::pointer pointer; typedef allocator_type::const_pointer const_pointer; typedef value_type* iterator; typedef const value_type* const_iterator; #if defined(HAVE_REVERSE_ITERATOR) typedef std::reverse_iterator reverse_iterator; typedef const std::reverse_iterator const_reverse_iterator; # define HAVE_STRING_REVERSE_ITERATOR #elif defined(HAVE_REVERSE_ITERATOR_4) typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; # define HAVE_STRING_REVERSE_ITERATOR #endif static const size_type npos = static_cast(-1); public: explicit basic_string( const allocator_type& a = allocator_type()); basic_string(const cxxtools::Char* str, const allocator_type& a = allocator_type()); basic_string(const wchar_t* str, const allocator_type& a = allocator_type()); basic_string(const wchar_t* str, size_type n, const allocator_type& a = allocator_type()); explicit basic_string(const std::string& str, const allocator_type& a = allocator_type()); explicit basic_string(const char* str, const allocator_type& a = allocator_type()); basic_string(const char* str, size_type n, const allocator_type& a = allocator_type()); basic_string(const cxxtools::Char* str, size_type n, const allocator_type& a = allocator_type()); basic_string(size_type n, cxxtools::Char c, const allocator_type& a = allocator_type()); basic_string(const basic_string& str); basic_string(const basic_string& str, const allocator_type& a); basic_string(const basic_string& str, size_type pos, const allocator_type& a = allocator_type()); basic_string(const basic_string& str, size_type pos, size_type n, const allocator_type& a = allocator_type()); basic_string(const cxxtools::Char* begin, const cxxtools::Char* end, const allocator_type& a = allocator_type()); template basic_string(InputIterator begin, InputIterator end, const allocator_type& a = allocator_type()); ~basic_string(); public: iterator begin() { return privdata_rw(); } iterator end() { return privdata_rw() + length(); } const_iterator begin() const { return privdata_ro(); } const_iterator end() const { return privdata_ro() + length(); } #ifdef HAVE_STRING_REVERSE_ITERATOR reverse_iterator rbegin() { return reverse_iterator( this->end() ); } reverse_iterator rend() { return reverse_iterator( this->begin() ); } const_reverse_iterator rbegin() const { return const_reverse_iterator( this->end() ); } const_reverse_iterator rend() const { return const_reverse_iterator( this->begin() ); } #endif reference operator[](size_type n) { return privdata_rw()[n]; } const_reference operator[](size_type n) const { return privdata_ro()[n]; } reference at(size_type n) { return privdata_rw()[n]; } const_reference at(size_type n) const { return privdata_ro()[n]; } public: void push_back(cxxtools::Char ch) { this->append(1, ch); } void resize( size_t n, cxxtools::Char ch = value_type() ); void reserve(size_t n = 0); void swap(basic_string& str); allocator_type get_allocator() const { return _data; } size_type copy(cxxtools::Char* a, size_type n, size_type pos = 0) const; basic_string substr(size_type pos, size_type n) const { return basic_string(*this, pos, n); } basic_string substr(size_type pos = 0) const { return basic_string(*this, pos); } public: size_type length() const { return isShortString() ? shortStringLength() : longStringLength(); } size_type size() const { return length(); } bool empty() const { return length() == 0; } size_type max_size() const { return ( size_type(-1) / sizeof(cxxtools::Char) ) - 1; } size_type capacity() const { return isShortString() ? shortStringCapacity() : longStringCapacity(); } const cxxtools::Char* data() const { return privdata_ro(); } const cxxtools::Char* c_str() const { return privdata_ro(); } basic_string& assign(const basic_string& str); basic_string& assign(const basic_string& str, size_type pos, size_type n); basic_string& assign(const string& str); basic_string& assign(const string& str, size_type pos, size_type n); basic_string& assign(const wchar_t* str); basic_string& assign(const wchar_t* str, size_type n); basic_string& assign(const cxxtools::Char* str); basic_string& assign(const cxxtools::Char* str, size_type length); basic_string& assign(const char* str); basic_string& assign(const char* str, size_type length); basic_string& assign(size_type n, cxxtools::Char c); template basic_string& assign(InputIterator begin, InputIterator end); basic_string& append(const cxxtools::Char* str); basic_string& append(const cxxtools::Char* str, size_type n); basic_string& append(size_type n, cxxtools::Char ch); basic_string& append(const basic_string& str); basic_string& append(const basic_string& str, size_type pos, size_type n); template basic_string& append(InputIterator begin, InputIterator end); basic_string& append(const cxxtools::Char* begin, const cxxtools::Char* end); basic_string& insert(size_type pos, const cxxtools::Char* str); basic_string& insert(size_type pos, const cxxtools::Char* str, size_type n); basic_string& insert(size_type pos, size_type n, cxxtools::Char ch); basic_string& insert(size_type pos, const basic_string& str); basic_string& insert(size_type pos, const basic_string& str, size_type pos2, size_type n); basic_string& insert(iterator p, cxxtools::Char ch); basic_string& insert(iterator p, size_type n, cxxtools::Char ch); // unimplemented //template //basic_string& insert(iterator p, InputIterator first, InputIterator last); void clear() { setLength(0); } basic_string& erase(size_type pos = 0, size_type n = npos); iterator erase(iterator pos); iterator erase(iterator first, iterator last); basic_string& replace(size_type pos, size_type n, const cxxtools::Char* str); basic_string& replace(size_type pos, size_type n, const cxxtools::Char* str, size_type n2); basic_string& replace(size_type pos, size_type n, size_type n2, cxxtools::Char ch); basic_string& replace(size_type pos, size_type n, const basic_string& str); basic_string& replace(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2); basic_string& replace(iterator i1, iterator i2, const cxxtools::Char* str); basic_string& replace(iterator i1, iterator i2, const cxxtools::Char* str, size_type n); basic_string& replace(iterator i1, iterator i2, size_type n, cxxtools::Char ch); basic_string& replace(iterator i1, iterator i2, const basic_string& str); //template //basic_string& replace(iterator i1, iterator i2, InputIterator j1, InputIterator j2); int compare(const basic_string& str) const; int compare(const cxxtools::Char* str) const; int compare(const cxxtools::Char* str, size_type n) const; int compare(const wchar_t* str) const; int compare(const wchar_t* str, size_type n) const; int compare(const std::string& str) const { return compare(str.data(), str.length()); } int compare(const char* str) const; int compare(const char* str, size_type n) const; int compare(size_type pos, size_type n, const basic_string& str) const; int compare(size_type pos, size_type n, const basic_string& str, size_type pos2, size_type n2) const; int compare(size_type pos, size_type n, const cxxtools::Char* str) const; int compare(size_type pos, size_type n, const cxxtools::Char* str, size_type n2) const; size_type find(const basic_string& str, size_type pos = 0) const; size_type find(const cxxtools::Char* str, size_type pos, size_type n) const; size_type find(const cxxtools::Char* str, size_type pos = 0) const; // size_type find(cxxtools::Char ch, size_type pos = 0) const; size_type rfind(const basic_string& str, size_type pos = npos) const; size_type rfind(const cxxtools::Char* str, size_type pos, size_type n) const; size_type rfind(const cxxtools::Char* str, size_type pos = npos) const; size_type rfind(cxxtools::Char ch, size_type pos = npos) const; size_type find_first_of(const basic_string& str, size_type pos = 0) const { return this->find_first_of( str.data(), pos, str.size() ); } size_type find_first_of(const cxxtools::Char* s, size_type pos, size_type n) const; size_type find_first_of(const cxxtools::Char* str, size_type pos = 0) const { return this->find_first_of( str, pos, traits_type::length(str) ); } size_type find_first_of(const cxxtools::Char ch, size_type pos = 0) const { return this->find(ch, pos); } size_type find_last_of(const basic_string& str, size_type pos = npos) const { return this->find_last_of( str.data(), pos, str.size() ); } size_type find_last_of(const cxxtools::Char* s, size_type pos, size_type n) const; size_type find_last_of(const cxxtools::Char* str, size_type pos = npos) const { return this->find_last_of( str, pos, traits_type::length(str) ); } size_type find_last_of(const cxxtools::Char ch, size_type pos = npos) const { return this->rfind(ch, pos); } size_type find_first_not_of(const basic_string& str, size_type pos = 0) const { return this->find_first_not_of( str.data(), pos, str.size() ); } size_type find_first_not_of(const cxxtools::Char* s, size_type pos, size_type n) const; size_type find_first_not_of(const cxxtools::Char* str, size_type pos = 0) const { // requires_string(str); return this->find_first_not_of( str, pos, traits_type::length(str) ); } size_type find_first_not_of(const cxxtools::Char ch, size_type pos = 0) const; size_type find_last_not_of(const basic_string& str, size_type pos = npos) const { return this->find_last_not_of( str.data(), pos, str.size() ); } size_type find_last_not_of(const cxxtools::Char* tok, size_type pos, size_type n) const; size_type find_last_not_of(const cxxtools::Char* str, size_type pos = npos) const { //requires_string(s); return this->find_last_not_of( str, pos, traits_type::length(str) ); } // untested size_type find_last_not_of(cxxtools::Char ch, size_type pos = npos) const; public: std::string narrow(char dfault = '?') const; static basic_string widen(const char* str); static basic_string widen(const std::string& str); template OutIterT toUtf16(OutIterT to) const; template static basic_string fromUtf16(InIterT from, InIterT fromEnd); public: basic_string& operator=(const basic_string& str) { return this->assign(str); } basic_string& operator=(const string& str) { return this->assign(str); } basic_string& operator=(const char* str) { return this->assign(str); } basic_string& operator=(const cxxtools::Char* str) { return this->assign(str); } basic_string& operator=(cxxtools::Char c) { return this->assign(1, c); } basic_string& operator+=(const basic_string& str) { return this->append(str); } basic_string& operator+=(const cxxtools::Char* str) { return this->append(str); } basic_string& operator+=(cxxtools::Char c) { return this->append(1, c); } private: struct Ptr { cxxtools::Char* _begin; cxxtools::Char* _end; cxxtools::Char* _capacity; }; static const unsigned _minN = (sizeof(Ptr) / sizeof(uint32_t)) + 1; static const unsigned _shortStringSize = _minN < 8 ? 8 : _minN; struct Data : public allocator_type { Data(const allocator_type& a) : allocator_type(a) { u.shortdata[0] = 0; u.shortdata[_shortStringSize - 1] = _shortStringSize - 1; } union { Ptr ptr; uint32_t shortdata[_shortStringSize]; } u; } _data; private: const cxxtools::Char* privdata_ro() const { return isShortString() ? shortStringData() : longStringData(); } cxxtools::Char* privdata_rw() { return isShortString() ? shortStringData() : longStringData(); } void privreserve(size_t n); bool isShortString() const { return shortStringMagic() != 0xffff; } void markLongString() { shortStringMagic() = 0xffff; } const cxxtools::Char* shortStringData() const { return reinterpret_cast(&_data.u.shortdata[0]); } cxxtools::Char* shortStringData() { return reinterpret_cast(&_data.u.shortdata[0]); } uint32_t shortStringMagic() const { return _data.u.shortdata[_shortStringSize - 1]; } uint32_t& shortStringMagic() { return _data.u.shortdata[_shortStringSize - 1]; } size_type shortStringLength() const { return _shortStringSize - 1 - shortStringMagic(); } size_type shortStringCapacity() const { return _shortStringSize - 1; } void setShortStringLength(size_type n) { shortStringData()[n] = cxxtools::Char::null(); shortStringMagic() = _shortStringSize - n - 1; } void shortStringAssign(const cxxtools::Char* str, size_type n) { traits_type::copy(shortStringData(), str, n); shortStringData()[n] = cxxtools::Char::null(); shortStringMagic() = _shortStringSize - n - 1; } void shortStringAssign(const wchar_t* str, size_type n) { for (size_type nn = 0; nn < n; ++nn) shortStringData()[nn] = str[nn]; shortStringData()[n] = cxxtools::Char::null(); shortStringMagic() = _shortStringSize - n - 1; } const cxxtools::Char* longStringData() const { return _data.u.ptr._begin; } cxxtools::Char* longStringData() { return _data.u.ptr._begin; } size_type longStringLength() const { return _data.u.ptr._end - _data.u.ptr._begin; } size_type longStringCapacity() const { return _data.u.ptr._capacity - _data.u.ptr._begin; } void setLength(size_type n) { if (isShortString()) setShortStringLength(n); else { _data.u.ptr._end = _data.u.ptr._begin + n; _data.u.ptr._begin[n] = cxxtools::Char::null(); } } }; inline basic_string operator+(const basic_string& a, const basic_string& b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(const basic_string& a, const cxxtools::Char* b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(const cxxtools::Char* a, const basic_string& b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(const basic_string& a, cxxtools::Char b) { basic_string temp; temp += a; temp += b; return temp; } inline basic_string operator+(cxxtools::Char a, const basic_string& b) { basic_string temp; temp += a; temp += b; return temp; } // operator == inline bool operator==(const basic_string& a, const basic_string& b) { return a.compare(b) == 0; } inline bool operator==(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) == 0; } inline bool operator==(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) == 0; } inline bool operator==(const basic_string& a, const wchar_t* b) { return a.compare(b) == 0; } inline bool operator==(const wchar_t* b, const basic_string& a) { return a.compare(b) == 0; } inline bool operator==(const basic_string& a, const char* b) { return a.compare(b) == 0; } inline bool operator==(const char* b, const basic_string& a) { return a.compare(b) == 0; } inline bool operator==(const basic_string& a, const std::string& b) { return a.compare(b) == 0; } inline bool operator==(const std::string& b, const basic_string& a) { return a.compare(b) == 0; } // operator != inline bool operator!=(const basic_string& a, const basic_string& b) { return a.compare(b) != 0; } inline bool operator!=(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) != 0; } inline bool operator!=(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) != 0; } inline bool operator!=(const basic_string& a, const wchar_t* b) { return a.compare(b) != 0; } // operator < inline bool operator<(const basic_string& a, const basic_string& b) { return a.compare(b) < 0; } inline bool operator<(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) > 0; } inline bool operator<(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) < 0; } inline bool operator<(const basic_string& a, const wchar_t* b) { return a.compare(b) < 0; } // operator > inline bool operator>(const basic_string& a, const basic_string& b) { return a.compare(b) > 0; } inline bool operator>(const cxxtools::Char* a, const basic_string& b) { return b.compare(a) < 0; } inline bool operator>(const basic_string& a, const cxxtools::Char* b) { return a.compare(b) > 0; } inline bool operator>(const basic_string& a, const wchar_t* b) { return a.compare(b) > 0; } CXXTOOLS_API ostream& operator<< (ostream& out, const basic_string& str); } // namespace std namespace cxxtools { /** @brief Unicode capable strings @ingroup Unicode */ typedef std::basic_string String; } // Include the implementation header #include #endif cxxtools-2.2.1/include/cxxtools/csvformatter.h0000664000175000017500000000663312256773774016554 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVFORMATTER_H #define CXXTOOLS_CSVFORMATTER_H #include #include #include #include #include #include namespace cxxtools { class CsvFormatter : public Formatter { public: CsvFormatter(std::ostream& os, TextCodec* codec = new Utf8Codec()); CsvFormatter(TextOStream& os); ~CsvFormatter(); void selectColumn(const std::string& title); void selectColumn(const std::string& memberName, const std::string& title); void delimiter(Char delimiter) { _delimiter = delimiter; } void quote(Char quote) { _quote = quote; } void lineEnding(const String& le) { _lineEnding = le; } virtual void addValueString(const std::string& name, const std::string& type, const String& value); virtual void beginArray(const std::string& name, const std::string& type); virtual void finishArray(); virtual void beginObject(const std::string& name, const std::string& type); virtual void beginMember(const std::string& name); virtual void finishMember(); virtual void finishObject(); virtual void finish(); private: void toCsvData(String& ret, const std::string& type, const String& value); void dataOut(); bool _firstline; bool _collectTitles; unsigned _level; Char _delimiter; Char _quote; String _lineEnding; // titles and member names struct Title { std::string _memberName; std::string _title; }; std::vector _titles; std::vector<String> _data; std::string _memberName; TextOStream* _ts; TextOStream& _os; }; } #endif // CXXTOOLS_CSVFORMATTER_H �����������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/inifile.h�����������������������������������������������������������0000664�0001750�0001750�00000013236�12256773774�015451� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_INIFILE_H #define CXXTOOLS_INIFILE_H #include <iostream> #include <string> #include <sstream> #include <map> namespace cxxtools { class IniFile { friend std::ostream& operator << (std::ostream& out, const IniFile& ini); typedef std::map<std::string, std::map<std::string, std::string> > MapType; MapType data; public: IniFile() { } explicit IniFile(const std::string& filename); explicit IniFile(std::istream& in); /// Returns true, if section exists. bool exists(const std::string& section) const { return data.find(section) != data.end(); } /// Returns true, if key exists in section exists. bool exists(const std::string& section, const std::string& token) const { MapType::const_iterator si = data.find(section); return si != data.end() && si->second.find(token) != si->second.end(); } /// Returns associated value from section-key-pair or default-value. std::string getValue(const std::string& section, const std::string& token, const std::string& def = std::string()) const { // find section MapType::const_iterator si = data.find(section); if (si != data.end()) { // find token MapType::mapped_type::const_iterator token_it = si->second.find(token); if (token_it != si->second.end()) return token_it->second; } return def; } /// Get the value and convert it with istream-operator. /// The return-type is identified by the default-value-type. template <typename T> T getValueT(const std::string& section, const std::string& token, const T& def) const { // find section MapType::const_iterator si = data.find(section); if (si != data.end()) { // find token MapType::mapped_type::const_iterator token_it = si->second.find(token); if (token_it != si->second.end()) { // extract value with stream T value; std::istringstream s(token_it->second); s >> value; if (s) return value; } } return def; } /// setting a new value void setValue(const std::string& section, const std::string& key, const std::string& value) { data[section][key] = value; } /// setting a new value with a type (need output-operator for ostream). template <typename T> void setValueT(const std::string& section, const std::string& key, const T& value) { std::ostringstream v; v << value; data[section][key] = v.str(); } /** * Get the names of sections. * example1: * <code> * cxxtools::IniFile ini("my.ini"); * * // copy names of sections into a container * std::set<std::string> keys; * ini.getSections(std::inserter(s, s.begin()); * * // or printing the names: * ini.getSections(std::ostream_iterator(std::cout, "\n")); * </code> */ template <typename OutputIterator> void getSections(OutputIterator oi) { for (MapType::const_iterator it = data.begin(); it != data.end(); ++it, ++oi) *oi = it->first; } /** * Get the keys of a section. * example1: * <code> * cxxtools::IniFile ini("my.ini"); * * // copy keys into a container * std::set<std::string> keys; * ini.getKeys("section2", std::inserter(s, s.begin()); * * // or printing the keys: * ini.getKeys("section2", std::ostream_iterator(std::cout, "\n")); * </code> */ template <typename OutputIterator> void getKeys(const std::string& section, OutputIterator oi) { MapType::const_iterator si = data.find(section); if (si != data.end()) { for (MapType::mapped_type::const_iterator it = si->second.begin(); it != si->second.end(); ++it, ++oi) *oi = it->first; } } }; /// Outputs ini-file to a output-stream std::ostream& operator << (std::ostream& out, const IniFile& ini); } #endif // CXXTOOLS_INIFILE_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/propertiesdeserializer.h��������������������������������������������0000664�0001750�0001750�00000004064�12256773774�020630� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_PROPERTIESDESERIALIZER_H #define CXXTOOLS_PROPERTIESDESERIALIZER_H #include <cxxtools/composer.h> #include <cxxtools/serializationinfo.h> #include <cxxtools/serializationerror.h> #include <cxxtools/deserializer.h> #include <cxxtools/textstream.h> namespace cxxtools { class CXXTOOLS_API PropertiesDeserializer : public Deserializer { class Ev; friend class Ev; public: PropertiesDeserializer(std::istream& in, TextCodec<Char, char>* codec = 0); PropertiesDeserializer(TextIStream& in); ~PropertiesDeserializer(); private: void doDeserialize(); TextIStream* _ts; TextIStream& _in; }; } #endif // CXXTOOLS_PROPERTIESDESERIALIZER_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/textstream.h��������������������������������������������������������0000664�0001750�0001750�00000032106�12256773774�016227� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_BasicTextStream_h #define cxxtools_BasicTextStream_h #include <cxxtools/api.h> #include <cxxtools/textbuffer.h> #include <iostream> namespace cxxtools { /** @brief Converts character sequences using a Codec. This generic stream, which only supports input, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered. This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device. The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed! @see std::basic_istream */ template <typename CharT, typename ByteT> class BasicTextIStream : public std::basic_istream<CharT> { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits<CharT> traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef std::basic_istream<extern_type> StreamType; typedef TextCodec<char_type, extern_type> CodecType; public: /** @brief Construct by input stream and codec. The input stream @a is is used ro read a character sequence and convert it using the codec @a codec. The Codec object which is passed as pointer will afterwards be managed by this class and also be deleted on destruction */ BasicTextIStream(StreamType& is, CodecType* codec) : std::basic_istream<intern_type>(0) , _buffer( &is, codec ) { std::basic_istream<CharT>::init(&_buffer); std::basic_istream<CharT>::exceptions(is.exceptions()); } explicit BasicTextIStream(CodecType* codec) : std::basic_istream<intern_type>(0) , _buffer( 0, codec ) { std::basic_istream<CharT>::init(&_buffer); } //! @brief Deletes to codec. ~BasicTextIStream() { } void attach(StreamType& is) { _buffer.attach( is ); this->clear(); std::basic_istream<CharT>::exceptions(is.exceptions()); } void detach() { _buffer.detach(); this->clear(); } void terminate() { _buffer.terminate(); } BasicTextBuffer<intern_type, extern_type>& buffer() { return _buffer; } private: BasicTextBuffer<intern_type, extern_type> _buffer; }; /** @brief Converts character sequences using a Codec. This generic stream, which only supports output, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered. This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device. The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed! @see std::basic_istream */ template <typename CharT, typename ByteT> class BasicTextOStream : public std::basic_ostream<CharT> { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits<CharT> traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef std::basic_ostream<extern_type> StreamType; typedef TextCodec<char_type, extern_type> CodecType; public: /** @brief Construct by output stream and codec. The output stream @a os is used to write a character sequence which has been converted using the codec @a codec. The Codec object which is passed as pointer will afterwards be managed by this class and be deleted on destruction */ BasicTextOStream(StreamType& os, CodecType* codec) : std::basic_ostream<intern_type>(0) , _buffer( &os , codec ) { std::basic_ostream<CharT>::init(&_buffer); std::basic_ostream<CharT>::exceptions(os.exceptions()); } explicit BasicTextOStream(CodecType* codec) : std::basic_ostream<intern_type>(0) , _buffer( 0 , codec ) { std::basic_ostream<CharT>::init(&_buffer); } //! @brief Deletes to codec. ~BasicTextOStream() { } void attach(StreamType& os) { _buffer.attach( os ); std::basic_ostream<CharT>::exceptions(os.exceptions()); this->clear(); } void detach() { _buffer.detach(); this->clear(); } void terminate() { _buffer.terminate(); } BasicTextBuffer<intern_type, extern_type>& buffer() { return _buffer; } private: BasicTextBuffer<intern_type, extern_type> _buffer; }; /** @brief Converts character sequences using a Codec. This generic stream, which only supports input and output, wraps another input-stream and converts the character data which is received from the stream on-the-fly using a Codec. The data which is received from the wrapped input-stream is buffered. This class derives from std::basic_istream which is the super-class of input-stream classes. Stream classes are used to connect to an external device and transport characters from this external device. The internal character set can be specified using the template parameters 'I', the external character set using 'E'. The external type is the input type and output type when reading from or writing to the external device. The internal type is the type which is used to internally store the data from the external device after the external format was converted using the Codec which is passed when constructing an object of this class. The Codec object which is passed as pointer to the constructor will afterwards be managed by this class and also be deleted by this class when it's destructed! @see std::basic_istream */ template <typename CharT, typename ByteT> class BasicTextStream : public std::basic_iostream<CharT> { public: typedef ByteT extern_type; typedef CharT intern_type; typedef CharT char_type; typedef typename std::char_traits<CharT> traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; typedef std::basic_iostream<extern_type> StreamType; typedef TextCodec<char_type, extern_type> CodecType; public: /** @brief Construct by stream and codec. The stream @a ios is used to read a character sequences and convert is using the codec @a codec and write character sequences which have been converted using the codec @a codec. The codec object which is passed as pointer will afterwards be managed by this class and be deleted on destruction */ BasicTextStream(StreamType& ios, CodecType* codec) : std::basic_iostream<intern_type>(0) , _buffer( &ios, codec) { std::basic_iostream<CharT>::init(&_buffer); std::basic_iostream<CharT>::exceptions(ios.exceptions()); } explicit BasicTextStream(CodecType* codec) : std::basic_iostream<intern_type>(0) , _buffer(0, codec) { std::basic_iostream<CharT>::init(&_buffer); } //! @brief Deletes the codec. ~BasicTextStream() { } void attach(StreamType& ios) { _buffer.attach( ios ); this->clear(); std::basic_iostream<CharT>::exceptions(ios.exceptions()); } void detach() { _buffer.detach(); this->clear(); } void terminate() { _buffer.terminate(); } BasicTextBuffer<intern_type, extern_type>& buffer() { return _buffer; } private: BasicTextBuffer<intern_type, extern_type> _buffer; }; /** @brief Text Input Stream for Character conversion */ class CXXTOOLS_API TextIStream : public BasicTextIStream<Char, char> { public: typedef TextCodec<cxxtools::Char, char> Codec; public: /** @brief Constructor The stream will read bytes from \a is and use the codec \a codec for character conversion. The codec will be destroyed by the buffer of this stream if the codec was constructed with a refcount of 0. */ TextIStream(std::istream& is, Codec* codec); explicit TextIStream(Codec* codec); ~TextIStream(); }; /** @brief Text Output Stream for Character conversion */ class CXXTOOLS_API TextOStream : public BasicTextOStream<Char, char> { public: typedef TextCodec<cxxtools::Char, char> Codec; public: /** @brief Constructor The stream will write bytes to \a os and use the codec \a codec for character conversion. The codec will be destroyed by the buffer of this stream if the codec was constructed with a refcount of 0. */ TextOStream(std::ostream& os, Codec* codec); explicit TextOStream(Codec* codec); ~TextOStream(); }; /** @brief Text Stream for Character conversion */ class CXXTOOLS_API TextStream : public BasicTextStream<Char, char> { public: typedef TextCodec<cxxtools::Char, char> Codec; public: /** @brief Constructor The stream will write or write bytes to \a ios and use the codec \a codec for character conversion. The codec will be destroyed by the buffer of this stream if the codec was constructed with a refcount of 0. */ TextStream(std::iostream& ios, Codec* codec); explicit TextStream(Codec* codec); ~TextStream(); }; inline std::basic_ostream<Char>& operator<< (std::basic_ostream<Char>& out, wchar_t ch) { return out << Char(ch); } inline std::basic_ostream<Char>& operator<< (std::basic_ostream<Char>& out, const wchar_t* str) { while (*str) out << Char(*str++); return out; } } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/csvparser.h���������������������������������������������������������0000664�0001750�0001750�00000006067�12256773774�016046� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_CSVPARSER_H #define CXXTOOLS_CSVPARSER_H #include <cxxtools/api.h> #include <cxxtools/string.h> #include <vector> namespace cxxtools { class DeserializerBase; class CXXTOOLS_API CsvParser { public: CsvParser() : _deserializer(0), _delimiter(autoDelimiter), _readTitle(true), _noColumns(0), _lineNo(0) { } Char delimiter() const { return _delimiter; } void delimiter(Char ch) { _delimiter = ch; } bool readTitle() const { return _readTitle; } void readTitle(bool sw) { _readTitle = sw; } static const Char autoDelimiter; void begin(DeserializerBase& handler); void advance(Char ch); void finish(); private: enum { state_detectDelim, state_detectDelim_q, state_detectDelim_postq, state_title, state_qtitle, state_qtitlep, state_cr, state_rowstart, state_datastart, state_data0, state_data, state_qdata, state_qdata_end } _state; DeserializerBase* _deserializer; Char _delimiter; bool _readTitle; typedef std::vector<std::string> rowType; rowType _titles; String _value; rowType::size_type _column; unsigned _noColumns; unsigned _lineNo; Char _quote; }; } #endif // CXXTOOLS_CSVPARSER_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/signal.tpp����������������������������������������������������������0000664�0001750�0001750�00000204417�12256773774�015666� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// BEGIN_Signal 10 /** Multicast Signal A Signal can be connected to multiple targets. The return value of the target(s) is/are ignored. */ template <class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Signal : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { this->send(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } }; // END_Signal 10 // BEGIN_SignalSlot 10 /** SignalSlot is a "slot wrapper" for Signal objects. That is, it effectively converts a Signal object into a Slot object, so that it can be used as the target of another Signal. This allows chaining of Signals. */ template <class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class SignalSlot : public BasicSlot<void,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> { public: /** Wraps signal. */ SignalSlot(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal) : _method( signal, &Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>::send ) {} /** Creates a clone of this object and returns it. Caller owns the returned object. */ Slot* clone() const { return new SignalSlot(*this); } /** Returns a pointer to this object's internal Callable object. */ virtual const void* callable() const { return &_method; } /** ??? */ virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } /** ??? */ virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } /** returns true if this object and rhs are equivalent. */ virtual bool equals(const Slot& rhs) const { const SignalSlot* ss = dynamic_cast<const SignalSlot*>(&rhs); return ss ? (_method == ss->_method) : false; } private: mutable ConstMethod<void, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10 > _method; }; /** Creates a SignalSlot object from an equivalent Signal. */ template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> SignalSlot<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> slot( Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> & signal ) { return SignalSlot<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>( signal ); } /** Connects the given signal and slot objects and returns that Connection object (which can normally be ignored). */ template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, const BasicSlot<R,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& slot) { return signal.connect( slot ); } //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, const BasicSlot<R,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& slot) { return signal.disconnect( slot ); } template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, class ClassT, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> void disconnect( Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 10 // BEGIN_Signal 9 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7,a8,a9); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { this->send(a1,a2,a3,a4,a5,a6,a7,a8,a9); } }; // END_Signal 9 // BEGIN_SignalSlot 9 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> void disconnect( Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8,A9>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 9 // BEGIN_Signal 8 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Signal<A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7,a8); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { this->send(a1,a2,a3,a4,a5,a6,a7,a8); } }; // END_Signal 8 // BEGIN_SignalSlot 8 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7,A8)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> void disconnect( Signal<A1,A2,A3,A4,A5,A6,A7,A8>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7,A8>& sender, Signal<A1,A2,A3,A4,A5,A6,A7,A8>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 8 // BEGIN_Signal 7 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Signal<A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6,a7); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { this->send(a1,a2,a3,a4,a5,a6,a7); } }; // END_Signal 7 // BEGIN_SignalSlot 7 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4, class A5, class A6, class A7> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7>& sender, Signal<A1,A2,A3,A4,A5,A6,A7>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7>& signal, R(*func)(A1,A2,A3,A4,A5,A6,A7)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6,A7)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> void disconnect(Signal<A1,A2,A3,A4,A5,A6,A7>& signal, ClassT & object, R(BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4, class A5, class A6, class A7> void disconnect( Signal<A1,A2,A3,A4,A5,A6,A7>& sender, Signal<A1,A2,A3,A4,A5,A6,A7>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4, class A5, class A6, class A7> Connection connect(Signal<A1,A2,A3,A4,A5,A6,A7>& sender, Signal<A1,A2,A3,A4,A5,A6,A7>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 7 // BEGIN_Signal 6 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6> class Signal<A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5,a6); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { this->send(a1,a2,a3,a4,a5,a6); } }; // END_Signal 6 // BEGIN_SignalSlot 6 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4, class A5, class A6> Connection connect(Signal<A1,A2,A3,A4,A5,A6>& signal, R(*func)(A1,A2,A3,A4,A5,A6)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6> Connection connect(Signal<A1,A2,A3,A4,A5,A6>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6> Connection connect(Signal<A1,A2,A3,A4,A5,A6>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4, class A5, class A6> Connection connect(Signal<A1,A2,A3,A4,A5,A6>& sender, Signal<A1,A2,A3,A4,A5,A6>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4, class A5, class A6> void disconnect(Signal<A1,A2,A3,A4,A5,A6>& signal, R(*func)(A1,A2,A3,A4,A5,A6)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6> void disconnect(Signal<A1,A2,A3,A4,A5,A6>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6> void disconnect(Signal<A1,A2,A3,A4,A5,A6>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5,A6) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4, class A5, class A6> void disconnect( Signal<A1,A2,A3,A4,A5,A6>& sender, Signal<A1,A2,A3,A4,A5,A6>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4, class A5, class A6> Connection connect(Signal<A1,A2,A3,A4,A5,A6>& sender, Signal<A1,A2,A3,A4,A5,A6>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 6 // BEGIN_Signal 5 // specialization template <class A1, class A2, class A3, class A4, class A5> class Signal<A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4,a5); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { this->send(a1,a2,a3,a4,a5); } }; // END_Signal 5 // BEGIN_SignalSlot 5 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4, class A5> Connection connect(Signal<A1,A2,A3,A4,A5>& signal, R(*func)(A1,A2,A3,A4,A5)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5> Connection connect(Signal<A1,A2,A3,A4,A5>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5> Connection connect(Signal<A1,A2,A3,A4,A5>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4, class A5> Connection connect(Signal<A1,A2,A3,A4,A5>& sender, Signal<A1,A2,A3,A4,A5>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4, class A5> void disconnect(Signal<A1,A2,A3,A4,A5>& signal, R(*func)(A1,A2,A3,A4,A5)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5> void disconnect(Signal<A1,A2,A3,A4,A5>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2, class A3, class A4, class A5> void disconnect(Signal<A1,A2,A3,A4,A5>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4,A5) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4, class A5> void disconnect( Signal<A1,A2,A3,A4,A5>& sender, Signal<A1,A2,A3,A4,A5>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4, class A5> Connection connect(Signal<A1,A2,A3,A4,A5>& sender, Signal<A1,A2,A3,A4,A5>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 5 // BEGIN_Signal 4 // specialization template <class A1, class A2, class A3, class A4> class Signal<A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3, A4 a4) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3,a4); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { this->send(a1,a2,a3,a4); } }; // END_Signal 4 // BEGIN_SignalSlot 4 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3, class A4> Connection connect(Signal<A1,A2,A3,A4>& signal, R(*func)(A1,A2,A3,A4)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4> Connection connect(Signal<A1,A2,A3,A4>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3, class A4> Connection connect(Signal<A1,A2,A3,A4>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3, class A4> Connection connect(Signal<A1,A2,A3,A4>& sender, Signal<A1,A2,A3,A4>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3, class A4> void disconnect(Signal<A1,A2,A3,A4>& signal, R(*func)(A1,A2,A3,A4)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3, class A4> void disconnect(Signal<A1,A2,A3,A4>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3,A4)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2, class A3, class A4> void disconnect(Signal<A1,A2,A3,A4>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3,A4) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3, class A4> void disconnect( Signal<A1,A2,A3,A4>& sender, Signal<A1,A2,A3,A4>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3, class A4> Connection connect(Signal<A1,A2,A3,A4>& sender, Signal<A1,A2,A3,A4>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 4 // BEGIN_Signal 3 // specialization template <class A1, class A2, class A3> class Signal<A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2, A3 a3) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2,a3); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2, A3 a3) const { this->send(a1,a2,a3); } }; // END_Signal 3 // BEGIN_SignalSlot 3 //! Connects a Signal to a function. template <typename R,class A1, class A2, class A3> Connection connect(Signal<A1,A2,A3>& signal, R(*func)(A1,A2,A3)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3> Connection connect(Signal<A1,A2,A3>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2, class A3> Connection connect(Signal<A1,A2,A3>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2, class A3> Connection connect(Signal<A1,A2,A3>& sender, Signal<A1,A2,A3>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2, class A3> void disconnect(Signal<A1,A2,A3>& signal, R(*func)(A1,A2,A3)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2, class A3> void disconnect(Signal<A1,A2,A3>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2,A3)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2, class A3> void disconnect(Signal<A1,A2,A3>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2,A3) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2, class A3> void disconnect( Signal<A1,A2,A3>& sender, Signal<A1,A2,A3>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2, class A3> Connection connect(Signal<A1,A2,A3>& sender, Signal<A1,A2,A3>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 3 // BEGIN_Signal 2 // specialization template <class A1, class A2> class Signal<A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1, A2 a2) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1,a2); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1, A2 a2) const { this->send(a1,a2); } }; // END_Signal 2 // BEGIN_SignalSlot 2 //! Connects a Signal to a function. template <typename R,class A1, class A2> Connection connect(Signal<A1,A2>& signal, R(*func)(A1,A2)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1, class A2> Connection connect(Signal<A1,A2>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1, class A2> Connection connect(Signal<A1,A2>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1, class A2> Connection connect(Signal<A1,A2>& sender, Signal<A1,A2>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1, class A2> void disconnect(Signal<A1,A2>& signal, R(*func)(A1,A2)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1, class A2> void disconnect(Signal<A1,A2>& signal, BaseT & object, R(ClassT::*memFunc)(A1,A2)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1, class A2> void disconnect(Signal<A1,A2>& signal, BaseT& object, R(ClassT::*memFunc)(A1,A2) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1, class A2> void disconnect( Signal<A1,A2>& sender, Signal<A1,A2>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1, class A2> Connection connect(Signal<A1,A2>& sender, Signal<A1,A2>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 2 // BEGIN_Signal 1 // specialization template <class A1> class Signal<A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send(A1 a1) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(a1); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()(A1 a1) const { this->send(a1); } }; // END_Signal 1 // BEGIN_SignalSlot 1 //! Connects a Signal to a function. template <typename R,class A1> Connection connect(Signal<A1>& signal, R(*func)(A1)) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT,class A1> Connection connect(Signal<A1>& signal, BaseT& object, R(ClassT::*memFunc)(A1)) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT,class A1> Connection connect(Signal<A1>& signal, BaseT& object, R(ClassT::*memFunc)(A1) const) { return connect( signal, slot(object, memFunc) ); } /// Connects a Signal to another Signal /** template <class A1> Connection connect(Signal<A1>& sender, Signal<A1>& receiver) { return connect( sender, slot(receiver) ); } */ template <typename R,class A1> void disconnect(Signal<A1>& signal, R(*func)(A1)) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT,class A1> void disconnect(Signal<A1>& signal, BaseT & object, R(ClassT::*memFunc)(A1)) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT,class A1> void disconnect(Signal<A1>& signal, BaseT& object, R(ClassT::*memFunc)(A1) const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R,class A1> void disconnect( Signal<A1>& sender, Signal<A1>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ template <class A1> Connection connect(Signal<A1>& sender, Signal<A1>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 1 // BEGIN_Signal 0 // specialization template <> class Signal<Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> : public SignalBase { public: typedef Invokable<Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> InvokableT; public: /** Does nothing. */ Signal() { } /** Deeply copies rhs. */ Signal(const Signal& rhs) { Signal::operator=(rhs); } /** Connects slot to this signal, such that firing this signal will invoke slot. */ template <typename R> Connection connect(const BasicSlot<R, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>& slot) { return Connection(*this, slot.clone() ); } /** The converse of connect(). */ template <typename R> void disconnect(const BasicSlot<R, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>& slot) { this->disconnectSlot(slot); } /** Invokes all slots connected to this signal, in an undefined order. Their return values are ignored. Calling of connected slots will be interrupted if a slot deletes this Signal object or throws an exception. */ inline void send() const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. SignalBase::Sentry sentry(this); std::list<Connection>::const_iterator it = Connectable::connections().begin(); std::list<Connection>::const_iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( false == it->valid() || &( it->sender() ) != this ) continue; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot const InvokableT* invokable = static_cast<const InvokableT*>( it->slot().callable() ); invokable->invoke(); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } /** Same as send(...). */ inline void operator()() const { this->send(); } }; // END_Signal 0 // BEGIN_SignalSlot 0 //! Connects a Signal to a function. template <typename R> Connection connect(Signal<>& signal, R(*func)()) { return connect( signal, slot(func) ); } //! Connects a Signal to a member function. template <typename R, class BaseT, class ClassT> Connection connect(Signal<>& signal, BaseT& object, R(ClassT::*memFunc)()) { return connect( signal, slot(object, memFunc) ); } //! Connects a Signal to a const member function. template <typename R, class BaseT, class ClassT> Connection connect(Signal<>& signal, BaseT& object, R(ClassT::*memFunc)() const) { return connect( signal, slot(object, memFunc) ); } template <typename R> void disconnect(Signal<>& signal, R(*func)()) { signal.disconnect( slot(func) ); } template <typename R, typename BaseT, typename ClassT> void disconnect(Signal<>& signal, BaseT & object, R(ClassT::*memFunc)()) { signal.disconnect( slot( object, memFunc ) ); } template <typename R, class BaseT, typename ClassT> void disconnect(Signal<>& signal, BaseT& object, R(ClassT::*memFunc)() const) { signal.disconnect( slot( object, memFunc ) ); } template <typename R> void disconnect( Signal<>& sender, Signal<>& receiver ) { sender.disconnect( slot(receiver) ); } /** Connects a Signal to another Signal. */ inline Connection connect(Signal<>& sender, Signal<>& receiver) { return connect( sender, slot(receiver) ); } // END_SignalSlot 0 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/remoteprocedure.h���������������������������������������������������0000664�0001750�0001750�00000061417�12266277345�017234� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTEPROCEDURE_H #define CXXTOOLS_REMOTEPROCEDURE_H #include <cxxtools/remoteclient.h> #include <cxxtools/remoteresult.h> #include <cxxtools/composer.h> #include <cxxtools/decomposer.h> #include <cxxtools/signal.h> #include <cxxtools/string.h> #include <string> namespace cxxtools { class IRemoteProcedure { public: IRemoteProcedure(RemoteClient& client, const String& name) : _client(&client) , _name(name) { } virtual ~IRemoteProcedure() { cancel(); } RemoteClient& client() { return *_client; } void client(RemoteClient& client) { _client = &client; } const String& name() const { return _name; } virtual void setFault(int rc, const std::string& msg) = 0; virtual bool failed() const = 0; void cancel() { if (_client && _client->activeProcedure() == this) _client->cancel(); } virtual void onFinished() = 0; private: RemoteClient* _client; String _name; }; template <typename R> class RemoteProcedureBase : public IRemoteProcedure { public: RemoteProcedureBase(RemoteClient& client, const String& name) : IRemoteProcedure(client, name), _result(client) { } void setFault(int rc, const std::string& msg) { _result.setFault(rc, msg); } const R& result() { return _result.get(); } virtual bool failed() const { return _result.failed(); } Signal< const RemoteResult<R> & > finished; const R& end(std::size_t msecs = RemoteClient::WaitInfinite) { _result.client().wait(msecs); return _result.get(); } protected: void onFinished() { finished.send(_result); } RemoteResult<R> _result; Composer<R> _r; }; template <typename R, typename A1 = cxxtools::Void, typename A2 = cxxtools::Void, typename A3 = cxxtools::Void, typename A4 = cxxtools::Void, typename A5 = cxxtools::Void, typename A6 = cxxtools::Void, typename A7 = cxxtools::Void, typename A8 = cxxtools::Void, typename A9 = cxxtools::Void, typename A10 = cxxtools::Void> class RemoteProcedure : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); _a10.begin(a10); this->_r.begin(this->_result.value()); IDecomposer* argv[10] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9, &_a10 }; this->client().beginCall(this->_r, *this, argv, 10); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); _a10.begin(a10); this->_r.begin(this->_result.value()); IDecomposer* argv[10] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9, &_a10 }; this->client().call(this->_r, *this, argv, 10); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9, const A10& a10) { return this->call(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; Decomposer<A5> _a5; Decomposer<A6> _a6; Decomposer<A7> _a7; Decomposer<A8> _a8; Decomposer<A9> _a9; Decomposer<A10> _a10; }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> class RemoteProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); this->_r.begin(this->_result.value()); IDecomposer* argv[9] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9 }; this->client().beginCall(this->_r, *this, argv, 9); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); _a9.begin(a9); this->_r.begin(this->_result.value()); IDecomposer* argv[9] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8, &_a9 }; this->client().call(this->_r, *this, argv, 9); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9) { return this->call(a1, a2, a3, a4, a5, a6, a7, a8, a9); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; Decomposer<A5> _a5; Decomposer<A6> _a6; Decomposer<A7> _a7; Decomposer<A8> _a8; Decomposer<A9> _a9; }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> class RemoteProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); this->_r.begin(this->_result.value()); IDecomposer* argv[8] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8 }; this->client().beginCall(this->_r, *this, argv, 8); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); _a8.begin(a8); this->_r.begin(this->_result.value()); IDecomposer* argv[8] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7, &_a8 }; this->client().call(this->_r, *this, argv, 8); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { return this->call(a1, a2, a3, a4, a5, a6, a7, a8); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; Decomposer<A5> _a5; Decomposer<A6> _a6; Decomposer<A7> _a7; Decomposer<A8> _a8; }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> class RemoteProcedure<R, A1, A2, A3, A4, A5, A6, A7, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); this->_r.begin(this->_result.value()); IDecomposer* argv[7] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7 }; this->client().beginCall(this->_r, *this, argv, 7); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); _a7.begin(a7); this->_r.begin(this->_result.value()); IDecomposer* argv[7] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6, &_a7 }; this->client().call(this->_r, *this, argv, 7); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { return this->call(a1, a2, a3, a4, a5, a6, a7); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; Decomposer<A5> _a5; Decomposer<A6> _a6; Decomposer<A7> _a7; }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> class RemoteProcedure<R, A1, A2, A3, A4, A5, A6, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); this->_r.begin(this->_result.value()); IDecomposer* argv[6] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6 }; this->client().beginCall(this->_r, *this, argv, 6); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); _a6.begin(a6); this->_r.begin(this->_result.value()); IDecomposer* argv[6] = { &_a1, &_a2, &_a3, &_a4, &_a5, &_a6 }; this->client().call(this->_r, *this, argv, 6); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { return this->call(a1, a2, a3, a4, a5, a6); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; Decomposer<A5> _a5; Decomposer<A6> _a6; }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5> class RemoteProcedure<R, A1, A2, A3, A4, A5, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); this->_r.begin(this->_result.value()); IDecomposer* argv[5] = { &_a1, &_a2, &_a3, &_a4, &_a5 }; this->client().beginCall(this->_r, *this, argv, 5); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); _a5.begin(a5); this->_r.begin(this->_result.value()); IDecomposer* argv[5] = { &_a1, &_a2, &_a3, &_a4, &_a5 }; this->client().call(this->_r, *this, argv, 5); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { return this->call(a1, a2, a3, a4, a5); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; Decomposer<A5> _a5; }; template <typename R, typename A1, typename A2, typename A3, typename A4> class RemoteProcedure<R, A1, A2, A3, A4, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3, const A4& a4) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); this->_r.begin(this->_result.value()); IDecomposer* argv[4] = { &_a1, &_a2, &_a3, &_a4 }; this->client().beginCall(this->_r, *this, argv, 4); } const R& call(const A1& a1, const A2& a2, const A3& a3, const A4& a4) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); _a4.begin(a4); this->_r.begin(this->_result.value()); IDecomposer* argv[4] = { &_a1, &_a2, &_a3, &_a4 }; this->client().call(this->_r, *this, argv, 4); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4) { return this->call(a1, a2, a3, a4); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; Decomposer<A4> _a4; }; template <typename R, typename A1, typename A2, typename A3> class RemoteProcedure<R, A1, A2, A3, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2, const A3& a3) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); this->_r.begin(this->_result.value()); IDecomposer* argv[3] = { &_a1, &_a2, &_a3 }; this->client().beginCall(this->_r, *this, argv, 3); } const R& call(const A1& a1, const A2& a2, const A3& a3) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); _a3.begin(a3); this->_r.begin(this->_result.value()); IDecomposer* argv[3] = { &_a1, &_a2, &_a3 }; this->client().call(this->_r, *this, argv, 3); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2, const A3& a3) { return this->call(a1, a2, a3); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; Decomposer<A3> _a3; }; template <typename R, typename A1, typename A2> class RemoteProcedure<R, A1, A2, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1, const A2& a2) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); this->_r.begin(this->_result.value()); IDecomposer* argv[2] = { &_a1, &_a2 }; this->client().beginCall(this->_r, *this, argv, 2); } const R& call(const A1& a1, const A2& a2) { this->_result.clearFault(); _a1.begin(a1); _a2.begin(a2); this->_r.begin(this->_result.value()); IDecomposer* argv[2] = { &_a1, &_a2 }; this->client().call(this->_r, *this, argv, 2); return this->_result.get(); } const R& operator()(const A1& a1, const A2& a2) { return this->call(a1, a2); } private: Decomposer<A1> _a1; Decomposer<A2> _a2; }; template <typename R, typename A1> class RemoteProcedure<R, A1, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin(const A1& a1) { this->_result.clearFault(); _a1.begin(a1); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { &_a1 }; this->client().beginCall(this->_r, *this, argv, 1); } const R& call(const A1& a1) { this->_result.clearFault(); _a1.begin(a1); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { &_a1 }; this->client().call(this->_r, *this, argv, 1); return this->_result.get(); } const R& operator()(const A1& a1) { return this->call(a1); } private: Decomposer<A1> _a1; }; template <typename R> class RemoteProcedure<R, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public RemoteProcedureBase<R> { public: RemoteProcedure(RemoteClient& client, const String& name) : RemoteProcedureBase<R>(client, name) { } RemoteProcedure(RemoteClient& client, const char* name) : RemoteProcedureBase<R>(client, String(name)) { } void begin() { this->_result.clearFault(); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { 0 }; this->client().beginCall(this->_r, *this, argv, 0); } const R& call() { this->_result.clearFault(); this->_r.begin(this->_result.value()); IDecomposer* argv[1] = { 0 }; this->client().call(this->_r, *this, argv, 0); return this->_result.get(); } const R& operator()() { return this->call(); } }; } #endif // CXXTOOLS_REMOTEPROCEDURE_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/atomicity.gcc.mips.h������������������������������������������������0000664�0001750�0001750�00000003104�12256773774�017527� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_MIPS_H #define CXXTOOLS_ATOMICINT_GCC_MIPS_H #include <csignal> namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/atomicity.h���������������������������������������������������������0000664�0001750�0001750�00000013726�12256773774�016040� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 by Marc Boris Duerner * Copyright (C) 2006-2007 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICITY_H #define CXXTOOLS_ATOMICITY_H #include <cxxtools/config.h> #if defined(CXXTOOLS_ATOMICITY_SUN) #include <cxxtools/atomicity.sun.h> #elif defined(CXXTOOLS_ATOMICITY_WINDOWS) #include <cxxtools/atomicity.windows.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_ARM) #include <cxxtools/atomicity.gcc.arm.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_MIPS) #include <cxxtools/atomicity.gcc.mips.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_AVR32) #include <cxxtools/atomicity.gcc.avr32.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_SPARC32) #include <cxxtools/atomicity.gcc.sparc32.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_SPARC64) #include <cxxtools/atomicity.gcc.sparc64.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_X86_64) #include <cxxtools/atomicity.gcc.x86_64.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_X86) #include <cxxtools/atomicity.gcc.x86.h> #elif defined(CXXTOOLS_ATOMICITY_GCC_PPC) #include <cxxtools/atomicity.gcc.ppc.h> #elif defined(CXXTOOLS_ATOMICITY_PTHREAD) #include <cxxtools/atomicity.pthread.h> #elif defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE) #define CXXTOOLS_ATOMICITY_WINDOWS #include <cxxtools/atomicity.windows.h> #elif defined(__sun) #define CXXTOOLS_ATOMICITY_SUN #include <cxxtools/atomicity.sun.h> #elif defined(__GNUC__) || defined(__xlC__) || \ defined(__SUNPRO_CC) || defined(__SUNPRO_C) #if defined (i386) || defined(__i386) || defined (__i386__) || \ defined(_X86_) || defined(sun386) || defined (_M_IX86) #define CXXTOOLS_ATOMICITY_GCC_X86 #include <cxxtools/atomicity.gcc.x86.h> #elif defined(__x86_64__) || defined(__amd64__) #define CXXTOOLS_ATOMICITY_GCC_X86_64 #include <cxxtools/atomicity.gcc.x86_64.h> #elif defined (ARM) || defined(__arm__) || defined(_M_ARM) || defined(_M_ARMT) #define CXXTOOLS_ATOMICITY_GCC_ARM #include <cxxtools/atomicity.gcc.arm.h> #elif defined (AVR) || defined(__AVR__) #define CXXTOOLS_ATOMICITY_GCC_AVR32 #include <cxxtools/atomicity.avr32.h> #elif defined( _M_PPC ) || defined( PPC ) || \ defined( ppc ) || defined( __powerpc__ ) || \ defined( __ppc__ ) #define CXXTOOLS_ATOMICITY_GCC_PPC #include <cxxtools/atomicity.gcc.ppc.h> #elif defined(__mips__) || defined(MIPSEB) || defined(_MIPSEB) || \ defined(MIPSEL) || defined(_MIPSEL) #define CXXTOOLS_ATOMICITY_GCC_MIPS #include <cxxtools/atomicity.gcc.mips.h> #elif defined(__sparcv9) #define CXXTOOLS_ATOMICITY_GCC_SPARC64 #include <cxxtools/atomicity.gcc.sparc64.h> #elif defined(__sparc__) || defined(sparc) || defined(__sparc) || \ defined(__sparcv8) #define CXXTOOLS_ATOMICITY_GCC_SPARC32 #include <cxxtools/atomicity.gcc.sparc32.h> #else #include <cxxtools/atomicity.generic.h> #endif #else #include <cxxtools/atomicity.generic.h> #endif namespace cxxtools { /** @brief Atomically get a value Returns the value after employing a memory fence. */ atomic_t atomicGet(volatile atomic_t& val); /** @brief Atomically set a value Sets the value and employs a memory fence. */ void atomicSet(volatile atomic_t& val, atomic_t n); /** @brief Increases a value by one as an atomic operation Returns the resulting incremented value. */ atomic_t atomicIncrement(volatile atomic_t& val); /** @brief Decreases a value by one as an atomic operation Returns the resulting decremented value. */ atomic_t atomicDecrement(volatile atomic_t& val); /** @brief Performs atomic addition of two values Returns the initial value of the addend. */ atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add); /** @brief Performs an atomic compare-and-exchange operation If \a val is equal to \a comp, \a val is replaced by \a exch. The initial value of of \a val is returned. */ atomic_t atomicCompareExchange(volatile atomic_t& val, atomic_t exch, atomic_t comp); /** @brief Performs an atomic compare-and-exchange operation If \a ptr is equal to \a comp, \a ptr is replaced by \a exch. The initial value of \a ptr is returned. */ void* atomicCompareExchange(void* volatile& ptr, void* exch, void* comp); /** @brief Performs an atomic exchange operation Sets \a val to \a exch and returns the initial value of \a val. */ atomic_t atomicExchange(volatile atomic_t& val, atomic_t exch); /** @brief Performs an atomic exchange operation Sets \a dest to \a exch and returns the initial value of \a dest. */ void* atomicExchange(void* volatile& dest, void* exch); } #endif ������������������������������������������cxxtools-2.2.1/include/cxxtools/jsondeserializer.h��������������������������������������������������0000664�0001750�0001750�00000004021�12266277345�017370� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSONDESERIALIZER_H #define CXXTOOLS_JSONDESERIALIZER_H #include <cxxtools/jsonparser.h> #include <cxxtools/api.h> #include <cxxtools/deserializer.h> #include <cxxtools/textstream.h> #include <cxxtools/utf8codec.h> namespace cxxtools { class CXXTOOLS_API JsonDeserializer : public Deserializer { public: JsonDeserializer(std::istream& in, TextCodec<Char, char>* codec = new Utf8Codec()); JsonDeserializer(TextIStream& in); ~JsonDeserializer(); protected: virtual void doDeserialize(); private: TextIStream* _ts; TextIStream& _in; }; } #endif // CXXTOOLS_JSONDESERIALIZER_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/�������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277564�015236� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/client.h�����������������������������������������������������0000775�0001750�0001750�00000004443�12266277345�016612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Client_h #define cxxtools_xmlrpc_Client_h #include <cxxtools/xmlrpc/api.h> #include <cxxtools/remoteclient.h> #include <string> namespace cxxtools { namespace xmlrpc { class ClientImpl; class CXXTOOLS_XMLRPC_API Client : public RemoteClient { ClientImpl* _impl; Client(Client&) { } void operator= (const Client&) { } protected: void impl(ClientImpl* i) { _impl = i; } public: Client() : _impl(0) { } virtual ~Client(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); std::size_t timeout() const; void timeout(std::size_t t); std::string url() const; const IRemoteProcedure* activeProcedure() const; void cancel(); }; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/formatter.h��������������������������������������������������0000775�0001750�0001750�00000005002�12256773774�017335� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Formatter_h #define cxxtools_xmlrpc_Formatter_h #include <cxxtools/xmlrpc/api.h> #include <cxxtools/xml/xmlwriter.h> #include <cxxtools/formatter.h> #include <cxxtools/string.h> #include <string> #include <map> namespace cxxtools { namespace xmlrpc { class CXXTOOLS_XMLRPC_API Formatter : public cxxtools::Formatter { public: Formatter(xml::XmlWriter& writer) : _writer(&writer) { } void addAlias(const std::string& type, const std::string& alias) { _typemap[type] = alias; } void attach(xml::XmlWriter& writer) { _writer = &writer; } void addValueString(const std::string& name, const std::string& type, const cxxtools::String& value); void beginArray(const std::string& name, const std::string& type); void finishArray(); void beginObject(const std::string& name, const std::string& type); void beginMember(const std::string& name); void finishMember(); void finishObject(); void finish(); private: xml::XmlWriter* _writer; std::map<std::string, std::string> _typemap; }; } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/service.h����������������������������������������������������0000775�0001750�0001750�00000003707�12256773774�017004� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Service_h #define cxxtools_xmlrpc_Service_h #include <cxxtools/xmlrpc/api.h> #include <cxxtools/http/service.h> #include <cxxtools/serviceregistry.h> namespace cxxtools { namespace xmlrpc { class CXXTOOLS_XMLRPC_API Service : public http::Service, public ServiceRegistry { friend class XmlRpcResponder; public: Service() { } virtual ~Service(); protected: virtual http::Responder* createResponder(const http::Request&); virtual void releaseResponder(http::Responder* resp); }; } } #endif ���������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/httpclient.h�������������������������������������������������0000664�0001750�0001750�00000005077�12266277345�017513� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_HttpClient_h #define cxxtools_xmlrpc_HttpClient_h #include <cxxtools/xmlrpc/client.h> namespace cxxtools { class SelectorBase; namespace net { class AddrInfo; class Uri; } namespace xmlrpc { class HttpClientImpl; class CXXTOOLS_XMLRPC_API HttpClient : public Client { public: HttpClient(); HttpClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& url); HttpClient(SelectorBase& selector, const net::Uri& uri); HttpClient(const std::string& addr, unsigned short port, const std::string& url); explicit HttpClient(const net::Uri& uri); virtual ~HttpClient(); void connect(const net::AddrInfo& addrinfo, const std::string& url); void connect(const net::Uri& uri); void connect(const std::string& addr, unsigned short port, const std::string& url); void url(const std::string& url); void auth(const std::string& username, const std::string& password); void clearAuth(); void setSelector(SelectorBase& selector); void wait(std::size_t msecs = WaitInfinite); private: HttpClientImpl* _impl; }; } } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/scanner.h����������������������������������������������������0000775�0001750�0001750�00000004670�12256773774�016775� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Scanner_h #define cxxtools_xmlrpc_Scanner_h #include <cxxtools/xmlrpc/api.h> #include <cxxtools/string.h> namespace cxxtools { class DeserializerBase; class IComposer; namespace xml { class Node; } namespace xmlrpc { class CXXTOOLS_XMLRPC_API Scanner { enum State { OnParam, OnValueBegin, OnValueEnd, //OnParamEnd, OnScalarBegin, OnScalar, OnScalarEnd, OnStructBegin, OnMemberBegin, OnNameBegin, OnName, OnNameEnd, //OnMemberEnd, OnStructEnd, OnArrayBegin, OnDataBegin, OnDataEnd, OnArrayEnd }; public: Scanner() : _state(OnParam) , _deserializer(0) , _composer(0) {} ~Scanner() {} void begin(DeserializerBase& handler, IComposer& composer); bool advance(const xml::Node& node); private: State _state; DeserializerBase* _deserializer; IComposer* _composer; String _value; String _type; }; } } #endif ������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/api.h��������������������������������������������������������0000664�0001750�0001750�00000003434�12256773774�016107� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_XMLRPC_API_H #define CXXTOOLS_XMLRPC_API_H #include <cxxtools/api.h> #if defined(CXXTOOLS_XMLRPC_API_EXPORT) # define CXXTOOLS_XMLRPC_API CXXTOOLS_EXPORT #else # define CXXTOOLS_XMLRPC_API CXXTOOLS_IMPORT #endif namespace cxxtools { /** @namespace cxxtools::xmlrpc @brief XML RPC services and clients */ namespace xmlrpc { } // namespace xmlrpc } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/errorcodes.h�������������������������������������������������0000664�0001750�0001750�00000004076�12256773774�017510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_XMLRPC_ERRORCODES_H #define CXXTOOLS_XMLRPC_ERRORCODES_H namespace cxxtools { namespace xmlrpc { namespace ErrorCodes { static const int parseError = -32700; static const int unsupportedEncoding = -32701; static const int invalidCharacterForEncoding = -32702; static const int invalidXmlRpc = -32600; static const int methodNotFound = -32601; static const int invalidMethodParameters = -32602; static const int internalXmlRpcError = -32603; static const int applicationError = -32500; static const int systemError = -32400; static const int transportError = -32300; } } } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/xmlrpc/responder.h��������������������������������������������������0000775�0001750�0001750�00000006021�12256773774�017335� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_Responder_h #define cxxtools_xmlrpc_Responder_h #include <cxxtools/xmlrpc/api.h> #include <cxxtools/remoteexception.h> #include <cxxtools/xmlrpc/scanner.h> #include <cxxtools/xmlrpc/formatter.h> #include <cxxtools/xml/xmlreader.h> #include <cxxtools/xml/xmlwriter.h> #include <cxxtools/http/responder.h> #include <cxxtools/deserializerbase.h> #include <cxxtools/textstream.h> namespace cxxtools { class ServiceProcedure; class IComposer; class IDecomposer; namespace xmlrpc { class Service; class CXXTOOLS_XMLRPC_API XmlRpcResponder : public http::Responder { enum State { OnBegin, OnMethodCallBegin, OnMethodNameBegin, OnMethodName, OnMethodNameEnd, OnParams, OnParam, OnParamsEnd, OnMethodCallEnd }; public: explicit XmlRpcResponder(Service& service); ~XmlRpcResponder(); void beginRequest(std::istream& in, http::Request& request); std::size_t readBody(std::istream& is); void replyError(std::ostream& os, http::Request& request, http::Reply& reply, const std::exception& ex); void reply(std::ostream& os, http::Request& request, http::Reply& reply); protected: void advance(const cxxtools::xml::Node& node); private: State _state; TextIStream _ts; xml::XmlReader _reader; xml::XmlWriter _writer; Scanner _scanner; Formatter _formatter; DeserializerBase _deserializer; Service* _service; ServiceProcedure* _proc; IComposer** _args; RemoteException _fault; }; } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/atomicity.sun.h�����������������������������������������������������0000664�0001750�0001750�00000003144�12256773774�016635� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by PTV AG * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICITY_SUN_H #define CXXTOOLS_ATOMICITY_SUN_H #include <sys/types.h> #include <sys/atomic.h> namespace cxxtools { typedef long atomic_t; } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/stringstream.h������������������������������������������������������0000664�0001750�0001750�00000006160�12256773774�016552� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_STRINGSTREAM_H #define CXXTOOLS_STRINGSTREAM_H #include <cxxtools/api.h> #include <cxxtools/char.h> #include <cxxtools/string.h> #include <sstream> namespace cxxtools { class CXXTOOLS_API StringStreamBuffer : public std::basic_stringbuf<cxxtools::Char> { public: explicit StringStreamBuffer(std::ios::openmode mode = std::ios::in | std::ios::out); explicit StringStreamBuffer(const cxxtools::String& str, std::ios::openmode mode = std::ios::in | std::ios::out); }; } // namespace cxxtools namespace std { template<> class CXXTOOLS_API basic_stringstream<cxxtools::Char> : public basic_iostream<cxxtools::Char> { public: typedef cxxtools::Char char_type; typedef std::char_traits<cxxtools::Char> traits_type; typedef std::allocator<cxxtools::Char> allocator_type; typedef traits_type::int_type int_type; typedef traits_type::pos_type pos_type; typedef traits_type::off_type off_type; public: explicit basic_stringstream(ios_base::openmode mode = ios_base::in | ios_base::out); explicit basic_stringstream(const cxxtools::String& str, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out); virtual ~basic_stringstream(); basic_stringbuf<cxxtools::Char>* rdbuf() const; cxxtools::String str() const; void str(const cxxtools::String& str); private: cxxtools::StringStreamBuffer _buffer; }; } // namespace std namespace cxxtools { typedef std::basic_stringstream<cxxtools::Char> StringStream; typedef std::basic_ostringstream<cxxtools::Char> OStringStream; typedef std::basic_istringstream<cxxtools::Char> IStringStream; } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/thread.h������������������������������������������������������������0000664�0001750�0001750�00000024600�12266277345�015270� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * Copyright (C) 2006-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(CXXTOOLS_SYSTEM_THREAD_H) #define CXXTOOLS_SYSTEM_THREAD_H #include <cxxtools/noncopyable.h> #include <cxxtools/callable.h> #include <cxxtools/function.h> #include <cxxtools/method.h> namespace cxxtools { /** @brief Platform independent threads This is a thread base class, which is flexible, but hard to use. Try to use either an AttachedThread or a DetachedThread instead !!! A Thread represents a separate thread of control within the program. It shares data with all the other threads within the process but executes independently in the way that a separate program does on a multitasking operating system. Each thread gets its own stack, which size is determinated by the operating system. The execution of a thread starts either by calling the start() which calls the thread entry object passed to the constructor. Threads can either be joined, so you can wait for them, or be detached, so they run indepentently. A thread can be forced to terminate by calling terminate(), however, doing so is dangerous and discouraged. Thread also provides a platform independent sleep function. A thread can give up CPU time either by calling Thread::yield() or sleep() to stop for a specified periode of time. */ class Thread : protected NonCopyable { public: //! @brief Status of a thread enum State { Ready = 0, //!< Thread was not started yet Running = 1, //!< Thread was started Finished = 2 //!< Thread has Finished }; protected: /** @brief Default Constructor Constructs a thread object without a thread entry. Use the init() method to set a callable. The thread will terminate immediately, if no thread entry is set. */ Thread(); /** @brief Constructs a thread with a thread entry Constructs a thread object to execute the %Callable \a cb. The Thread is not started on construction, but when start() is called. */ explicit Thread(const Callable<void>& cb); /** @brief Initialize with a thread entry The callable \a cb will be used as the thread entry. If another thread entry was set previously it will be replaced. */ void init(const Callable<void>& cb); public: /** @brief Destructor The thread must either be joined or detached before the destructor is called. */ virtual ~Thread(); //! @brief Returns the current state of the thread. State state() const { return _state; } /** @brief Starts the thread This starts the execution of the thread by calling the thread entry. Throws a SystemError on failure. */ void start(); void create() { this->start(); } /** @brief Exits athread. This function is meant to be called from within a thread to leave the thread at once. Implicitly called when the thread entry is left. Throws a SystemError on failure. */ static void exit(); /** @brief Yield CPU time This function is meant to be called from within a thread to give up the CPU to other threads. Throws a SystemError on failure. */ static void yield(); /** @brief Sleep for some time The calling thread sleeps for \a ms milliseconds. Throws a SystemError on failure. */ static void sleep(unsigned int ms); protected: //! @brief Detaches the thread void detach(); //! @brief Joins the thread void join(); //! @brief Joins the thread bool joinNoThrow(); //! @brief Terminates the thread void terminate(); private: //! @internal Thread::State _state; //! @internal class ThreadImpl* _impl; }; /** @brief Platform independent joinable thread %AttachedThreads are threads, which are managed by the creator, and are normally created on the stack. The creator must wait, until the thread terminates either explicitly by calling join() or implicitly by the destructor. The life-time of the callable object must exceed the life-time of the thread. Mind the order of destruction if the %AttachedThread is a member variable of a class. Example: \code struct Operation { void run() { // implement, whatever needs to be done in parallel } }; int main() { Operation op; cxxtools::Thread thread( cxxtools::callable(op, &Operation::run) ); thread.start(); // the thread runs and we can do something else in parallel doMoreWork(); // the thread's destructor waits for the thread to join // the op object outlives the thread object return 0; } \endcode */ class AttachedThread : public Thread { public: /** @brief Constructs a thread with a thread entry Constructs a thread object to execute the %Callable \a cb. The Thread is not started on construction, but when start() is called. */ explicit AttachedThread(const Callable<void>& cb) : Thread(cb) {} //! @brief Joins the thread, if not already joined. ~AttachedThread() { Thread::joinNoThrow(); } /** @brief Wait explicitly for the thread to terminate. Join() is called automatically in the destructor if not already called. Throws SystemError on failure */ void join() { Thread::join(); } /** @brief Terminates the thread. Forces the thread to terminate is dangerous and discouraged. */ void terminate() { Thread::terminate(); } }; /** @brief Platform independent detached thread A detached thread runs just for its own. The user does not need (actually can not even) wait for the thread to stop. The object is normally created on the heap. Example: \code class MyThread : public cxxtools::DetachedThread { protected: void run(); }; void MyThread::run() { // implement, whatever needs to be done in parallel } void someFunc() { MyThread *thread = new MyThread(); thread->start(); // here the thread runs and the program can do something // else in parallel. It continues to run even after this // function returns. The object is automatically destroyed, // when the thread has finished. } \endcode */ class DetachedThread : public Thread { typedef void (*FuncPtrT)(); public: explicit DetachedThread(FuncPtrT fp) : Thread( callable(fp) ) { Thread::detach(); } protected: /** @brief Constructs a detached thread Constructs a thread object to execute the virtual method run() when start() is called. %DetachedThreads are always destructed by the virtual method destroy(). If objects of this class are created by new, destroy() must be overloaded ti call delete. */ DetachedThread() : Thread() { Thread::init( callable(*this, &DetachedThread::exec) ); Thread::detach(); } /** @brief Destroys a detached thread This method is called after the thread has finished. The default implementation uses delete to destruct this object. */ virtual void destroy() { delete this; } /** @brief Thread entry method This method is executed in a separate thread once start() is called. Override this method to implement a thread. */ virtual void run() {} private: //! @internal void exec() { this->run(); this->destroy(); } }; } // !namespace cxxtools #endif // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/connectable.h�������������������������������������������������������0000664�0001750�0001750�00000010502�12256773774�016300� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Connectable_h #define cxxtools_Connectable_h #include <cxxtools/connection.h> #include <list> namespace cxxtools { /** @brief %Connection management for signal and slot objects @ingroup sigslot This class implements connection management for signal and slot objects. It makes sure that all connections where this object is involved are closed on destruction. Deriving classes can overload Connectable::opened and Connectable::closed to tune connection managenment. */ class Connectable { public: /** @brief Default constructor. Creates an empty %Connectable. */ Connectable(); /** @brief Closes all connections. When a %Connectable object is destroyed, it closes all its connections automatically. */ virtual ~Connectable(); /** @brief Registers a Connection with the %Connectable. This function is called when a new Connection involving this object is opened. The default implementation adds the connection to a list, so the destructor can close it. @param c Connection being opened @return True if the Connection was accepted */ virtual void onConnectionOpen(const Connection& c); /** @brief Unregisters a Connection from the %Connectable. This function is called when a new Connection involving this object is closed. The default implementation removes the connection from its list of connections. @param c Connection being opened */ virtual void onConnectionClose(const Connection& c); //! @internal @brief For unit tests only. size_t connectionCount() const { return _connections.size(); } protected: /** @brief Copy constructor @sa Connectable::operator=() */ Connectable(const Connectable& c); /** @brief Assignment operator Connectables can be copy constructed if the derived class provides a public copy constructor. Copying a %Connectable will not change its connections. */ Connectable& operator=(const Connectable& rhs); /** @brief Returns a list of all current connections */ const std::list<Connection>& connections() const { return _connections; } /** @brief Returns a list of all current connections */ std::list<Connection>& connections() { return _connections; } protected: /** @brief A list of all current connections */ mutable std::list<Connection> _connections; //! @internal void clear(); }; } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/atomicity.pthread.h�������������������������������������������������0000664�0001750�0001750�00000003102�12256773774�017451� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_PTHREAD_H #define CXXTOOLS_ATOMICINT_PTHREAD_H #include <csignal> namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/membar.gcc.h��������������������������������������������������������0000664�0001750�0001750�00000003211�12256773774�016020� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_GCC_H #define CXXTOOLS_MEMBAR_GCC_H namespace cxxtools { inline void membar_rw() { __sync_synchronize(); } inline void membar_write() { __sync_synchronize(); } inline void membar_read() { __sync_synchronize(); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_GCC_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/remoteexception.h���������������������������������������������������0000664�0001750�0001750�00000004361�12256773774�017243� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REMOTEEXCEPTION_H #define CXXTOOLS_REMOTEEXCEPTION_H #include <exception> #include <string> namespace cxxtools { class RemoteException : public std::exception { public: RemoteException() : _rc(0) { } explicit RemoteException(const std::string& text, int rc = 0) : _text(text), _rc(rc) { } ~RemoteException() throw () { } const char* what() const throw () { return _text.c_str(); } const std::string& text() const { return _text; } int rc() const { return _rc; } void text(const std::string& t) { _text = t; } void rc(int v) { _rc = v; } void clear() { _rc = 0; _text.clear(); } protected: std::string _text; int _rc; }; } #endif // CXXTOOLS_REMOTEEXCEPTION_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/join.h��������������������������������������������������������������0000664�0001750�0001750�00000005442�12256773774�014771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <sstream> namespace cxxtools { /** @brief Joins a list of tokens into a output stream using a delimiter. A list of tokens read from a range is printed to a out stream. The tokens are separated by a token. Example (prints "4, 17, 12"): \code std::vector<unsigned> v; v.push_back(4); v.push_back(17); v.push_back(12); join(v.begin(), v.end(), ", ", std::cout); \endcode */ template <typename inputIterator, typename separatorType, typename characterType> void join(inputIterator b, inputIterator e, const separatorType& sep, std::basic_ostream<characterType>& out) { bool first = true; for (inputIterator it = b; it != e; ++it) { if (first) first = false; else out << sep; out << *it; } } /** @brief Joins a list of tokens into a std::string using a delimiter. This function is just like the other join function, but returns the result as a std::string. Example (prints "4, 17, 12"): \code std::vector<unsigned> v; v.push_back(4); v.push_back(17); v.push_back(12); std::cout << join(v.begin(), v.end(), ", "); \endcode */ template <typename inputIterator, typename separatorType> std::string join(inputIterator b, inputIterator e, const separatorType& sep) { std::ostringstream ret; join(b, e, sep, ret); return ret.str(); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/dir.h���������������������������������������������������������������0000664�0001750�0001750�00000003036�12256773774�014605� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DIR_H #define CXXTOOLS_DIR_H #include <cxxtools/directory.h> namespace cxxtools { /** * for compatibility with old implementation */ typedef Directory Dir; } #endif // DIR_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/���������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277564�014710� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testprotocol.h�������������������������������������������������0000664�0001750�0001750�00000005204�12256773774�017546� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTPROTOCOL_H #define CXXTOOLS_UNIT_TESTPROTOCOL_H #include <cxxtools/unit/test.h> #include <cxxtools/unit/assertion.h> namespace cxxtools { namespace unit { class TestSuite; /** @brief Protocol for test suites @ingroup UnitTests This is the base class for protocols that can be used to run a test suite. The default implementation will simply run each registered test of the test suite without passing it any data. Implementors need to override the method TestProtocol::run. */ class TestProtocol { public: /** @brief Destructor */ virtual ~TestProtocol() {} /** @brief Executes the protocol This method can be overriden to specify a custom protocol for a test suite. The default implementation will simply call each registered method of the test suite. Implementors will most likely call TestSuite::runTest to resolve a test method by name and pass it required arguments. @param test The test suite to apply the protocol */ virtual void run(TestSuite& test); }; } // namespace onit } // namespace cxxtools #endif // for header ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/application.h��������������������������������������������������0000664�0001750�0001750�00000012275�12256773774�017316� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_APPLICATION_H #define CXXTOOLS_UNIT_APPLICATION_H #include <cxxtools/unit/reporter.h> #include <cxxtools/unit/test.h> #include <list> #include <string> namespace cxxtools { namespace unit { /** @brief Run registered tests The application class serves as an environment for a number of tests to be run. An application object is usually created in the main loop of a program and the return value of Unit::Application::run returned. A reporter can be set for the application to process test events. Reporters can be made to print information to the console or write XML logs. A typical example may look like this: @code int main() { cxxtools::Unit::Reporter reporter; cxxtools::Unit::Application app; app.setReporter(reporter); return app.run(); } @endcode The TestMain.h include already defines a main loop with an application for the common use case. */ class Application : public Test { public: /** @brief Default Constructor */ Application(); /** @brief Destructor */ virtual ~Application(); static Application& instance(); /** @brief Find a test by name Returns a pointer to the found test or 0 if not found. */ Test* findTest(const std::string& testname); /** @brief Add reporter for test events Adds the reporter \a r to report test events. */ void attachReporter(Reporter& r); /** @brief Add reporter for test events Adds the reporter \a r to report test events of the test name \a testname. */ void attachReporter(Reporter& r, const std::string& testname); /** @brief Run test by name This method will run a previously registered test. Use the RegisterTest<T> template to register a test to the application. @param testName name of the test to be run */ void run(const std::string& testName); /** @brief Run all tests This method will run all tests that have been registered previously. Use the RegisterTest<T> template to register a test to the application. */ virtual void run(); //! @brief Returns the number of errors which occured during a run unsigned errors() const { return _errors; } /** @brief Returns a list of all registered test @return Reference to the registered tests. */ static std::list<Test*>& tests(); /** @brief Register a test Registers the test \a test to the application. The application will not own the test and the caller has to make sure it exists as long as the application object. Tests can be deregistered by calling %deregisterTest. */ static void staticRegisterTest(Test& test); /** @brief Register a test Registers the test \a test to the application. The application will not own the test and the caller has to make sure it exists as long as the application object. Tests can be deregistered by calling %deregisterTest. */ void registerTest(Test& test); void deregisterTest(Test& test); private: static Application* _app; /** @brief Number of errors that occured during a run */ unsigned _errors; }; } // namespace unit } // namespace cxxtools #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testcontext.h��������������������������������������������������0000664�0001750�0001750�00000003707�12256773774�017377� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTCONTEXT_H #define CXXTOOLS_UNIT_TESTCONTEXT_H #include <string> #include <cstddef> namespace cxxtools { namespace unit { class Test; class TestFixture; class TestContext { public: virtual ~TestContext(); std::string testName() const; void run(); protected: TestContext(TestFixture& fixture, Test& test); virtual void exec() = 0; private: TestFixture& _fixture; Test& _test; bool _setUp; }; } // namespace unit } // namespace cxxtools #endif ���������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testmethod.h���������������������������������������������������0000664�0001750�0001750�00000010014�12266277345�017152� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTMETHOD_H #define CXXTOOLS_UNIT_TESTMETHOD_H #include <cxxtools/unit/test.h> #include <stdexcept> #include <cstddef> namespace cxxtools { class SerializationInfo; namespace unit { class TestMethod : public cxxtools::unit::Test { public: TestMethod(const std::string& name) : cxxtools::unit::Test(name) {} virtual ~TestMethod() {} virtual void run() {} virtual void exec(const SerializationInfo* si, unsigned argCount) = 0; }; template < class C, typename A1 = cxxtools::Void, typename A2 = cxxtools::Void, typename A3 = cxxtools::Void, typename A4 = cxxtools::Void, typename A5 = cxxtools::Void, typename A6 = cxxtools::Void, typename A7 = cxxtools::Void, typename A8 = cxxtools::Void > class BasicTestMethod : public cxxtools::Method<void, C, A1, A2, A3, A4, A5, A6, A7, A8> , public TestMethod { public: typedef C ClassT; typedef void (C::*MemFuncT)(A1, A2, A3, A4, A5, A6, A7, A8); public: BasicTestMethod(const std::string& name, C& object, MemFuncT ptr) : cxxtools::Method<void, C, A1, A2, A3, A4, A5, A6, A7, A8>(object, ptr) , TestMethod(name) {} void exec(const SerializationInfo* args, unsigned argCount) { throw std::logic_error("SerializationInfo not implemented"); } virtual void run() {} }; template < class C > class BasicTestMethod<C, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void, cxxtools::Void> : public cxxtools::Method<void, C> , public TestMethod { public: typedef C ClassT; typedef void (C::*MemFuncT)(); public: BasicTestMethod(const std::string& name, C& object, MemFuncT ptr) : cxxtools::Method<void, C>(object, ptr) , TestMethod(name) {} void exec(const SerializationInfo* si, unsigned argCount) { cxxtools::Method<void, C>::call(); } virtual void run() {} }; } // namespace unit } // namespace cxxtools #endif // for header ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/registertest.h�������������������������������������������������0000664�0001750�0001750�00000004543�12256773774�017536� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_REGISTERTEST_H #define CXXTOOLS_UNIT_REGISTERTEST_H #include <cxxtools/api.h> #include <cxxtools/unit/application.h> namespace cxxtools { namespace unit { /** @param TestT The type of test to register */ template <class TestT> /** @brief Registers tests to an application Tests can be registered easily with the RegisterTest<> class template to an Unit::Application at program initialisation. A typical example looks like this: @code class MyTest : public Unit::TestCase { ... }; RegisterTest<MyTest> _registerMyTest; @endcode The constructor of the RegisterTest class template will register an instance of its template parameter to the application. */ struct RegisterTest { RegisterTest() { static TestT test; Application::staticRegisterTest(test); } }; } // namespace unit } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testsuite.h����������������������������������������������������0000664�0001750�0001750�00000021275�12256773774�017044� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTSUITE_H #define CXXTOOLS_UNIT_TESTSUITE_H #include <cxxtools/unit/test.h> #include <cxxtools/unit/testfixture.h> #include <cxxtools/unit/testmethod.h> #include <cxxtools/unit/testprotocol.h> #include <vector> #include <utility> namespace cxxtools { class SerializationInfo; namespace unit { /** @brief Protocol and data driven testing @ingroup UnitTests The TestSuite is used to implement protocol and data driven tests. It inherits its ability to register methods and properties from %Reflectable. The implementor is supposed to write and register the required test methods on construction. @code class MyTest : public TestSuite { public: MyTest() : TestSuite("MyTest") { this->registerMethod("test1", *this, &MyTest::test1); } void test1(); }; @endcode Once the test is written it can be registered to an application by using the RegisterTest class template. The default protocol will run each registered test method when the test is run. Before each test method setUp is called and tearDown after each test. The TestProtocol can be replaced with a customised one and reflection can be used to call any method multiple times with the required data. */ class TestSuite : public Test , public TestFixture { private: class Context : public TestContext { public: Context(TestFixture& fixture, TestMethod& test, const SerializationInfo* args, unsigned argCount) : TestContext(fixture, test) , _test(test) , _args(args) , _argCount(argCount) {} virtual ~Context() {} protected: virtual void exec() { _test.exec(_args, _argCount); } private: TestMethod& _test; const SerializationInfo* _args; unsigned _argCount; }; public: /** @brief Construct by name and protocol Constructs a %TestCase with the passed name and optionally a custom protocol. The protocol is not owned by the TestSuite, but can be owned by the derived class. @param name Name of the test @param protocol Protocol for the test. */ explicit TestSuite(const std::string& name, TestProtocol& protocol = TestSuite::defaultProtocol); ~TestSuite(); //! @brief TODO: rename setParameter virtual void setParameter(const std::string& name, const cxxtools::SerializationInfo& value); /** @brief Sets the protocol. @param protocol Protocol for the test */ void setProtocol(TestProtocol* protocol); /** \brief Set up conText before running a test. This function is called before each registered tester function is invoked. It is meant to initialize any required resources. */ virtual void setUp(); /** \brief Clean up after the test run. This function is called after each registered tester function is invoked. It is meant to remove any resources previously initialized in TestSuite::setUp. */ virtual void tearDown(); /** @brief Runs the test suite The TestProtocol assosiated with the test will be executed. The default protocol will simply call all registered tests. */ virtual void run(); /** @brief Runs a registered test A test method will be called by name and the given arguments are passe to it just like when the reflection API is used. The method 'setUp' will be called before, and the method tearDown after the test. Signals inherited from unit::Test are sent appropriatly. @param name Name of the method to be run @param args Arguments to invoke the method */ void runTest( const std::string& name, const SerializationInfo* args = 0, size_t argCount = 0); void runAll(); protected: template <class ParentT> void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)() ) { cxxtools::unit::TestMethod* test = new BasicTestMethod<ParentT>(this->name() + "::" + name, parent, method); this->registerTest(test); } template <class ParentT, typename A1> void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod<ParentT, A1>(this->name() + "::" + name, parent, method); this->registerTest(test); } template <class ParentT, typename A1, typename A2> void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod<ParentT, A1, A2>(this->name() + "::" + name, parent, method); this->registerTest(test); } template <class ParentT, typename A1, typename A2, typename A3> void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2, A3) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod<ParentT, A1, A2, A3>(this->name() + "::" + name, parent, method); this->registerTest(test); } template <class ParentT, typename A1, typename A2, typename A3, typename A4> void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2, A3, A4) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod<ParentT, A1, A2, A3, A4>(this->name() + "::" + name, parent, method); this->registerTest(test); } template <class ParentT, typename A1, typename A2, typename A3, typename A4, typename A5> void registerMethod(const std::string& name, ParentT& parent, void (ParentT::*method)(A1, A2, A3, A4, A5) ) { cxxtools::unit::TestMethod* test = new BasicTestMethod<ParentT, A1, A2, A3, A4, A5>(this->name() + "::" + name, parent, method); this->registerTest(test); } private: void registerTest(TestMethod* test); TestMethod* findTest(const std::string& name); /** @brief The assoziated test protocol */ TestProtocol* _protocol; typedef std::vector<std::pair<std::string, TestMethod*> > Tests; Tests _tests; public: static TestProtocol defaultProtocol; }; } // namespace unit } // namespace cxxtools #endif // for header �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testfixture.h��������������������������������������������������0000664�0001750�0001750�00000004171�12256773774�017375� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Drner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTFIXTURE_H #define CXXTOOLS_UNIT_TESTFIXTURE_H namespace cxxtools { namespace unit { class TestFixture { public: virtual ~TestFixture() {} /** \brief Set up conText before running a test. This function is called before each registered tester function is invoked. It is meant to initialize any required resources. */ virtual void setUp() {} /** \brief Clean up after the test run. This function is called after each registered tester function is invoked. It is meant to remove any resources previously initialized in TestCase::setUp. */ virtual void tearDown() {} }; } // namespace init } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testcase.h�����������������������������������������������������0000664�0001750�0001750�00000011114�12256773774�016615� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTCASE_H #define CXXTOOLS_UNIT_TESTCASE_H #include <cxxtools/unit/test.h> #include <cxxtools/unit/testfixture.h> #include <string> namespace cxxtools { namespace unit { /** @brief Single test with setup and teardown @ingroup UnitTests A %TestCase can be used for simple tests that require a initialization and deinitialization of resources. The implementor is supposed to implement the abstract method 'test' and the methods 'setUp' and 'tearDown' for resource management. When the test is run, 'setUp' will be called first, then 'test' and finally 'tearDown'. @code class MyTest : public TestCase { public: MyTest() : TestCase("MyTest") {} virtual void setUp() { // init resource } virtual void tearDown() { // release resource } void test() { // test code using a resourc } }; @endcode Once the test is written it can be registered to an application by using the RegisterTest class template. */ class TestCase : public Test , public TestFixture { private: class Context : public TestContext { public: Context(TestFixture& fixture, TestCase& test) : TestContext(fixture, test) , _test(test) {} protected: virtual void exec() { _test.test(); } private: TestCase& _test; }; public: /** @brief Construct by name Constructs a %TestCase with the passed name. @param name Name of the test */ TestCase(const std::string& name); /** @brief Runs the test When the test is run, 'setUp' will be called first, then 'test' and finally 'tearDown'. Signals inherited from Unit::Test are sent appropriatly. */ virtual void run(); /** \brief Set up conText before running a test. This function is called before each registered tester function is invoked. It is meant to initialize any required resources. */ virtual void setUp(); /** \brief Clean up after the test run. This function is called after each registered tester function is invoked. It is meant to remove any resources previously initialized in TestCase::setUp. */ virtual void tearDown(); protected: /** @brief Implements the actual test procedure When the test is run, this method will be called after setUp and before tearDown. */ virtual void test() = 0; }; } // namespace unit } // namespace cxxtools #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/testmain.h�����������������������������������������������������0000664�0001750�0001750�00000006331�12256773774�016633� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TESTMAIN_H #define CXXTOOLS_UNIT_TESTMAIN_H #include <cxxtools/arg.h> #include <cxxtools/unit/reporter.h> #include <cxxtools/unit/application.h> #include <cxxtools/log.h> #include <fstream> namespace TestMain { static int argc = 0; static char** argv = 0; } int main(int argc, char** argv) { log_init(); TestMain::argc = argc; TestMain::argv = argv; cxxtools::unit::Application app; cxxtools::Arg<bool> help(argc, argv, 'h'); cxxtools::Arg<bool> list(argc, argv, 'l'); if( help || list ) { std::cerr << "Usage: " << argv[0] << " [-t <testname>] [-f <logfile>] { testname }\n"; std::cerr << "Available Tests:\n"; std::list<cxxtools::unit::Test*>::const_iterator it; for( it = app.tests().begin(); it != app.tests().end(); ++it) { std::cerr << " - " << (*it)->name() << std::endl; } return 0; } cxxtools::unit::BriefReporter consoleReporter; app.attachReporter(consoleReporter); cxxtools::Arg<std::string> file(argc, argv, 'f'); std::ofstream logFile; cxxtools::unit::BriefReporter fileReporter; std::string fileName = file.getValue(); if( ! fileName.empty() ) { logFile.open( fileName.c_str() ); fileReporter.setOutput(logFile); app.attachReporter(fileReporter); } try { if (argc <= 1) { app.run(); } else { for (int a = 1; a < argc; ++a) { std::string testName = argv[a]; if (testName == "-t") continue; // just for compatibility app.run(testName); } } return app.errors(); } catch(const std::exception& ex) { std::cerr << ex.what() << std::endl; } return 1; } #endif// CXXTOOLS_UNIT_TESTMAIN_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/reporter.h�����������������������������������������������������0000664�0001750�0001750�00000011760�12256773774�016653� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_REPORTER_H #define CXXTOOLS_UNIT_REPORTER_H #include <cxxtools/unit/assertion.h> #include <cxxtools/unit/testcontext.h> #include <cxxtools/signal.h> #include <cxxtools/noncopyable.h> #include <iosfwd> #include <stdexcept> namespace cxxtools { namespace unit { /** @brief Test event reporter This class is the base class for all reporters for test events. It lets the implementor override several virtual methods that are called on perticular events during the test. Reporters can be made to print information to the console or write XML logs. */ class Reporter : protected NonCopyable { public: /** @brief Destructor */ virtual ~Reporter() { destroyed.send(*this);} /** @brief Start notification This method is called when a test has started. Every test sends this signal at startup. @param test The started test */ virtual void reportStart(const TestContext& test) = 0; /** @brief Finished notification This method is called when a test has finished. Every test sends this signal at its end no matter if it failed or succeeded. @param test The finished test */ virtual void reportFinish(const TestContext& test) = 0; /** @brief Message notification This method is called when a test has produced an informational message. @param msg The message */ virtual void reportMessage(const std::string& msg) = 0; /** @brief Success notification This method is called when a test was successful. @param test The succeeded test */ virtual void reportSuccess(const TestContext& test) = 0; /** @brief Assertion notification This method is called when a an assertion failed during a test. an assertion fails when a user defined condition is not met. @param test The failed test */ virtual void reportAssertion(const TestContext& test, const Assertion& a) = 0; /** @brief Exception notification This method is called when a an exception failed during a test. An exception usually means that an error occured that was even u nexpected in a test scenario @param test The failed test */ virtual void reportException(const TestContext& test, const std::exception& ex) = 0; /** @brief Error notification This method is called when a an unknown error occurs during a test. @param test The failed test */ virtual void reportError(const TestContext& test) = 0; Signal<Reporter&> destroyed; protected: /** @brief Constructs a reporter */ Reporter() {} }; class BriefReporter : public Reporter { public: explicit BriefReporter(std::ostream* out = &std::cout); virtual ~BriefReporter(); void setOutput(std::ostream& out); virtual void reportStart(const TestContext& test); virtual void reportFinish(const TestContext& test); virtual void reportMessage(const std::string& msg); virtual void reportSuccess(const TestContext& test); virtual void reportAssertion(const TestContext& test, const Assertion& a); virtual void reportException(const TestContext& test, const std::exception& ex); virtual void reportError(const TestContext& test); private: /** @brief Ostream to print output to */ std::ostream* _out; }; } // namespace unit } // namespace cxxtools #endif ����������������cxxtools-2.2.1/include/cxxtools/unit/assertion.h����������������������������������������������������0000664�0001750�0001750�00000013037�12256773774�017017� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ASSERTION_H #define CXXTOOLS_ASSERTION_H #include "cxxtools/sourceinfo.h" #include <stdexcept> #include <iostream> #include <sstream> namespace cxxtools { namespace unit { /** @brief %Test %Assertion exception @ingroup UnitTests Assertions are modeled as an exception type, which is thrown by Unit tests when an assertion has failed. This class implements std::exception and overrides std::exception::what() to return an error message Besides the error message, Assertions can provide information where the exception was raised in the source code through a SourceInfo object. It is recommended to use the CXXTOOLS_UNIT_ASSERT for easy creation from a source info object. @code void myTest() { int ten = 5 + 5; CXXTOOLS_UNIT_ASSERT(ten == 10) } @endcode */ class Assertion { public: /** @brief Construct from a message and source info. Constructs a assertion exception from a message string and a source info object that describes where the assertion failed. Use the CXXTOOLS_UNIT_ASSERT macro instead of this constructor. @param what Error message @param si Info where the assertion failed */ Assertion(const std::string& what, const SourceInfo& si); const SourceInfo& sourceInfo() const; const char* what() const { return _what.c_str(); } private: SourceInfo _sourceInfo; std::string _what; }; #define CXXTOOLS_UNIT_ASSERT(cond) \ do { \ if( !(cond) ) \ throw cxxtools::unit::Assertion(#cond, CXXTOOLS_SOURCEINFO); \ } while (false) #define CXXTOOLS_UNIT_ASSERT_MSG(cond, what) \ do { \ if( !(cond) ) \ { \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << what; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } \ } while (false) #define CXXTOOLS_UNIT_ASSERT_EQUALS(value1, value2) \ do { \ if( ! ((value1) == (value2)) ) \ { \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << "not equal:\n\tvalue1 (" #value1 ")=\n\t\t<" << value1 << ">\n\tvalue2 (" #value2 ")=\n\t\t<" << value2 << '>'; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } \ } while (false) #define CXXTOOLS_UNIT_ASSERT_THROW(cond, EX) \ do { \ struct _cxxtools_ex { }; \ try \ { \ cond; \ throw _cxxtools_ex(); \ } \ catch(const _cxxtools_ex &) \ { \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << "exception of type " #EX " expected in " #cond; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } \ catch(const EX &) \ {} \ } while (false) #define CXXTOOLS_UNIT_ASSERT_NOTHROW(cond) \ do { \ try { \ \ cond; \ } \ catch(const std::exception& e) \ { \ throw cxxtools::unit::Assertion( \ std::string("unexpected exception of type ") + typeid(e).name() + ": " + e.what(), \ CXXTOOLS_SOURCEINFO); \ } \ catch(const cxxtools::unit::Assertion&) \ { \ throw; \ } \ catch(...) \ { \ throw cxxtools::unit::Assertion("unexpected exception." , CXXTOOLS_SOURCEINFO); \ } \ } while (false) #define CXXTOOLS_UNIT_FAIL(what) \ do { \ std::ostringstream _cxxtools_msg; \ _cxxtools_msg << what; \ throw cxxtools::unit::Assertion(_cxxtools_msg.str(), CXXTOOLS_SOURCEINFO); \ } while (false) } // namespace unit } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/unit/test.h���������������������������������������������������������0000664�0001750�0001750�00000012256�12256773774�015771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_UNIT_TEST_H #define CXXTOOLS_UNIT_TEST_H #include <cxxtools/unit/reporter.h> #include <cxxtools/unit/assertion.h> #include <cxxtools/connectable.h> #include <cxxtools/noncopyable.h> #include <string> namespace cxxtools { namespace unit { class TestContext; /** @brief Test base class @ingroup UnitTests This is the base class for all types of tests that can be registered and run in a test application. It provides a virtual method run that is overriden by the derived classes and signals to inform about events that occur while the test is run. */ class Test : public Connectable, protected NonCopyable { public: /** @brief Destructor */ virtual ~Test() { } /** @brief Runs the test Derived test classes are supposed to implement this method to run the test procedure. A derived class should send the 'started' signal at the begin of the test and send the 'finished' signal at the end of the test. If the test was successful, the 'success' signal is sent, otheriwse one of the signals indicating a failrue. In case of a failed assertion, the signal 'assertion' is sent, if a regular std::exception was the cause of the error the signal 'exception' is sent and and the signal 'error' indicates an unknown exception or error. This method should not propagate any exceptions */ virtual void run() = 0; const std::string& name() const; /** @brief Reports the start of a test */ void reportStart(const TestContext& ctx); /** @brief Finished notification This signal is sent when the test finished. It does not indicate that the test was successful. */ void reportFinish(const TestContext& ctx); /** @brief Success notification This signal is sent when the test was successful. */ void reportSuccess(const TestContext& ctx); /** @brief Assertion notification This signal is sent when a assertion failed. */ void reportAssertion(const TestContext& ctx, const Assertion& ass); /** @brief Exception notification This signal is sent when a regular std::exception occured. */ void reportException(const TestContext& ctx, const std::exception& ex); /** @brief Error notification This signal is sent when an unknown error occured. */ void reportError(const TestContext& ctx); /** @brief Message notification This signal can be sent to report informational messages. */ void reportMessage(const std::string& msg); void setParent(Test* test); Test* parent(); const Test* parent() const; /** @brief Add reporter for test events Adds the reporter \a r to report test events. The caller owns the reporter and must make sure it lives as long as the test. */ void attachReporter(Reporter& r); void detachReporter(Reporter& r); protected: /** @brief Construct a test by name @param name Name of the test */ explicit Test(const std::string& name) : _name(name) , _parent(0) { } private: std::string _name; Test* _parent; std::list<Reporter*> _reporter; }; } // namespace unit } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/lrucache.h����������������������������������������������������������0000664�0001750�0001750�00000013666�12256773774�015627� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LRUCACHE_H #define CXXTOOLS_LRUCACHE_H #include <map> #include <limits> namespace cxxtools { /** Implements a lru cache */ template <typename Key, typename Value> class LruCache { struct Data { unsigned serial; Value value; Data() { } Data(unsigned serial_, const Value& value_) : serial(serial_), value(value_) { } }; typedef std::map<Key, Data> DataType; DataType data; typename DataType::size_type maxElements; unsigned serial; unsigned hits; unsigned misses; unsigned _nextSerial() { if (serial == std::numeric_limits<unsigned>::max()) { for (typename DataType::iterator it = data.begin(); it != data.end(); ++it) it->second.serial = 0; serial = 1; } return serial++; } typename DataType::iterator _getOldest() { typename DataType::iterator foundElement = data.begin(); typename DataType::iterator it = data.begin(); for (++it; it != data.end(); ++it) if (it->second.serial < foundElement->second.serial) foundElement = it; return foundElement; } public: typedef typename DataType::size_type size_type; typedef Value value_type; explicit LruCache(size_type maxElements_) : maxElements(maxElements_), serial(0), hits(0), misses(0) { } /// returns the number of elements currently in the cache size_type size() const { return data.size(); } /// returns the maximum number of elements in the cache size_type getMaxElements() const { return maxElements; } void setMaxElements(size_type maxElements_) { maxElements = maxElements_; while (data.size() > maxElements) data.erase(_getOldest()); } /// removes a element from the cache and returns true, if found bool erase(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) return false; data.erase(it); return true; } /// clears the cache. void clear(bool stats = false) { data.clear(); if (stats) hits = misses = 0; } /// puts a new element in the cache. If the element is already found in /// the cache, it is considered a cache hit and pushed to the top of the /// list. Value& put(const Key& key, const Value& value) { typename DataType::iterator it = data.find(key); if (it == data.end()) { if (data.size() >= maxElements) data.erase(_getOldest()); it = data.insert(data.begin(), typename DataType::value_type(key, Data(_nextSerial(), value))); } else { // element found it->second.serial = _nextSerial(); } return it->second.value; } Value* getptr(const Key& key) { typename DataType::iterator it = data.find(key); if (it == data.end()) { ++misses; return 0; } it->second.serial = _nextSerial(); ++hits; return &it->second.value; } /// returns a pair of values - a flag, if the value was found and the /// value if found or the passed default otherwise. If the value is /// found it is a cache hit and pushed to the top of the list. std::pair<bool, Value> getx(const Key& key, Value def = Value()) { Value* v = getptr(key); return v ? std::pair<bool, Value>(true, *v) : std::pair<bool, Value>(false, def); } /// returns the value to a key or the passed default value if not found. /// If the value is found it is a cahce hit and pushed to the top of the /// list. Value get(const Key& key, Value def = Value()) { return getx(key, def).second; } /// returns the number of hits. unsigned getHits() const { return hits; } /// returns the number of misses. unsigned getMisses() const { return misses; } /// returns the cache hit ratio between 0 and 1. double hitRatio() const { return hits+misses > 0 ? static_cast<double>(hits)/static_cast<double>(hits+misses) : 0; } /// returns the ratio, between held elements and maximum elements. double fillfactor() const { return static_cast<double>(data.size()) / static_cast<double>(maxElements); } }; } #endif // CXXTOOLS_LRUCACHE_H ��������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/deserializerbase.h��������������������������������������������������0000664�0001750�0001750�00000006362�12256773774�017351� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DESERIALIZERBASE_H #define CXXTOOLS_DESERIALIZERBASE_H #include <cxxtools/serializationinfo.h> #include <cxxtools/api.h> namespace cxxtools { /** * convert format to SerializationInfo */ class CXXTOOLS_API DeserializerBase { public: #ifdef HAVE_LONG_LONG typedef long long int_type; #else typedef long int_type; #endif #ifdef HAVE_UNSIGNED_LONG_LONG typedef unsigned long long unsigned_type; #else typedef unsigned long unsigned_type; #endif DeserializerBase() : _current(0) { } virtual ~DeserializerBase() { } void begin() { _current = &_si; _si.clear(); } void clear() { _current = 0; _si.clear(); } SerializationInfo* si() { return &_si; } const SerializationInfo* si() const { return &_si; } SerializationInfo* current() { return _current; } void setCategory(SerializationInfo::Category category); void setName(const std::string& name); void setValue(const String& value); void setValue(const std::string& value); void setValue(const char* value); void setValue(bool value); void setValue(int_type value); void setValue(unsigned_type value); void setValue(long double value); void setNull(); void setTypeName(const std::string& type); void beginMember(const std::string& name, const std::string& type, SerializationInfo::Category category); void leaveMember(); private: SerializationInfo _si; SerializationInfo* _current; }; } #endif // CXXTOOLS_DESERIALIZERBASE_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/condition.h���������������������������������������������������������0000664�0001750�0001750�00000007155�12266277345�016015� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_CONDITION_H #define CXXTOOLS_SYSTEM_CONDITION_H #include <cxxtools/api.h> #include <cxxtools/noncopyable.h> #include <cxxtools/mutex.h> #include <cstddef> namespace cxxtools { /** @brief This class is used to control concurrent access. The Condition class is used to control concurrent access in a queued manner. The Condition class supports two types of signaling events, manual reset and automatic reset. Manual resets cause all blocked callers to be released. This can be understood as some kind of broadcast to signal all blocked callers at once. Manual resets are triggered by a call to signal(). Automatic resets cause only a single blocked caller to be released. So this can be seen as some kind of wait queue where only the topmost is signaled. Automatic resets are signaled by a call to broadcast(). */ class CXXTOOLS_API Condition : private NonCopyable { public: //! @brief Default Constructor. Condition(); //! @brief Destructor. ~Condition(); /** @brief Wait until condition becomes signalled. Causes the caller to be suspended until the condition will be signaled. The given mutex will be unlocked before the caller is suspended. */ void wait( Mutex& mtx); void wait( MutexLock& m) { this->wait( m.mutex() ); } /** @brief Wait until condition becomes signalled. Causes the caller to be suspended until the condition will be signaled. The given mutex will be unlocked before the caller is suspended. The suspension takes at maximum ms milliseconds. Returns true if successful, false if a timeout occurred. */ bool wait( Mutex& mtx, unsigned int ms); bool wait( MutexLock& m, unsigned int ms) { return this->wait( m.mutex(), ms ); } //! @brief Unblock a single blocked thread. void signal(); //! @brief Unblock all blocked threads. void broadcast(); private: class ConditionImpl* _impl; }; } // !namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/dlloader.h����������������������������������������������������������0000664�0001750�0001750�00000003076�12266277345�015613� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_DLLOADER_H #define CXXTOOLS_DLLOADER_H #include <cxxtools/library.h> namespace cxxtools { namespace dl { using cxxtools::Library; using cxxtools::Symbol; } } #endif // CXXTOOLS_DLLOADER_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/log/����������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277564�014512� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/log/cxxtools.h������������������������������������������������������0000664�0001750�0001750�00000017455�12266277345�016477� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LOG_CXXTOOLS_H #define CXXTOOLS_LOG_CXXTOOLS_H #include <string> #include <iostream> #define _cxxtools_log_enabled(level) \ (getLogger() != 0 && getLogger()->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level)) #define _cxxtools_log(level, expr) \ do { \ ::cxxtools::Logger* _cxxtools_logger = getLogger(); \ if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level)) \ { \ ::cxxtools::LogMessage _cxxtools_logMessage(_cxxtools_logger, #level); \ _cxxtools_logMessage.out() << expr; \ _cxxtools_logMessage.finish(); \ } \ } while (false) #define _cxxtools_log_if(level, cond, expr) \ do { \ ::cxxtools::Logger* _cxxtools_logger = getLogger(); \ if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_LEVEL_ ## level) && (cond)) \ { \ ::cxxtools::LogMessage _cxxtools_logMessage(_cxxtools_logger, #level); \ _cxxtools_logMessage.out() << expr; \ _cxxtools_logMessage.finish(); \ } \ } while (false) #define log_fatal_enabled() _cxxtools_log_enabled(FATAL) #define log_error_enabled() _cxxtools_log_enabled(ERROR) #define log_warn_enabled() _cxxtools_log_enabled(WARN) #define log_info_enabled() _cxxtools_log_enabled(INFO) #define log_debug_enabled() _cxxtools_log_enabled(DEBUG) #define log_trace_enabled() _cxxtools_log_enabled(TRACE) #define log_fatal(expr) _cxxtools_log(FATAL, expr) #define log_error(expr) _cxxtools_log(ERROR, expr) #define log_warn(expr) _cxxtools_log(WARN, expr) #define log_info(expr) _cxxtools_log(INFO, expr) #define log_debug(expr) _cxxtools_log(DEBUG, expr) #define log_fatal_if(cond, expr) _cxxtools_log_if(FATAL, cond, expr) #define log_error_if(cond, expr) _cxxtools_log_if(ERROR, cond, expr) #define log_warn_if(cond, expr) _cxxtools_log_if(WARN, cond, expr) #define log_info_if(cond, expr) _cxxtools_log_if(INFO, cond, expr) #define log_debug_if(cond, expr) _cxxtools_log_if(DEBUG, cond, expr) #define log_trace(expr) \ ::cxxtools::LogTracer _cxxtools_tracer; \ do { \ ::cxxtools::Logger* _cxxtools_logger = getLogger(); \ if (_cxxtools_logger != 0 && _cxxtools_logger->isEnabled(::cxxtools::Logger::LOG_LEVEL_TRACE)) \ { \ _cxxtools_tracer.setLogger(_cxxtools_logger); \ _cxxtools_tracer.out() << expr; \ _cxxtools_tracer.enter(); \ } \ } while (false) #define log_define(category) \ static ::cxxtools::Logger* getLogger() \ { \ static cxxtools::Logger* logger = 0; \ if (!::cxxtools::LoggerManager::isEnabled()) \ return 0; \ if (logger == 0) \ logger = ::cxxtools::LoggerManager::getInstance().getLogger(category); \ return logger; \ } #define log_init_cxxtools ::cxxtools::LoggerManager::logInit #define log_init log_init_cxxtools namespace cxxtools { class SerializationInfo; ////////////////////////////////////////////////////////////////////// // class Logger { public: typedef enum { LOG_LEVEL_FATAL = 0, LOG_LEVEL_ERROR = 100, LOG_LEVEL_WARN = 200, LOG_LEVEL_INFO = 300, LOG_LEVEL_DEBUG = 400, LOG_LEVEL_TRACE = 500 } log_level_type; private: std::string category; log_level_type level; Logger(const Logger&); Logger& operator=(const Logger&); public: Logger(const std::string& c, log_level_type l) : category(c), level(l) { } bool isEnabled(log_level_type l) const { return level >= l; } const std::string& getCategory() const { return category; } log_level_type getLogLevel() const { return level; } }; ////////////////////////////////////////////////////////////////////// // class LoggerManagerConfiguration { public: class Impl; private: friend class Impl; Impl* _impl; public: LoggerManagerConfiguration(); LoggerManagerConfiguration(const LoggerManagerConfiguration&); LoggerManagerConfiguration& operator=(const LoggerManagerConfiguration&); ~LoggerManagerConfiguration(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } Logger::log_level_type rootLevel() const; Logger::log_level_type logLevel(const std::string& category) const; }; void operator>>= (const SerializationInfo& si, LoggerManagerConfiguration& loggerManagerConfiguration); ////////////////////////////////////////////////////////////////////// // class LoggerManager { public: class Impl; friend class Impl; Impl* _impl; LoggerManager(); static bool _enabled; LoggerManager(const LoggerManager&); LoggerManager& operator=(const LoggerManager&); public: ~LoggerManager(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } static LoggerManager& getInstance(); static void logInit(); static void logInit(const std::string& fname); static void logInit(const cxxtools::SerializationInfo& si); void configure(const LoggerManagerConfiguration& config); Logger* getLogger(const std::string& category); static bool isEnabled() { return _enabled; } Logger::log_level_type rootLevel() const; Logger::log_level_type logLevel(const std::string& category) const; }; ////////////////////////////////////////////////////////////////////// // class LogMessage { public: class Impl; private: Impl* _impl; LogMessage(const LogMessage&); LogMessage& operator=(const LogMessage&); public: LogMessage(Logger* logger, const char* level); LogMessage(Logger* logger, Logger::log_level_type level); ~LogMessage(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } std::ostream& out(); std::string str() const; void finish(); }; ////////////////////////////////////////////////////////////////////// // class LogTracer { public: class Impl; private: Impl* _impl; LogTracer(const LogTracer&); LogTracer& operator=(const LogTracer&); public: LogTracer(); ~LogTracer(); Impl* impl() { return _impl; } const Impl* impl() const { return _impl; } void setLogger(Logger* l); std::ostream& out(); void enter(); void exit(); }; } #endif // LOG_CXXTOOLS_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/selector.h����������������������������������������������������������0000664�0001750�0001750�00000015107�12266277345�015643� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 PTV AG * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_SELECTOR_H #define CXXTOOLS_SYSTEM_SELECTOR_H #include <cxxtools/timespan.h> #include <cxxtools/noncopyable.h> #include <cxxtools/connectable.h> #include <cxxtools/api.h> #include <map> namespace cxxtools { class Timer; class Selectable; class Application; class SelectorImpl; /** @brief Reports activity on a set of devices. A Selector can be used to monitor a set of Selectables and Timers and wait for activity on them. The wait call can be performed with a timeout and the respective timeout signal is sent if it occurs. Clients can be notified about Timer and Selectable activity by connecting to the appropriate signals of the Timer and Selectable classes. The following example uses a %Selector to wait on acitvity on a %Timer, which is set to time-out after 1000 msecs. @code // slot to handle timer activity void onTimer(); int main() { using cxxtools::System; Timer timer; timer.start(1000); connect(timer.timeout, ontimer); Selector selector; selector.addTimer(timer); selector wait(); return 0; } @endcode A Selector is the heart of the EventLoop, which calls Selector::wait continously. The %EventLoop and %Application classes provide the same API as the Selector itself. */ class CXXTOOLS_API SelectorBase : public Connectable , protected NonCopyable { friend class Selectable; friend class Timer; public: static const std::size_t WaitInfinite = static_cast<const std::size_t>(-1); //! @brief Destructor virtual ~SelectorBase(); /** @brief Adds an IOResult Adds an IOResult to the selector. IOResult are removed automatically when they get destroyed. */ void add(Selectable& s); /** @brief Cancel an IOResult. */ void remove(Selectable& s); /** @brief Adds a Timer Adds a Timer to the selector. Timers are removed automatically when they get destroyed. @param timer The device to add */ void add(Timer& timer); /** @brief Removes a Timer @param timer The timer to remove */ void remove(Timer& timer); /** @brief Wait for activity This method will wait for activity on the registered Selectables and Timers. Use Selector::WaitInfinite to wait without timeout. @param msecs timeout in miliseconds @return true on timeout */ bool wait(std::size_t msecs = WaitInfinite); /** @brief Wakes the selctor from waiting This method can be used to end a Selector::wait call before the timeout expires. It is supposed to be used from another thread and thus is thread-safe. */ void wake(); protected: //! @brief Default constructor SelectorBase(); void onAddTimer(Timer& timer); void onRemoveTimer( Timer& timer ); void onTimerChanged( Timer& timer ); /** @brief A Selectable is added to this %Selector Do not throw exceptions. */ virtual void onAdd(Selectable&) = 0; /** @brief A Selectable is removed from this %Selector Do not throw exceptions. */ virtual void onRemove(Selectable&) = 0; /** @brief A Selectable is reinitialised and needs to be updated Do not throw exceptions. */ virtual void onReinit(Selectable&) = 0; /** @brief A Selectable in this %Selector has changed Do not throw exceptions. */ virtual void onChanged(Selectable& s) = 0; virtual bool onWait(std::size_t msecs) = 0; virtual void onWake() = 0; private: /** @internal Update all timers and return true if a timer fired @param timeout interval to next expiring timer */ bool updateTimer(size_t& timeout); //! @internal typedef std::multimap<Timespan, Timer*> TimerMap; //! @internal TimerMap _timers; void* _reserved; }; class CXXTOOLS_API Selector : public SelectorBase { public: Selector(); virtual ~Selector(); SelectorImpl& impl(); protected: void onAdd( Selectable& dev ); void onRemove( Selectable& dev ); void onReinit(Selectable&); void onChanged(Selectable&); bool onWait(std::size_t msecs = WaitInfinite); void onWake(); private: //! @internal class SelectorImpl* _impl; }; } //namespace cxxtools #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/method.tpp����������������������������������������������������������0000664�0001750�0001750�00000100537�12256773774�015667� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// BEGIN_Method 10 /** The Method class wraps member functions for use with the signals/slots framework. */ template < typename R,typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Method : public Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>(obj,ptr); } /** MethodSlot wraps Method objects so that they can act as Slots. */ template < typename R, typename ClassT,class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class MethodSlot : public BasicSlot<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> { public: /** Wraps the given Method object. */ MethodSlot(const Method<R, ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>& method) : _method( method ) {} /** Creates a copy of this object and returns it. The caller owns the returned object. */ Slot* clone() const { return new MethodSlot(*this); } /** Returns a pointer to this object's internal Callable. */ virtual const void* callable() const { return &_method; } virtual void onConnect(const Connection& c) { _method.object().onConnectionOpen(c); } virtual void onDisconnect(const Connection& c) { _method.object().onConnectionClose(c); } virtual bool equals(const Slot& slot) const { const MethodSlot* ms = dynamic_cast<const MethodSlot*>(&slot); return ms ? (_method == ms->_method) : false; } private: Method<R, ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> _method; }; /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10>( callable( obj, memFunc ) ); } // END_Method 10 // BEGIN_Method 9 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8,A9); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7,a8,a9); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,A8,A9,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8,A9) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8,A9>( callable( obj, memFunc ) ); } // END_Method 9 // BEGIN_Method 8 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7,A8); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7,a8); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,A8,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7,A8) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7,A8>( callable( obj, memFunc ) ); } // END_Method 8 // BEGIN_Method 7 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6,A7); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6,a7); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,A7,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6,A7>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6, class A7> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6,A7) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6,A7>( callable( obj, memFunc ) ); } // END_Method 7 // BEGIN_Method 6 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5, class A6> class Method<R,ClassT, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5,A6); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5,a6); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,A6,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6> Method<R,ClassT,A1,A2,A3,A4,A5,A6> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)) { return Method<R,ClassT,A1,A2,A3,A4,A5,A6>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5, class A6> MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5,A6) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5,A6>( callable( obj, memFunc ) ); } // END_Method 6 // BEGIN_Method 5 template < typename R, typename ClassT,class A1, class A2, class A3, class A4, class A5> class Method<R,ClassT, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4,A5); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { return (_object->*_memFunc)(a1,a2,a3,a4,a5); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,A5,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5> Method<R,ClassT,A1,A2,A3,A4,A5> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)) { return Method<R,ClassT,A1,A2,A3,A4,A5>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4, class A5> MethodSlot<R,ClassT,A1,A2,A3,A4,A5> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4,A5) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4,A5>( callable( obj, memFunc ) ); } // END_Method 5 // BEGIN_Method 4 template < typename R, typename ClassT,class A1, class A2, class A3, class A4> class Method<R,ClassT, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3,A4); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3, A4 a4) const { return (_object->*_memFunc)(a1,a2,a3,a4); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,A4,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4> Method<R,ClassT,A1,A2,A3,A4> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3, A4 a4)) { return Method<R,ClassT,A1,A2,A3,A4>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3, class A4> MethodSlot<R,ClassT,A1,A2,A3,A4> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3,A4) ) { return MethodSlot<R,ClassT,A1,A2,A3,A4>( callable( obj, memFunc ) ); } // END_Method 4 // BEGIN_Method 3 template < typename R, typename ClassT,class A1, class A2, class A3> class Method<R,ClassT, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2,A3); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2, A3 a3) const { return (_object->*_memFunc)(a1,a2,a3); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,A3,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3> Method<R,ClassT,A1,A2,A3> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2, A3 a3)) { return Method<R,ClassT,A1,A2,A3>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2, class A3> MethodSlot<R,ClassT,A1,A2,A3> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2,A3) ) { return MethodSlot<R,ClassT,A1,A2,A3>( callable( obj, memFunc ) ); } // END_Method 3 // BEGIN_Method 2 template < typename R, typename ClassT,class A1, class A2> class Method<R,ClassT, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1,A2); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1, A2 a2) const { return (_object->*_memFunc)(a1,a2); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,A2,Void,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1, class A2> Method<R,ClassT,A1,A2> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1, A2 a2)) { return Method<R,ClassT,A1,A2>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1, class A2> MethodSlot<R,ClassT,A1,A2> slot( ClassT & obj, R (BaseT::*memFunc)(A1,A2) ) { return MethodSlot<R,ClassT,A1,A2>( callable( obj, memFunc ) ); } // END_Method 2 // BEGIN_Method 1 template < typename R, typename ClassT,class A1> class Method<R,ClassT, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(A1); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()(A1 a1) const { return (_object->*_memFunc)(a1); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, A1,Void,Void,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT,class A1> Method<R,ClassT,A1> callable( ClassT & obj, R (BaseT::*ptr)(A1 a1)) { return Method<R,ClassT,A1>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT,class A1> MethodSlot<R,ClassT,A1> slot( ClassT & obj, R (BaseT::*memFunc)(A1) ) { return MethodSlot<R,ClassT,A1>( callable( obj, memFunc ) ); } // END_Method 1 // BEGIN_Method 0 template < typename R, typename ClassT> class Method<R,ClassT, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> : public Callable<R, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Convenience typedef of the wrapped member function signature. */ typedef R (ClassT::*MemFuncT)(); /** Wraps the given object/member pair. */ explicit Method(ClassT& object, MemFuncT ptr) : _object(&object), _memFunc(ptr) { } /** Deeply copies rhs. */ Method(const Method& rhs) : Callable<R, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>() { this->operator=(rhs); } /** Returns a reference to this object's wrapped ClassT object. */ ClassT& object() { return *_object;} /** Returns a const reference to this object's wrapped ClassT object. */ const ClassT& object() const { return *_object;} /** Returns a reference to this object's wrapped MemFuncT. */ const MemFuncT& method() const { return _memFunc;} /** Passes on all arguments to the wrapped object/member pair and returns the result of that member. */ inline R operator()() const { return (_object->*_memFunc)(); } /** Creates a copy of this object and returns it. The caller owns the returned object. */ Method<R, ClassT, Void,Void,Void,Void,Void,Void,Void,Void,Void,Void>* clone() const { return new Method(*this); } /** Deeply copies rhs. */ Method& operator=(const Method& rhs) { _object = rhs._object; _memFunc = rhs._memFunc; return (*this); } /** Returns true if rhs and this object point to the same object and method. */ bool operator==(const Method& rhs) const { return (_object == rhs._object) && (_memFunc == rhs._memFunc); } private: ClassT* _object; MemFuncT _memFunc; }; /** Creates and returns a Method object for the given object/method pair. */ template <class R, class BaseT, class ClassT> Method<R,ClassT> callable( ClassT & obj, R (BaseT::*ptr)()) { return Method<R,ClassT>(obj,ptr); } /** Creates and returns a MethodSlot object for the given object/member pair. */ template <class R, class BaseT, class ClassT> MethodSlot<R,ClassT> slot( ClassT & obj, R (BaseT::*memFunc)() ) { return MethodSlot<R,ClassT>( callable( obj, memFunc ) ); } // END_Method 0 �����������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/iconvstream.h�������������������������������������������������������0000664�0001750�0001750�00000011511�12256773774�016356� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ICONVSTREAM_H #define CXXTOOLS_ICONVSTREAM_H #include <iostream> #include <stdexcept> #include "iconvwrap.h" namespace cxxtools { class iconv_error : public std::runtime_error { private: mutable std::string msg; size_t pos; public: explicit iconv_error(size_t pos); virtual size_t position() const throw(); virtual const char *what() const throw(); virtual ~iconv_error() throw(); }; /** std::streambuf-Interface for iconv(3) and related. iconv converts charactersets. */ class iconvstreambuf : public std::streambuf { public: /** Behaviour on iconv error. */ typedef enum { /** Old behaviour, just send EOF. */ mode_eof, /** Throw iconv_error. */ mode_throw, /** Skip invalid characters. */ mode_skip, mode_default = mode_eof } mode_t; private: std::ostream* sink; iconvwrap conv; char buffer[256]; mode_t mode; size_t pos; public: iconvstreambuf() : sink(0), mode(mode_default), pos(0) { setg(buffer, buffer, buffer + (sizeof(buffer) - 1)); setp(buffer, buffer + (sizeof(buffer) - 1)); } ~iconvstreambuf() { close(); } iconvstreambuf* open(std::ostream& sink_, const char* tocode, const char* fromcode); iconvstreambuf* open(std::ostream& sink_, const char* tocode, const char* fromcode, mode_t mode_); iconvstreambuf* close() throw(); /// overloaded from std::streambuf int_type overflow(int_type c); /// overloaded from std::streambuf int_type underflow(); /// overloaded from std::streambuf int sync(); /** overloaded from std::streambuf, for input returned value represents * number of bytes succesfully converted (does not count skipped bytes). */ virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which); /** overloaded from std::streambuf, for input returned value represents * number of bytes succesfully converted (does not count skipped bytes). */ virtual std::streampos seekpos(std::streampos sp, std::ios_base::openmode which); }; /** std::ostream-Interface for iconv(3) and related. iconv converts charactersets. To perform a character set conversion from one characterset to another, instantiate a iconvstream with a std::ostream as a sink. Write the data to the iconvstream and the converted stream is written to the sink. example (unix2win-filter): \code int main(int argc, char* argv[]) { cxxtools::iconvstream out(std::cout, "LATIN1", "WINDOWS-1251"); // copy input to output: out << std::cin.rdbuf(); } \endcode */ class iconvstream : public std::ostream { iconvstreambuf streambuf; public: iconvstream(std::ostream& sink, const char* tocode, const char* fromcode) : std::ostream(0) { init(&streambuf); open(sink, tocode, fromcode); } iconvstream(std::ostream& sink, const char* tocode, const char* fromcode, iconvstreambuf::mode_t mode) : std::ostream(0) { init(&streambuf); open(sink, tocode, fromcode, mode); } iconvstream() : std::ostream(0) { init(&streambuf); } void open(std::ostream& sink_, const char* tocode, const char* fromcode); void open(std::ostream& sink_, const char* tocode, const char* fromcode, iconvstreambuf::mode_t mode_); void close() throw() { streambuf.close(); } }; } #endif // CXXTOOLS_ICONVSTREAM_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/quotedprintablestream.h���������������������������������������������0000664�0001750�0001750�00000004577�12266277345�020452� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUOTEDPRINTABLE_H #define CXXTOOLS_QUOTEDPRINTABLE_H #include <iostream> namespace cxxtools { class QuotedPrintable_streambuf : public std::streambuf { std::streambuf* sinksource; unsigned col; public: QuotedPrintable_streambuf(std::streambuf* sinksource_) : sinksource(sinksource_), col(0) { } protected: std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); }; class QuotedPrintable_ostream : public std::ostream { QuotedPrintable_streambuf streambuf; public: /// instantiate encode with a output-stream, which received encoded /// Data. QuotedPrintable_ostream(std::ostream& out) : std::ostream(0), streambuf(out.rdbuf()) { init(&streambuf); } /// instantiate encode with a output-std::streambuf. QuotedPrintable_ostream(std::streambuf* sb) : std::ostream(0), streambuf(sb) { init(&streambuf); } }; } #endif // CXXTOOLS_QUOTEDPRINTABLE_H ���������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/threadpool.h��������������������������������������������������������0000664�0001750�0001750�00000005673�12256773774�016201� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_THREADPOOL_H #define CXXTOOLS_THREADPOOL_H #include <cxxtools/callable.h> namespace cxxtools { class ThreadPoolImpl; class ThreadPool { public: /** @brief Creates a thread pool structure. When the argument \a doStart is set to true (which is the default), the threads are started. */ explicit ThreadPool(unsigned size, bool doStart = true); /** @brief Destroys a thread pool structure. Before destruction all jobs are processed and the threads are stopped. */ ~ThreadPool(); /** @brief Explict start of the thread pool. */ void start(); /** @brief Stops the thread of the thread pool. All threads of this pool are stopped. The current job is finished. Remaining jobs are discarded, when cancel is set. Otherwise the threads stop, when the queue is empty. */ void stop(bool cancel = false); /** @brief Schedules a task to be processed. The task is processed by the next available thread. */ void schedule(const Callable<void>& cb); /** @brief Returns true, if the threadpool is in running state. */ bool running() const; /** @brief Returns true, if the threadpool is in stopped state. */ bool stopped() const; private: ThreadPoolImpl* _impl; }; } #endif // CXXTOOLS_THREADPOOL_H ���������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/invokable.tpp�������������������������������������������������������0000664�0001750�0001750�00000011300�12256773774�016346� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// BEGIN_Invokable 10 /** Invokable is a type which can be "called" via the invoke() member. It serves as a base type for other types in the Pt signals/slots framework. */ template <class A1 = Void, class A2 = Void, class A3 = Void, class A4 = Void, class A5 = Void, class A6 = Void, class A7 = Void, class A8 = Void, class A9 = Void, class A10 = Void> class Invokable { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) const = 0; }; // END_Invokable 10 // BEGIN_Invokable 9 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class Invokable<A1,A2,A3,A4,A5,A6,A7,A8,A9,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) const = 0; }; // END_Invokable 9 // BEGIN_Invokable 8 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class Invokable<A1,A2,A3,A4,A5,A6,A7,A8,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const = 0; }; // END_Invokable 8 // BEGIN_Invokable 7 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6, class A7> class Invokable<A1,A2,A3,A4,A5,A6,A7,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const = 0; }; // END_Invokable 7 // BEGIN_Invokable 6 // specialization template <class A1, class A2, class A3, class A4, class A5, class A6> class Invokable<A1,A2,A3,A4,A5,A6,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const = 0; }; // END_Invokable 6 // BEGIN_Invokable 5 // specialization template <class A1, class A2, class A3, class A4, class A5> class Invokable<A1,A2,A3,A4,A5,Void,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const = 0; }; // END_Invokable 5 // BEGIN_Invokable 4 // specialization template <class A1, class A2, class A3, class A4> class Invokable<A1,A2,A3,A4,Void,Void,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3, A4 a4) const = 0; }; // END_Invokable 4 // BEGIN_Invokable 3 // specialization template <class A1, class A2, class A3> class Invokable<A1,A2,A3,Void,Void,Void,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2, A3 a3) const = 0; }; // END_Invokable 3 // BEGIN_Invokable 2 // specialization template <class A1, class A2> class Invokable<A1,A2,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1, A2 a2) const = 0; }; // END_Invokable 2 // BEGIN_Invokable 1 // specialization template <class A1> class Invokable<A1,Void,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke(A1 a1) const = 0; }; // END_Invokable 1 // BEGIN_Invokable 0 // specialization template <> class Invokable<Void,Void,Void,Void,Void,Void,Void,Void,Void,Void> { public: /** Does nothing. Does not throw. */ virtual ~Invokable() {} /** Behaviour is determined by subclass implementations. */ virtual void invoke() const = 0; }; // END_Invokable 0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/callable.h����������������������������������������������������������0000664�0001750�0001750�00000003015�12256773774�015563� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Callable_h #define cxxtools_Callable_h #include <cxxtools/invokable.h> namespace cxxtools { #include <cxxtools/callable.tpp> } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/membar.gcc.arm.h����������������������������������������������������0000664�0001750�0001750�00000003211�12256773774�016576� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_ARM_H #define CXXTOOLS_MEMBAR_ARM_H namespace cxxtools { inline void membar_rw() { asm volatile("dmb;"); } inline void membar_write() { asm volatile("dmb;"); } inline void membar_read() { asm volatile("dmb;"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_ARM_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/void.h��������������������������������������������������������������0000664�0001750�0001750�00000002731�12256773774�014771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_void_h #define cxxtools_void_h namespace cxxtools { struct Void {}; } // namespace cxxtools #endif ���������������������������������������cxxtools-2.2.1/include/cxxtools/constmethod.h�������������������������������������������������������0000664�0001750�0001750�00000003127�12256773774�016357� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_ConstMethod_h #define cxxtools_ConstMethod_h #include <cxxtools/callable.h> #include <cxxtools/connectable.h> #include <cxxtools/slot.h> namespace cxxtools { #include <cxxtools/constmethod.tpp> } // !namespace cxxtools #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/refcounted.h��������������������������������������������������������0000664�0001750�0001750�00000004654�12266277345�016166� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REFCOUNTED_H #define CXXTOOLS_REFCOUNTED_H #include <cxxtools/noncopyable.h> #include <cxxtools/atomicity.h> namespace cxxtools { class SimpleRefCounted : private NonCopyable { unsigned rc; public: SimpleRefCounted() : rc(0) { } explicit SimpleRefCounted(unsigned refs_) : rc(refs_) { } virtual ~SimpleRefCounted() { } virtual unsigned addRef() { return ++rc; } virtual unsigned release() { return --rc; } unsigned refs() const { return rc; } }; class AtomicRefCounted : private NonCopyable { mutable volatile atomic_t rc; public: AtomicRefCounted() : rc(0) { } explicit AtomicRefCounted(unsigned refs_) : rc(refs_) { } virtual ~AtomicRefCounted() { } virtual atomic_t addRef() { return atomicIncrement(rc); } virtual atomic_t release() { atomic_t ret = atomicDecrement(rc); return ret; } atomic_t refs() const { return rc; } }; typedef SimpleRefCounted RefCounted; } #endif // CXXTOOLS_REFCOUNTED_H ������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/posix/��������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277564�015073� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/posix/pipestream.h��������������������������������������������������0000664�0001750�0001750�00000007122�12256773774�017342� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_PIPESTREAM_H #define CXXTOOLS_POSIX_PIPESTREAM_H #include <iostream> #include <cxxtools/posix/pipe.h> namespace cxxtools { namespace posix { /** @brief Simple unix pipe iostream This iostream works only on POSIX systems. A portable alternative is to use an IOStream attached to the input or output end of a Pipe. */ class Pipestreambuf : public std::streambuf { std::streambuf::int_type overflow(std::streambuf::int_type ch); std::streambuf::int_type underflow(); int sync(); posix::Pipe pipe; unsigned bufsize; char* ibuffer; char* obuffer; public: explicit Pipestreambuf(unsigned bufsize = 8192); ~Pipestreambuf(); void closeReadFd() { sync(); pipe.closeReadFd(); } void closeWriteFd() { sync(); pipe.closeWriteFd(); } int getReadFd() const { return pipe.getReadFd(); } int getWriteFd() const { return pipe.getWriteFd(); } void redirectStdout(bool close = true) { pipe.redirectStdout(close); } void redirectStdin(bool close = true) { pipe.redirectStdin(close); } void redirectStderr(bool close = true) { pipe.redirectStderr(close); } IODevice& out() { return pipe.out(); } IODevice& in() { return pipe.in(); } }; class Pipestream : public std::iostream { Pipestreambuf streambuf; public: explicit Pipestream(unsigned bufsize = 8192) : std::iostream(0), streambuf(bufsize) { init(&streambuf); } void closeReadFd() { streambuf.closeReadFd(); } void closeWriteFd() { streambuf.closeWriteFd(); } void close() { closeReadFd(); closeWriteFd(); } int getReadFd() const { return streambuf.getReadFd(); } int getWriteFd() const { return streambuf.getWriteFd(); } void redirectStdout(bool close = true) { streambuf.redirectStdout(close); } void redirectStdin(bool close = true) { streambuf.redirectStdin(close); } void redirectStderr(bool close = true) { streambuf.redirectStderr(close); } IODevice& out() { return streambuf.out(); } IODevice& in() { return streambuf.in(); } }; } } #endif // CXXTOOLS_POSIX_PIPESTREAM_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/posix/commandinput.h������������������������������������������������0000664�0001750�0001750�00000005756�12256773774�017702� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_COMMANDINPUT_H #define CXXTOOLS_POSIX_COMMANDINPUT_H #include <cxxtools/posix/exec.h> #include <cxxtools/posix/pipestream.h> #include <cxxtools/posix/fork.h> namespace cxxtools { namespace posix { /** cxxtools::posix::CommandInput starts a process and the stdin is connected to the current process. The class is derived from std::ostream. You can use all methods provided from that class to send data to the stdin of the process. Typical usage example: \code cxxtools::posix::CommandInput grep("grep"); grep.push_back("foo"); // add a parameter grep.run(); // runs the process grep << "foo" << std::endl; // this line is printed grep << "bar" << std::endl; // this line is not printed grep << "foobar" << std::endl; // this line is printed \endcode */ class CommandInput : public std::ostream { Fork _fork; Exec _exec; Pipestreambuf streambuf; public: typedef Exec::const_reference const_reference; typedef Exec::reference reference; explicit CommandInput(const std::string& cmd, unsigned bufsize = 8192) : std::ostream(&streambuf), _fork(false), _exec(cmd), streambuf(bufsize) { } void push_back(const std::string& arg) { _exec.push_back(arg); } void run(); int wait(int options = 0) { return _fork.wait(); } IODevice& out() { return streambuf.out(); } void close() { streambuf.closeWriteFd(); } }; } } #endif // CXXTOOLS_POSIX_COMMANDINPUT_H ������������������cxxtools-2.2.1/include/cxxtools/posix/pipe.h��������������������������������������������������������0000664�0001750�0001750�00000006136�12256773774�016132� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_PIPE_H #define CXXTOOLS_POSIX_PIPE_H #include <cxxtools/pipe.h> namespace cxxtools { namespace posix { class CXXTOOLS_API Pipe : public cxxtools::Pipe { public: /** @brief Creates the pipe with two IODevices The default constructor will create the pipe and the appropriate IODevices to read and write to the pipe. */ explicit Pipe(OpenMode mode = Sync) : cxxtools::Pipe(mode) { } /** @brief Endpoint of the pipe to read from @return An IODevice used to read from the pipe */ int getReadFd() const; int getWriteFd() const; void closeReadFd() { out().close(); } void closeWriteFd() { in().close(); } /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStdout(bool close = true, bool inherit = true); /// Redirect read-end to stdin. /// When the close argument is set, closes the original filedescriptor void redirectStdin(bool close = true, bool inherit = true); /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStderr(bool close = true, bool inherit = true); size_t write(const char* buf, size_t count) { return in().write(buf, count); } void write(char ch) { in().write(&ch, 1); } size_t read(char* buf, size_t count) { return out().read(buf, count); } char read() { char ch; out().read(&ch, 1); return ch; } }; } } #endif // CXXTOOLS_POSIX_PIPE_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/posix/exec.h��������������������������������������������������������0000664�0001750�0001750�00000006373�12256773774�016124� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/noncopyable.h> #include <cxxtools/systemerror.h> #include <stdexcept> #include <string> #include <unistd.h> namespace cxxtools { namespace posix { /** cxxtools::posix::Exec is a wrapper around the exec?? functions of posix. Usage is like this: \code cxxtools::posix::Exec e("ls"); e.push_back("-l"); e.exec(); \endcode This replaces the current process with the unix command "ls -l". */ template <unsigned dataSize, unsigned maxArgs> class BasicExec : private cxxtools::NonCopyable { char data[dataSize]; char* args[maxArgs + 2]; unsigned argc; public: typedef const std::string& const_reference; typedef std::string& reference; explicit BasicExec(const std::string& cmd) : argc(0) { if (cmd.size() >= dataSize - 1) throw std::out_of_range("command <" + cmd + "> too large"); args[0] = &data[0]; cmd.copy(args[0], cmd.size()); args[0][cmd.size()] = '\0'; args[1] = args[0] + cmd.size() + 1; } BasicExec& push_back(const std::string& arg) { if (static_cast<unsigned>(args[argc + 1] + arg.size() - data) >= dataSize) throw std::out_of_range("argument list too long"); if (argc >= maxArgs) throw std::out_of_range("too many arguments"); ++argc; arg.copy(args[argc], arg.size()); args[argc][arg.size()] = '\0'; args[argc + 1] = args[argc] + arg.size() + 1; return *this; } // nice alias of push_back BasicExec& arg(const std::string& arg) { return push_back(arg); } void exec() { args[argc + 1] = 0; ::execvp(args[0], args); throw SystemError("execvp"); } }; typedef BasicExec<0x8000, 256> Exec; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/posix/fork.h��������������������������������������������������������0000664�0001750�0001750�00000006307�12256773774�016136� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_FORK_H #define CXXTOOLS_FORK_H #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <cxxtools/systemerror.h> namespace cxxtools { namespace posix { /** A simple wrapper for the system function fork(2). * * The advantage of using this class instead of fork directly is, easyness, * robustness and readability due to less code. The constructor executes * fork(2) and does error checking. The destructor waits for the child * process, which prevents the creation of zombie processes. The user may * decide to deactivate it or waiting explicitely to receive the return * status, but this has to be done explicitely, which helps robustness. * * Example: * \code * { * cxxtools::Fork process; * if (process.child()) * { * // we are in the child process here. * * exit(0); // normally the child either exits or execs an other * // process * } * } * \endcode */ class Fork { Fork(const Fork&); Fork& operator= (const Fork&); pid_t pid; public: Fork(bool now = true) : pid(0) { if (now) fork(); } ~Fork() { if (pid) wait(); } void fork() { pid = ::fork(); if (pid < 0) throw SystemError("fork"); } pid_t getPid() const { return pid; } bool parent() const { return pid > 0; } bool child() const { return !parent(); } void setNowait() { pid = 0; } int wait(int options = 0) { int status; ::waitpid(pid, &status, options); pid = 0; return status; } }; } } #endif // CXXTOOLS_FORK_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/posix/commandoutput.h�����������������������������������������������0000664�0001750�0001750�00000005747�12256773774�020103� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_POSIX_COMMANDOUTPUT_H #define CXXTOOLS_POSIX_COMMANDOUTPUT_H #include <cxxtools/posix/exec.h> #include <cxxtools/posix/pipestream.h> #include <cxxtools/posix/fork.h> namespace cxxtools { namespace posix { /** cxxtools::posix::CommandOutput starts a process and the stdout of the process can be read. The class is derived from std::istream, so all methods provided from that base class can be used to read the output. Typical usage example: \code cxxtools::posix::CommandOutput ls("ls"); ls.push_back("-l"); // add a parameter ls.push_back("/bin"); // and another one ls.run(); // start the process // read output line by line std::string line; while (std::getline(ls, line)) std::cout << line << std::endl; \endcode */ class CommandOutput : public std::istream { Fork _fork; Exec _exec; Pipestreambuf streambuf; public: typedef Exec::const_reference const_reference; typedef Exec::reference reference; explicit CommandOutput(const std::string& cmd, unsigned bufsize = 8192) : std::istream(&streambuf), _fork(false), _exec(cmd), streambuf(bufsize) { } void push_back(const std::string& arg) { _exec.push_back(arg); } void run(bool combineStderr = false); int wait(int options = 0) { return _fork.wait(); } IODevice& in() { return streambuf.in(); } void close() { streambuf.closeReadFd(); } }; } } #endif // CXXTOOLS_POSIX_COMMANDOUTPUT_H �������������������������cxxtools-2.2.1/include/cxxtools/method.h������������������������������������������������������������0000664�0001750�0001750�00000003101�12256773774�015300� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Dr. Marc Boris Drner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Method_h #define cxxtools_Method_h #include <cxxtools/callable.h> #include <cxxtools/connectable.h> #include <cxxtools/slot.h> namespace cxxtools { #include <cxxtools/method.tpp> } // !namespace cxxtools #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/atomicity.gcc.sparc64.h���������������������������������������������0000664�0001750�0001750�00000003030�12256773774�020037� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ATOMICINT_GCC_SPARC64_H #define CXXTOOLS_ATOMICINT_GCC_SPARC64_H #include <csignal> namespace cxxtools { typedef std::sig_atomic_t atomic_t; } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/membar.gcc.sparc32.h������������������������������������������������0000664�0001750�0001750�00000003305�12256773774�017300� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Julian Wiesener * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MEMBAR_SPARC32_H #define CXXTOOLS_MEMBAR_SPARC32_H namespace cxxtools { inline void membar_rw() { asm volatile("stbar" : : : "memory"); } inline void membar_write() { asm volatile("stbar" : : : "memory"); } inline void membar_read() { asm volatile("stbar" : : : "memory"); } } // namespace cxxtools #endif // CXXTOOLS_MEMBAR_SPARC32_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/query_params.h������������������������������������������������������0000664�0001750�0001750�00000017026�12256773774�016543� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003,2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_QUERY_PARAMS_H #define CXXTOOLS_QUERY_PARAMS_H #include <string> #include <vector> #include <set> #include <map> #include <algorithm> #include <iostream> #include <iterator> namespace cxxtools { /** QueryParams represents parameters from a HTML-Form. There are 2 types of Query-Parameters from a HTML-Form: named and unnamed. And names are not unique. This results in a combination of a multiset and a set. this class uses a vector instead of a set, because order does matter in unnamed parameters. The class has a parser to extract parameters from a std::string or from a input-stream. */ class QueryParams { public: struct value_type { std::string name; std::string value; value_type() { } value_type(const std::string& name_, const std::string& value_) : name(name_), value(value_) { } }; typedef std::vector<value_type> values_type; typedef values_type::size_type size_type; /** Iterator for named and unnamed parameters in QueryParams. */ class const_iterator : public std::iterator<std::bidirectional_iterator_tag, const std::string> { const QueryParams* params; std::string name; size_type pos; size_type size() const { return (name.empty() ? params->paramcount() : params->paramcount(name)); } bool is_end() const { return params == 0 || pos >= size(); } size_type getpos() const { return is_end() ? size() : pos; } public: /// initialize generic end-iterator const_iterator() : params(0), pos(0) { } /// initialize iterator for unnamed params explicit const_iterator(const QueryParams& p) : params(&p), pos(0) { } /// initialize iterator for named params const_iterator(const QueryParams& p, const std::string& n) : params(&p), name(n), pos(0) { } bool operator== (const const_iterator& it) const { bool e = it.is_end(); return is_end() ? e : !e && pos == it.pos; } bool operator!= (const const_iterator& it) const { bool e = it.is_end(); return is_end() ? !e : e || pos != it.pos; } const_iterator& operator++() { ++pos; return *this; } const_iterator operator++(int) { const_iterator it = *this; ++pos; return it; } const_iterator& operator--() { --pos; return *this; } const_iterator operator--(int) { const_iterator it = *this; --pos; return it; } reference operator*() const { return name.empty() ? params->param(pos) : params->param(name, pos); } pointer operator->() const { return &(operator*()); } }; private: values_type _values; public: /// default constructor QueryParams() { } explicit QueryParams(const std::string& url) { parse_url(url); } explicit QueryParams(const char* url) { parse_url(url); } /// read parameters from url void parse_url(const std::string& url); /// read parameters from url void parse_url(const char* url); /// read parameters from stream void parse_url(std::istream& url_stream); // // unnamed parameter // /// get unnamed parameter by number (no range-check!) const std::string& param(size_type n) const { return param(std::string(), n); } /// get number of unnamed parameters size_type paramcount() const { return paramcount(std::string()); } /// get unnamed parameter with operator[] (no range-check!) const std::string& operator[] (size_type n) const { return param(n); } /// add unnamed parameter QueryParams& add(const std::string& value) { _values.push_back(value_type(std::string(), value)); return *this; } // // named parameter // /// get nth named parameter. const std::string& param(const std::string& name, size_type n = 0) const; /// get nth named parameter with default value. std::string param(const std::string& name, size_type n, const std::string& def) const; /// get named parameter or default value. std::string param(const std::string& name, const std::string& def) const { return param(name, 0, def); } /// get number of parameters with the given name size_type paramcount(const std::string& name) const; /// get first named parameter with operator[] std::string operator[] (const std::string& name) const { return param(name, 0, std::string()); } /// checks if the named parameter exists bool has(const std::string& name) const; /// add named parameter QueryParams& add(const std::string& name, const std::string& value) { _values.push_back(value_type(name, value)); return *this; } QueryParams& add(const QueryParams& other) { _values.insert(_values.end(), other._values.begin(), other._values.end()); return *this; } /// removes all data void clear() { _values.clear(); } /// returns true, when no parameters exist (named and unnamed) bool empty() const { return _values.empty(); } // // iterator-methods // /// get iterator to unnamed parameters const_iterator begin() const { return const_iterator(*this); } /// get iterator to named parameter const_iterator begin(const std::string& name) const { return const_iterator(*this, name); } /// get end-iterator (named and unnamed) const_iterator end() const { return const_iterator(); } /// get parameters as url std::string getUrl() const; }; /// output QueryParams in url-syntax inline std::ostream& operator<< (std::ostream& out, const QueryParams& p) { return out << p.getUrl(); } } #endif // CXXTOOLS_QUERY_PARAMS_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/pool.h��������������������������������������������������������������0000664�0001750�0001750�00000014623�12256773774�015004� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/smartptr.h> #include <cxxtools/noncopyable.h> #include <cxxtools/mutex.h> #include <vector> namespace cxxtools { /** This class is a factory for objects wich are default constructable. */ template <class T> class DefaultCreator { public: T* operator() () { return new T(); } }; /** A Pool is a container for pooled objects. It maintains a list of object instances, which are not in use. If a program needs a instance, it can request one with the get-method. The pool returns a smart pointer to an instance. When the pointer is released, the instance is put back into the pool or dropped, if the pool has already a maximum number of instances. */ template <typename ObjectType, typename CreatorType = DefaultCreator<ObjectType>, template <class> class OwnershipPolicy = RefLinked, template <class> class DestroyPolicy = DeletePolicy> class Pool : private NonCopyable { public: class Ptr : public OwnershipPolicy<ObjectType>, public DestroyPolicy<ObjectType> { ObjectType* object; Pool* pool; typedef OwnershipPolicy<ObjectType> OwnershipPolicyType; typedef DestroyPolicy<ObjectType> DestroyPolicyType; void doUnlink() { if (OwnershipPolicyType::unlink(object)) { if (pool == 0 || !pool->put(*this)) DestroyPolicyType::destroy(object); } } public: Ptr() : object(0) {} Ptr(ObjectType* ptr) : object(ptr) { OwnershipPolicyType::link(*this, ptr); } Ptr(const Ptr& ptr) : object(ptr.object), pool(ptr.pool) { OwnershipPolicyType::link(ptr, ptr.object); } ~Ptr() { doUnlink(); } Ptr& operator= (const Ptr& ptr) { if (object != ptr.object) { doUnlink(); object = ptr.object; pool = ptr.pool; OwnershipPolicyType::link(ptr, object); } return *this; } /// The object can be dereferenced like the held object ObjectType* operator->() const { return object; } /// The object can be dereferenced like the held object ObjectType& operator*() const { return *object; } bool operator== (const ObjectType* p) const { return object == p; } bool operator!= (const ObjectType* p) const { return object != p; } bool operator< (const ObjectType* p) const { return object < p; } bool operator! () const { return object == 0; } operator bool () const { return object != 0; } ObjectType* getPointer() { return object; } const ObjectType* getPointer() const { return object; } operator ObjectType* () { return object; } operator const ObjectType* () const { return object; } void setPool(Pool* p) { pool = p; } // don't put the object back to the pool void release() { pool = 0; } }; private: typedef std::vector<Ptr> Container; Container freePool; unsigned maxSpare; mutable Mutex mutex; CreatorType creator; bool put(Ptr& po) // returns true, if object was put into the freePool vector { MutexLock lock(mutex); if (maxSpare == 0 || freePool.size() < maxSpare) { po.setPool(0); freePool.push_back(po); return true; } return false; } public: explicit Pool(unsigned maxSpare_ = 0, CreatorType creator_ = CreatorType()) : maxSpare(maxSpare_), creator(creator_) { } explicit Pool(CreatorType creator_) : maxSpare(0), creator(creator_) { } ~Pool() { freePool.clear(); } Ptr get() { MutexLock lock(mutex); Ptr po; if (freePool.empty()) { po = creator(); } else { po = freePool.back(); freePool.pop_back(); } po.setPool(this); return po; } void drop(unsigned keep = 0) { MutexLock lock(mutex); if (freePool.size() > keep) freePool.resize(keep); } unsigned getMaximumSize() const { MutexLock lock(mutex); return maxSpare; } unsigned size() const { MutexLock lock(mutex); return freePool.size(); } unsigned getCurrentSize() const { MutexLock lock(mutex); return freePool.size(); } void setMaximumSize(unsigned s) { MutexLock lock(mutex); maxSpare = s; if (freePool.size() > s) freePool.resize(s); } CreatorType& getCreator() { return creator; } const CreatorType& getCreator() const { return creator; } }; } �������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/cxxtools/regex.h�������������������������������������������������������������0000664�0001750�0001750�00000007374�12266277345�015144� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_REGEX_H #define CXXTOOLS_REGEX_H #include <string> #include <sys/types.h> #include <regex.h> #include <cxxtools/smartptr.h> namespace cxxtools { class RegexSMatch; template <typename objectType> class RegexDestroyPolicy; template <> class RegexDestroyPolicy<regex_t> { protected: void destroy(regex_t* expr) { ::regfree(expr); delete expr; } }; /// regex(3)-wrapper. class Regex { SmartPtr<regex_t, ExternalRefCounted, RegexDestroyPolicy> expr; void checkerr(int ret) const; public: Regex() { } explicit Regex(const char* ex, int cflags = REG_EXTENDED) : expr(0) { if (ex && ex[0]) { expr = new regex_t(); checkerr(::regcomp(expr.getPointer(), ex, cflags)); } } explicit Regex(const std::string& ex, int cflags = REG_EXTENDED) : expr(0) { if (!ex.empty()) { expr = new regex_t(); checkerr(::regcomp(expr.getPointer(), ex.c_str(), cflags)); } } bool match(const std::string& str_, RegexSMatch& smatch, int eflags = 0) const; bool match(const std::string& str_, int eflags = 0) const; void free() { expr = 0; } bool empty() const { return expr.getPointer() == 0; } }; /// collects matches in a regex class RegexSMatch { friend class Regex; std::string str; regmatch_t matchbuf[10]; public: RegexSMatch() { matchbuf[0].rm_so = 0; } /// returns the number of expressions, which were found unsigned size() const; /// returns the start position of the n-th expression regoff_t offsetBegin(unsigned n) const { return matchbuf[n].rm_so; } /// returns the end position of the n-th expression regoff_t offsetEnd(unsigned n) const { return matchbuf[n].rm_eo; } /// returns true if the n-th element is set. bool has(unsigned n) const { return matchbuf[n].rm_so >= 0; } /// returns the n-th element. No range checking is done. std::string get(unsigned n) const; /// replace each occurence of "$n" with the n-th element (n: 0..9). std::string format(const std::string& s) const; /// returns the n-th element. No range checking is done. std::string operator[] (unsigned n) const { return get(n); } }; } #endif // CXXTOOLS_REGEX_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/Makefile.am������������������������������������������������������������������0000664�0001750�0001750�00000020361�12266277345�014021� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������nobase_include_HEADERS = \ cxxtools/allocator.h \ cxxtools/application.h \ cxxtools/arg.h \ cxxtools/argin.h \ cxxtools/argout.h \ cxxtools/atomicity.h \ cxxtools/api.h \ cxxtools/base64codec.h \ cxxtools/base64stream.h \ cxxtools/bin/formatter.h \ cxxtools/bin/serializer.h \ cxxtools/bin/deserializer.h \ cxxtools/bin/rpcclient.h \ cxxtools/bin/rpcserver.h \ cxxtools/bin/valueparser.h \ cxxtools/byteorder.h \ cxxtools/cache.h \ cxxtools/callable.h \ cxxtools/callable.tpp \ cxxtools/composer.h \ cxxtools/csvdeserializer.h \ cxxtools/csvformatter.h \ cxxtools/csvparser.h \ cxxtools/csvserializer.h \ cxxtools/char.h \ cxxtools/cgi.h \ cxxtools/clock.h \ cxxtools/condition.h \ cxxtools/connectable.h \ cxxtools/connection.h \ cxxtools/constmethod.h \ cxxtools/constmethod.tpp \ cxxtools/conversionerror.h \ cxxtools/convert.h \ cxxtools/date.h\ cxxtools/datetime.h \ cxxtools/decomposer.h \ cxxtools/delegate.h \ cxxtools/delegate.tpp \ cxxtools/deserializer.h \ cxxtools/deserializerbase.h \ cxxtools/dir.h \ cxxtools/directory.h \ cxxtools/dlloader.h \ cxxtools/event.h \ cxxtools/eventloop.h \ cxxtools/eventsink.h \ cxxtools/eventsource.h \ cxxtools/facets.h \ cxxtools/fdstream.h \ cxxtools/formatter.h \ cxxtools/file.h \ cxxtools/filedevice.h \ cxxtools/fileinfo.h \ cxxtools/function.h \ cxxtools/function.tpp \ cxxtools/hdstream.h \ cxxtools/hmac.h \ cxxtools/http/api.h \ cxxtools/http/client.h \ cxxtools/http/messageheader.h \ cxxtools/http/reply.h \ cxxtools/http/replyheader.h \ cxxtools/http/request.h \ cxxtools/http/requestheader.h \ cxxtools/http/server.h \ cxxtools/http/service.h \ cxxtools/http/responder.h \ cxxtools/inifile.h \ cxxtools/iniparser.h \ cxxtools/invokable.h \ cxxtools/invokable.tpp \ cxxtools/ioerror.h \ cxxtools/iodevice.h \ cxxtools/iostream.h \ cxxtools/join.h \ cxxtools/json/httpclient.h \ cxxtools/json/httpservice.h \ cxxtools/json/request.h \ cxxtools/json/responder.h \ cxxtools/json/rpcclient.h \ cxxtools/json/rpcserver.h \ cxxtools/jsondeserializer.h \ cxxtools/jsonformatter.h \ cxxtools/jsonparser.h \ cxxtools/jsonserializer.h \ cxxtools/library.h \ cxxtools/lrucache.h \ cxxtools/log.h \ cxxtools/main.h \ cxxtools/md5.h \ cxxtools/md5stream.h \ cxxtools/membar.gcc.h \ cxxtools/membar.gcc.nosmp.h \ cxxtools/membar.h \ cxxtools/method.h \ cxxtools/method.tpp \ cxxtools/mime.h \ cxxtools/multifstream.h \ cxxtools/mutex.h \ cxxtools/net/addrinfo.h \ cxxtools/net/net.h \ cxxtools/net/tcpserver.h \ cxxtools/net/tcpsocket.h \ cxxtools/net/tcpstream.h \ cxxtools/net/udp.h \ cxxtools/net/udpstream.h \ cxxtools/net/uri.h \ cxxtools/noncopyable.h \ cxxtools/pipe.h \ cxxtools/pool.h \ cxxtools/posix/commandinput.h \ cxxtools/posix/commandoutput.h \ cxxtools/posix/exec.h \ cxxtools/posix/fork.h \ cxxtools/posix/pipe.h \ cxxtools/posix/pipestream.h \ cxxtools/properties.h \ cxxtools/propertiesdeserializer.h \ cxxtools/query_params.h \ cxxtools/queue.h \ cxxtools/quotedprintablestream.h \ cxxtools/refcounted.h \ cxxtools/regex.h \ cxxtools/remoteclient.h \ cxxtools/remoteexception.h \ cxxtools/remoteprocedure.h \ cxxtools/remoteresult.h \ cxxtools/selector.h \ cxxtools/selectable.h \ cxxtools/semaphore.h \ cxxtools/serializationerror.h \ cxxtools/serializationinfo.h \ cxxtools/serviceprocedure.h \ cxxtools/serviceregistry.h \ cxxtools/settings.h \ cxxtools/split.h \ cxxtools/signal.h \ cxxtools/signal.tpp \ cxxtools/singleton.h \ cxxtools/slot.h \ cxxtools/slot.tpp \ cxxtools/smartptr.h \ cxxtools/sourceinfo.h \ cxxtools/streambuffer.h \ cxxtools/streamcounter.h \ cxxtools/string.h \ cxxtools/string.tpp \ cxxtools/stringstream.h \ cxxtools/systemerror.h \ cxxtools/tee.h \ cxxtools/textbuffer.h \ cxxtools/textcodec.h \ cxxtools/textstream.h \ cxxtools/thread.h \ cxxtools/threadpool.h \ cxxtools/time.h \ cxxtools/timer.h \ cxxtools/timespan.h \ cxxtools/trim.h \ cxxtools/typetraits.h \ cxxtools/utf8codec.h \ cxxtools/uuencode.h \ cxxtools/void.h \ cxxtools/xmltag.h \ cxxtools/log/cxxtools.h \ cxxtools/unit/application.h \ cxxtools/unit/assertion.h \ cxxtools/unit/registertest.h \ cxxtools/unit/reporter.h \ cxxtools/unit/test.h \ cxxtools/unit/testcase.h \ cxxtools/unit/testcontext.h \ cxxtools/unit/testfixture.h \ cxxtools/unit/testmain.h \ cxxtools/unit/testmethod.h \ cxxtools/unit/testprotocol.h \ cxxtools/unit/testsuite.h \ cxxtools/xml/api.h \ cxxtools/xml/characters.h \ cxxtools/xml/comment.h \ cxxtools/xml/doctypedeclaration.h \ cxxtools/xml/enddocument.h \ cxxtools/xml/endelement.h \ cxxtools/xml/entityresolver.h \ cxxtools/xml/namespace.h \ cxxtools/xml/namespacecontext.h \ cxxtools/xml/node.h \ cxxtools/xml/processinginstruction.h \ cxxtools/xml/startelement.h \ cxxtools/xml/xmlerror.h \ cxxtools/xml/xmlformatter.h \ cxxtools/xml/xmldeserializer.h \ cxxtools/xml/xmlreader.h \ cxxtools/xml/xmlserializer.h \ cxxtools/xml/xmlwriter.h \ cxxtools/xmlrpc/api.h \ cxxtools/xmlrpc/client.h \ cxxtools/xmlrpc/errorcodes.h \ cxxtools/xmlrpc/httpclient.h \ cxxtools/xmlrpc/formatter.h \ cxxtools/xmlrpc/responder.h \ cxxtools/xmlrpc/scanner.h \ cxxtools/xmlrpc/service.h nobase_nodist_include_HEADERS = \ cxxtools/config.h if MAKE_ICONVSTREAM nobase_include_HEADERS += \ cxxtools/iconverter.h \ cxxtools/iconvstream.h \ cxxtools/iconvwrap.h endif if MAKE_ATOMICITY_SUN nobase_include_HEADERS += \ cxxtools/membar.sun.h \ cxxtools/atomicity.sun.h endif if MAKE_ATOMICITY_WINDOWS nobase_include_HEADERS += \ cxxtools/membar.windows.h \ cxxtools/atomicity.windows.h endif if MAKE_ATOMICITY_GCC_ARM nobase_include_HEADERS += \ cxxtools/membar.gcc.arm.h \ cxxtools/atomicity.gcc.arm.h endif if MAKE_ATOMICITY_GCC_MIPS nobase_include_HEADERS += \ cxxtools/membar.gcc.mips.h \ cxxtools/atomicity.gcc.mips.h endif if MAKE_ATOMICITY_GCC_PPC nobase_include_HEADERS += \ cxxtools/membar.gcc.ppc.h \ cxxtools/atomicity.gcc.ppc.h endif if MAKE_ATOMICITY_GCC_X86_64 nobase_include_HEADERS += \ cxxtools/membar.gcc.x86.h \ cxxtools/atomicity.gcc.x86_64.h endif if MAKE_ATOMICITY_GCC_X86 nobase_include_HEADERS += \ cxxtools/membar.gcc.x86.h \ cxxtools/atomicity.gcc.x86.h endif if MAKE_ATOMICITY_GCC_SPARC32 nobase_include_HEADERS += \ cxxtools/membar.gcc.sparc32.h \ cxxtools/atomicity.gcc.sparc32.h endif if MAKE_ATOMICITY_GCC_SPARC64 nobase_include_HEADERS += \ cxxtools/membar.gcc.sparc64.h \ cxxtools/atomicity.gcc.sparc64.h endif if MAKE_ATOMICITY_GCC_AVR32 nobase_include_HEADERS += \ cxxtools/atomicity.gcc.avr32.h endif if MAKE_ATOMICITY_PTHREAD nobase_include_HEADERS += \ cxxtools/atomicity.pthread.h endif if MAKE_ATOMICITY_GENERIC nobase_include_HEADERS += \ cxxtools/atomicity.generic.h endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/include/Makefile.in������������������������������������������������������������������0000664�0001750�0001750�00000073053�12266277545�014042� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @MAKE_ICONVSTREAM_TRUE@am__append_1 = \ @MAKE_ICONVSTREAM_TRUE@ cxxtools/iconverter.h \ @MAKE_ICONVSTREAM_TRUE@ cxxtools/iconvstream.h \ @MAKE_ICONVSTREAM_TRUE@ cxxtools/iconvwrap.h @MAKE_ATOMICITY_SUN_TRUE@am__append_2 = \ @MAKE_ATOMICITY_SUN_TRUE@ cxxtools/membar.sun.h \ @MAKE_ATOMICITY_SUN_TRUE@ cxxtools/atomicity.sun.h @MAKE_ATOMICITY_WINDOWS_TRUE@am__append_3 = \ @MAKE_ATOMICITY_WINDOWS_TRUE@ cxxtools/membar.windows.h \ @MAKE_ATOMICITY_WINDOWS_TRUE@ cxxtools/atomicity.windows.h @MAKE_ATOMICITY_GCC_ARM_TRUE@am__append_4 = \ @MAKE_ATOMICITY_GCC_ARM_TRUE@ cxxtools/membar.gcc.arm.h \ @MAKE_ATOMICITY_GCC_ARM_TRUE@ cxxtools/atomicity.gcc.arm.h @MAKE_ATOMICITY_GCC_MIPS_TRUE@am__append_5 = \ @MAKE_ATOMICITY_GCC_MIPS_TRUE@ cxxtools/membar.gcc.mips.h \ @MAKE_ATOMICITY_GCC_MIPS_TRUE@ cxxtools/atomicity.gcc.mips.h @MAKE_ATOMICITY_GCC_PPC_TRUE@am__append_6 = \ @MAKE_ATOMICITY_GCC_PPC_TRUE@ cxxtools/membar.gcc.ppc.h \ @MAKE_ATOMICITY_GCC_PPC_TRUE@ cxxtools/atomicity.gcc.ppc.h @MAKE_ATOMICITY_GCC_X86_64_TRUE@am__append_7 = \ @MAKE_ATOMICITY_GCC_X86_64_TRUE@ cxxtools/membar.gcc.x86.h \ @MAKE_ATOMICITY_GCC_X86_64_TRUE@ cxxtools/atomicity.gcc.x86_64.h @MAKE_ATOMICITY_GCC_X86_TRUE@am__append_8 = \ @MAKE_ATOMICITY_GCC_X86_TRUE@ cxxtools/membar.gcc.x86.h \ @MAKE_ATOMICITY_GCC_X86_TRUE@ cxxtools/atomicity.gcc.x86.h @MAKE_ATOMICITY_GCC_SPARC32_TRUE@am__append_9 = \ @MAKE_ATOMICITY_GCC_SPARC32_TRUE@ cxxtools/membar.gcc.sparc32.h \ @MAKE_ATOMICITY_GCC_SPARC32_TRUE@ cxxtools/atomicity.gcc.sparc32.h @MAKE_ATOMICITY_GCC_SPARC64_TRUE@am__append_10 = \ @MAKE_ATOMICITY_GCC_SPARC64_TRUE@ cxxtools/membar.gcc.sparc64.h \ @MAKE_ATOMICITY_GCC_SPARC64_TRUE@ cxxtools/atomicity.gcc.sparc64.h @MAKE_ATOMICITY_GCC_AVR32_TRUE@am__append_11 = \ @MAKE_ATOMICITY_GCC_AVR32_TRUE@ cxxtools/atomicity.gcc.avr32.h @MAKE_ATOMICITY_PTHREAD_TRUE@am__append_12 = \ @MAKE_ATOMICITY_PTHREAD_TRUE@ cxxtools/atomicity.pthread.h @MAKE_ATOMICITY_GENERIC_TRUE@am__append_13 = \ @MAKE_ATOMICITY_GENERIC_TRUE@ cxxtools/atomicity.generic.h subdir = include DIST_COMMON = $(am__nobase_include_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__nobase_include_HEADERS_DIST = cxxtools/allocator.h \ cxxtools/application.h cxxtools/arg.h cxxtools/argin.h \ cxxtools/argout.h cxxtools/atomicity.h cxxtools/api.h \ cxxtools/base64codec.h cxxtools/base64stream.h \ cxxtools/bin/formatter.h cxxtools/bin/serializer.h \ cxxtools/bin/deserializer.h cxxtools/bin/rpcclient.h \ cxxtools/bin/rpcserver.h cxxtools/bin/valueparser.h \ cxxtools/byteorder.h cxxtools/cache.h cxxtools/callable.h \ cxxtools/callable.tpp cxxtools/composer.h \ cxxtools/csvdeserializer.h cxxtools/csvformatter.h \ cxxtools/csvparser.h cxxtools/csvserializer.h cxxtools/char.h \ cxxtools/cgi.h cxxtools/clock.h cxxtools/condition.h \ cxxtools/connectable.h cxxtools/connection.h \ cxxtools/constmethod.h cxxtools/constmethod.tpp \ cxxtools/conversionerror.h cxxtools/convert.h cxxtools/date.h \ cxxtools/datetime.h cxxtools/decomposer.h cxxtools/delegate.h \ cxxtools/delegate.tpp cxxtools/deserializer.h \ cxxtools/deserializerbase.h cxxtools/dir.h \ cxxtools/directory.h cxxtools/dlloader.h cxxtools/event.h \ cxxtools/eventloop.h cxxtools/eventsink.h \ cxxtools/eventsource.h cxxtools/facets.h cxxtools/fdstream.h \ cxxtools/formatter.h cxxtools/file.h cxxtools/filedevice.h \ cxxtools/fileinfo.h cxxtools/function.h cxxtools/function.tpp \ cxxtools/hdstream.h cxxtools/hmac.h cxxtools/http/api.h \ cxxtools/http/client.h cxxtools/http/messageheader.h \ cxxtools/http/reply.h cxxtools/http/replyheader.h \ cxxtools/http/request.h cxxtools/http/requestheader.h \ cxxtools/http/server.h cxxtools/http/service.h \ cxxtools/http/responder.h cxxtools/inifile.h \ cxxtools/iniparser.h cxxtools/invokable.h \ cxxtools/invokable.tpp cxxtools/ioerror.h cxxtools/iodevice.h \ cxxtools/iostream.h cxxtools/join.h cxxtools/json/httpclient.h \ cxxtools/json/httpservice.h cxxtools/json/request.h \ cxxtools/json/responder.h cxxtools/json/rpcclient.h \ cxxtools/json/rpcserver.h cxxtools/jsondeserializer.h \ cxxtools/jsonformatter.h cxxtools/jsonparser.h \ cxxtools/jsonserializer.h cxxtools/library.h \ cxxtools/lrucache.h cxxtools/log.h cxxtools/main.h \ cxxtools/md5.h cxxtools/md5stream.h cxxtools/membar.gcc.h \ cxxtools/membar.gcc.nosmp.h cxxtools/membar.h \ cxxtools/method.h cxxtools/method.tpp cxxtools/mime.h \ cxxtools/multifstream.h cxxtools/mutex.h \ cxxtools/net/addrinfo.h cxxtools/net/net.h \ cxxtools/net/tcpserver.h cxxtools/net/tcpsocket.h \ cxxtools/net/tcpstream.h cxxtools/net/udp.h \ cxxtools/net/udpstream.h cxxtools/net/uri.h \ cxxtools/noncopyable.h cxxtools/pipe.h cxxtools/pool.h \ cxxtools/posix/commandinput.h cxxtools/posix/commandoutput.h \ cxxtools/posix/exec.h cxxtools/posix/fork.h \ cxxtools/posix/pipe.h cxxtools/posix/pipestream.h \ cxxtools/properties.h cxxtools/propertiesdeserializer.h \ cxxtools/query_params.h cxxtools/queue.h \ cxxtools/quotedprintablestream.h cxxtools/refcounted.h \ cxxtools/regex.h cxxtools/remoteclient.h \ cxxtools/remoteexception.h cxxtools/remoteprocedure.h \ cxxtools/remoteresult.h cxxtools/selector.h \ cxxtools/selectable.h cxxtools/semaphore.h \ cxxtools/serializationerror.h cxxtools/serializationinfo.h \ cxxtools/serviceprocedure.h cxxtools/serviceregistry.h \ cxxtools/settings.h cxxtools/split.h cxxtools/signal.h \ cxxtools/signal.tpp cxxtools/singleton.h cxxtools/slot.h \ cxxtools/slot.tpp cxxtools/smartptr.h cxxtools/sourceinfo.h \ cxxtools/streambuffer.h cxxtools/streamcounter.h \ cxxtools/string.h cxxtools/string.tpp cxxtools/stringstream.h \ cxxtools/systemerror.h cxxtools/tee.h cxxtools/textbuffer.h \ cxxtools/textcodec.h cxxtools/textstream.h cxxtools/thread.h \ cxxtools/threadpool.h cxxtools/time.h cxxtools/timer.h \ cxxtools/timespan.h cxxtools/trim.h cxxtools/typetraits.h \ cxxtools/utf8codec.h cxxtools/uuencode.h cxxtools/void.h \ cxxtools/xmltag.h cxxtools/log/cxxtools.h \ cxxtools/unit/application.h cxxtools/unit/assertion.h \ cxxtools/unit/registertest.h cxxtools/unit/reporter.h \ cxxtools/unit/test.h cxxtools/unit/testcase.h \ cxxtools/unit/testcontext.h cxxtools/unit/testfixture.h \ cxxtools/unit/testmain.h cxxtools/unit/testmethod.h \ cxxtools/unit/testprotocol.h cxxtools/unit/testsuite.h \ cxxtools/xml/api.h cxxtools/xml/characters.h \ cxxtools/xml/comment.h cxxtools/xml/doctypedeclaration.h \ cxxtools/xml/enddocument.h cxxtools/xml/endelement.h \ cxxtools/xml/entityresolver.h cxxtools/xml/namespace.h \ cxxtools/xml/namespacecontext.h cxxtools/xml/node.h \ cxxtools/xml/processinginstruction.h \ cxxtools/xml/startelement.h cxxtools/xml/xmlerror.h \ cxxtools/xml/xmlformatter.h cxxtools/xml/xmldeserializer.h \ cxxtools/xml/xmlreader.h cxxtools/xml/xmlserializer.h \ cxxtools/xml/xmlwriter.h cxxtools/xmlrpc/api.h \ cxxtools/xmlrpc/client.h cxxtools/xmlrpc/errorcodes.h \ cxxtools/xmlrpc/httpclient.h cxxtools/xmlrpc/formatter.h \ cxxtools/xmlrpc/responder.h cxxtools/xmlrpc/scanner.h \ cxxtools/xmlrpc/service.h cxxtools/iconverter.h \ cxxtools/iconvstream.h cxxtools/iconvwrap.h \ cxxtools/membar.sun.h cxxtools/atomicity.sun.h \ cxxtools/membar.windows.h cxxtools/atomicity.windows.h \ cxxtools/membar.gcc.arm.h cxxtools/atomicity.gcc.arm.h \ cxxtools/membar.gcc.mips.h cxxtools/atomicity.gcc.mips.h \ cxxtools/membar.gcc.ppc.h cxxtools/atomicity.gcc.ppc.h \ cxxtools/membar.gcc.x86.h cxxtools/atomicity.gcc.x86_64.h \ cxxtools/atomicity.gcc.x86.h cxxtools/membar.gcc.sparc32.h \ cxxtools/atomicity.gcc.sparc32.h cxxtools/membar.gcc.sparc64.h \ cxxtools/atomicity.gcc.sparc64.h \ cxxtools/atomicity.gcc.avr32.h cxxtools/atomicity.pthread.h \ cxxtools/atomicity.generic.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)" HEADERS = $(nobase_include_HEADERS) $(nobase_nodist_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ nobase_include_HEADERS = cxxtools/allocator.h cxxtools/application.h \ cxxtools/arg.h cxxtools/argin.h cxxtools/argout.h \ cxxtools/atomicity.h cxxtools/api.h cxxtools/base64codec.h \ cxxtools/base64stream.h cxxtools/bin/formatter.h \ cxxtools/bin/serializer.h cxxtools/bin/deserializer.h \ cxxtools/bin/rpcclient.h cxxtools/bin/rpcserver.h \ cxxtools/bin/valueparser.h cxxtools/byteorder.h \ cxxtools/cache.h cxxtools/callable.h cxxtools/callable.tpp \ cxxtools/composer.h cxxtools/csvdeserializer.h \ cxxtools/csvformatter.h cxxtools/csvparser.h \ cxxtools/csvserializer.h cxxtools/char.h cxxtools/cgi.h \ cxxtools/clock.h cxxtools/condition.h cxxtools/connectable.h \ cxxtools/connection.h cxxtools/constmethod.h \ cxxtools/constmethod.tpp cxxtools/conversionerror.h \ cxxtools/convert.h cxxtools/date.h cxxtools/datetime.h \ cxxtools/decomposer.h cxxtools/delegate.h \ cxxtools/delegate.tpp cxxtools/deserializer.h \ cxxtools/deserializerbase.h cxxtools/dir.h \ cxxtools/directory.h cxxtools/dlloader.h cxxtools/event.h \ cxxtools/eventloop.h cxxtools/eventsink.h \ cxxtools/eventsource.h cxxtools/facets.h cxxtools/fdstream.h \ cxxtools/formatter.h cxxtools/file.h cxxtools/filedevice.h \ cxxtools/fileinfo.h cxxtools/function.h cxxtools/function.tpp \ cxxtools/hdstream.h cxxtools/hmac.h cxxtools/http/api.h \ cxxtools/http/client.h cxxtools/http/messageheader.h \ cxxtools/http/reply.h cxxtools/http/replyheader.h \ cxxtools/http/request.h cxxtools/http/requestheader.h \ cxxtools/http/server.h cxxtools/http/service.h \ cxxtools/http/responder.h cxxtools/inifile.h \ cxxtools/iniparser.h cxxtools/invokable.h \ cxxtools/invokable.tpp cxxtools/ioerror.h cxxtools/iodevice.h \ cxxtools/iostream.h cxxtools/join.h cxxtools/json/httpclient.h \ cxxtools/json/httpservice.h cxxtools/json/request.h \ cxxtools/json/responder.h cxxtools/json/rpcclient.h \ cxxtools/json/rpcserver.h cxxtools/jsondeserializer.h \ cxxtools/jsonformatter.h cxxtools/jsonparser.h \ cxxtools/jsonserializer.h cxxtools/library.h \ cxxtools/lrucache.h cxxtools/log.h cxxtools/main.h \ cxxtools/md5.h cxxtools/md5stream.h cxxtools/membar.gcc.h \ cxxtools/membar.gcc.nosmp.h cxxtools/membar.h \ cxxtools/method.h cxxtools/method.tpp cxxtools/mime.h \ cxxtools/multifstream.h cxxtools/mutex.h \ cxxtools/net/addrinfo.h cxxtools/net/net.h \ cxxtools/net/tcpserver.h cxxtools/net/tcpsocket.h \ cxxtools/net/tcpstream.h cxxtools/net/udp.h \ cxxtools/net/udpstream.h cxxtools/net/uri.h \ cxxtools/noncopyable.h cxxtools/pipe.h cxxtools/pool.h \ cxxtools/posix/commandinput.h cxxtools/posix/commandoutput.h \ cxxtools/posix/exec.h cxxtools/posix/fork.h \ cxxtools/posix/pipe.h cxxtools/posix/pipestream.h \ cxxtools/properties.h cxxtools/propertiesdeserializer.h \ cxxtools/query_params.h cxxtools/queue.h \ cxxtools/quotedprintablestream.h cxxtools/refcounted.h \ cxxtools/regex.h cxxtools/remoteclient.h \ cxxtools/remoteexception.h cxxtools/remoteprocedure.h \ cxxtools/remoteresult.h cxxtools/selector.h \ cxxtools/selectable.h cxxtools/semaphore.h \ cxxtools/serializationerror.h cxxtools/serializationinfo.h \ cxxtools/serviceprocedure.h cxxtools/serviceregistry.h \ cxxtools/settings.h cxxtools/split.h cxxtools/signal.h \ cxxtools/signal.tpp cxxtools/singleton.h cxxtools/slot.h \ cxxtools/slot.tpp cxxtools/smartptr.h cxxtools/sourceinfo.h \ cxxtools/streambuffer.h cxxtools/streamcounter.h \ cxxtools/string.h cxxtools/string.tpp cxxtools/stringstream.h \ cxxtools/systemerror.h cxxtools/tee.h cxxtools/textbuffer.h \ cxxtools/textcodec.h cxxtools/textstream.h cxxtools/thread.h \ cxxtools/threadpool.h cxxtools/time.h cxxtools/timer.h \ cxxtools/timespan.h cxxtools/trim.h cxxtools/typetraits.h \ cxxtools/utf8codec.h cxxtools/uuencode.h cxxtools/void.h \ cxxtools/xmltag.h cxxtools/log/cxxtools.h \ cxxtools/unit/application.h cxxtools/unit/assertion.h \ cxxtools/unit/registertest.h cxxtools/unit/reporter.h \ cxxtools/unit/test.h cxxtools/unit/testcase.h \ cxxtools/unit/testcontext.h cxxtools/unit/testfixture.h \ cxxtools/unit/testmain.h cxxtools/unit/testmethod.h \ cxxtools/unit/testprotocol.h cxxtools/unit/testsuite.h \ cxxtools/xml/api.h cxxtools/xml/characters.h \ cxxtools/xml/comment.h cxxtools/xml/doctypedeclaration.h \ cxxtools/xml/enddocument.h cxxtools/xml/endelement.h \ cxxtools/xml/entityresolver.h cxxtools/xml/namespace.h \ cxxtools/xml/namespacecontext.h cxxtools/xml/node.h \ cxxtools/xml/processinginstruction.h \ cxxtools/xml/startelement.h cxxtools/xml/xmlerror.h \ cxxtools/xml/xmlformatter.h cxxtools/xml/xmldeserializer.h \ cxxtools/xml/xmlreader.h cxxtools/xml/xmlserializer.h \ cxxtools/xml/xmlwriter.h cxxtools/xmlrpc/api.h \ cxxtools/xmlrpc/client.h cxxtools/xmlrpc/errorcodes.h \ cxxtools/xmlrpc/httpclient.h cxxtools/xmlrpc/formatter.h \ cxxtools/xmlrpc/responder.h cxxtools/xmlrpc/scanner.h \ cxxtools/xmlrpc/service.h $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) \ $(am__append_6) $(am__append_7) $(am__append_8) \ $(am__append_9) $(am__append_10) $(am__append_11) \ $(am__append_12) $(am__append_13) nobase_nodist_include_HEADERS = \ cxxtools/config.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-nobase_nodist_includeHEADERS: $(nobase_nodist_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_includeHEADERS \ install-nobase_nodist_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_includeHEADERS \ uninstall-nobase_nodist_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-nobase_includeHEADERS \ install-nobase_nodist_includeHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-nobase_includeHEADERS \ uninstall-nobase_nodist_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/Releasenotes-2.2.1.markdown����������������������������������������������������������0000664�0001750�0001750�00000000626�12266277345�015177� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Releasenotes cxxtools 2.2.1 =========================== 2.2.1 is a bugfix release. It fixes a major bug when parsing query parameters in http communication. Query parameters containing two percent signs resulted in an recursive loop, which results in a crash. Since query parameters are typically received from the network, it is a major problem, since there is no control over the input parameters sent. ����������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/����������������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277561�010740� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/lt~obsolete.m4��������������������������������������������������������������������0000644�0001750�0001750�00000013756�12027535365�013500� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) ������������������cxxtools-2.2.1/m4/ax_compiler_vendor.m4�������������������������������������������������������������0000664�0001750�0001750�00000006616�12256773774�015020� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS # # AX_COMPILER_VENDOR # # DESCRIPTION # # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, # watcom, etc. The vendor is returned in the cache variable # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2008 Matteo Frigo # # 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 3 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, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 11 AC_DEFUN([AX_COMPILER_VENDOR], [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [# note: don't check for gcc first since some other compilers define __GNUC__ vendors="intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__TURBOC__ comeau: __COMO__ cray: _CRAYC kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ portland: __PGI unknown: UNKNOWN" for ventest in $vendors; do case $ventest in *:) vendor=$ventest; continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ #if !($vencpp) thisisanerror; #endif ])], [break]) done ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` ]) ]) ������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/ax_check_compile_flag.m4����������������������������������������������������������0000664�0001750�0001750�00000006251�12256773774�015402� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.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 3 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, see <http://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/ltsugar.m4������������������������������������������������������������������������0000644�0001750�0001750�00000010424�12027535365�012574� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/ltversion.m4����������������������������������������������������������������������0000644�0001750�0001750�00000001262�12027535365�013140� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/ltoptions.m4����������������������������������������������������������������������0000644�0001750�0001750�00000030073�12027535365�013150� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/asmtype.m4������������������������������������������������������������������������0000664�0001750�0001750�00000020553�12256773774�012617� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dnl Copyright (C) 2008 by Tommi Maekitalo dnl dnl This library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public dnl License as published by the Free Software Foundation; either dnl version 2.1 of the License, or (at your option) any later version. dnl dnl As a special exception, you may use this file as part of a free dnl software library without restriction. Specifically, if other files dnl instantiate templates or use macros or inline functions from this dnl file, or you compile this file and link it with other files to dnl produce an executable, this file does not by itself cause the dnl resulting executable to be covered by the GNU General Public dnl License. This exception does not however invalidate any other dnl reasons why the executable file might be covered by the GNU Library dnl General Public License. dnl dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA dnl dnl AC_DEFUN([AC_CHECKATOMICTYPE], [ if test "$ac_cxxtools_atomicity" = "$1" -o "$ac_cxxtools_atomicity" = "probe" then AC_COMPILE_IFELSE( [AC_LANG_SOURCE([$3])], CXXTOOLS_ATOMICITY=$2 ac_cxxtools_atomicity=$1, if test "$ac_cxxtools_atomicity" = "$1" then AC_MSG_ERROR([atomictype $1 failed]) fi ) fi ] ) AC_DEFUN([AC_CXXTOOLS_ATOMICTYPE], [ AC_MSG_CHECKING([atomic type]) AC_ARG_WITH( [atomictype], AS_HELP_STRING([--with-atomictype], [force atomic type. Accepted arguments: sun, windows, att_x86, att_x86_64, att_arm, att_mips, att_ppc, att_sparc32, att_sparc64, pthread, generic, probe]), [ ac_cxxtools_atomicity=$withval ], [ ac_cxxtools_atomicity=probe ]) dnl check, if atomictype is valid dnl sun AC_CHECKATOMICTYPE([sun], [CXXTOOLS_ATOMICITY_SUN], [ #include <sys/atomic.h> int main () { volatile ulong_t* uvalue; atomic_inc_ulong_nv( uvalue ); } ]) AC_CHECKATOMICTYPE([windows], [CXXTOOLS_ATOMICITY_WINDOWS], [ #define _WINSOCKAPI_ #include <windows.h> int main() { LONG value; InterlockedIncrement(&value); } ]) AC_CHECKATOMICTYPE([att_arm], [CXXTOOLS_ATOMICITY_GCC_ARM], [ #include <csignal> typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& dest) { int a, b, c; asm volatile ( "0:\n\t" "ldr %0, [[%3]]\n\t" "add %1, %0, %4\n\t" "swp %2, %1, [[%3]]\n\t" "cmp %0, %2\n\t" "swpne %1, %2, [[%3]]\n\t" "bne 0b" : "=&r" (a), "=&r" (b), "=&r" (c) : "r" (&dest), "r" (1) : "cc", "memory"); } ]) AC_CHECKATOMICTYPE([att_mips], [CXXTOOLS_ATOMICITY_GCC_MIPS], [ #include <csignal> typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { atomic_t tmp, result = 0; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " addu %1, %0, 1\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (val) : "m" (val)); } ]) AC_CHECKATOMICTYPE([att_ppc], [CXXTOOLS_ATOMICITY_GCC_PPC], [ #include <csignal> typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { atomic_t result = 0, tmp; asm volatile ("\n1:\n\t" "lwarx %0, 0, %2\n\t" "addi %1, %0, 1\n\t" "stwcx. %1, 0, %2\n\t" "bne- 1b\n" "isync\n" : "=&b" (result), "=&b" (tmp): "r" (&val): "cc", "memory"); } ]) AC_CHECKATOMICTYPE([att_sparc64], [CXXTOOLS_ATOMICITY_GCC_SPARC64], [ #include <csignal> typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile ("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" : : : "memory"); asm volatile( "1: ld [%%g1], %%o4\n\t" " add %%o4, 1, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); } ]) AC_CHECKATOMICTYPE([att_sparc32], [CXXTOOLS_ATOMICITY_GCC_SPARC32], [ #include <csignal> typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile("stbar" : : : "memory"); asm volatile( "1: ld [%%g1], %%o4\n\t" " add %%o4, 1, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); } ]) AC_CHECKATOMICTYPE([att_x86_64], [CXXTOOLS_ATOMICITY_GCC_X86_64], [ #include <unistd.h> typedef ssize_t atomic_t; void atomicIncrement(volatile atomic_t& val) { static const atomic_t d = 1; atomic_t tmp; asm volatile ("lock; xaddq %0, %1" : "=r" (tmp), "=m" (val) : "0" (d), "m" (val)); } ]) AC_CHECKATOMICTYPE([att_x86], [CXXTOOLS_ATOMICITY_GCC_X86], [ #include <csignal> typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { atomic_t tmp; asm volatile ("lock; xaddl %0, %1" : "=r" (tmp), "=m" (val) : "0" (1), "m" (val)); } ]) AC_CHECKATOMICTYPE([att_avr32], [CXXTOOLS_ATOMICITY_GCC_AVR32], [ typedef int atomic_t; void atomicIncrement(volatile atomic_t& val) { volatile uint8_t tmp; asm volatile( "in %0, __SREG__" "\n\t" "cli" "\n\t" "ld __tmp_reg__, %a1" "\n\t" "inc __tmp_reg__" "\n\t" "st %a1, __tmp_reg__" "\n\t" "out __SREG__, %0" "\n\t" : "=&r" (tmp) : "e" (&val) : "memory" ); } ]) if test "$ac_cxxtools_atomicity" = "pthread" then CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_PTHREAD fi if test "$ac_cxxtools_atomicity" = "generic" then CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GENERIC fi if test "$CXXTOOLS_ATOMICITY" = "" then AC_MSG_ERROR([check for atomictype failed]) else AC_MSG_RESULT($ac_cxxtools_atomicity) fi ]) �����������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/iconv.m4��������������������������������������������������������������������������0000664�0001750�0001750�00000005636�12256773774�012260� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. Modified by Tommi Mäkitalo AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCICONV" LIBICONV=-liconv AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include <stdlib.h> #include <iconv.h> extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) ��������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/libtool.m4������������������������������������������������������������������������0000644�0001750�0001750�00001057432�12027535365�012572� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) _LT_PATH_LD_GNU AC_SUBST([LD]) _LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) ])# LT_PATH_LD # Old names: AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_LD], []) dnl AC_DEFUN([AC_PROG_LD], []) # _LT_PATH_LD_GNU #- -------------- m4_defun([_LT_PATH_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac]) with_gnu_ld=$lt_cv_prog_gnu_ld ])# _LT_PATH_LD_GNU # _LT_CMD_RELOAD # -------------- # find reload flag for linker # -- PORTME Some linkers may need a different reload flag. m4_defun([_LT_CMD_RELOAD], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/m4/acx_pthread.m4��������������������������������������������������������������������0000664�0001750�0001750�00000022417�12256773774�013420� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl @summary figure out how to build C programs using POSIX threads dnl dnl This macro figures out how to build C programs using POSIX threads. dnl It sets the PTHREAD_LIBS output variable to the threads library and dnl linker flags, and the PTHREAD_CFLAGS output variable to any special dnl C compiler flags that are needed. (The user can also force certain dnl compiler flags/libs to be tested by setting these environment dnl variables.) dnl dnl Also sets PTHREAD_CC to any special C compiler that is needed for dnl multi-threaded programs (defaults to the value of CC otherwise). dnl (This is necessary on AIX to use the special cc_r compiler alias.) dnl dnl NOTE: You are assumed to not only compile your program with these dnl flags, but also link it with them as well. e.g. you should link dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS dnl $LIBS dnl dnl If you are only building threads programs, you may wish to use dnl these variables in your default LIBS, CFLAGS, and CC: dnl dnl LIBS="$PTHREAD_LIBS $LIBS" dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" dnl CC="$PTHREAD_CC" dnl dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a threads dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the dnl default action will define HAVE_PTHREAD. dnl dnl Please let the authors know if this macro fails on any platform, or dnl if you have any other suggestions or comments. This macro was based dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. dnl We are also grateful for the helpful feedback of numerous users. dnl dnl @category InstalledPackages dnl @author Steven G. Johnson <stevenj@alum.mit.edu> dnl @version 2005-06-15 dnl @license GPLWithACException AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads -mt --thread-safe pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads -mt pthread -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include <pthread.h>], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) AC_CHECK_PROG(PTHREAD_CXX, CC_r, CC_r, ${CXX}) else PTHREAD_CC="$CC" PTHREAD_CXX="$CXX" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) AC_SUBST(PTHREAD_CXX) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/README�������������������������������������������������������������������������������0000664�0001750�0001750�00000000711�12266277345�011217� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Cxxtools ======== cxxtools is my toolbox with reusable c++-components see INSTALL for installation-instructions Installation from SVN ===================== In the SVN-repository there is no configure-script, but configure.in, which is the source for configure. You need autoconf and automake to create configure. There is a shellscript autogen.sh included, which calls the desired programs. I used automake 1.9.4 and autoconf 2.5.9 for development. �������������������������������������������������������cxxtools-2.2.1/ltmain.sh����������������������������������������������������������������������������0000644�0001750�0001750�00001051522�12027535365�012156� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to <bug-libtool@gnu.org>. # GNU libtool home page: <http://www.gnu.org/software/libtool/>. # General help using GNU software: <http://www.gnu.org/gethelp/>. PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <<EOF # $write_libobj - a libtool object file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # Name of the PIC object. pic_object=$write_lobj # Name of the non-PIC object non_pic_object=$write_oldobj EOF $MV "${write_libobj}T" "${write_libobj}" } } ################################################## # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # ################################################## # func_convert_core_file_wine_to_w32 ARG # Helper function used by file name conversion functions when $build is *nix, # and $host is mingw, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. # # ARG is the $build file name to be converted to w32 format. # Result is available in $func_convert_core_file_wine_to_w32_result, and will # be empty on error (or when ARG is empty) func_convert_core_file_wine_to_w32 () { $opt_debug func_convert_core_file_wine_to_w32_result="$1" if test -n "$1"; then # Unfortunately, winepath does not exit with a non-zero error code, so we # are forced to check the contents of stdout. On the other hand, if the # command is not found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both error code of # zero AND non-empty stdout, which explains the odd construction: func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen <import library>. $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 </dev/null >/dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat <<EOF /* $cwrappersource - temporary wrapper executable for $objdir/$outputname Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION The $output program cannot be directly executed until all the libtool libraries that it depends on are installed. This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. */ EOF cat <<"EOF" #ifdef _MSC_VER # define _CRT_SECURE_NO_DEPRECATE 1 #endif #include <stdio.h> #include <stdlib.h> #ifdef _MSC_VER # include <direct.h> # include <process.h> # include <io.h> #else # include <unistd.h> # include <stdint.h> # ifdef __CYGWIN__ # include <io.h> # endif #endif #include <malloc.h> #include <stdarg.h> #include <assert.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <sys/stat.h> /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <<EOF volatile const char * MAGIC_EXE = "$magic_exe"; const char * LIB_PATH_VARNAME = "$shlibpath_var"; EOF if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then func_to_host_path "$temp_rpath" cat <<EOF const char * LIB_PATH_VALUE = "$func_to_host_path_result"; EOF else cat <<"EOF" const char * LIB_PATH_VALUE = ""; EOF fi if test -n "$dllsearchpath"; then func_to_host_path "$dllsearchpath:" cat <<EOF const char * EXE_PATH_VARNAME = "PATH"; const char * EXE_PATH_VALUE = "$func_to_host_path_result"; EOF else cat <<"EOF" const char * EXE_PATH_VARNAME = ""; const char * EXE_PATH_VALUE = ""; EOF fi if test "$fast_install" = yes; then cat <<EOF const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */ EOF else cat <<EOF const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */ EOF fi cat <<"EOF" #define LTWRAPPER_OPTION_PREFIX "--lt-" static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; int main (int argc, char *argv[]) { char **newargz; int newargc; char *tmp_pathspec; char *actual_cwrapper_path; char *actual_cwrapper_name; char *target_name; char *lt_argv_zero; intptr_t rval = 127; int i; program_name = (char *) xstrdup (base_name (argv[0])); newargz = XMALLOC (char *, argc + 1); /* very simple arg parsing; don't want to rely on getopt * also, copy all non cwrapper options to newargz, except * argz[0], which is handled differently */ newargc=0; for (i = 1; i < argc; i++) { if (strcmp (argv[i], dumpscript_opt) == 0) { EOF case "$host" in *mingw* | *cygwin* ) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; esac cat <<"EOF" lt_dump_script (stdout); return 0; } if (strcmp (argv[i], debug_opt) == 0) { lt_debug = 1; continue; } if (strcmp (argv[i], ltwrapper_option_prefix) == 0) { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and have already dealt with, above (inluding dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll need to make LTWRAPPER_OPTION_PREFIX a configure-time option or a configure.ac-settable value. */ lt_fatal (__FILE__, __LINE__, "unrecognized %s option: '%s'", ltwrapper_option_prefix, argv[i]); } /* otherwise ... */ newargz[++newargc] = xstrdup (argv[i]); } newargz[++newargc] = NULL; EOF cat <<EOF /* The GNU banner must be the first non-error debug message */ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n"); EOF cat <<"EOF" lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name); tmp_pathspec = find_executable (argv[0]); if (tmp_pathspec == NULL) lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); lt_debugprintf (__FILE__, __LINE__, "(main) found exe (before symlink chase) at: %s\n", tmp_pathspec); actual_cwrapper_path = chase_symlinks (tmp_pathspec); lt_debugprintf (__FILE__, __LINE__, "(main) found exe (after symlink chase) at: %s\n", actual_cwrapper_path); XFREE (tmp_pathspec); actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path)); strendzap (actual_cwrapper_path, actual_cwrapper_name); /* wrapper name transforms */ strendzap (actual_cwrapper_name, ".exe"); tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1); XFREE (actual_cwrapper_name); actual_cwrapper_name = tmp_pathspec; tmp_pathspec = 0; /* target_name transforms -- use actual target program name; might have lt- prefix */ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME)); strendzap (target_name, ".exe"); tmp_pathspec = lt_extend_str (target_name, ".exe", 1); XFREE (target_name); target_name = tmp_pathspec; tmp_pathspec = 0; lt_debugprintf (__FILE__, __LINE__, "(main) libtool target name: %s\n", target_name); EOF cat <<EOF newargz[0] = XMALLOC (char, (strlen (actual_cwrapper_path) + strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1)); strcpy (newargz[0], actual_cwrapper_path); strcat (newargz[0], "$objdir"); strcat (newargz[0], "/"); EOF cat <<"EOF" /* stop here, and copy so we don't have to do this twice */ tmp_pathspec = xstrdup (newargz[0]); /* do NOT want the lt- prefix here, so use actual_cwrapper_name */ strcat (newargz[0], actual_cwrapper_name); /* DO want the lt- prefix here if it exists, so use target_name */ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1); XFREE (tmp_pathspec); tmp_pathspec = NULL; EOF case $host_os in mingw*) cat <<"EOF" { char* p; while ((p = strchr (newargz[0], '\\')) != NULL) { *p = '/'; } while ((p = strchr (lt_argv_zero, '\\')) != NULL) { *p = '/'; } } EOF ;; esac cat <<"EOF" XFREE (target_name); XFREE (actual_cwrapper_path); XFREE (actual_cwrapper_name); lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ lt_setenv ("DUALCASE", "1"); /* for MSK sh */ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) because on Windows, both *_VARNAMEs are PATH but uninstalled libraries must come first. */ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", nonnull (lt_argv_zero)); for (i = 0; i < newargc; i++) { lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", i, nonnull (newargz[i])); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ lt_debugprintf (__FILE__, __LINE__, "(main) failed to launch target \"%s\": %s\n", lt_argv_zero, nonnull (strerror (errno))); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal (__FILE__, __LINE__, "memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c <<EOF int main() { return 0; } EOF $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then ldd_output=`ldd conftest` for i in $deplibs; do case $i in -l*) func_stripname -l '' "$i" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" i="" ;; esac fi if test -n "$i" ; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then func_append newdeplibs " $i" else droppeddeps=yes echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which I believe you do not have" echo "*** because a test_compile did reveal that the linker did not use it for" echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) func_append newdeplibs " $i" ;; esac done else # Error occurred in the first compile. Let's try to salvage # the situation: Compile a separate program for each library. for i in $deplibs; do case $i in -l*) func_stripname -l '' "$i" name=$func_stripname_result $opt_dry_run || $RM conftest if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) func_append newdeplibs " $i" i="" ;; esac fi if test -n "$i" ; then libname=`eval "\\$ECHO \"$libname_spec\""` deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then func_append newdeplibs " $i" else droppeddeps=yes echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because a test_compile did reveal that the linker did not use this one" echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" echo "*** make it link in! You will probably need to install it or some" echo "*** library that it depends on before this library will be fully" echo "*** functional. Installing it before continuing would be even better." fi ;; *) func_append newdeplibs " $i" ;; esac done fi ;; file_magic*) set dummy $deplibs_check_method; shift file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` if test -n "$file_magic_glob"; then libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` else libnameglob=$libname fi test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do if test "$want_nocaseglob" = yes; then shopt -s nocaseglob potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/configure.in�������������������������������������������������������������������������0000664�0001750�0001750�00000016122�12266277345�012653� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AC_INIT(cxxtools, 2.2.1, [Tommi Maekitalo <tommi@tntnet.org>]) AM_INIT_AUTOMAKE AC_PREREQ([2.5.9]) abi_current=9 abi_revision=0 abi_age=0 sonumber=${abi_current}:${abi_revision}:${abi_age} AC_SUBST(sonumber) unset CDPATH AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([src/config.h ]) AC_CONFIG_FILES([include/cxxtools/config.h]) AC_CONFIG_SRCDIR([src/log.cpp]) AC_HEADER_DIRENT AC_PROG_CC AC_PROG_CXX AC_LANG(C++) AX_COMPILER_VENDOR AS_IF([test "$ax_cv_cxx_compiler_vendor" = "ibm"], [CPPFLAGS="$CPPFLAGS -qrtti -qlanglvl=newexcp -D__NOLOCK_ON_INPUT -D__NOLOCK_ON_OUTPUT"], AX_CHECK_COMPILE_FLAG([-Wno-long-long], [CPPFLAGS="$CPPFLAGS -Wno-long-long"]) AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"]) AX_CHECK_COMPILE_FLAG([-pedantic], [CPPFLAGS="$CPPFLAGS -pedantic"])) AC_CHECK_HEADERS(sys/filio.h) AC_CHECK_HEADERS(csignal) AC_CHECK_LIB(nsl, setsockopt) AC_CHECK_LIB(socket, accept) AC_CHECK_LIB(rt, sem_destroy) AC_SEARCH_LIBS(dlopen, dl, , AC_MSG_ERROR([dlopen not found])) AC_SEARCH_LIBS(inet_ntop, nsl socket resolv) AC_SEARCH_LIBS(clock_gettime, rt) AC_CHECK_FUNCS(inet_ntop accept4) AC_CHECK_FUNCS(clock_gettime) AC_TYPE_LONG_LONG_INT AC_TYPE_UNSIGNED_LONG_LONG_INT if test "$ac_cv_type_long_long_int" = yes; then HAVE_LONG_LONG=HAVE_LONG_LONG AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include <stdint.h> void f(short); void f(int); void f(long); void f(long long); void f() { int64_t v = 1; f(v); } ])], [AC_DEFINE(INT64_IS_BASETYPE, 1, [defined if int64_t is one of the base types])]) else AC_MSG_WARN([long long not found]); HAVE_LONG_LONG=NO_LONG_LONG AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include <stdint.h> void f(short); void f(int); void f(long); void f() { int64_t v = 1; f(v); } ])], [AC_DEFINE(INT64_IS_BASETYPE, 1, [defined if int64_t is one of the base types])]) fi AC_SUBST(HAVE_LONG_LONG, "$HAVE_LONG_LONG") if test "$ac_cv_type_unsigned_long_long_int" = yes; then HAVE_UNSIGNED_LONG_LONG=HAVE_UNSIGNED_LONG_LONG else AC_MSG_WARN([unsigned long long not found ($ac_cv_type_unsigned_long_long_int)]); HAVE_UNSIGNED_LONG_LONG=NO_UNSIGNED_LONG_LONG fi AC_SUBST(HAVE_UNSIGNED_LONG_LONG, "$HAVE_UNSIGNED_LONG_LONG") AC_ARG_WITH([iconvstream], AS_HELP_STRING([--with-iconvstream=yes|no], [compile iconv stream (default: no)]), [with_iconvstream=$withval], [with_iconvstream=no]) if test "$with_iconvstream" = yes; then AM_ICONV if test "$am_cv_func_iconv" != yes; then AC_MSG_ERROR(iconv not found); fi fi AM_CONDITIONAL(MAKE_ICONVSTREAM, test $with_iconvstream = yes) ACX_PTHREAD CC="$PTHREAD_CC" CXX="$PTHREAD_CXX" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" LIBS="$LIBS $PTHREAD_LIBS" AC_PROG_LIBTOOL CXXTOOLS_CXXFLAGS='-I${includedir}' CXXTOOLS_LDFLAGS='-L${libdir} -lcxxtools' AC_SUBST(CXXTOOLS_CXXFLAGS) AC_SUBST(CXXTOOLS_LDFLAGS) case "${host_cpu}-${host_os}" in *-aix*) SHARED_LIB_FLAG=-qmkshrobj ;; *) SHARED_LIB_FLAG= ;; esac AC_SUBST(SHARED_LIB_FLAG) # # checking inline assembler type for atomic operations # AC_CXXTOOLS_ATOMICTYPE AC_SUBST(CXXTOOLS_ATOMICITY) AM_CONDITIONAL(MAKE_ATOMICITY_SUN, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_SUN) AM_CONDITIONAL(MAKE_ATOMICITY_WINDOWS, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_WINDOWS) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_ARM, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_ARM) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_MIPS, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_MIPS) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_PPC, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_PPC) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_X86_64, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_X86_64) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_X86, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_X86) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_SPARC32, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_SPARC32) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_SPARC64, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_SPARC64) AM_CONDITIONAL(MAKE_ATOMICITY_GCC_AVR32, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_AVR32) AM_CONDITIONAL(MAKE_ATOMICITY_PTHREAD, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_PTHREAD) AM_CONDITIONAL(MAKE_ATOMICITY_GENERIC, test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GENERIC) # # checking existence of suseconds_t, needed by hirestime.h # AC_CHECKING(for suseconds_t) AC_CHECK_TYPE( suseconds_t, [CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_T], [CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_TIME_T], [#include <sys/time.h>]) AC_SUBST(CXXTOOLS_SUSECONDS) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include <locale> void foo() { std::numpunct<char>* np; } ])], [CXXTOOLS_STD_LOCALE=CXXTOOLS_WITH_STD_LOCALE], [CXXTOOLS_STD_LOCALE=CXXTOOLS_WITHOUT_STD_LOCALE]) AC_SUBST(CXXTOOLS_STD_LOCALE) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include <netinet/tcp.h> int i = TCP_DEFER_ACCEPT; ])], AC_DEFINE(HAVE_TCP_DEFER_ACCEPT, 1, [defined if TCP_DEFER_ACCEPT is defined])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include <sys/socket.h> #include <netinet/in.h> int i = IPPROTO_IPV6; ])], AC_DEFINE(HAVE_IPV6, 1, [defined if IPV6 is supported])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include <sys/types.h> #include <sys/socket.h> int i = SO_NOSIGPIPE; ])], AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [defined if socket option SO_NOSIGPIPE is supported])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([ #include <sys/types.h> #include <sys/socket.h> int i = MSG_NOSIGNAL; ])], AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [defined if MSG_NOSIGNAL is defined])) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include <iterator> std::reverse_iterator<char*> r;])], [HAVE_REVERSE_ITERATOR=HAVE_REVERSE_ITERATOR], [HAVE_REVERSE_ITERATOR=NO_REVERSE_ITERATOR]) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([#include <iterator> std::reverse_iterator<char*, int, char, char*, char&> r;])], [HAVE_REVERSE_ITERATOR_4=HAVE_REVERSE_ITERATOR_4], [HAVE_REVERSE_ITERATOR_4=NO_REVERSE_ITERATOR_4]) AC_SUBST(HAVE_REVERSE_ITERATOR, "$HAVE_REVERSE_ITERATOR") AC_SUBST(HAVE_REVERSE_ITERATOR_4, "$HAVE_REVERSE_ITERATOR_4") AC_ARG_ENABLE([demos], AS_HELP_STRING([--disable-demos], [disable building demos]), [enable_demos=$enableval], [enable_demos=enable_demos]) AM_CONDITIONAL(MAKE_DEMOS, test "$enable_demos" = "enable_demos") AC_ARG_ENABLE([unittest], AS_HELP_STRING([--disable-unittest], [disable building unittest]), [enable_unittest=$enableval], [enable_unittest=enable_unittest]) AM_CONDITIONAL(MAKE_UNITTEST, test "$enable_unittest" = "enable_unittest") AC_CONFIG_FILES([cxxtools-config], [chmod +x cxxtools-config]) AC_CONFIG_FILES([ Makefile src/Makefile src/unit/Makefile src/http/Makefile src/xmlrpc/Makefile src/bin/Makefile src/json/Makefile include/Makefile demo/Makefile test/Makefile ]) AC_CONFIG_FILES([ pkgconfig/cxxtools-bin.pc pkgconfig/cxxtools-http.pc pkgconfig/cxxtools-json.pc pkgconfig/cxxtools.pc pkgconfig/cxxtools-unit.pc pkgconfig/cxxtools-xmlrpc.pc ]) AC_OUTPUT ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/NEWS���������������������������������������������������������������������������������0000664�0001750�0001750�00000000000�12256773774�011033� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/INSTALL������������������������������������������������������������������������������0000644�0001750�0001750�00000036605�12030605446�011363� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `<wchar.h>' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. ���������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/config.guess�������������������������������������������������������������������������0000755�0001750�0001750�00000127432�12030605446�012651� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-06-10' # This file 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. # # 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, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to <config-patches@gnu.org> and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_ # include <sys/types.h> # include <sys/utsname.h> #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include <sys/param.h> # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 <<EOF $0: unable to guess system type This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/COPYING������������������������������������������������������������������������������0000664�0001750�0001750�00000057506�12256773774�011416� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/Makefile.am��������������������������������������������������������������������������0000664�0001750�0001750�00000001105�12266277345�012371� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ACLOCAL_AMFLAGS = -I m4 if MAKE_DEMOS DEMO_DIR = demo endif if MAKE_UNITTEST UNITTEST_DIR = test endif SUBDIRS = src \ src/unit \ src/http \ src/xmlrpc \ src/bin \ src/json \ include \ $(DEMO_DIR) $(UNITTEST_DIR) bin_SCRIPTS = cxxtools-config pkgconfigdir = $(libdir)/pkgconfig/ pkgconfig_DATA = pkgconfig/cxxtools-bin.pc \ pkgconfig/cxxtools-http.pc \ pkgconfig/cxxtools-json.pc \ pkgconfig/cxxtools.pc \ pkgconfig/cxxtools-unit.pc \ pkgconfig/cxxtools-xmlrpc.pc EXTRA_DIST = \ Releasenotes-2.2.markdown \ Releasenotes-2.2.1.markdown �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/���������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277561�012367� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/cxxtools-http.pc.in��������������������������������������������������������0000664�0001750�0001750�00000000412�12256773774�016103� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-http Description: A toolbox with reusable C++ components - HTTP protocol implementation Version: @PACKAGE_VERSION@ Requires: cxxtools Libs: -L${libdir} -lcxxtools-http ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/cxxtools-json.pc.in��������������������������������������������������������0000664�0001750�0001750�00000000410�12256773774�016073� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-json Description: A toolbox with reusable C++ components - JSON package Version: @PACKAGE_VERSION@ Requires: cxxtools cxxtools-http Libs: -L${libdir} -lcxxtools-json ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/cxxtools-unit.pc.in��������������������������������������������������������0000664�0001750�0001750�00000000375�12256773774�016113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-unit Description: A toolbox with reusable C++ components - testing library Version: @PACKAGE_VERSION@ Requires: cxxtools Libs: -L${libdir} -lcxxtools-unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/cxxtools-xmlrpc.pc.in������������������������������������������������������0000664�0001750�0001750�00000000416�12256773774�016435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-xmlrpc Description: A toolbox with reusable C++ components - XMLRPC package Version: @PACKAGE_VERSION@ Requires: cxxtools cxxtools-http Libs: -L${libdir} -lcxxtools-xmlrpc ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/cxxtools.pc.in�������������������������������������������������������������0000664�0001750�0001750�00000000346�12256773774�015134� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools Description: A toolbox with reusable C++ components Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lcxxtools Cflags: -I${includedir} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/pkgconfig/cxxtools-bin.pc.in���������������������������������������������������������0000664�0001750�0001750�00000000376�12256773774�015705� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: cxxtools-bin Description: A toolbox with reusable C++ components - binary RPC package Version: @PACKAGE_VERSION@ Requires: cxxtools Libs: -L${libdir} -lcxxtools-bin ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/missing������������������������������������������������������������������������������0000755�0001750�0001750�00000023703�12030605446�011724� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.18; # UTC # Copyright (C) 1996-2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # 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, 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, see <http://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, 'missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file 'aclocal.m4' autoconf touch file 'configure' autoheader touch file 'config.h.in' autom4te touch the output file, or create a stub one automake touch all 'Makefile.in' files bison create 'y.tab.[ch]', if possible, from existing .[ch] flex create 'lex.yy.c', if possible, from existing .c help2man touch the output file lex create 'lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create 'y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to <bug-automake@gnu.org>." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running '$TOOL --version' or '$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'acinclude.m4' or '${configure_ac}'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified '${configure_ac}'. You might want to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'acconfig.h' or '${configure_ac}'. You might want to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. You might want to install the Automake and Perl packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: '$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get '$1' as part of Autoconf from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: '$1' $msg. You should only need it if you modified a '.y' file. You may need the Bison package in order for those modifications to take effect. You can get Bison from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a '.l' file. You may need the Flex package in order for those modifications to take effect. You can get Flex from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the Help2man package in order for those modifications to take effect. You can get Help2man from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: '$1' is $msg. You should only need it if you modified a '.texi' or '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy 'make' (AIX, DU, IRIX). You might want to install the Texinfo package or the GNU make package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: '$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing '$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: �������������������������������������������������������������cxxtools-2.2.1/AUTHORS������������������������������������������������������������������������������0000664�0001750�0001750�00000000066�12256773774�011420� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Tommi Maekitalo <tommi@tntnet.org> Marc Boris Dürner ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/Releasenotes-2.2.markdown������������������������������������������������������������0000664�0001750�0001750�00000006525�12266277345�015044� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Releasenotes cxxtools 2.2 ========================= Logging is configured now with xml by default but may use other deserializable formats as well ---------------------------------------------------------------------------------------------- Previously logging was configured using a properties file format. Since the format is not really standard, a xml format is used now. The previous properties format is supported also to be compatible and it is also easier to edit that xml. Move xml stuff into core library libcxxtools -------------------------------------------- Since logging is now configured using xml, it was necessary to move the xml stuff into the core library. It makes also sense, since xml is a widely used format. Improve iconv wrapper class --------------------------- Iconv is a feature of the standard library for character conversion. Since the interface was quite difficult to use, cxxtools has had a simple wrapper for it for a long time. This wrapper is now improved to meake it even simpler for simple cases. Almost rewrite unicode character class cxxtools::Char ----------------------------------------------------- The class cxxtools::Char represents a unicode character. The class was rewritten in large parts to make it more robust and stringent when it comes to automatic conversion between Char and fundamental types. Simplify use of codecs ---------------------- Static methods in codecs like the Utf8Codec makes using them simpler in simple cases. New file device for asynchronous file I/O ----------------------------------------- Cxxtools offers a asynchronous API which uses the signal slot feature. It was widely used in the network classes and rpc. Now also file I/O is supported. Extend binary rpc protocol to support domains (similar namespace in C++) ------------------------------------------------------------------------ The binary rpc protocol now offers domains to group functions. This makes it more similar to xmlrpc or json over http, where functions can be grouped using different urls. Better handling of SIGPIPE in network classes --------------------------------------------- SIGPIPE is somewhat ugly in POSIX. By default a program stops using a signal when the peer closes the connection. This is unacceptable in larger applications. POSIX allows to ignore that signal. But this can be set only globally which is also bad for a library like cxxtools. But luckily there are extensions, which allow handling SIGPIPE per connections. These extensions are now used in cxxtools. No global handler for SIGPIPE need to be set any more. Deseriailzer for property files ------------------------------- A deserializer to read property files is implemented. This makes it easy to read complex structures from property files. Implement simple API for parallel rpc calls ------------------------------------------- Sometimes it is necessary to execute multiple rpc calls. And often it speeds up processing, when these requests are executed in parallel since the server normally run multithreaded or the request may even go to different servers, which run in parallel then. Previously this could be done using either threads or more lightweight using the asyncrounous rpc API. This API is quite difficult to handle since handlers for signals must be installed. Now a much simpler API is implemented. Multiple request can be initiated before waiting for results. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/aclocal.m4���������������������������������������������������������������������������0000664�0001750�0001750�00000115562�12266277544�012213� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.12.2 -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # longlong.m4 serial 14 dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. # This fixes a bug in Autoconf 2.61, but can be removed once we # assume 2.62 everywhere. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be # defined. In this case you can treat 'long long int' like 'long int'. AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. dnl If cross compiling, assume the bug isn't important, since dnl nobody cross compiles for this platform as far as we know. AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[@%:@include <limits.h> @%:@ifndef LLONG_MAX @%:@ define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) @%:@ define LLONG_MAX (HALF - 1 + HALF) @%:@endif]], [[long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0;]])], [ac_cv_type_long_long_int=yes], [ac_cv_type_long_long_int=no], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # This fixes a bug in Autoconf 2.61, but can be removed once we # assume 2.62 everywhere. # Note: If the type 'unsigned long long int' exists but is only 32 bits # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # will not be defined. In this case you can treat 'unsigned long long int' # like 'unsigned long int'. AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ AC_CACHE_CHECK([for unsigned long long int], [ac_cv_type_unsigned_long_long_int], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) # Expands to a C program that can be used to test for simultaneous support # of 'long long' and 'unsigned long long'. We don't want to say that # 'long long' is available if 'unsigned long long' is not, or vice versa, # because too many programs rely on the symmetry between signed and unsigned # integer types (excluding 'bool'). AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], [ AC_LANG_PROGRAM( [[/* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63;]], [[/* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull));]]) ]) # Copyright (C) 2002-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.12' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.12.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.12.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 17 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 19 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated. For more info, see: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl dnl Support for Objective C++ was only introduced in Autoconf 2.65, dnl but we still cater to Autoconf 2.62. m4_ifdef([AC_PROG_OBJCXX], [AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2001-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of '-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar <conftest.tar]) grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/acx_pthread.m4]) m4_include([m4/asmtype.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_compiler_vendor.m4]) m4_include([m4/iconv.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) ����������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/config.sub���������������������������������������������������������������������������0000755�0001750�0001750�00000105327�12030605446�012313� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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. # # 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, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/cxxtools-config.in�������������������������������������������������������������������0000664�0001750�0001750�00000004157�12256773774�014033� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ usage() { cat 1>&2 <<EOF Usage: $0 [OPTION] Known values for OPTION are: --libs print library linking information --cxxflags print pre-processor and compiler flags --logxml app print logging-xml-template for application "app" --help display this help and exit --version output version information EOF exit 1 } CXXTOOLS_LOGGING_CXXTOOLS_template() { cat <<EOF <?xml version="1.0" encoding="UTF-8"?> <!-- sample logging-properties for application ++APP++ put this in ++APP++.properties and use: log_init("++APP++.properties"); in your application to initialize logging define categories with: log_define("some.category") this defines a static function, so you must put it outside other functions. you can define a category per file or a category per namespace. print logging-messages with: log_fatal("some fatal message"); log_error("some error message"); log_warn("some warn message"); log_info("some info message"); log_debug("some debug message"); --> <logging> <rootlogger>INFO</rootlogger> <loggers> <logger> <category>++APP++</category> <level>INFO</level> </logger> </loggers> <!-- <file>$LOGFILE</file> --> <!--uncomment if you want to log to a file --> <!-- <maxfilesize>1MB</maxfilesize> --> <!-- <maxbackupindex>2</maxbackupindex> --> <!-- <host>localhost:1234</host> --> <!-- # send log-messages with udp --> </logging> EOF } if test $# -eq 0; then usage 1 fi LOGFILE=++APP++.log while test $# -gt 0; do case "$1" in --version) echo @VERSION@ exit 0 ;; --help) usage 0 ;; --cxxflags) echo @CXXTOOLS_CXXFLAGS@ ;; --libs) echo @CXXTOOLS_LDFLAGS@ ;; --logxml) if test $# -gt 1 then CXXTOOLS_LOGGING_CXXTOOLS_template | sed "s/++APP++/$2/" shift else usage 1 fi ;; *) usage 1 ;; esac shift done exit 0 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/Makefile.in��������������������������������������������������������������������������0000664�0001750�0001750�00000073477�12266277545�012431� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/cxxtools-config.in \ $(top_srcdir)/configure \ $(top_srcdir)/include/cxxtools/config.h.in \ $(top_srcdir)/pkgconfig/cxxtools-bin.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-http.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-json.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-unit.pc.in \ $(top_srcdir)/pkgconfig/cxxtools-xmlrpc.pc.in \ $(top_srcdir)/pkgconfig/cxxtools.pc.in AUTHORS COPYING \ ChangeLog INSTALL NEWS config.guess config.sub depcomp \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = include/cxxtools/config.h cxxtools-config \ pkgconfig/cxxtools-bin.pc pkgconfig/cxxtools-http.pc \ pkgconfig/cxxtools-json.pc pkgconfig/cxxtools.pc \ pkgconfig/cxxtools-unit.pc pkgconfig/cxxtools-xmlrpc.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ cscope distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = src src/unit src/http src/xmlrpc src/bin src/json \ include demo test DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 @MAKE_DEMOS_TRUE@DEMO_DIR = demo @MAKE_UNITTEST_TRUE@UNITTEST_DIR = test SUBDIRS = src \ src/unit \ src/http \ src/xmlrpc \ src/bin \ src/json \ include \ $(DEMO_DIR) $(UNITTEST_DIR) bin_SCRIPTS = cxxtools-config pkgconfigdir = $(libdir)/pkgconfig/ pkgconfig_DATA = pkgconfig/cxxtools-bin.pc \ pkgconfig/cxxtools-http.pc \ pkgconfig/cxxtools-json.pc \ pkgconfig/cxxtools.pc \ pkgconfig/cxxtools-unit.pc \ pkgconfig/cxxtools-xmlrpc.pc EXTRA_DIST = \ Releasenotes-2.2.markdown \ Releasenotes-2.2.1.markdown all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): include/cxxtools/config.h: $(top_builddir)/config.status $(top_srcdir)/include/cxxtools/config.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ cxxtools-config: $(top_builddir)/config.status $(srcdir)/cxxtools-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-bin.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-bin.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-http.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-http.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-json.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-json.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-unit.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-unit.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkgconfig/cxxtools-xmlrpc.pc: $(top_builddir)/config.status $(top_srcdir)/pkgconfig/cxxtools-xmlrpc.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done cscopelist-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist-recursive cscopelist cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ cscopelist-recursive ctags-recursive install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-cscope \ clean-generic clean-libtool cscope cscopelist \ cscopelist-recursive ctags ctags-recursive dist dist-all \ dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binSCRIPTS uninstall-pkgconfigDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/ChangeLog����������������������������������������������������������������������������0000664�0001750�0001750�00000133472�12266277533�012123� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������2014-01-17 tommi@tntnet.org - release version 2.2.1 2013-12-14 tommi@tntnet.org - fix parsing double % in query parameters 2013-04-21 tommi@tntnet.org - release version 2.2 2013-04-17 tommi@tntnet.org - fix exception handling in xmlrpc and json over http - exceptions were lost when executed just via the event loop 2013-04-06 tommi@tntnet.org - fix build on FreeBSD 2013-04-05 tommi@tntnet.org - replace use of strerror with thread safe strerror_r 2013-04-03 tommi@tntnet.org - make string type a template parameter in ltrim, rtrim and trim so that it works with cxxtools::String (unicode string) also 2013-03-31 tommi@tntnet.org - make passing listen ip address optional for http and rpc servers, which means to listen on all interfaces - fix compiler warnings 2013-03-30 tommi@tntnet.org - implement a new much simpler api for asynchronous rpc calls (see demo/rpcasyncaddclient.cpp for a example) 2013-03-29 tommi@tntnet.org - set pthread flags and select threaded compiler globally in configure script - forgot to pass event loop to json rpc client demo 2013-03-26 tommi@tntnet.org - make selecting remote client a little more readable in demo 2013-03-22 tommi@tntnet.org - release candidate 2.2rc3 2013-03-20 tommi@tntnet.org - implement lru cache - fix collecting cache stats - return reference to new value in put method of cache 2013-03-17 tommi@tntnet.org - set preprocessor flags in CPPFLAGS instead of CXXFLAGS - fix some compiler warnings - use INHERIT flag on non-linux systems in cxxtools::net::TcpServer::accept also 2013-03-16 tommi@tntnet.org - release candidate 2.2rc2 2013-03-13 tommi@tntnet.org - remove some unused members 2013-03-09 tommi@tntnet.org - remove implicit conversion from cxxtools::SmartPtr to raw pointer and make different SmartPtr types compatible as long as the pointees are compatible - fix handling of escape character in format method of cxxtools::RegexSMatch 2013-03-05 tommi@tntnet.org - fix jsonrpc client connect method: last optimization was silly wrong - release candidate 2.2rc1 2013-03-04 tommi@tntnet.org - handle empty regular expression explicitly since at least OSX complains about it - fix crash in binary rpc client when reusing client - close existing connection in json rpc client when connection parameters are changed in connect - close existing connection in binary rpc client only if connection parameters are changed in connect 2013-03-01 tommi@tntnet.org - binary rpc client crashed when connect method was called on a default constructed instance 2013-02-27 tommi@tntnet.org - simplify cxxtools::QueryParams and remove the unused parent feature - update ChangeLog 2013-02-14 tommi@tntnet.org - add domain parameter to connect method and constructor of binary rpc client to make it more similar to xmlrpc - do not convert string values to double and back in json formatter when doubles are serialized as strings 2013-01-30 tommi@tntnet.org - make conversion explicit in cxxtools::String (clang was pinky about it and he was right) 2013-01-18 tommi@tntnet.org - improve compatibility to previous cxxtools release in log_init - fix properties unit test: a wide char string cannot be printed to a std::ostream 2013-01-16 tommi@tntnet.org - allow full 32 bit unicode escapes in properties files 2013-01-14 tommi@tntnet.org - use deserializer API to extract data from properties in unit test 2013-01-13 tommi@tntnet.org - improve error handling in properties parser 2013-01-12 tommi@tntnet.org - allow unicode escape sequences in properties and comments starting with ! - implement PropertiesDeserializer - read logging settings optionally from log.properties like before - bugfix: SerializationInfo::getMember(unsigned) was just wrong - use unicode strings in Properties class 2013-01-09 tommi@tntnet.org - add missing library dependency 2013-01-03 tommi@tntnet.org - fix stopping tcp server if only one listen socket is active - make value of cxxtools::Char signed like other char types - fixes for IBM/xlC-compiler 2013-01-02 tommi@tntnet.org - do not block SIGPIPE if MSG_NOSIGNAL is used - extend cxxtools::split by passing split as set of chars 2012-12-30 tommi@tntnet.org - fix preprocessor warning about redefinition of HAVE_REVERSE_ITERATOR - fix handling SIGPIPE in tcp server for BSD - do not set signal handler for SIGPIPE any more in servers since it is now handled by the socket code - fix setting SO_NOSIGPIPE 2012-12-29 tommi@tntnet.org - use SO_NOSIGPIPE or MSG_NOSIGNAL to suppress SIGPIPE - fix compile problem on FreeBSD 2012-12-01 tommi@tntnet.org - allocate dynamically the buffer for cxxtools::Directory::cwd to be safe for all times 2012-11-25 tommi@tntnet.org - replace function praefix in binary rpc with domain and implement explicit protocol support for it - allow assigning value to cxxtools::Arg 2012-11-18 tommi@tntnet.org - new file device for asynchronous file i/o (ported from Pt) 2012-11-17 tommi@tntnet.org - add force flag to cxxtools::Queue::put to override capacity limitation of queue - make Base64Codec::encode/decode public as they are inteded to be and make codec methods in Utf8Codec protected instead of public - add missing file - iconvwrap should have been checked in long ago - compile with -Wall and -pedantic by default if compiler supports it 2012-10-26 tommi@tntnet.org - do not loose assertion message when unit tests are nested 2012-10-08 tommi@tntnet.org - format null value correctly in xmlrpc - make type conversion explicit in SerializationInfo - add unit tests for cxxtools::split and cxxtools::join 2012-09-21 tommi@tntnet.org - add static helper functions to codecs for encoding and decoding utf-8 and base84 data - fix new cxxtools::encode and decode functions and add unit tests for them 2012-09-20 tommi@tntnet.org - implement encode and decode helper template functions 2012-09-12 tommi@tntnet.org - add host and port into error message in tcp client when connect fails 2012-09-02 tommi@tntnet.org - make json rpc conformant to JSON-RPC specification 2.0 - use monotonic clock function clock_gettime if available to measure times cxxtools::Clock 2012-08-20 tommi@tntnet.org - make cxxtools::Thread::sleep(ms) signal safe 2012-08-04 tommi@tntnet.org - allow absolute uris in http request header as the standard demands 2012-07-31 tommi@tntnet.org - fix problems detected by clang 3.1 (yofuh) 2012-07-29 tommi@tntnet.org - make cxxtools::Char more restrictive (like removing automatic conversion to int or removing shift operators) - make of logging deinitialization more robust 2012-07-16 tommi@tntnet.org - comparing Char against wchar_t 2012-06-25 tommi@tntnet.org - better formatting of failed message in unittest macro CXXTOOLS_UNIT_ASSERT_EQUALS 2012-06-11 tommi@tntnet.org - fix race condition when creating deteached threads 2012-06-10 tommi@tntnet.org - fix 2 small memory leaks - add test for smart pointer with atomic counter 2012-06-07 tommi@tntnet.org - make smart pointer implicit convertable to const ObjectType* again - move responsibility in destroying object from refcounted to smartptr class, so that smartptr can use its destroy poliy 2012-06-02 tommi@tntnet.org - simplify writing log to stderr or stdout since this complicated optimization do not help at all - fix optimized writing to console in logger (log messages were not completed with a line feed when delayed) - do not create log.properties but new log.xml when building demos - add new cxxtools/iconvwrap.h to dist package 2012-05-30 tommi@tntnet.org - add pkg-config support (Leandro Santiago) - improve iconv support (Jiří Pinkava) 2012-05-29 tommi@tntnet.org - update cxxtools-config to generate new configuration file log.xml file instead of log.properties for logging - limit size of buffered log messages to stderr or stdout to about 8k - do not use std::cerr to write log message since it is a global resource may be used by another thread - add setting "stdout" to print log output to stdout instead of stderr 2012-05-28 tommi@tntnet.org - optimize printing cxxtools::String to std::ostream by using codec directly instead of instantiation of TextStream - fix buffer overflow in Utf8Codec::decode - rewrite logging - configure logging using xml (or serializationinfo) instead of properties - remove cxxtools/loginit.h - it was obsolete for long time already - move xml support from libcxxtools-xml into core library libcxxtools and remove libcxxtools-xml - do not use all html entities in xml but only the few, which are defined in xml 2012-05-26 tommi@tntnet.org - fix reading authentication data from http request 2012-05-19 tommi@tntnet.org - remove remaining parts of support of log4cxx and log4cplus 2012-05-13 tommi@tntnet.org - limit number of pooled message impl in logger to 8 and release pooled messages on end 2012-05-12 tommi@tntnet.org - optimize logging: pool of message impls 2012-05-07 tommi@tntnet.org - add clear method to deserializer and fix unit tests - they were broken with the new feature, that deserializers can deserialize multiple objects without rerun 2012-05-06 tommi@tntnet.org - optimize logging by delaying flush when other threads are already waiting to write next log message 2012-05-06 tommi@tntnet.org - small fix in properties parser - use unicode string in properties parser - allow multiple calls to deserializer without reparsing 2012-05-05 tommi@tntnet.org - fix reading custom types in binary parser 2012-05-04 tommi@tntnet.org - make some extensions to Directory and FileInfo 2012-04-29 tommi@tntnet.org - semicolon is a comment in ini files - fix in iniparser 2012-04-27 tommi@tntnet.org - fix base64 encoder 2012-04-25 tommi@tntnet.org - add method getMember(unsigned) to read nth member from SerializationInfo - allow comments (single line with // and multiline with /* */) in json 2012-04-24 tommi@tntnet.org - new method terminateAccept in TcpServer to terminate a blocking accept from another thread 2012-04-10 tommi@tntnet.org - fix xmlrpc url and add json over http to the rpc add client (Leandro Santiago) - fix formatting and parsing floating point value 0 in binary format 2012-04-07 tommi@tntnet.org - fix resizing cxxtools::Cache 2012-04-02 tommi@tntnet.org - release 2.1 2012-03-30 tommi@tntnet.org - optimize cache template - no linear search necessary any more when searching for elements 2012-03-27 tommi@tntnet.org - arg/argv can be passed to log_init, so that the logging properties file is derived from the current binary name or optionally a option char or string is passed to log_init 2012-03-18 tommi@tntnet.org - remove support for log4cpp and log4cxx 2012-03-15 tommi@tntnet.org - fix reading csv data without title 2012-03-05 tommi@tntnet.org - use unicode escape sequence for control characters (<0x20) in json as done already for characters > 0x80 2012-03-04 tommi@tntnet.org - add log macros log_xxx_if(cond, expr) - add feature to json serializer to serialize empty objects 2012-02-29 tommi@tntnet.org - fix encoding in base64codec 2012-02-25 tommi@tntnet.org - use AX_CHECK_COMPILE_FLAG instead of AX_CXXFLAGS_*_OPTION to check compile flags - this is a standard macro of autoconf and works better than the old ones - set compile flags for ibm xlc correctly 2012-02-24 tommi@tntnet.org - report right type in serializationinfo when convert fails - inherit exception mask from source stream in csv deserializer - improve error reporting in serializer - inherit exception flag from base stream in text streams - fix member function in string to match exactly the declaration in the header - add compiler flags -Wno-long-long for gcc and -qrtti for aix/xlc 2012-02-19 tommi@tntnet.org - do not check doubles for equality but for almost equal in unit test to work around rounding problems - add configure check if int64_t can be serialized using standard types 2012-02-18 tommi@tntnet.org - fix some compiler warnings 2012-02-17 tommi@tntnet.org - add missing explicit specifier - process last line of log.properties even if there is no line feed at end - fix documentation of cxxtools::IODevice::eof() 2012-02-15 tommi@tntnet.org - serializer bool as "true" and "false" as before instead of 1 and 0 - give addValue methods of formatter unique names for easier resolution and to remove some compiler warnings 2012-02-13 tommi@tntnet.org - fix typo in textstream, which caused a crash - remove cxxtools/types.h header and replace with stdint.h - and clean up code again to reduce compiler warnings - use the result of the long long type check where needed 2012-02-09 tommi@tntnet.org - add some missing includes - change tabs to spaces - increase abi number from 7 to 8 - add some missing headers and other minor code cleanup (yofuh) - fix initalization of application class - fix compiler warning in json parser 2012-02-08 tommi@tntnet.org - avoid long long constants since they are difficult to make fully portable 2012-02-08 tommi@tntnet.org - add check for cygwin platform to disable min/max macros from win32 headers 2012-02-03 tommi@tntnet.org - csvserializer is not copyable 2012-02-02 tommi@tntnet.org - allow quoted titles in csv parser 2012-01-30 tommi@tntnet.org - print header line in csv serializer when titles are set explicitly even if no data lines are written 2012-01-29 tommi@tntnet.org - change serializer-bench to use fraction numbers also in double test 2012-01-28 tommi@tntnet.org - handle eof correctly in json and binary rpc client - make name parameter optional when serializing objects into binary format - remove unnecessary end of value marker in binary format 2012-01-27 tommi@tntnet.org - autodetect tab in csv files 2012-01-26 tommi@tntnet.org - fix setting of delimiter in csv parser and impl csv formatter in csv serializer to help binary compatibility in the future 2012-01-25 tommi@tntnet.org - fix bug in binary rpc and json rpc server: large requests (>8192 bytes) let server to wait forever - change in unittest main: take argument list as list of tests to execute instead of option -t and add option -l as an alias to -h (i.e. list available tests) 2012-01-25 tommi@tntnet.org - implement cxxtools::poxix::CommandInput::wait and cxxtools::posix::CommandOutput::wait 2012-01-18 tommi@tntnet.org - make titles changable in csv serializer - serialize floating point values using mantissa and exponent in binary format instead of bcd 2012-01-15 tommi@tntnet.org - optimize binary format 2012-01-14 tommi@tntnet.org - sort unit tests alphabetically 2012-01-12 tommi@tntnet.org - fix rounding error in convert 2012-01-09 tommi@tntnet.org - fix parsing floating point values in scientific notation with decimal point in cxxtools::convert (Adi) 2012-01-08 tommi@tntnet.org - remove id from SerialzationInfo - add json to serializer benchmark 2012-01-05 tommi@tntnet.org - define output operators for wchar_t and const wchar_t* to text streams - send right id to client in jsonrpc 2012-01-05 tommi@tntnet.org - add version string to json message to comply with json rpc 2.0 2012-01-04 tommi@tntnet.org - add support for null values in serialization and use it in json and binary serialization - improve json rpc conformance (works now the perl json rpc client and server) 2012-01-02 tommi@tntnet.org - implement jsonrpc over http client and server 2011-12-30 tommi@tntnet.org - fix build on ubuntu 11.10 due to new DSO linking behaviour 2011-12-28 tommi@tntnet.org - make xml attributes in xml serialization optional - improve beautification mode of json 2011-12-27 tommi@tntnet.org - add jsonrpc to demo applications - enable CallbackException test for jsonrpc 2011-12-26 tommi@tntnet.org - bugfix: jsondeserializer can deserialize now empty arrays - add operator== to SerializationInfo - execute tests in a testsuite of unit test in the same order as registered - override all formatter methods in json formatter for simplification - implement json rpc over raw socket - xmlrpc actually do not throw an RemoteException but returns http 404 if method is not found 2011-12-26 tommi@tntnet.org - serialize boolean value in json as "true" or "false" 2011-12-23 tommi@tntnet.org - reduce default size of arguments from 64k to 32k in cxxtools::posix::Exec to save stack - implement method addService in binary rpc server to register all procedures of a service 2011-12-21 tommi@tntnet.org - fix unnecessary memory use in string class 2011-12-19 tommi@tntnet.org - move parse event methods from Composer to Deserializer 2011-12-16 tommi@tntnet.org - improve error message in cxxtools::convert and implement conversions from const char* to all number types - fix parsing csv files with a single column 2011-12-14 tommi@tntnet.org - use longer variable names to prevent naming conflict (happened with _N in cxxtools::String on solaris/gcc) 2011-12-11 tommi@tntnet.org - new class ServiceRegistry for registering rpc functions 2011-12-11 tommi@tntnet.org - add range checks into serializationinfo 2011-12-10 tommi@tntnet.org - finish method of json parser does not return anything - move csv parser code from CsvDeserializer into a separaten class CsvParser 2011-12-09 tommi@tntnet.org - add char type to SerializationInfo and make some fixes in type conversion in SerializationInfo 2011-12-09 tommi@tntnet.org - remove some remaining source info outputs from exceptions - fix deserialization of bool from std::string 2011-12-08 tommi@tntnet.org - make composer and decomposer non copyable and fix 2 compile problems with IBM xlc 2011-12-06 tommi@tntnet.org - add procedure name into error message of xmlrpc server when procedure is not found - new exception type SerializationMemberNotFound which is thrown, when a deserialization operator do not find a member with the specified name - check right config variable to enable IPv6 2011-12-05 tommi@tntnet.org - Remove SourceInfo since I don't want to know where a error was detected but what happened. - add optional praefix for method calls in binary rpc client - allow multiple objects to be serialized into a single json object in json serializer 2011-12-04 tommi@tntnet.org 2011-12-04 tommi@tntnet.org - increase default listen backlog from 5 to 64 in http server and binary rpc server - remove obsolete class SerializationContext 2011-12-04 tommi@tntnet.org - add method "JsonSerializer::serializer(const T&)" to serializer a C++ value without wrapping it into a json object - use new shorter variant of json serializer in json demo - do not throw exception on EINTR in accept system call but just repeat it 2011-12-04 tommi@tntnet.org - rename Serializer to Composer and Deserializer to Decomposer to distinguish them from real Serializer classes (and consistency with Pt) - add optional name parameter to deserialize method of Deserializer to make it symetric with Serializer 2011-12-02 tommi@tntnet.org - zero byte in std::string works know in binary format 2011-11-30 tommi@tntnet.org - accept character set specification in content type reply header in xmlrpc client 2011-11-29 tommi@tntnet.org - major optimzations: - SerializationInfo has now a union with different types instead of just converting everyting into unicode string - remove reference feature from serialization framework since there is currently no format, which actually uses it 2011-11-27 tommi@tntnet.org - add error code to binary exception response - add rpc binary client 2011-11-23 tommi@tntnet.org - add checks for empty tags in xml writer and xml serializer - implement json deserializer - generalize rpc client in preparation for binary rpc client 2011-11-21 tommi@tntnet.org - new method cxxtools::SerializationInfo::swap 2011-11-20 tommi@tntnet.org - implementation of binary rpc server 2011-11-19 tommi@tntnet.org - add hmac (rfc 2104) implementation and unit tests for md5 and hmac (yofuh) 2011-11-18 tommi@tntnet.org - implement csv serializer 2011-11-17 tommi@tntnet.org - allow colon in attribute names of xml files 2011-11-16 tommi@tntnet.org - implement deserializer for csv 2011-11-13 tommi@tntnet.org - move binary serializer and deserializer into separate library and rewrite binary deserializer to fit better into a binary rpc server - remove obsolete class ProcessImpl - move ServiceProcedure from namespace cxxtools::xmlrpc to cxxtools 2011-11-12 tommi@tntnet.org - change binary serialization format for easier parsing 2011-11-09 tommi@tntnet.org - simplify use of cxxtools::net::TcpStream 2011-11-08 tommi@tntnet.org - encode bool as single byte in binary serialization 2011-11-04 tommi@tntnet.org - optimize cxxtools::String::replace methods and do some code cleanup in cxxtools::String class 2011-11-01 tommi@tntnet.org - improve rpc benchmark client and server - improve serializer benchmark program 2011-10-28 tommi@tntnet.org - move private md5 interface to private header and md5 helper functions to cxxtools/md5.h header - fix handling of buffer in cxxtools::Fdiostream 2011-10-27 tommi@tntnet.org - string improvements: extend string capacity by factor of 1.5 instead of 2 and define output operator to std::ostream - add help page to xmlrpc benchmark programs 2011-10-26 tommi@tntnet.org allow assignment of narrow string to cxxtools::String 2011-10-24 tommi@tntnet.org - optimize cxxtools::String (short string optimization, no refcounting) - use atomic operation in rpcbenchclient to increment request counter 2011-10-22 tommi@tntnet.org - add unittest for cxxtools::String (copied from pt-framework) - make distinction between sparc32 and sparc64 (yofuh) - fix detection of 64 bit sparc in generic part 2011-10-20 tommi@tntnet.org - abstract http server implementation even more 2011-10-20 tommi@tntnet.org - do not inline everything from cxxtools::String 2011-10-17 tommi@tntnet.org - add benchmark client and server for xmlrpc - make SerializationContext non copyable as it should be 2011-10-16 tommi@tntnet.org - fix reading chunked encoding in http client 2011-10-07 tommi@tntnet.org - fix cxxtools::ArgIn and cxxtools::ArgOut classes 2011-10-05 tommi@tntnet.org - make cxxtools::SerializationInfo serializable and deserializable 2011-09-30 tommi@tntnet.org - improve serializer benchmark program (passing flag -f program writes output to files) 2011-09-28 tommi@tntnet.org - add template methods registerFunction and registerCallable to xmlrpc service to even more simplify definition of xmlrpc service functions - make xmlrpc::Service::createResponder protected 2011-09-22 tommi@tntnet.org - binary integers in binary serialization format - unit test assertion macros are now only one statement - implement bcd encoding for double values in binary serialization 2011-09-21 tommi@tntnet.org - optimized cxxtools::convert (ported from Pt-framework) - another fix autoconf check since autoconf version 2.68 do not accept the current any more 2011-09-20 tommi@tntnet.org - fix problems with AIX/xlC - fix autoconf check since autoconf version 2.68 do not accept the current any more 2011-09-04 tommi@tntnet.org - rename DefaultDestroyPolicy to DeletePolicy in SmartPtr since it expresses better, what is really done - add memory barrier (yofuh) 2011-08-30 tommi@tntnet.org - fix crash in http server when last service is removed manually 2011-08-28 tommi@tntnet.org - fix potential memory leak - remove unused template parameter 2011-08-26 tommi@tntnet.org - implement binary serializer/deserializer 2011-08-26 tommi@tntnet.org - helper classes for controling input or output using command line argument 2011-08-12 tommi@tntnet.org - fix error checking in iconvstream 2011-06-24 tommi@tntnet.org - fix for clang++: looks like it is pinkier about missing this when accessing members of base classes in template classes 2011-06-05 tommi@tntnet.org - ignore SIGPIPE in http server 2011-06-05 tommi@tntnet.org - read body into request body in http server by default 2011-06-04 tommi@tntnet.org - regular expressions can now be used for mapping to responder in http server 2011-05-31 tommi@tntnet.org - do not throw after fork but just exit with -1 in command input and output 2011-05-26 tommi@tntnet.org - remove now obsolet class process.cpp 2011-05-23 tommi@tntnet.org - remove obsolete cxxtools::SysError class (replaced with cxxtools::SystemError long time ago) 2011-05-22 tommi@tntnet.org - add classes cxxtools::posix::CommandInput and cxxtools::posix::CommandOutput for easily reading from and writing to processes 2011-05-21 tommi@tntnet.org - move Fork-class from cxxtools to cxxtools::posix namespace - add a wrapper cxxtools::posix::Exec around exec??-functions of posix 2011-05-21 tommi@tntnet.org - inherit pipe filedescriptor by default in cxxtools::posix::Pipe 2011-05-19 tommi@tntnet.org - set default char ? to cxxtools::Char::narrow - use ? instead of _ as default in cxxtools::String::narrow - fix error message in xml reader when unexpected character is found 2011-05-08 tommi@tntnet.org - add conversion function from std::string to std::string (just assignment) 2011-05-06 tommi@tntnet.org - print log messages to stderr instead of stdout 2011-04-29 tommi@tntnet.org - add beautify flag to static toString methods of xml and json serializers 2011-04-29 tommi@tntnet.org - add link and symlink methods to file class 2011-03-29 tommi@tntnet.org - fix stopping http server without listener 2011-03-27 tommi@tntnet.org - remove cxxtools::sodo - it was non functional anyway 2011-03-26 tommi@tntnet.org - split rpcecho demo into separate client and server for simplification - add documentation and unit test to smartptr and do some minor fixes - make destroy policy method public in smartptr (it is called in tntnet directly) 2011-03-24 tommi@tntnet.org - make null from nan, inf and -inf in json serializer 2011-02-27 tommi@tntnet.org - reimplement cxxtools::pool using smart pointer instead of proxy object 2011-02-04 tommi@tntnet.org - do not pass output_iterator as reference to QueryParams::get to get unnamed params; iterators should be always by value 2011-02-03 tommi@tntnet.org - do not put boolean values into quotation marks in json 2011-01-31 tommi@tntnet.org - add demo for json serializer in a http server - accept "inifity" for float and double values in convert - add put_top method to cache to use it as a simple lru cache 2011-01-29 tommi@tntnet.org - improved support nan and inf in conversion functions for float and double 2011-01-26 tommi@tntnet.org - fix include guard in atomicity.h 2011-01-24 tommi@tntnet.org - fix data type in conversion function - fix license header - do not inline larger functions in cxxtools::convert 2011-01-23 tommi@tntnet.org - add compare operators to cxxtools::DateTime - move some larger methods from DateTime to cpp file and other small code cleanup 2011-01-16 tommi@tntnet.org - do not use explicit IPv4 addresses in xmlrpc unittest 2011-01-15 tommi@tntnet.org - add static toString and toObject methods to serializers and deserializer to simplify api 2010-12-31 tommi@tntnet.org - fix some problems due to apache stl (were issues in cxxtools - not apache stl) 2010-12-28 tommi@tntnet.org - bugfix: accidentally removed allocation for string when copied - 2 fixes for xmldeserialation: - move type from tag name back to typeName in serializationinfo - do not change category from Array to Object when elements are added to an array 2010-12-27 tommi@tntnet.org - add category to xmlserializer - set type of serializationinfo in xmlrpc scanner - reduce some more allocations 2010-12-21 tommi@tntnet.org - reduced library size by inlining trivial methods and other small optimizations 2010-12-19 tommi@tntnet.org - reduced allocations 2010-12-18 tommi@tntnet.org - reverse xml entity resolver - better error reporting in failed unittests - cxxtools::OStringStream and cxxtools::IStringStream as typedefs - use reverse xml entity resolver in xml writer - fix reading xml entities in xml attribute values - pass strings by const reference instead of const copies in xml reader 2010-12-17 tommi@tntnet.org - remove need for static initialization and locking in xml entityresolver - add xmlreader test frame 2010-12-16 tommi@tntnet.org - set xml attribute "type" in xmlserializer and read it in deserializer - clean up some code (breaking abi) 2010-12-16 tommi@tntnet.org - fix parsing options like --option=value 2010-12-13 tommi@tntnet.org - small optimization in tcpserver: don't use poll in accept, if we have only one listener - use static entity map with delayed initialization in xmlreader 2010-12-10 tommi@tntnet.org - add query and fragment parts to uri class 2010-12-07 tommi@tntnet.org - accept dates, times and datetimes with discrete components in deserialization 2010-11-21 tommi@tntnet.org - set user agent header in http client if not set by user 2010-11-20 tommi@tntnet.org - fix handling of detached threads - support for special characters in xml attributes as well as html entities add all html4 entities into default list of entities in entityresolver delay instantiation of entityresolver until really needed 2010-11-17 tommi@tntnet.org - fix for serialization of std::pair (type name was not set) 2010-11-13 tommi@tntnet.org - reduce compiler warnings by cleaning up code 2010-11-08 tommi@tntnet.org - add constructor and connect with cxxtools::net::Uri method to xmlrpc client - take username and password from uri in xmlrpc client - add default constructor to uri class 2010-11-07 tommi@tntnet.org - add class cxxtools::net::Uri for parsing uris 2010-11-05 tommi@tntnet.org - close socket in http client when new address is set - make selector settable in cxxtools::xmlrpc::HttpClient 2010-11-01 tommi@tntnet.org - add serialization operators to Date, Time and DateTime 2010-10-29 tommi@tntnet.org - new method clear in cxxtools::Cache to clear the cache 2010-10-17 tommi@tntnet.org - add cxxtools prefix to md5 code to prevent name clash with other md5 libraries 2010-10-14 tommi@tntnet.org - new member template function SerialzationInfo::getMember(name, value), which deserializes a member only if the value is found and do not throw, if the member is not found; a success flag is returned as bool 2010-10-08 tommi@tntnet.org - add serialization operator for string constant 2010-10-04 tommi@tntnet.org - add helper templates cxxtools::md5 2010-09-12 tommi@tntnet.org - fix handling of IPv6 in server socket - add configure check for IPv6 - new utility functions split, join and trim 2010-08-19 tommi@tntnet.org - fixes for atomicity on sun - fix compile problem for atomicity for arm 2010-08-17 tommi@tntnet.org - fix reading of chunked encoded data in http client 2010-08-01 tommi@tntnet.org - release 2.0 2010-06-16 tommi@tntnet.org - flush textstream in finish method of xml- and jsonserializer 2010-06-07 tommi@tntnet.org - fix race condition in http server when handling idle sockets 2010-04-05 tommi@tntnet.org - add template class Argp for reading arguments with parameter and add unit tests for Arg* template classes 2010-03-24 tommi@tntnet.org - add support for TCP_DEFER_ACCEPT 2010-03-22 tommi@tntnet.org - support for out of tree builds 2010-03-19 tommi@tntnet.org - replace errorOccured signal with throwing errors in endXXX-methods 2010-03-07 tommi@tntnet.org - make url settable in http xmlrpc client 2010-03-02 tommi@tntnet.org - add new BasicEvent template for easier event definition and use it in http server 2010-02-27 tommi@tntnet.org - add template class for (thread-)queue - add support for listen on any socket and connect to any local by passing an empty ip address - run http server in event loop - add exited signal to event loop 2010-02-07 tommi@tntnet.org - accept gets a inherit flag instead of closeOnExec 2010-02-06 tommi@tntnet.org - add new class cxxtools::Cache 2010-02-05 tommi@tntnet.org - add mutex to service list in httpserver, so that other threads may add or remove services while the server is running 2010-02-04 tommi@tntnet.org - extend number of parameters in xmlrpc client from 5 to 10 2010-02-03 tommi@tntnet.org - add cancel method to http client, xmlrpc client and iodevice 2009-12-27 tommi@tntnet.org - remove cxxtools::Dynbuffer (use std::vector instead) 2009-12-22 tommi@tntnet.org - split pipe class into generic and posix specific functionality 2009-12-21 tommi@tntnet.org - remove old compatibility typedefs cxxtools::net::Server and cxxtools::net::Stream 2009-12-17 tommi@tntnet.org - new static methods Utf8Codec::encode and Utf8Codec::decode 2009-12-06 tommi@tntnet.org - make building of demos and unittests optional by configure flags --disable-demos and --disable-unittest 2009-11-16 tommi@tntnet.org - support for FD_CLOEXEC flag on sockets and support for accept4 (conditional by configure check) 2009-11-15 tommi@tntnet.org - improve Process class 2009-11-03 tommi@tntnet.org - merge cxxtools::ext::Pipe and cxxtools::Pipe into cxxtools::Pipe 2009-10-30 tommi@tntnet.org - make SimpleRefCounted the default in RefCounted again 2009-10-16 tommi@tntnet.org - new class cxxtools::net::AddrInfo, which encapsulates ip and port - let cxxtools::RefCounted use atomic_t - support for multiple listeners to httpserver 2009-09-06 tommi@tntnet.org - extract http code from xmlrpc client into a separate class 2009-08-28 tommi@tntnet.org - do not indent json by default but make it optional 2009-08-25 tommi@tntnet.org - support for chunked encoding transfer in http-client 2009-08-18 tommi@tntnet.org - add support for authentication to http server 2009-08-02 tommi@tntnet.org - add http authorization to http client 2009-07-05 tommi@tntnet.org - compile iconvstream only if explicitely configured 2009-07-03 tommi@tntnet.org - implement json serializer 2009-07-03 d-marc - added settings and xml serialization 2009-06-21 tommi@tntnet.org - add serialization for all std container templates 2009-06-12 tommi@tntnet.org - add new rpcclient and server demo rpcecho 2009-06-02 tommi@tntnet.org - propagte connect error in http client through errorOccured signal 2009-05-31 tommi@tntnet.org - serialization for std::deque 2009-05-28 tommi@tntnet.org - improved exception handling in xmlrpc 2009-05-27 tommi@tntnet.org - serializer for std::list and std::set 2009-04-04 tommi@tntnet.org - move http to a separate library - move net-headers to own subdirectory 2009-04-03 d-marc - throw on endConnect if connect failed 2009-04-03 d-marc - added xmlrpc library 2009-04-02 d-marc - added xml reader and writer 2009-04-02 d-marc - added serializer, deserializer and serializationinfo class 2009-04-01 d-marc - added stringstream 2009-04-01 d-marc - added codecs 2009-03-31 d-marc - added textstreams 2009-03-26 d-marc - added unicode capable string class 2009-03-26 tommi@tntnet.org - make httpserver multithreaded 2009-03-23 d-marc - added unicode char class 2009-03-23 d-marc - added getSystemTime method 2009-03-22 tommi@tntnet.org - http client rewritten and new http server 2009-02-27 tommi@tntnet.org - new FreeDestroyPolicy for smart pointers 2009-02-23 d-marc - added TCP iostream 2009-02-19 d-marc - added unit test for tcp 2009-02-18 d-marc - added unit testing library 2009-02-17 d-marc - sockets are always async 2009-02-16 tommi@tntnet.org - return std::string for ip adresses instead of system specific structure 2009-02-13 tommi@tntnet.org - make destroy policy methods of smart pointer public 2009-02-13 d-marc - added blocking connect 2009-02-11 d-marc - renamed to TcpServer 2009-02-10 d-marc - added signal for pending connections 2009-02-10 d-marc - TcpServersocket is a Selectable 2009-02-09 d-marc - moved tcp server socket to separate header 2009-02-09 d-marc - moved addrinfo to separate files 2008-12-19 d-marc - added streambuf for iodevices 2008-12-18 d-marc - added semaphore class 2008-12-17 d-marc - new classes EventLoop, Process, IODevice, Selectable, Selector, Application, Timer 2008-12-16 tommi@tntnet.org - new methods in pipe to easily redirect stdin, stdout and stderr 2008-12-16 tommi@tntnet.org - new method cxxtools::net::iostream::canRead() 2008-12-12 d-marc - added event soure and sink class 2008-12-02 d-marc - added singleton template and typetraits 2008-12-02 d-marc - added high precision system clock 2008-12-02 d-marc - added date and time classes 2008-12-01 tommi@tntnet.org - default to maxbackupindex of 2 instead of 10 in cxxtools-config-script 2008-12-01 tommi@tntnet.org - use spinlock instead of mutex in logger 2008-12-01 d-marc - added conversion algos 2008-11-26 d-marc - mutex class consolidation; Added more IOError types 2008-11-25 d-marc - added tryReadLock and tryWriteLock for ReadWriteMutex 2008-11-24 d-marc - added IOError and AccessFailed 2008-11-19 d-marc - renamed timedwait in condition 2008-11-05 tommi@tntnet.org - rename RWLock to RWMutex and add typedef for old name for compatibility 2008-11-04 d-marc - unified attached and detached thread classes 2008-10-30 d-marc - use callables as thread functors 2008-09-12 tommi@tntnet.org - add LGPL exception for large templates and macros 2008-08-14 d-marc - added tryLock method to SpinMutex 2008-08-08 tommi@tntnet.org - move mutex classes into separate files and add spinlock mutex 2008-07-03 tommi@tntnet.org - don't throw exceptions when logging fails 2008-06-18 tommi@tntnet.org - use non-atomic reference counting by default and add atomic refcounted class and smart pointer policy 2008-06-10 d-marc - added new file/dir API 2008-06-18 tommi@tntnet.org - split referencecounting into a thread safe and a non thread safe variant 2008-06-03 tommi@tntnet.org - release version 1.4.8 2008-05-02 tommi@tntnet.org - change the way of announcing configure results to headers 2008-05-01 tommi@tntnet.org - use pipl-idiom in cxxtools::Dir to remove needed includes in public header - allow ':' in httprequests and other small improvements and add documentation to http client classes - add wrapper for regex(3) 2008-03-31 marc - added conversion functions 2008-03-27 tommi@tntnet.org - increase default tcp buffer size from 256 to 8192 bytes 2008-03-09 tommi@tntnet.org - remove the queing of log messages since it was not reliable - translate api-documentation of network classes to english - add a flush parameter to cxxtools::net::Stream::write to allow partial writes and use this in cxxtools::net::iostream::overflow, so that overflow always tries to write the full buffer. 2008-02-21 tommi@tntnet.org - new command line utility cxxlog to use the logger in shell scripts 2008-12-27 tommi@tntnet.org - add classes for creation of mime mails 2007-11-13 tommi@tntnet.org - optimization of logging 2007-11-03 tommi@tntnet.org - functions for handling endianess (cxxtools/byteorder.h) - atomic increment and decrement wrappers (Marc) 2007-11-01 tommi@tntnet.org - cxxtools::Any and compile-time typeinfo (Marc) 2007-10-17 tommi@tntnet.org - remove libltdl code completely - implement destroy-policy for cxxtools::SmartPtr 2007-10-12 tommi@tntnet.org - signal-slot (Marc) 2007-09-16 tommi@tntnet.org - don't use libltdl by default since it brings more problems than it solves. On linux we need RTLD_GLOBAL in dlopen to make exceptions and rtti working. libltdl does not pass that flag. On Aix shared libraries has a extension .a by default, which is not recognized by libltdl. 2007-07-07 tommi@tntnet.org - rewritten ini-file-parser - make iconv unconditional and make iconv-buffer bigger for better performance - properties-file-parser 2007-07-06 tommi@tntnet.org - add policy based smart pointer implementation - add NonCopyable-class, which can be used as a base-class for objects, which must not be copied - fix bug in subtraction-method of cxxtools::HiresTime 2007-05-12 tommi@tntnet.org - logging can be disabled completely now in the logging-properties by setting disabled to 1 (or 'y' or 'Y' or 't' or 'T') 2007-05-11 tommi@tntnet.org - make cxxtools::Pool working again - build-improvements (port to solaris/SunStudio) 2007-05-04 tommi@tntnet.org - replace std::string with char* as a buffer in udpstream-class - remove RWLOCK_MUTEX_INITIALIZER because this is unknown on Mac OS X and the rwlock_t-structure is anyway initalized with pthread_rwlock_init 2007-05-03 tommi@tntnet.org - bugfix: clear buffer of udpstream after sending message - make cxxtools::socket::doPoll-method public and rename to poll 2007-04-26 tommi@tntnet.org - try next addrinfo, when socket-creation fails. Previously cxxtools fails to create a socket, if first addrinfo-entry does not work. 2007-04-20 tommi@tntnet.org - fix stream-classes to conform ANSI 2007-04-18 tommi@tntnet.org - remove double-lock in pool-class, which resulted in a deadlock on solaris 2007-04-17 tommi@tntnet.org - another change in initialization in std::ios-derived classes after reading the c++-standard (now std::ios::init is used for initialization) 2007-04-11 tommi@tntnet.org - don't pass uninitialized std::streabuf to base-class in classes derived from std::[io]stream. This should be ok, but at least Sun Studio 11 fails here. 2007-03-25 tommi@tntnet.org - replace semaphore with condition in cxxtools::Pool and make max-size of pool settable 2007-03-23 tommi@tntnet.org - add error-checking for glob in cxxtools::multifstreambuf 2007-02-20 tommi@tntnet.org - fix stupid bug in tcp-class. Stream reported eof when only part of data was written. 2007-01-24 tommi@tntnet.org - wrappers for fork(2) and pipe(2) and a std::iostream on top of pipe(2) - cxxtools::Fdstream: std::iostream for filedescriptors 2007-01-21 tommi@tntnet.org - support for udp-broadcast - don't throw exception in tcpstream, when connection is closed report eof instead 2007-01-15 tommi@tntnet.org - make offset in hexdumper settable - logging-improvement (don't try to output current logstatement when exception occurs during creation of log-message) - Condition::timedwait 2006-12-31 tommi@tntnet.org - improve eof-handling in socket-class 2006-12-28 tommi@tntnet.org - log process-id - bugfix in cxxtools::UdpReceiver: adress-length-field was not initialized 2006-12-20 tommi@tntnet.org - make constuctor for QueryParams::const_iterator explicit to prevent accidentally converting QueryParams-objects into const_iterator 2006-11-22 tommi@tntnet.org - make loggers more private and instantiate existing loggers later - "putchar" is a macro somewhere - rename member-method to workaround this name-conflict 2006-11-20 tommi@tntnet.org - fix tcpstream to correctly report end-of-file in all circumstances 2006-09-11 tommi@tntnet.org - fixed buffer-overflow in logger when formatting dates 2006-08-10 tommi@tntnet.org - new helper-class IConverter for easier usage of iconv(3) and iconvstream 2006-07-27 tommi@tntnet.org - fix iconvstream 2006-06-21 tommi@tntnet.org - license changed to LGPL 2006-05-24 tommi@tntnet.org - fix tcp-client: create socket when known, which to create this fixes also problems in running any applications on systems without IPv6 2006-04-27 tommi@tntnet.org - support for IPv6 2006-04-16 tommi@tntnet.org - fixes for AIX-compatibility 2006-04-06 tommi@tntnet.org - faster formatting of logmessages 2006-04-04 tommi@tntnet.org - flushdelay works now with rolling-files - ANSI-C++-fixes 2006-03-02 tommi@tntnet.org - new logging-parameter flushdelay, which speeds up logging by starting a backgroundthread, which flushes asynchronous 2005-01-20 tommi@tntnet.org - thread-classes simplified and demo improved - output of log-messages speed-optimized 2005-12-12 tommi@tntnet.org - improved error-checking in network-classes - logging integrated into base-lib (no libcxxtools-log.so any more) 2005-11-08 tommi@tntnet.org - cxxtools::Thread split into cxxtools::AttachedThread and cxxtools::DetachedThread 2005-11-04 tommi@tntnet.org - bugfix in cxxtools::HttpRequest 2005-09-18 tommi@tntnet.org - udp-reply 2005-07-19 tommi@tntnet.org - new namingconventions: classfiles start with capitals, methods with lower case - support for udp-messages (cxxtools::UdpSender, cxxtools::UdpReceiver) - logging through udp 2005-07-15 tommi@tntnet.org - fixed some method-names to conform common naming convetions 2005-06-18 tommi@tntnet.org - version 1.3.1 released - fixed copy-constructor for query_params 2005-01-29 tommi@tntnet.org - version 1.3.0 released - modified timeout-handling in tcpstream - simple http-client added - cxxtools::Condition is not derived from cxxtools::Thread any more 2005-01-05 tommi@tntnet.org - version 1.2.3 released - missing errno.h in iconvstream.cpp added - support in cxxtools::arg for multiple alternative switches in a single arg-variable (set-method) - use gethostbyname to determine address to listen, so you can specify a hostname as a listener-parameter 2004-12-14 tommi@tntnet.org - version 1.2.2 released - bug fixed: cxxtools::arg does not find user-specific inputstreamoperators - support for log4cxx - logging-library selectable at build-time 2004-12-03 tommi@tntnet.org - version 1.2.1 released - removed obsolete timeclass.cpp - switched dl-classes to libtool for better portability - skip iconvstream if libiconv is not installed - new library: logging-wrapper for log4cplus (log4cxx-support will follow) - simple lightweight logging-library as a alternative for log4cplus 2004-11-25 tommi@tntnet.org - version 1.2 released - all classes moved to namespace cxxtools - documentation-updates (most classes documented with doxygen-style comments 2004-11-11 tommi@tntnet.org - version 1.1.3 released - error in eof-handling in base64 fixed -- Tommi Maekitalo <tommi@epgmbh.de> Thu, 11 Nov 2004 12:33:47 +0100 2004-11-03 tommi@tntnet.org - version 1.1.2 released - new class base64stream 2004-10-04 tommi@tntnet.org - use libtool/autoconf/automake 2004-09-16 tommi@tntnet.org - version 1.1 released - unused variable in tcpstream.h removed this breaks binary-compatibility 2004-03-23 tommi@tntnet.org - Initial Release 1.0. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/��������������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277565�011403� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/string-test.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000052203�12256773774�014316� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #undef CXXTOOLS_API_EXPORT #include "cxxtools/api.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" #include <vector> #include <sstream> class StringTest : public cxxtools::unit::TestSuite { public: StringTest() : cxxtools::unit::TestSuite("string") { cxxtools::unit::TestSuite::registerMethod( "testConstructor", *this, &StringTest::testConstructor ); cxxtools::unit::TestSuite::registerMethod( "testCompare", *this, &StringTest::testCompare ); cxxtools::unit::TestSuite::registerMethod( "testCompareShort", *this, &StringTest::testCompareShort ); cxxtools::unit::TestSuite::registerMethod( "testAssign", *this, &StringTest::testAssign ); cxxtools::unit::TestSuite::registerMethod( "testAppend", *this, &StringTest::testAppend ); cxxtools::unit::TestSuite::registerMethod( "testInsert", *this, &StringTest::testInsert ); cxxtools::unit::TestSuite::registerMethod( "testClear", *this, &StringTest::testClear ); cxxtools::unit::TestSuite::registerMethod( "testErase", *this, &StringTest::testErase ); cxxtools::unit::TestSuite::registerMethod( "testReplace", *this, &StringTest::testReplace ); cxxtools::unit::TestSuite::registerMethod( "testFind", *this, &StringTest::testFind ); cxxtools::unit::TestSuite::registerMethod( "testRFind", *this, &StringTest::testRFind ); cxxtools::unit::TestSuite::registerMethod( "testFindFirstOf", *this, &StringTest::testFindFirstOf ); cxxtools::unit::TestSuite::registerMethod( "testFindLastOf", *this, &StringTest::testFindLastOf ); cxxtools::unit::TestSuite::registerMethod( "testFindFirstNotOf", *this, &StringTest::testFindFirstNotOf ); cxxtools::unit::TestSuite::registerMethod( "testFindLastNotOf", *this, &StringTest::testFindLastNotOf ); cxxtools::unit::TestSuite::registerMethod( "testCStr", *this, &StringTest::testCStr ); cxxtools::unit::TestSuite::registerMethod( "testSubstr", *this, &StringTest::testSubstr ); cxxtools::unit::TestSuite::registerMethod( "testSwap", *this, &StringTest::testSwap ); cxxtools::unit::TestSuite::registerMethod( "testAt", *this, &StringTest::testAt ); cxxtools::unit::TestSuite::registerMethod( "testPushBack", *this, &StringTest::testPushBack ); cxxtools::unit::TestSuite::registerMethod( "testCopy", *this, &StringTest::testCopy ); cxxtools::unit::TestSuite::registerMethod( "testReserve", *this, &StringTest::testReserve ); cxxtools::unit::TestSuite::registerMethod( "testReserveEmpty", *this, &StringTest::testReserveEmpty ); cxxtools::unit::TestSuite::registerMethod( "testLengthAndSize", *this, &StringTest::testLengthAndSize ); } protected: void testConstructor(); void testCompare(); void testCompareShort(); void testAssign(); void testAppend(); void testInsert(); void testClear(); void testErase(); void testReplace(); void testFind(); void testRFind(); void testFindFirstOf(); void testFindLastOf(); void testFindFirstNotOf(); void testFindLastNotOf(); void testCStr(); void testSubstr(); void testSwap(); void testIndexOperator(); void testAt(); void testPushBack(); void testCopy(); void testReserve(); void testReserveEmpty(); void testLengthAndSize(); }; cxxtools::unit::RegisterTest<StringTest> register_StringTest; void StringTest::testConstructor() { cxxtools::String s1; CXXTOOLS_UNIT_ASSERT(s1 == cxxtools::String(L"")); cxxtools::String s2(L"abcde"); CXXTOOLS_UNIT_ASSERT(s2 == L"abcde"); cxxtools::String s3(L"abcde", 3); CXXTOOLS_UNIT_ASSERT(s3 == L"abc"); cxxtools::String s4(3, 'x'); CXXTOOLS_UNIT_ASSERT(s4 == L"xxx"); cxxtools::String s5(s2); CXXTOOLS_UNIT_ASSERT(s5 == L"abcde"); cxxtools::String s6(s2, 1); CXXTOOLS_UNIT_ASSERT(s6 == L"bcde"); cxxtools::String s7(s2, 1, 3); CXXTOOLS_UNIT_ASSERT(s7 == L"bcd"); cxxtools::String s10; CXXTOOLS_UNIT_ASSERT(s10 == cxxtools::String(L"")); const cxxtools::Char c11[] = { 'a', 'b', 'c', 'd', 'e', '\0' }; cxxtools::String s11(c11); CXXTOOLS_UNIT_ASSERT(s11 == c11); const cxxtools::Char c12[] = { 'a', 'b', 'c', '\0' }; cxxtools::String s12(L"abcde", 3); CXXTOOLS_UNIT_ASSERT(s12 == c12); const cxxtools::Char c13[] = { 'x', 'x', 'x', '\0' }; cxxtools::String s13(3, 'x'); CXXTOOLS_UNIT_ASSERT(s13 == c13); const cxxtools::Char c14[] = { 'a', 'b', 'c', 'd', 'e', '\0' }; cxxtools::String s14(s11); CXXTOOLS_UNIT_ASSERT(s14 == c14); const cxxtools::Char c15[] = { 'b', 'c', 'd', 'e', '\0' }; cxxtools::String s15(s11, 1); CXXTOOLS_UNIT_ASSERT(s15 == c15); const cxxtools::Char c16[] = { 'b', 'c', 'd', '\0' }; cxxtools::String s16(s11, 1, 3); CXXTOOLS_UNIT_ASSERT(s16 == c16); // TODO API not implemented yet. // cxxtools::String s20(s2.begin(), s2.end()); // CXXTOOLS_UNIT_ASSERT(s20 == L"abcde"); } void StringTest::testCompare() { const cxxtools::Char abc[] = { 'a', 'b', 'c', '\0' }; const wchar_t* z = L"abcxyz"; cxxtools::String s(L"abcd"); cxxtools::String t(abc); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(s) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(z) , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 3, t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 3, t, 1, 2) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 3, z) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare(1, 2, z + 1, 0, 2) , 0); cxxtools::String x1(L"abc"); cxxtools::String x2(abc); CXXTOOLS_UNIT_ASSERT(x1 == x2); CXXTOOLS_UNIT_ASSERT(x1 == abc); CXXTOOLS_UNIT_ASSERT(x2 == abc); const cxxtools::Char empty[] = { '\0' }; cxxtools::String y1(L""); cxxtools::String y2(empty); CXXTOOLS_UNIT_ASSERT(y1 == y2); CXXTOOLS_UNIT_ASSERT(y1 == empty); CXXTOOLS_UNIT_ASSERT(y2 == empty); } void StringTest::testCompareShort() { cxxtools::String s(L"abcd"); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcd") , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abc") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcxyz") , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abd") , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abb") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("ab") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcd", 4) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcxyz", 3) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abcxyz", 4) , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abd", 3) , -1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("abb", 3) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.compare("ab", 2) , 1); cxxtools::String x1(L"abc"); CXXTOOLS_UNIT_ASSERT(x1 == "abc"); cxxtools::String y1(L""); cxxtools::String y2(""); CXXTOOLS_UNIT_ASSERT(y1 == y2); CXXTOOLS_UNIT_ASSERT(y1 == ""); CXXTOOLS_UNIT_ASSERT(y2 == ""); } void StringTest::testAssign() { { cxxtools::String s1; cxxtools::String s2(L"abc"); cxxtools::String s3 = s1; cxxtools::Char& ref = s2[0]; // make it unsharable ref = L'x'; s1 = s2; } const wchar_t* z = L"abcde"; std::vector<wchar_t> v(z, z + 5); cxxtools::String s; cxxtools::String t(z); s.assign(z); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); s.assign(z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"bcd"); s.assign(3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"xxx"); s.assign(t); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); s.assign(t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"bcd"); /* TODO API not implemented yet. s.assign(v.begin(), v.end()); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); */ s = s; CXXTOOLS_UNIT_ASSERT(s == L"bcd"); s.assign(t); s = s.c_str(); CXXTOOLS_UNIT_ASSERT(s == L"abcde"); } void StringTest::testAppend() { const wchar_t* z = L"abcde"; std::vector<wchar_t> v(z, z + 5); cxxtools::String s(L"ABC"); cxxtools::String t(z); s.append(z); CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; s.append(z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABCbcd"); s = L"ABC"; s.append(3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABCxxx"); s = L"ABC"; s.append(t); CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; s.append(t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABCbcd"); /* TODO API not implemented yet. s = L"ABC"; s.append(v.begin(), v.end()); CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); */ // operator += s = L"ABC"; s += z; CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; s += 'x'; CXXTOOLS_UNIT_ASSERT(s == L"ABCx"); s = L"ABC"; s += t; CXXTOOLS_UNIT_ASSERT(s == L"ABCabcde"); s = L"ABC"; cxxtools::String u = s + t; CXXTOOLS_UNIT_ASSERT(u == L"ABCabcde"); } void StringTest::testInsert() { cxxtools::String::iterator i; const wchar_t* z = L"abcde"; std::vector<wchar_t> v(z, z + 5); cxxtools::String s(L"ABC"); cxxtools::String t(z); s.insert(2, z); CXXTOOLS_UNIT_ASSERT(s == L"ABabcdeC"); s = L"ABC"; s.insert(2, z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABbcdC"); s = L"ABC"; s.insert(2, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABxxxC"); s = L"ABC"; s.insert(2, t); CXXTOOLS_UNIT_ASSERT(s == L"ABabcdeC"); s = L"ABC"; s.insert(2, t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"ABbcdC"); s = L"ABC"; i = s.begin() + 2; s.insert(i, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABxC"); s = L"ABC"; i = s.begin() + 2; s.insert(i, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"ABxxxC"); /* TODO API not implemented yet. s = L"ABC"; s.insert(i, v.begin(), v.end()); i = s.begin() + 2; CXXTOOLS_UNIT_ASSERT(s == L"ABabcdeC");*/ } void StringTest::testClear() { cxxtools::String s(L"abcdefg"); s.clear(); CXXTOOLS_UNIT_ASSERT(s == L""); } void StringTest::testErase() { cxxtools::String s(L"abcdefg"); cxxtools::String::iterator p = s.begin() + 2; cxxtools::String::iterator q = s.end() - 2; s.erase(); CXXTOOLS_UNIT_ASSERT(s == L""); s = L"abcdefg"; s.erase(2); CXXTOOLS_UNIT_ASSERT(s == L"ab"); s = L"abcdefg"; s.erase(2, 3); CXXTOOLS_UNIT_ASSERT(s == L"abfg"); s = L"abcdefg"; p = s.begin() + 2; s.erase(p); CXXTOOLS_UNIT_ASSERT(s == L"abdefg"); s = L"abcdefg"; p = s.begin() + 2; q = s.end() - 2; s.erase(p, q); CXXTOOLS_UNIT_ASSERT(s == L"abfg"); } void StringTest::testReplace() { const wchar_t* z = L"vwxyz"; std::vector<wchar_t> v(z, z + 5); cxxtools::String s(L"ABCDEF"); cxxtools::String t(z); cxxtools::String::iterator i1; cxxtools::String::iterator i2; s.replace(1, 4, z); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); s = L"ABCDEF"; s.replace(1, 4, z + 1, 0, 3); CXXTOOLS_UNIT_ASSERT(s == L"AwxyF"); s = L"ABCDEF"; s.replace(1, 4, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"AxxxF"); s = L"ABCDEF"; s.replace(1, 4, t); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); s = L"ABCDEF"; s.replace(1, 4, t, 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"AwxyF"); s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, z); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); cxxtools::Char z2[] = { 'v', 'w', 'x', 'y' }; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, z2 + 1, 3); CXXTOOLS_UNIT_ASSERT(s == L"AwxyF"); s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, 3, 'x'); CXXTOOLS_UNIT_ASSERT(s == L"AxxxF"); s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, t); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); /* TODO API not implemented yet. s = L"ABCDEF"; i1 = s.begin() + 1; i2 = s.end() - 1; s.replace(i1, i2, v.begin(), v.end()); CXXTOOLS_UNIT_ASSERT(s == L"AvwxyzF"); */ } void StringTest::testFind() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"bc"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(t, 2) , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(L"bc") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(L"bc", 2) , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find(abcd, 2, 3) , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find('b') , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find('b', 2) , 5); } void StringTest::testRFind() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"bc"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(t) , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(t, 2) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(L"bc") , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(L"bc", 2) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind(abcd, 2, 3) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind('b') , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.rfind('b', 2) , 1); } void StringTest::testFindFirstOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(t) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(t, 2) , 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(L"bc") , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(L"bc", 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of(abcd, 2, 3) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of('b') , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_of('b', 2) , 5); } void StringTest::testFindLastOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(t) , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(t, 2) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(L"bc") , 6); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(L"bc", 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of(abcd, 2, 3) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of('b') , 5); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_of('b', 2) , 1); } void StringTest::testFindFirstNotOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(t) , 1); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(t, 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(L"bc") , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(L"bc", 2) , 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of(abcd, 2, 3) , 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of('b') , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_first_not_of('b', 2) , 2); } void StringTest::testFindLastNotOf() { cxxtools::String s(L"abc-abc"); cxxtools::String t(L"a-x"); cxxtools::Char abcd[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(t) , 6); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(t, 2) , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(L"bc") , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(L"bc", 2) , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of(abcd, 2, 3) , cxxtools::String::npos); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of('b') , 6); CXXTOOLS_UNIT_ASSERT_EQUALS(s.find_last_not_of('b', 2) , 2); } void StringTest::testCStr() { cxxtools::String s1(L"abc"); CXXTOOLS_UNIT_ASSERT(s1.c_str()[0] == 'a' && s1.c_str()[1] == 'b' && s1.c_str()[2] == 'c' && s1.c_str()[3] == '\0'); cxxtools::String s2; CXXTOOLS_UNIT_ASSERT(s2.c_str()[0] == '\0'); cxxtools::Char abc[] = { 'a', 'b', 'c', '\0' }; cxxtools::String s3(abc); CXXTOOLS_UNIT_ASSERT(s3.c_str()[0] == 'a' && s3.c_str()[1] == 'b' && s3.c_str()[2] == 'c' && s3.c_str()[3] == '\0'); cxxtools::Char zero[] = { '\0' }; cxxtools::String s4(zero); CXXTOOLS_UNIT_ASSERT(s4.c_str()[0] == '\0'); } void StringTest::testSubstr() { cxxtools::String s(L"abcdefg"); CXXTOOLS_UNIT_ASSERT(s.substr() == L"abcdefg"); CXXTOOLS_UNIT_ASSERT(s.substr(2) == L"cdefg"); CXXTOOLS_UNIT_ASSERT(s.substr(2, 3) == L"cde"); } void StringTest::testSwap() { cxxtools::String s1(L"abc"); cxxtools::String s2(L"xyz"); CXXTOOLS_UNIT_ASSERT(s1 == L"abc"); CXXTOOLS_UNIT_ASSERT(s2 == L"xyz"); s1.swap(s2); CXXTOOLS_UNIT_ASSERT(s1 == L"xyz"); CXXTOOLS_UNIT_ASSERT(s2 == L"abc"); s2.swap(s1); CXXTOOLS_UNIT_ASSERT(s1 == L"abc"); CXXTOOLS_UNIT_ASSERT(s2 == L"xyz"); } void StringTest::testIndexOperator() { cxxtools::String s(L"abcdef"); CXXTOOLS_UNIT_ASSERT(s[0] == 'a'); CXXTOOLS_UNIT_ASSERT(s[5] == 'f'); CXXTOOLS_UNIT_ASSERT(s[6] == '\0'); /* bool exceptionOccured = false; try { s[10]; } catch (const cxxtools::Exception& e) { exceptionOccured = true; }*/ } void StringTest::testAt() { cxxtools::String s(L"abcdef"); CXXTOOLS_UNIT_ASSERT(s.at(0) == 'a'); CXXTOOLS_UNIT_ASSERT(s.at(5) == 'f'); } void StringTest::testPushBack() { cxxtools::String s(L"abc"); s.push_back('d'); CXXTOOLS_UNIT_ASSERT(s == L"abcd"); } void StringTest::testCopy() { cxxtools::Char t1[3]; cxxtools::String s(L"abcd"); s.copy(t1, 2); t1[2] = '\0'; const cxxtools::Char c1[] = { 'a', 'b', '\0' }; CXXTOOLS_UNIT_ASSERT(std::char_traits<cxxtools::Char>::compare(t1, c1, 3) == 0); cxxtools::Char t2[5]; s.copy(t2, 4); t2[4] = '\0'; const cxxtools::Char c2[] = { 'a', 'b', 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(std::char_traits<cxxtools::Char>::compare(t2, c2, 5) , 0); cxxtools::Char t3[3]; s.copy(t3, 2, 2); t3[2] = '\0'; const cxxtools::Char c3[] = { 'c', 'd', '\0' }; CXXTOOLS_UNIT_ASSERT_EQUALS(std::char_traits<cxxtools::Char>::compare(t3, c3, 3) , 0); } void StringTest::testReserve() { const cxxtools::Char c1[] = { 'a', 'b', 'c', 'd', '\0' }; cxxtools::String s(L"abcd"); cxxtools::String s2 = s; s2.reserve(10); CXXTOOLS_UNIT_ASSERT( s2.capacity() >= 10 ); CXXTOOLS_UNIT_ASSERT( s2.size() == 4 ); CXXTOOLS_UNIT_ASSERT_EQUALS( std::char_traits<cxxtools::Char>::compare(s2.c_str(), c1, 4) , 0 ); CXXTOOLS_UNIT_ASSERT( s.capacity() >= 4 ); CXXTOOLS_UNIT_ASSERT_EQUALS( s.size(), 4 ); CXXTOOLS_UNIT_ASSERT_EQUALS( std::char_traits<cxxtools::Char>::compare(s.c_str(), c1, 4) , 0 ); } void StringTest::testReserveEmpty() { cxxtools::String s; s.reserve(0); CXXTOOLS_UNIT_ASSERT( s.capacity() >= 0 ); CXXTOOLS_UNIT_ASSERT_EQUALS( s.size() , 0 ); } void StringTest::testLengthAndSize() { cxxtools::String s1; CXXTOOLS_UNIT_ASSERT_EQUALS(s1.length() , 0); CXXTOOLS_UNIT_ASSERT_EQUALS(s1.size() , 0); cxxtools::String s2(L"ab"); CXXTOOLS_UNIT_ASSERT_EQUALS(s2.length() , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s2.size() , 2); s2 += L"cd"; CXXTOOLS_UNIT_ASSERT_EQUALS(s2.length() , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s2.size() , 4); cxxtools::Char ab[] = { 'a', 'b', '\0' }; cxxtools::String s3(ab); CXXTOOLS_UNIT_ASSERT_EQUALS(s3.length() , 2); CXXTOOLS_UNIT_ASSERT_EQUALS(s3.size() , 2); cxxtools::Char cd[] = { 'c', 'd', '\0' }; s3 += cd; CXXTOOLS_UNIT_ASSERT_EQUALS(s3.length() , 4); CXXTOOLS_UNIT_ASSERT_EQUALS(s3.size() , 4); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/clock-test.cpp������������������������������������������������������������������0000664�0001750�0001750�00000005633�12256773774�014110� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/log.h" #include "cxxtools/clock.h" #include "cxxtools/timespan.h" #include "cxxtools/thread.h" log_define("cxxtools.test.clock") class ClockTest : public cxxtools::unit::TestSuite { public: ClockTest() : cxxtools::unit::TestSuite("clock") { registerMethod("testClock", *this, &ClockTest::testClock); // test for one second commented out since sleeping one second would slow down unit testing //registerMethod("testClockS", *this, &ClockTest::testClockS); } void testClock() { cxxtools::Clock cl; cl.start(); cxxtools::Thread::sleep(1); cxxtools::Timespan t = cl.stop(); log_debug("timespan=" << t.totalMSecs() << "ms"); CXXTOOLS_UNIT_ASSERT(t.totalMSecs() >= 1); // lets assume, that the test is below 1 second since the sleep is just one millisecond // without that test we wouldn't detect overflows in the implementation CXXTOOLS_UNIT_ASSERT(t.totalMSecs() < 1000); } void testClockS() { cxxtools::Clock cl; cl.start(); cxxtools::Thread::sleep(1001); cxxtools::Timespan t = cl.stop(); log_debug("timespan=" << t.totalMSecs() << "ms"); CXXTOOLS_UNIT_ASSERT(t.totalMSecs() > 1000); CXXTOOLS_UNIT_ASSERT(t.totalMSecs() < 2000); } }; cxxtools::unit::RegisterTest<ClockTest> register_ClockTest; �����������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/arg-test.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000017600�12256773774�013563� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <vector> #include <string.h> #include "cxxtools/arg.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class ArgTest : public cxxtools::unit::TestSuite { std::vector<char*> argp; char* arg(const char* value) { argp.push_back(new char [strlen(value) + 1]); strcpy(argp.back(), value); return argp.back(); } public: ArgTest() : cxxtools::unit::TestSuite("arg") { registerMethod("testArgBool", *this, &ArgTest::testArgBool); registerMethod("testArgCharP", *this, &ArgTest::testArgCharP); registerMethod("testArgpInt", *this, &ArgTest::testArgpInt); registerMethod("testArgpCharp", *this, &ArgTest::testArgpCharp); registerMethod("testArgpStdString", *this, &ArgTest::testArgpStdString); } void setUp() { } void tearDown() { for (std::vector<char*>::iterator it = argp.begin(); it != argp.end(); ++it) delete[] *it; argp.clear(); } void testArgBool() { int argc = 7; char* argv[] = { arg("prog"), arg("-i"), arg("-j"), arg("-k"), arg("-cf"), arg("--foo"), arg("foo"), 0 }; cxxtools::Arg<bool> optionJ(argc, argv, 'j'); cxxtools::Arg<bool> optionL(argc, argv, 'l'); cxxtools::Arg<bool> optionC(argc, argv, 'c'); cxxtools::Arg<bool> optionFoo(argc, argv, "--foo"); cxxtools::Arg<bool> optionBar(argc, argv, "--bar"); CXXTOOLS_UNIT_ASSERT(optionJ); CXXTOOLS_UNIT_ASSERT(!optionL); CXXTOOLS_UNIT_ASSERT(optionC); CXXTOOLS_UNIT_ASSERT(optionFoo); CXXTOOLS_UNIT_ASSERT(!optionBar); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-i"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "-k"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[3], "-f"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[4], "foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[5], 0); } void testArgCharP() { int argc = 7; char* argv[] = { arg("prog"), arg("-i"), arg("foo"), arg("--foo"), arg("inp"), arg("-k"), arg("bar"), 0 }; cxxtools::Arg<const char*> optionI(argc, argv, 'i'); cxxtools::Arg<const char*> optionL(argc, argv, 'l', "blah"); cxxtools::Arg<const char*> optionFoo(argc, argv, "--foo"); cxxtools::Arg<const char*> optionBar(argc, argv, "--bar"); CXXTOOLS_UNIT_ASSERT(optionI.isSet()); CXXTOOLS_UNIT_ASSERT(!optionL.isSet()); CXXTOOLS_UNIT_ASSERT(optionFoo.isSet()); CXXTOOLS_UNIT_ASSERT(!optionBar.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionI.getValue(), "foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionL.getValue(), "blah"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionFoo.getValue(), "inp"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(optionBar.getValue(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-k"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "bar"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], 0); } void testArgpInt() { int argc = 6; char* argv[] = { arg("prog"), arg("-v"), arg("42"), arg("-i"), arg("-j5"), arg("--foo"), 0 }; cxxtools::Arg<int> optionJ(argc, argv, 'j'); cxxtools::Arg<int> optionV(argc, argv, 'v'); CXXTOOLS_UNIT_ASSERT(optionJ.isSet()); CXXTOOLS_UNIT_ASSERT(optionV.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(optionJ, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(optionV, 42); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-i"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "--foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], 0); } void testArgpCharp() { int argc = 7; char* argv[] = { arg("prog"), arg("-v"), arg("42"), arg("-I"), arg("include"), arg("-Jfoo"), arg("-Khello world"), 0 }; cxxtools::Arg<const char*> optionI(argc, argv, 'I'); cxxtools::Arg<const char*> optionJ(argc, argv, 'J'); cxxtools::Arg<const char*> optionK(argc, argv, 'K'); CXXTOOLS_UNIT_ASSERT(optionI.isSet()); CXXTOOLS_UNIT_ASSERT(optionJ.isSet()); CXXTOOLS_UNIT_ASSERT(optionK.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionI, "include"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionJ, "foo"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(optionK, "hello world"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-v"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "42"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], 0); } void testArgpStdString() { int argc = 7; char* argv[] = { arg("prog"), arg("-v"), arg("42"), arg("-Jfoo"), arg("-I"), arg("include"), arg("-Khello world"), 0 }; cxxtools::Arg<std::string> optionI(argc, argv, 'I'); cxxtools::Arg<std::string> optionJ(argc, argv, 'J'); cxxtools::Arg<std::string> optionK(argc, argv, 'K'); CXXTOOLS_UNIT_ASSERT(optionI.isSet()); CXXTOOLS_UNIT_ASSERT(optionJ.isSet()); CXXTOOLS_UNIT_ASSERT(optionK.isSet()); CXXTOOLS_UNIT_ASSERT_EQUALS(optionI.getValue(), "include"); CXXTOOLS_UNIT_ASSERT_EQUALS(optionJ.getValue(), "foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(optionK.getValue(), "hello world"); CXXTOOLS_UNIT_ASSERT_EQUALS(argc, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[0], "prog"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[1], "-v"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(strcmp(argv[2], "42"), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(argv[3], 0); } }; cxxtools::unit::RegisterTest<ArgTest> register_ArgTest; ��������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/csvdeserializer-test.cpp��������������������������������������������������������0000664�0001750�0001750�00000030556�12266277345�016207� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/csvdeserializer.h" #include "cxxtools/log.h" //log_define("cxxtools.test.csvdeserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; } } class CsvDeserializerTest : public cxxtools::unit::TestSuite { public: CsvDeserializerTest() : cxxtools::unit::TestSuite("csvdeserializer") { registerMethod("testVectorVector", *this, &CsvDeserializerTest::testVectorVector); registerMethod("testVectorVectorNoTitle", *this, &CsvDeserializerTest::testVectorVectorNoTitle); registerMethod("testIntVector", *this, &CsvDeserializerTest::testIntVector); registerMethod("testObjectVector", *this, &CsvDeserializerTest::testObjectVector); registerMethod("testMissigColumn", *this, &CsvDeserializerTest::testMissingColumn); registerMethod("testTooManyColumns", *this, &CsvDeserializerTest::testTooManyColumns); registerMethod("testCr", *this, &CsvDeserializerTest::testCr); registerMethod("testEmptyLines", *this, &CsvDeserializerTest::testEmptyLines); registerMethod("testSingleColumn", *this, &CsvDeserializerTest::testSingleColumn); registerMethod("testSetDelimiter", *this, &CsvDeserializerTest::testSetDelimiter); registerMethod("testQuotedTitle", *this, &CsvDeserializerTest::testQuotedTitle); registerMethod("testFailDecoding", *this, &CsvDeserializerTest::testFailDecoding); } void testVectorVector() { std::vector<std::vector<std::string> > data; std::istringstream in( "A|B|C\n" "Hello|World|\n" "34|67|\"23\"\n" "col1|'col2'|col3\n"); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "34"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "67"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], "23"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][0], "col1"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][1], "col2"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][2], "col3"); } void testVectorVectorNoTitle() { std::vector<std::vector<std::string> > data; std::istringstream in( "Hello|World|\n" "34|67|\"23\"\n" "col1|'col2'|col3\n"); cxxtools::CsvDeserializer deserializer(in); deserializer.readTitle(false); deserializer.delimiter('|'); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "34"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "67"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], "23"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][0], "col1"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][1], "col2"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][2], "col3"); } void testIntVector() { std::vector<std::vector<int> > data; std::istringstream in( "A|B|C\n" "12|'23'|0\n" "34|67|\"23\""); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], 12); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], 23); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][2], 0); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], 34); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], 67); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], 23); } void testObjectVector() { std::vector<TestObject> data; std::istringstream in( "intValue\tstringValue\tdoubleValue\n" "17\t'Hi'\t2.5\n" "-6\tFoo\t-1000"); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].stringValue, "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].doubleValue, 2.5); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].intValue, -6); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].stringValue, "Foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].doubleValue, -1000); } void testMissingColumn() { std::vector<std::vector<std::string> > data; std::istringstream in( "A|B|C\n" "Hello|World\n" "34|67|\"23\"|someValue\n" "col1|'col2'|col3\n"); cxxtools::CsvDeserializer deserializer(in); CXXTOOLS_UNIT_ASSERT_THROW(deserializer.deserialize(data), std::exception); } void testTooManyColumns() { std::vector<std::vector<std::string> > data; std::istringstream in( "A|B|C\n" "Hello|World|blah\n" "34|67|\"23\"|someValue\n" "col1|'col2'|col3|col4"); cxxtools::CsvDeserializer deserializer(in); CXXTOOLS_UNIT_ASSERT_THROW(deserializer.deserialize(data), std::exception); } void testCr() { std::vector<std::vector<std::string> > data; std::istringstream in( "A|B|C\r\n" "Hello|World|\r" "34|67|\"23\"\n" "col1|'col2'|col3\r\n"); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], "34"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], "67"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], "23"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][0], "col1"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][1], "col2"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2][2], "col3"); } void testEmptyLines() { std::vector<std::vector<std::string> > data; std::istringstream in( "A;B;C\n" ";;\n" ";;\n"); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][2], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], ""); } void testSingleColumn() { std::vector<std::vector<std::string> > data; std::istringstream in( "A\n" "1\n" "2\n" "\n"); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2].size(), 1); } void testSetDelimiter() { std::vector<std::vector<int> > data; std::istringstream in( "A;|B|C\n" "12|'23'|0\n" "34|67|\"23\""); cxxtools::CsvDeserializer deserializer(in); deserializer.delimiter('|'); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][0], 12); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][1], 23); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0][2], 0); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][0], 34); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][1], 67); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1][2], 23); } void testQuotedTitle() { std::vector<TestObject> data; std::istringstream in( "\"intValue\",'stringValue',\"doubleValue\"\n" "17,'Hi',2.5\n" "-6,Foo,-1000"); cxxtools::CsvDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].stringValue, "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0].doubleValue, 2.5); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].intValue, -6); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].stringValue, "Foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1].doubleValue, -1000); } void testFailDecoding() { std::vector<std::vector<std::string> > data; std::istringstream in( "A\xff|B|C\n"); cxxtools::CsvDeserializer deserializer(in); CXXTOOLS_UNIT_ASSERT_THROW(deserializer.deserialize(data), std::exception); } }; cxxtools::unit::RegisterTest<CsvDeserializerTest> register_CsvDeserializerTest; ��������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/regex-test.cpp������������������������������������������������������������������0000664�0001750�0001750�00000005653�12266277345�014123� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/regex.h" class RegexTest : public cxxtools::unit::TestSuite { public: RegexTest() : cxxtools::unit::TestSuite("regex") { registerMethod("testRegex", *this, &RegexTest::testRegex); registerMethod("testSubexpression", *this, &RegexTest::testSubexpression); registerMethod("testEmptyRegex", *this, &RegexTest::testEmptyRegex); } void testRegex() { cxxtools::Regex r("^hel*o"); CXXTOOLS_UNIT_ASSERT(r.match("hello world")); CXXTOOLS_UNIT_ASSERT(!r.match(" hello world")); CXXTOOLS_UNIT_ASSERT(r.match("hellllo world")); CXXTOOLS_UNIT_ASSERT(r.match("heo world")); } void testSubexpression() { cxxtools::Regex r("([0-9]+)\\.([0-9]+)"); cxxtools::RegexSMatch s; CXXTOOLS_UNIT_ASSERT(r.match("hello 6.7 world", s)); CXXTOOLS_UNIT_ASSERT_EQUALS(s.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(s[0], "6.7"); CXXTOOLS_UNIT_ASSERT_EQUALS(s[1], "6"); CXXTOOLS_UNIT_ASSERT_EQUALS(s[2], "7"); } void testEmptyRegex() { cxxtools::Regex r(""); CXXTOOLS_UNIT_ASSERT(r.match("hello world")); CXXTOOLS_UNIT_ASSERT(r.match(" hello world")); CXXTOOLS_UNIT_ASSERT(r.match("hellllo world")); CXXTOOLS_UNIT_ASSERT(r.match("heo world")); } }; cxxtools::unit::RegisterTest<RegexTest> register_RegexTest; �������������������������������������������������������������������������������������cxxtools-2.2.1/test/base64-test.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000016076�12256773774�014104� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include "cxxtools/base64stream.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class Base64Test : public cxxtools::unit::TestSuite { static std::string encodeDecode(const std::string& data) { return cxxtools::decode<cxxtools::Base64Codec>( cxxtools::encode<cxxtools::Base64Codec>(data)); } public: Base64Test() : cxxtools::unit::TestSuite("base64") { registerMethod("encodeTest0", *this, &Base64Test::encodeTest0); registerMethod("encodeTest1", *this, &Base64Test::encodeTest1); registerMethod("encodeTest2", *this, &Base64Test::encodeTest2); registerMethod("encodeStreamTest0", *this, &Base64Test::encodeStreamTest0); registerMethod("encodeStreamTest1", *this, &Base64Test::encodeStreamTest1); registerMethod("encodeStreamTest2", *this, &Base64Test::encodeStreamTest2); registerMethod("encodeDecodeTest", *this, &Base64Test::encodeDecodeTest); registerMethod("binaryTest", *this, &Base64Test::binaryTest); } void encodeTest0() { std::string b64 = cxxtools::encode<cxxtools::Base64Codec>("123456789"); CXXTOOLS_UNIT_ASSERT_EQUALS(b64, "MTIzNDU2Nzg5"); } void encodeTest1() { std::string b64 = cxxtools::encode<cxxtools::Base64Codec>("1234567890"); CXXTOOLS_UNIT_ASSERT_EQUALS(b64, "MTIzNDU2Nzg5MA=="); } void encodeTest2() { std::string b64 = cxxtools::encode<cxxtools::Base64Codec>("12345678901"); CXXTOOLS_UNIT_ASSERT_EQUALS(b64, "MTIzNDU2Nzg5MDE="); } void encodeStreamTest0() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder << "123456789"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg5"); } void encodeStreamTest1() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder << "1234567890"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg5MA=="); } void encodeStreamTest2() { std::ostringstream s; cxxtools::Base64ostream encoder(s); encoder << "12345678901"; encoder.terminate(); CXXTOOLS_UNIT_ASSERT_EQUALS(s.str(), "MTIzNDU2Nzg5MDE="); } void encodeDecodeTest() { std::string data; for (unsigned n = 0; n < 100; ++n) { data += static_cast<char>('0' + n%10); for (char c = 'A'; c <= 'Z'; ++c) data += c; data += '\n'; } std::string data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); } void binaryTest() { std::string data2; std::string data; data.assign("\xff\xd8\xff\xe0\x00\x10\x4a\x46\x00\x01\x01\x00\x48", 16); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xef\xfe\xff\xca", 4); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xef\xfe\xff\xca\xea", 5); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xef\xfe\xff\xca\xea\xcc", 6); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); data.assign("\xff\xd8\xff\xe0\x0\x10\x4a\x46\x49\x46" "\x0\x1\x1\x1\x0\x48\x0\x48\x0\x0" "\xff\xfe\x0\xd\x4c\x61\x76\x63\x35\x33" "\x2e\x34\x32\x2e\x34\xff\xdb\x0\x43\x0" "\x5\x3\x4\x4\x4\x3\x5\x4\x4\x4" "\x5\x5\x5\x6\x7\xc\x8\x7\x7\x7" "\x7\xf\xb\xb\x9\xc\x11\xf\x12\x12" "\x11\xf\x11\x11\x13\x16\x1c\x17\x13\x14" "\x1a\x15\x11\x11\x18\x21\x18\x1a\x1d\x1d" "\x1f\x1f\x1f\x13\x17\x22\x24\x22\x1e\x24" "\x1c\x1e\x1f\x1e\xff\xdb\x0\x43\x1\x5" "\x5\x5\x7\x6\x7\xe\x8\x8\xe\x1e" "\x14\x11\x14\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" "\x1e\x1e\x1e\xff\xc0\x0\x11\x8\x0\x12" "\x0\x17\x3\x1\x22\x0\x2\x11\x1\x3" "\x11\x1\xff\xc4\x0\x18\x0\x1\x1\x1" "\x1\x1\x0\x0\x0\x0\x0\x0\x0\x0" "\x0\x0\x0\x0\x2\x4\x3\x7\xff\xc4" "\x0\x21\x10\x0\x1\x4\x1\x3\x5\x0" "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" "\x1\x2\x3\x12\x21\x4\x11\x22\x13\x31" "\x32\x42\x43\xff\xc4\x0\x17\x1\x1\x1" "\x1\x1\x0\x0\x0\x0\x0\x0\x0\x0" "\x0\x0\x0\x0\x0\x2\x1\x4\xff\xc4" "\x0\x15\x11\x1\x1\x0\x0\x0\x0\x0" "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" "\x11\xff\xda\x0\xc\x3\x1\x0\x2\x11" "\x3\x11\x0\x3f\x0\xf4\x5e\xad\x79\x6d" "\x9f\x53\x2b\xe5\xce\x6a\x44\xee\xcb\x50" "\x9a\xdd\x76\x79\xd3\x5\x49\xa9\x8d\xa9" "\xe7\xc8\x13\x2c\x51\xba\xb8\x6\xd\x33" "\x22\x1c\x7e\xcc\x0\xa0\x7f\x60\x1\x23" "\xff\xd9", 362); data2 = encodeDecode(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, data2); } }; cxxtools::unit::RegisterTest<Base64Test> register_Base64Test; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/jsonserializer-test.cpp���������������������������������������������������������0000664�0001750�0001750�00000017445�12256773774�016064� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/jsonserializer.h" namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; TestObject() : intValue(0), doubleValue(0), boolValue(false) { } }; inline void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); } } class JsonSerializerTest : public cxxtools::unit::TestSuite { public: JsonSerializerTest() : cxxtools::unit::TestSuite("jsonserializer") { registerMethod("testInt", *this, &JsonSerializerTest::testInt); registerMethod("testObject", *this, &JsonSerializerTest::testObject); registerMethod("testArray", *this, &JsonSerializerTest::testArray); registerMethod("testEmptyArrays", *this, &JsonSerializerTest::testEmptyArrays); registerMethod("testString", *this, &JsonSerializerTest::testString); registerMethod("testPlainInt", *this, &JsonSerializerTest::testPlainInt); registerMethod("testPlainObject", *this, &JsonSerializerTest::testPlainObject); registerMethod("testPlainArray", *this, &JsonSerializerTest::testPlainArray); registerMethod("testPlainString", *this, &JsonSerializerTest::testPlainString); registerMethod("testMultipleObjects", *this, &JsonSerializerTest::testMultipleObjects); registerMethod("testPlainEmpty", *this, &JsonSerializerTest::testPlainEmpty); registerMethod("testEmptyObject", *this, &JsonSerializerTest::testEmptyObject); } void testInt() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(-4711, "value").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"value\":-4711}"); } void testObject() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "testObject").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"testObject\":{" "\"intValue\":17," "\"stringValue\":\"foobar\"," "\"doubleValue\":1.5," "\"boolValue\":false," "\"nullValue\":null" "}}"); } void testArray() { std::vector<int> data; data.push_back(3); data.push_back(4); data.push_back(-33); std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "array").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"array\":[3,4,-33]}"); } void testEmptyArrays() { std::vector< std::vector<int> > data; data.resize(2); std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "[[],[]]"); } void testString() { cxxtools::String data; data = L"hi\xc3a4\xc3b6\xc3bc"; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data, "str").finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"str\":\"hi\\uc3a4\\uc3b6\\uc3bc\"}"); } void testPlainInt() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(-4711).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "-4711"); } void testPlainObject() { TestObject data; data.intValue = 17; data.stringValue = "foobar"; data.doubleValue = 1.5; data.boolValue = false; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{" "\"intValue\":17," "\"stringValue\":\"foobar\"," "\"doubleValue\":1.5," "\"boolValue\":false," "\"nullValue\":null" "}"); } void testPlainArray() { std::vector<int> data; data.push_back(3); data.push_back(4); data.push_back(-33); std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "[3,4,-33]"); } void testPlainString() { cxxtools::String data; data = L"hi\xc3a4\xc3b6\xc3bc"; std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize(data).finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "\"hi\\uc3a4\\uc3b6\\uc3bc\""); } void testMultipleObjects() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.serialize("Hi", "a") .serialize(42, "b") .finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{\"a\":\"Hi\",\"b\":42}"); } void testPlainEmpty() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), ""); } void testEmptyObject() { std::ostringstream out; cxxtools::JsonSerializer serializer(out); serializer.setObject(); serializer.finish(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "{}"); } }; cxxtools::unit::RegisterTest<JsonSerializerTest> register_JsonSerializerTest; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/jsonrpchttp-test.cpp������������������������������������������������������������0000664�0001750�0001750�00000054311�12266277345�015362� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/json/httpservice.h" #include "cxxtools/json/httpclient.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/http/server.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include <stdlib.h> #include <sstream> log_define("cxxtools.test.jsonrpchttp") namespace { struct Color { int red; int green; int blue; }; typedef std::set<int> IntSet; typedef std::multiset<int> IntMultiset; typedef std::map<int, int> IntMap; typedef std::multimap<int, int> IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class JsonRpcHttpTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::http::Server* _server; unsigned _count; unsigned short _port; public: JsonRpcHttpTest() : cxxtools::unit::TestSuite("jsonrpchttp"), _port(8001) { registerMethod("Nothing", *this, &JsonRpcHttpTest::Nothing); registerMethod("Boolean", *this, &JsonRpcHttpTest::Boolean); registerMethod("Integer", *this, &JsonRpcHttpTest::Integer); registerMethod("Double", *this, &JsonRpcHttpTest::Double); registerMethod("String", *this, &JsonRpcHttpTest::String); registerMethod("EmptyValues", *this, &JsonRpcHttpTest::EmptyValues); registerMethod("Array", *this, &JsonRpcHttpTest::Array); registerMethod("EmptyArray", *this, &JsonRpcHttpTest::EmptyArray); registerMethod("Struct", *this, &JsonRpcHttpTest::Struct); registerMethod("Set", *this, &JsonRpcHttpTest::Set); registerMethod("Multiset", *this, &JsonRpcHttpTest::Multiset); registerMethod("Map", *this, &JsonRpcHttpTest::Map); registerMethod("Multimap", *this, &JsonRpcHttpTest::Multimap); registerMethod("UnknownMethod", *this, &JsonRpcHttpTest::UnknownMethod); registerMethod("Fault", *this, &JsonRpcHttpTest::Fault); registerMethod("Exception", *this, &JsonRpcHttpTest::Exception); registerMethod("CallbackException", *this, &JsonRpcHttpTest::CallbackException); registerMethod("ConnectError", *this, &JsonRpcHttpTest::ConnectError); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &JsonRpcHttpTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _server = new cxxtools::http::Server(_loop, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyNothing); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyNothing); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcHttpTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(const cxxtools::RemoteResult<bool>& r) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::json::HttpClient client(_loop, "", _port + 1, "/calc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcHttpTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(const cxxtools::RemoteResult<bool>& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyBoolean); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<bool, bool, bool> multiply(client, "multiply"); multiply.begin(true, true); bool r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r, true); } bool multiplyBoolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyInt); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyDouble); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<double, double, double> multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { cxxtools::json::HttpService service; service.registerMethod("echoString", *this, &JsonRpcHttpTest::echoString); _server->addService("/foo", service); cxxtools::json::HttpClient client(_loop, "", _port, "/foo"); cxxtools::RemoteProcedure<std::string, std::string> echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyEmpty); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<std::string, std::string, std::string> multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyVector); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector<int> r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector<int> multiplyVector(const std::vector<int>& a, const std::vector<int>& b) { std::vector<int> r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyVector); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::multiplyColor); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { cxxtools::json::HttpService service; service.registerMethod("multiplyset", *this, &JsonRpcHttpTest::multiplySet); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntSet, IntSet, int> multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { cxxtools::json::HttpService service; service.registerMethod("multiplyset", *this, &JsonRpcHttpTest::multiplyMultiset); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMultiset, IntMultiset, int> multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { cxxtools::json::HttpService service; service.registerMethod("multiplymap", *this, &JsonRpcHttpTest::multiplyMap); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMap, IntMap, int> multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { cxxtools::json::HttpService service; service.registerMethod("multiplymultimap", *this, &JsonRpcHttpTest::multiplyMultimap); _server->addService("/test", service); cxxtools::json::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMultimap, IntMultimap, int> multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // UnknownMethod // void UnknownMethod() { cxxtools::json::HttpClient client(_loop, "", _port, "/test"); cxxtools::json::HttpService service; _server->addService("/test", service); cxxtools::RemoteProcedure<bool, bool, bool> unknownMethod(client, "unknownMethod"); unknownMethod.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::throwFault); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { cxxtools::json::HttpService service; service.registerMethod("multiply", *this, &JsonRpcHttpTest::throwException); _server->addService("/calc", service); cxxtools::json::HttpClient client(_loop, "", _port, "/calc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } }; cxxtools::unit::RegisterTest<JsonRpcHttpTest> register_JsonRpcHttpTest; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/jsonrpc-test.cpp����������������������������������������������������������������0000664�0001750�0001750�00000053220�12266277345�014460� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/json/rpcclient.h" #include "cxxtools/json/rpcserver.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include <stdlib.h> #include <sstream> log_define("cxxtools.test.jsonrpc") namespace { struct Color { int red; int green; int blue; }; typedef std::set<int> IntSet; typedef std::multiset<int> IntMultiset; typedef std::map<int, int> IntMap; typedef std::multimap<int, int> IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class JsonRpcTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::json::RpcServer* _server; unsigned _count; unsigned short _port; public: JsonRpcTest() : cxxtools::unit::TestSuite("jsonrpc"), _port(7003) { registerMethod("Nothing", *this, &JsonRpcTest::Nothing); registerMethod("Boolean", *this, &JsonRpcTest::Boolean); registerMethod("Integer", *this, &JsonRpcTest::Integer); registerMethod("Double", *this, &JsonRpcTest::Double); registerMethod("String", *this, &JsonRpcTest::String); registerMethod("EmptyValues", *this, &JsonRpcTest::EmptyValues); registerMethod("Array", *this, &JsonRpcTest::Array); registerMethod("EmptyArray", *this, &JsonRpcTest::EmptyArray); registerMethod("Struct", *this, &JsonRpcTest::Struct); registerMethod("Set", *this, &JsonRpcTest::Set); registerMethod("Multiset", *this, &JsonRpcTest::Multiset); registerMethod("Map", *this, &JsonRpcTest::Map); registerMethod("Multimap", *this, &JsonRpcTest::Multimap); registerMethod("UnknownMethod", *this, &JsonRpcTest::UnknownMethod); registerMethod("CallPrefix", *this, &JsonRpcTest::CallPrefix); registerMethod("Fault", *this, &JsonRpcTest::Fault); registerMethod("Exception", *this, &JsonRpcTest::Exception); registerMethod("CallbackException", *this, &JsonRpcTest::CallbackException); registerMethod("ConnectError", *this, &JsonRpcTest::ConnectError); registerMethod("BigRequest", *this, &JsonRpcTest::BigRequest); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &JsonRpcTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); _server = new cxxtools::json::RpcServer(_loop, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyNothing); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyNothing); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(const cxxtools::RemoteResult<bool>& r) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::json::RpcClient client(_loop, "", _port + 1); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &JsonRpcTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(const cxxtools::RemoteResult<bool>& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { _server->registerMethod("boolean", *this, &JsonRpcTest::boolean); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool, bool, bool> multiply(client, "boolean"); multiply.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), true); } bool boolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyInt); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyDouble); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<double, double, double> multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { _server->registerMethod("echoString", *this, &JsonRpcTest::echoString); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<std::string, std::string> echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyEmpty); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<std::string, std::string, std::string> multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyVector); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector<int> r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector<int> multiplyVector(const std::vector<int>& a, const std::vector<int>& b) { std::vector<int> r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyVector); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { _server->registerMethod("multiply", *this, &JsonRpcTest::multiplyColor); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { _server->registerMethod("multiplyset", *this, &JsonRpcTest::multiplySet); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntSet, IntSet, int> multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { _server->registerMethod("multiplyset", *this, &JsonRpcTest::multiplyMultiset); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntMultiset, IntMultiset, int> multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { _server->registerMethod("multiplymap", *this, &JsonRpcTest::multiplyMap); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntMap, IntMap, int> multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { _server->registerMethod("multiplymultimap", *this, &JsonRpcTest::multiplyMultimap); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntMultimap, IntMultimap, int> multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // CallPrefix // void CallPrefix() { _server->registerMethod("somePrefix.multiply", *this, &JsonRpcTest::multiplyInt); cxxtools::json::RpcClient client(_loop, "", _port); client.prefix("somePrefix."); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } void UnknownMethod() { cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> unknownMethod(client, "unknownMethod"); unknownMethod.begin(); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { _server->registerMethod("multiply", *this, &JsonRpcTest::throwFault); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { _server->registerMethod("multiply", *this, &JsonRpcTest::throwException); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { log_trace("ConnectError"); _server->registerMethod("countSize", *this, &JsonRpcTest::countSize); cxxtools::json::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<unsigned, std::vector<int> > countSize(client, "countSize"); std::vector<int> v; v.resize(5000); countSize.begin(v); try { countSize.end(2000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector<int>& v) { return v.size(); } }; cxxtools::unit::RegisterTest<JsonRpcTest> register_JsonRpcTest; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/query_params-test.cpp�����������������������������������������������������������0000664�0001750�0001750�00000015275�12256775511�015517� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/query_params.h" class QueryParamsTest : public cxxtools::unit::TestSuite { public: QueryParamsTest() : cxxtools::unit::TestSuite("queryparams") { registerMethod("testQueryParams", *this, &QueryParamsTest::testQueryParams); registerMethod("testCopy", *this, &QueryParamsTest::testCopy); registerMethod("testParseUrl", *this, &QueryParamsTest::testParseUrl); registerMethod("testParseUrlSpecialChar", *this, &QueryParamsTest::testParseUrlSpecialChar); registerMethod("testParseDoublePercent", *this, &QueryParamsTest::testParseDoublePercent); registerMethod("testCount", *this, &QueryParamsTest::testCount); registerMethod("testCombine", *this, &QueryParamsTest::testCombine); registerMethod("testIterator", *this, &QueryParamsTest::testIterator); registerMethod("testGetUrl", *this, &QueryParamsTest::testGetUrl); } void testQueryParams() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("value3"); CXXTOOLS_UNIT_ASSERT(q.has("p1")); CXXTOOLS_UNIT_ASSERT(q.has("p2")); CXXTOOLS_UNIT_ASSERT(!q.has("p3")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p1"], "value1"); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p2"], "value2"); CXXTOOLS_UNIT_ASSERT_EQUALS(q[0], "value3"); } void testCopy() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("value3"); cxxtools::QueryParams q2 = q; CXXTOOLS_UNIT_ASSERT(q2.has("p1")); CXXTOOLS_UNIT_ASSERT(q2.has("p2")); CXXTOOLS_UNIT_ASSERT(!q2.has("p3")); CXXTOOLS_UNIT_ASSERT_EQUALS(q2["p1"], "value1"); CXXTOOLS_UNIT_ASSERT_EQUALS(q2["p2"], "value2"); CXXTOOLS_UNIT_ASSERT_EQUALS(q2[0], "value3"); } void testParseUrl() { cxxtools::QueryParams q; q.parse_url("p2=value2&value3&p1=value1"); CXXTOOLS_UNIT_ASSERT(q.has("p1")); CXXTOOLS_UNIT_ASSERT(q.has("p2")); CXXTOOLS_UNIT_ASSERT(!q.has("p3")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p1"], "value1"); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p2"], "value2"); CXXTOOLS_UNIT_ASSERT_EQUALS(q[0], "value3"); } void testParseUrlSpecialChar() { cxxtools::QueryParams q; q.parse_url("p1=value+with%20spaces&m%a4kitalo=tommi+"); CXXTOOLS_UNIT_ASSERT(q.has("p1")); CXXTOOLS_UNIT_ASSERT(q.has("m\xa4kitalo")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["p1"], "value with spaces"); CXXTOOLS_UNIT_ASSERT_EQUALS(q["m\xa4kitalo"], "tommi "); } void testParseDoublePercent() { cxxtools::QueryParams q; q.parse_url("%%=%%%"); CXXTOOLS_UNIT_ASSERT(q.has("%%")); CXXTOOLS_UNIT_ASSERT_EQUALS(q["%%"], "%%%"); } void testCount() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("p2", "value3"); q.add("value4"); q.add("value5"); CXXTOOLS_UNIT_ASSERT_EQUALS(q.paramcount(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(q.paramcount("p1"), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(q.paramcount("p2"), 2); } void testCombine() { cxxtools::QueryParams q; cxxtools::QueryParams q2; q.add("p1", "value1"); q2.add("p2", "value2"); q2.add("value3"); q.add(q2); } void testIterator() { cxxtools::QueryParams q; q.add("p1", "value1"); q.add("p2", "value2"); q.add("p2", "value3"); q.add("value4"); q.add("value5"); cxxtools::QueryParams::const_iterator it; it = q.begin(); CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value4"); ++it; CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value5"); ++it; CXXTOOLS_UNIT_ASSERT(it == q.end()); it = q.begin("p1"); CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value1"); ++it; CXXTOOLS_UNIT_ASSERT(it == q.end()); it = q.begin("p2"); CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value2"); ++it; CXXTOOLS_UNIT_ASSERT(it != q.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(*it, "value3"); ++it; CXXTOOLS_UNIT_ASSERT(it == q.end()); } void testGetUrl() { cxxtools::QueryParams q; q.add("first name", "Tommi"); q.add("last name", "M\xa4kitalo"); q.add("some value"); std::string url = q.getUrl(); CXXTOOLS_UNIT_ASSERT_EQUALS(url, "first+name=Tommi&last+name=M%A4kitalo&some+value"); } }; cxxtools::unit::RegisterTest<QueryParamsTest> register_QueryParamsTest; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/convert-test.cpp����������������������������������������������������������������0000664�0001750�0001750�00000023602�12256773774�014471� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/convert.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" #include "cxxtools/log.h" #include <limits> #include <string.h> log_define("cxxtools.test.convert") namespace { bool nearBy(double v1, double v2, double e = 1e-6) { double q = v1 / v2; return q > 1 - e && q < 1 + e; } } class ConvertTest : public cxxtools::unit::TestSuite { public: ConvertTest() : cxxtools::unit::TestSuite("convert") { registerMethod("successTest", *this, &ConvertTest::successTest); registerMethod("failTest", *this, &ConvertTest::failTest); registerMethod("nanTest", *this, &ConvertTest::nanTest); registerMethod("infTest", *this, &ConvertTest::infTest); registerMethod("emptyTest", *this, &ConvertTest::emptyTest); registerMethod("floatTest", *this, &ConvertTest::floatTest); } void successTest() { std::string s(" -15 "); int n = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(n = cxxtools::convert<int>(s)); CXXTOOLS_UNIT_ASSERT_EQUALS(n, -15); cxxtools::String S(L" -42 "); CXXTOOLS_UNIT_ASSERT_NOTHROW(n = cxxtools::convert<int>(S)); CXXTOOLS_UNIT_ASSERT_EQUALS(n, -42); } void failTest() { std::string s(" -15 a"); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<int>(s), cxxtools::ConversionError); cxxtools::String S(L" -42 a"); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<int>(S), cxxtools::ConversionError); } void nanTest() { // test string to number // test nan double d = cxxtools::convert<double>(std::string("NaN")); CXXTOOLS_UNIT_ASSERT(d != d); float f = cxxtools::convert<float>(std::string("NaN")); CXXTOOLS_UNIT_ASSERT(f != f); d = cxxtools::convert<double>(cxxtools::String(L"NaN")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert<float>(cxxtools::String(L"NaN")); CXXTOOLS_UNIT_ASSERT(f != f); // test quiet nan d = cxxtools::convert<double>(std::string("NaNQ")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert<float>(std::string("NaNQ")); CXXTOOLS_UNIT_ASSERT(f != f); d = cxxtools::convert<double>(cxxtools::String(L"NaNQ")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert<float>(cxxtools::String(L"NaNQ")); CXXTOOLS_UNIT_ASSERT(f != f); // test signaling nan d = cxxtools::convert<double>(std::string("NaNS")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert<float>(std::string("NaNS")); CXXTOOLS_UNIT_ASSERT(f != f); d = cxxtools::convert<double>(cxxtools::String(L"NaNS")); CXXTOOLS_UNIT_ASSERT(d != d); f = cxxtools::convert<float>(cxxtools::String(L"NaNS")); CXXTOOLS_UNIT_ASSERT(f != f); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<float>(cxxtools::String(L"NaNF")), cxxtools::ConversionError); // test number to string std::string s = cxxtools::convert<std::string>(d); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "nan"); s = cxxtools::convert<std::string>(f); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "nan"); cxxtools::String ss = cxxtools::convert<cxxtools::String>(d); CXXTOOLS_UNIT_ASSERT_EQUALS(ss.narrow(), "nan"); ss = cxxtools::convert<cxxtools::String>(f); CXXTOOLS_UNIT_ASSERT_EQUALS(ss.narrow(), "nan"); } void infTest() { // test string to number double d = cxxtools::convert<double>(std::string("inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits<double>::infinity()); d = cxxtools::convert<double>(std::string("infinity")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits<double>::infinity()); float f = cxxtools::convert<float>(std::string("inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits<float>::infinity()); d = cxxtools::convert<double>(cxxtools::String(L"iNf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits<double>::infinity()); f = cxxtools::convert<float>(cxxtools::String(L"inF")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, std::numeric_limits<float>::infinity()); // test number to string std::string s = cxxtools::convert<std::string>(d); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "inf"); s = cxxtools::convert<std::string>(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(s.c_str(), "inf") == 0); cxxtools::String ss = cxxtools::convert<cxxtools::String>(d); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "inf") == 0); ss = cxxtools::convert<cxxtools::String>(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "inf") == 0); // negative inf // string to number d = cxxtools::convert<double>(std::string("-inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits<double>::infinity()); f = cxxtools::convert<float>(std::string("-inf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits<float>::infinity()); d = cxxtools::convert<double>(cxxtools::String(L"-iNf")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits<double>::infinity()); f = cxxtools::convert<float>(cxxtools::String(L"-INF")); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -std::numeric_limits<float>::infinity()); // test number to string s = cxxtools::convert<std::string>(d); CXXTOOLS_UNIT_ASSERT_EQUALS(s, "-inf"); s = cxxtools::convert<std::string>(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(s.c_str(), "-inf") == 0); ss = cxxtools::convert<cxxtools::String>(d); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "-inf") == 0); ss = cxxtools::convert<cxxtools::String>(f); CXXTOOLS_UNIT_ASSERT(strcasecmp(ss.narrow().c_str(), "-inf") == 0); } void emptyTest() { std::string emptyString; CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<int>(std::string()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<int>(cxxtools::String()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<unsigned>(std::string()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<unsigned>(cxxtools::String()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<double>(std::string()), cxxtools::ConversionError); CXXTOOLS_UNIT_ASSERT_THROW(cxxtools::convert<double>(cxxtools::String()), cxxtools::ConversionError); } void t(double d) { std::string s = cxxtools::convert<std::string>(d); double r = cxxtools::convert<double>(s); if (r == 0) { CXXTOOLS_UNIT_ASSERT_EQUALS(d, 0); } else { double q = d / r; log_debug("d=" << d << " s=\"" << s << "\" r=" << r << " q=" << q); if (q < 0.999999999999 || q > 1.0000000000001) { CXXTOOLS_UNIT_ASSERT_EQUALS(d, r); } } } void floatTest() { double d; d = cxxtools::convert<double>("1.5"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 1.5); d = cxxtools::convert<double>(" -345.75 "); CXXTOOLS_UNIT_ASSERT_EQUALS(d, -345.75); d = cxxtools::convert<double>("\n1e6\r"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 1e6); d = cxxtools::convert<double>("7.0e4"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 7e4); d = cxxtools::convert<double>("-2e-3"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -2e-3)); d = cxxtools::convert<double>("-8E-5"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -8e-5)); d = cxxtools::convert<double>("-3.0e-12"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -3e-12)); d = cxxtools::convert<double>("-8.5E-23"); CXXTOOLS_UNIT_ASSERT(nearBy(d, -8.5e-23)); t(3.141592653579893); t(0.314); t(0.0314); t(0.00123); t(123456789.55555555); t(0); t(1); t(1.4567e17); t(12345); t(1.4567e-17); t(0.2); t(12); } }; cxxtools::unit::RegisterTest<ConvertTest> register_ConvertTest; ������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/properties-test.cpp�������������������������������������������������������������0000664�0001750�0001750�00000020314�12266277345�015174� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/xml/xmlserializer.h" #include "cxxtools/properties.h" #include "cxxtools/propertiesdeserializer.h" namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue; } } class PropertiesTest : public cxxtools::unit::TestSuite { public: PropertiesTest() : cxxtools::unit::TestSuite("properties") { registerMethod("testProperties", *this, &PropertiesTest::testProperties); registerMethod("testFailProperties", *this, &PropertiesTest::testFailProperties); registerMethod("testScalar", *this, &PropertiesTest::testScalar); registerMethod("testStruct", *this, &PropertiesTest::testStruct); registerMethod("testVector", *this, &PropertiesTest::testVector); registerMethod("testMember", *this, &PropertiesTest::testMember); } void testProperties() { std::istringstream data( "a\\ b = 42\n" "b=\\u9\\r\\n\\t\n" "\\ufoo =Hi there\n" "l=Hi\\\n" "there\n" "c=\\uabc\\5\\u0000abCD1\\u1234"); cxxtools::PropertiesDeserializer deserializer(data); // the first call to the deserialize method will parse the input // and create a SerializationInfo object int v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(v, "a b")); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 42); CXXTOOLS_UNIT_ASSERT_THROW(deserializer.deserialize(v, "a b "), cxxtools::SerializationError); cxxtools::String b; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(b, "b")); CXXTOOLS_UNIT_ASSERT_EQUALS(b, "\t\r\n\t"); cxxtools::String c; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(c, "c")); CXXTOOLS_UNIT_ASSERT_EQUALS(c.size(), 5); CXXTOOLS_UNIT_ASSERT_EQUALS(c[0].value(), 0xabc); CXXTOOLS_UNIT_ASSERT_EQUALS(c[1], '5'); CXXTOOLS_UNIT_ASSERT_EQUALS(c[2].value(), 0xabcd); CXXTOOLS_UNIT_ASSERT_EQUALS(c[3], '1'); CXXTOOLS_UNIT_ASSERT_EQUALS(c[4].value(), 0x1234); cxxtools::String l; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(l, "l")); CXXTOOLS_UNIT_ASSERT_EQUALS(l, "Hi\nthere"); cxxtools::String f; CXXTOOLS_UNIT_ASSERT_NOTHROW(deserializer.deserialize(f, "\x0foo")); CXXTOOLS_UNIT_ASSERT_EQUALS(f, "Hi there"); } void testFailProperties() { std::istringstream data( "ab = \\uz42\n"); cxxtools::PropertiesDeserializer deserializer(data); CXXTOOLS_UNIT_ASSERT_THROW(deserializer.deserialize(), cxxtools::PropertiesParserError); } void testScalar() { std::istringstream data( "rootlogger=I\n" "value.a=17\n" "a.b.c=3.25" ); cxxtools::PropertiesDeserializer deserializer(data); int value = 5; deserializer.deserialize(value, "value.a"); CXXTOOLS_UNIT_ASSERT_EQUALS(value, 17); double d = 0; deserializer.deserialize(d, "a.b.c"); CXXTOOLS_UNIT_ASSERT_EQUALS(d, 3.25); } void testStruct() { std::istringstream data( "s.foo.intValue=5\n" "s.foo.stringValue=Hi there\n" "s.foo.doubleValue=45.5\n" "s.foo.boolValue=true\n" ); cxxtools::PropertiesDeserializer deserializer(data); TestObject obj; deserializer.deserialize(obj, "s.foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, 5); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, "Hi there"); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, 45.5); CXXTOOLS_UNIT_ASSERT(obj.boolValue); } void testVector() { std::istringstream data( "myvector=4\n" "myvector=Hi\n" "myvector=foo\n" ); cxxtools::PropertiesDeserializer deserializer(data); std::vector<std::string> v; deserializer.deserialize(v, "myvector"); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(v[0], "4"); CXXTOOLS_UNIT_ASSERT_EQUALS(v[1], "Hi"); CXXTOOLS_UNIT_ASSERT_EQUALS(v[2], "foo"); } void testMember() { std::istringstream data( "a.b.c.d=5\n" "a.e.f.g=7\n"); cxxtools::PropertiesDeserializer deserializer(data); deserializer.deserialize(); const cxxtools::SerializationInfo& si = *deserializer.si(); int v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a").getMember("b.c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a.b").getMember("c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a.b.c").getMember("d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a.b.c.d") >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a").getMember(0) >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 5); v = 0; CXXTOOLS_UNIT_ASSERT_NOTHROW(si.getMember("a").getMember(1) >>= v); CXXTOOLS_UNIT_ASSERT_EQUALS(v, 7); } }; cxxtools::unit::RegisterTest<PropertiesTest> register_PropertiesTest; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/Makefile.am���������������������������������������������������������������������0000664�0001750�0001750�00000004217�12266277345�013357� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_PROGRAMS = \ alltests \ serializer-bench \ rpcbenchclient \ rpcbenchserver AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include alltests_SOURCES = \ arg-test.cpp \ base64-test.cpp \ binrpc-test.cpp \ binserializer-test.cpp \ cache-test.cpp \ clock-test.cpp \ csvdeserializer-test.cpp \ csvserializer-test.cpp \ convert-test.cpp \ join-test.cpp \ json-test.cpp \ jsondeserializer-test.cpp \ jsonrpc-test.cpp \ jsonrpchttp-test.cpp \ jsonserializer-test.cpp \ lrucache-test.cpp \ md5-test.cpp \ pool-test.cpp \ properties-test.cpp \ query_params-test.cpp \ regex-test.cpp \ serializationinfo-test.cpp \ smartptr-test.cpp \ split-test.cpp \ string-test.cpp \ test-main.cpp \ trim-test.cpp \ uri-test.cpp \ xmlreader-test.cpp \ xmlrpc-test.cpp \ xmlrpccallback-test.cpp \ xmlserializer-test.cpp if MAKE_ICONVSTREAM alltests_SOURCES += \ iconvstream-test.cpp endif alltests_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la \ $(top_builddir)/src/unit/libcxxtools-unit.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la serializer_bench_SOURCES = serializer-bench.cpp serializer_bench_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la rpcbenchclient_SOURCES = rpcbenchclient.cpp rpcbenchclient_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la rpcbenchserver_SOURCES = rpcbenchserver.cpp rpcbenchserver_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/split-test.cpp������������������������������������������������������������������0000664�0001750�0001750�00000007716�12256773774�014154� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/split.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include <iterator> class SplitTest : public cxxtools::unit::TestSuite { public: SplitTest() : cxxtools::unit::TestSuite("split") { registerMethod("splitString", *this, &SplitTest::splitString); registerMethod("emptySplit", *this, &SplitTest::emptySplit); registerMethod("lastEmpty", *this, &SplitTest::lastEmpty); registerMethod("charsetSplit", *this, &SplitTest::charsetSplit); registerMethod("regexSplit", *this, &SplitTest::regexSplit); registerMethod("regexEmptySplit", *this, &SplitTest::regexEmptySplit); } void splitString() { std::vector<std::string> d; std::string t = "Hello:World:!"; cxxtools::split(':', t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], "!"); } void emptySplit() { std::vector<std::string> d; std::string t; cxxtools::split(':', t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], ""); } void lastEmpty() { std::vector<std::string> d; std::string t = "Hello:World:"; cxxtools::split(':', t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], ""); } void charsetSplit() { std::vector<std::string> d; std::string t = "Hello:World;!"; cxxtools::split(";:,.", t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], "!"); } void regexSplit() { std::vector<std::string> d; std::string t = "Hello:World)!"; cxxtools::split(cxxtools::Regex("[:)]"), t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[1], "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(d[2], "!"); } void regexEmptySplit() { std::vector<std::string> d; std::string t; cxxtools::split(cxxtools::Regex("[:)]"), t, std::back_inserter(d)); CXXTOOLS_UNIT_ASSERT_EQUALS(d.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(d[0], ""); } }; cxxtools::unit::RegisterTest<SplitTest> register_SplitTest; ��������������������������������������������������cxxtools-2.2.1/test/binserializer-test.cpp����������������������������������������������������������0000664�0001750�0001750�00000035761�12256773774�015664� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/bin/serializer.h" #include "cxxtools/bin/deserializer.h" #include "cxxtools/log.h" #include "cxxtools/hdstream.h" #include <limits> #include <stdint.h> #include <config.h> log_define("cxxtools.test.binserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; const cxxtools::SerializationInfo* p = si.findMember("nullValue"); obj.nullValue = p != 0 && p->isNull(); } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue && obj1.nullValue == obj2.nullValue; } struct TestObject2 : public TestObject { typedef std::set<unsigned> SetType; typedef std::map<unsigned, std::string> MapType; SetType setValue; MapType mapValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast<TestObject&>(obj); si.getMember("setValue") >>= obj.setValue; si.getMember("mapValue") >>= obj.mapValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject2& obj) { si <<= static_cast<const TestObject&>(obj); si.addMember("setValue") <<= obj.setValue; si.addMember("mapValue") <<= obj.mapValue; si.setTypeName("TestObject2"); } bool operator== (const TestObject2& obj1, const TestObject2& obj2) { return static_cast<const TestObject&>(obj1) == static_cast<const TestObject&>(obj2) && obj1.setValue == obj2.setValue && obj1.mapValue == obj2.mapValue; } } class BinSerializerTest : public cxxtools::unit::TestSuite { public: BinSerializerTest() : cxxtools::unit::TestSuite("binserializer") { registerMethod("testScalar", *this, &BinSerializerTest::testScalar); registerMethod("testInt", *this, &BinSerializerTest::testInt); registerMethod("testDouble", *this, &BinSerializerTest::testDouble); registerMethod("testArray", *this, &BinSerializerTest::testArray); registerMethod("testObject", *this, &BinSerializerTest::testObject); registerMethod("testComplexObject", *this, &BinSerializerTest::testComplexObject); registerMethod("testObjectVector", *this, &BinSerializerTest::testObjectVector); registerMethod("testBinaryData", *this, &BinSerializerTest::testBinaryData); } void testScalar() { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); int value = 5; serializer.serialize(value); int value2 = 0; deserializer.deserialize(value2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, value2); } template <typename IntT> void testIntValue(IntT value) { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); serializer.serialize(value); log_debug("int: " << cxxtools::hexDump(data.str())); IntT result = 0; deserializer.deserialize(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } void testInt() { testIntValue(30); testIntValue(300); testIntValue(100000); testIntValue(-30); testIntValue(-300); testIntValue(-100000); testIntValue(static_cast<int16_t>(std::numeric_limits<int8_t>::max()) + 1); testIntValue(static_cast<int32_t>(std::numeric_limits<int16_t>::max()) + 1); testIntValue(std::numeric_limits<int32_t>::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1); testIntValue(std::numeric_limits<int64_t>::max()); #endif testIntValue(static_cast<int16_t>(std::numeric_limits<int8_t>::min()) - 1); testIntValue(static_cast<int32_t>(std::numeric_limits<int16_t>::min()) - 1); testIntValue(std::numeric_limits<int32_t>::min()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<int64_t>(std::numeric_limits<int32_t>::min()) - 1); testIntValue(std::numeric_limits<int64_t>::min()); #endif testIntValue(static_cast<uint16_t>(std::numeric_limits<uint8_t>::max()) + 1); testIntValue(static_cast<uint32_t>(std::numeric_limits<uint16_t>::max()) + 1); testIntValue(std::numeric_limits<uint32_t>::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<uint64_t>(std::numeric_limits<uint32_t>::max()) + 1); testIntValue(std::numeric_limits<uint64_t>::max()); #endif } void testDoubleValue(double value) { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); serializer.serialize(value); double result = 0.0; deserializer.deserialize(result); log_debug("test double value " << value << " => " << cxxtools::hexDump(data.str()) << " => " << result); if (value != value) // check for nan CXXTOOLS_UNIT_ASSERT(result != result); else if (value == std::numeric_limits<double>::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::numeric_limits<double>::infinity()); else if (value == -std::numeric_limits<double>::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, -std::numeric_limits<double>::infinity()); else if (value / result > 1.00001 || value / result < 0.99999) CXXTOOLS_UNIT_FAIL("double test failed; value " << value << " got " << result); } void testDouble() { testDoubleValue(0.0); testDoubleValue(1234.0); // short float testDoubleValue(-1234.0); // short float testDoubleValue(12345678.0); // medium float testDoubleValue(-12345678.0); // medium float testDoubleValue(123456789123456789.0); // long float testDoubleValue(-123456789123456789.0); // long float testDoubleValue(-3.877e-123); testDoubleValue(std::numeric_limits<double>::max()); //testDoubleValue(std::numeric_limits<double>::min()); testDoubleValue(std::numeric_limits<double>::infinity()); testDoubleValue(-std::numeric_limits<double>::infinity()); testDoubleValue(std::numeric_limits<double>::quiet_NaN()); std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); serializer.serialize(std::numeric_limits<double>::quiet_NaN()); double result = 0.0; deserializer.deserialize(result); CXXTOOLS_UNIT_ASSERT(result != result); } void testArray() { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); std::vector<int> intvector; intvector.push_back(4711); intvector.push_back(4712); intvector.push_back(-3); intvector.push_back(-257); serializer.serialize(intvector); log_debug("intvector: " << cxxtools::hexDump(data.str())); std::vector<int> intvector2; deserializer.deserialize(intvector2); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector.size(), intvector2.size()); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[0], intvector2[0]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[1], intvector2[1]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[2], intvector2[2]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[3], intvector2[3]); } void testObject() { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); TestObject obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = true; obj.nullValue = true; serializer.serialize(obj); log_debug("bindata testobject: " << cxxtools::hexDump(data.str())); TestObject obj2; deserializer.deserialize(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, obj2.intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, obj2.stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, obj2.doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, obj2.boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.nullValue, obj2.nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testComplexObject() { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); std::vector<TestObject2> v; TestObject2 obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = false; obj.nullValue = true; obj.setValue.insert(17); obj.setValue.insert(23); obj.mapValue[45] = "fourtyfive"; obj.mapValue[88] = "eightyeight"; obj.mapValue[100] = "onehundred"; v.push_back(obj); obj.setValue.insert(88); v.push_back(obj); serializer.serialize(v); log_debug("bindata complex object: " << cxxtools::hexDump(data.str())); std::vector<TestObject2> v2; deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT(v == v2); } void testObjectVector() { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); std::vector<TestObject> obj; obj.resize(2); obj[0].intValue = 17; obj[0].stringValue = "foobar"; obj[0].doubleValue = 3.125; obj[0].boolValue = true; obj[0].nullValue = true; obj[1].intValue = 18; obj[1].stringValue = "hi there"; obj[1].doubleValue = -17.25; obj[1].boolValue = false; obj[1].nullValue = true; serializer.serialize(obj); std::vector<TestObject> obj2; deserializer.deserialize(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj2.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].intValue, obj2[0].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].stringValue, obj2[0].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].doubleValue, obj2[0].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].boolValue, obj2[0].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].nullValue, obj2[0].nullValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].intValue, obj2[1].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].stringValue, obj2[1].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].doubleValue, obj2[1].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].boolValue, obj2[1].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].nullValue, obj2[1].nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testBinaryData() { std::stringstream data; cxxtools::bin::Serializer serializer(data); cxxtools::bin::Deserializer deserializer(data); std::string v; for (unsigned n = 0; n < 1024; ++n) v.push_back(static_cast<char>(n)); serializer.serialize(v); log_debug("v.data=" << cxxtools::hexDump(data.str())); std::string v2; deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 1024); CXXTOOLS_UNIT_ASSERT(v == v2); data.str(std::string()); deserializer.clear(); for (unsigned n = 0; n < 0xffff; ++n) v.push_back(static_cast<char>(n)); serializer.serialize(v); deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT(v == v2); } }; cxxtools::unit::RegisterTest<BinSerializerTest> register_BinSerializerTest; ���������������cxxtools-2.2.1/test/lrucache-test.cpp���������������������������������������������������������������0000664�0001750�0001750�00000011172�12256773774�014576� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/lrucache.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class LruCacheTest : public cxxtools::unit::TestSuite { public: LruCacheTest() : cxxtools::unit::TestSuite("lrucache") { registerMethod("cacheTest", *this, &LruCacheTest::cacheTest); registerMethod("erase", *this, &LruCacheTest::erase); registerMethod("resize", *this, &LruCacheTest::resize); registerMethod("stats", *this, &LruCacheTest::stats); } void cacheTest() { cxxtools::LruCache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); std::pair<bool, int> result; result = cache.getx(1); CXXTOOLS_UNIT_ASSERT(!result.first); result = cache.getx(8); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 80); } void erase() { cxxtools::LruCache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.erase(2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.erase(9); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 5); } void resize() { cxxtools::LruCache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); } void stats() { cxxtools::LruCache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.getx(1); cache.getx(2); cache.getx(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getHits(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getMisses(), 1); } }; cxxtools::unit::RegisterTest<LruCacheTest> register_LruCacheTest; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/binrpc-test.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000054632�12266277345�014267� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/bin/rpcclient.h" #include "cxxtools/bin/rpcserver.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include <stdlib.h> #include <sstream> log_define("cxxtools.test.binrpc") namespace { struct Color { int red; int green; int blue; }; typedef std::set<int> IntSet; typedef std::multiset<int> IntMultiset; typedef std::map<int, int> IntMap; typedef std::multimap<int, int> IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class BinRpcTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::bin::RpcServer* _server; unsigned _count; unsigned short _port; public: BinRpcTest() : cxxtools::unit::TestSuite("binrpc"), _port(7003) { registerMethod("Nothing", *this, &BinRpcTest::Nothing); registerMethod("Boolean", *this, &BinRpcTest::Boolean); registerMethod("Integer", *this, &BinRpcTest::Integer); registerMethod("Double", *this, &BinRpcTest::Double); registerMethod("String", *this, &BinRpcTest::String); registerMethod("EmptyValues", *this, &BinRpcTest::EmptyValues); registerMethod("Array", *this, &BinRpcTest::Array); registerMethod("EmptyArray", *this, &BinRpcTest::EmptyArray); registerMethod("Struct", *this, &BinRpcTest::Struct); registerMethod("Set", *this, &BinRpcTest::Set); registerMethod("Multiset", *this, &BinRpcTest::Multiset); registerMethod("Map", *this, &BinRpcTest::Map); registerMethod("Multimap", *this, &BinRpcTest::Multimap); registerMethod("UnknownMethod", *this, &BinRpcTest::UnknownMethod); registerMethod("Domain", *this, &BinRpcTest::Domain); registerMethod("WrongDomain", *this, &BinRpcTest::WrongDomain); registerMethod("Fault", *this, &BinRpcTest::Fault); registerMethod("Exception", *this, &BinRpcTest::Exception); registerMethod("CallbackException", *this, &BinRpcTest::CallbackException); registerMethod("ConnectError", *this, &BinRpcTest::ConnectError); registerMethod("BigRequest", *this, &BinRpcTest::BigRequest); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &BinRpcTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); _server = new cxxtools::bin::RpcServer(_loop, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyNothing); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyNothing); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &BinRpcTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(const cxxtools::RemoteResult<bool>& r) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::bin::RpcClient client(_loop, "", _port + 1); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &BinRpcTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(const cxxtools::RemoteResult<bool>& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { _server->registerMethod("boolean", *this, &BinRpcTest::boolean); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool, bool, bool> multiply(client, "boolean"); multiply.begin(true, true); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), true); } bool boolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyInt); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyDouble); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<double, double, double> multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { _server->registerMethod("echoString", *this, &BinRpcTest::echoString); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<std::string, std::string> echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyEmpty); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<std::string, std::string, std::string> multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyVector); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector<int> r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector<int> multiplyVector(const std::vector<int>& a, const std::vector<int>& b) { std::vector<int> r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyVector); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { _server->registerMethod("multiply", *this, &BinRpcTest::multiplyColor); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { _server->registerMethod("multiplyset", *this, &BinRpcTest::multiplySet); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntSet, IntSet, int> multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { _server->registerMethod("multiplyset", *this, &BinRpcTest::multiplyMultiset); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntMultiset, IntMultiset, int> multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { _server->registerMethod("multiplymap", *this, &BinRpcTest::multiplyMap); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntMap, IntMap, int> multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { _server->registerMethod("multiplymultimap", *this, &BinRpcTest::multiplyMultimap); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<IntMultimap, IntMultimap, int> multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // Domain // void Domain() { cxxtools::ServiceRegistry registry; registry.registerMethod("multiply", *this, &BinRpcTest::multiplyInt); _server->addService("myDomain", registry); cxxtools::bin::RpcClient client(_loop, "", _port, "myDomain"); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } //////////////////////////////////////////////////////////// // WrongDomain // void WrongDomain() { cxxtools::ServiceRegistry registry; registry.registerMethod("multiply", *this, &BinRpcTest::multiplyInt); _server->addService("myDomain", registry); cxxtools::bin::RpcClient client(_loop, "", _port, "unknownDomain"); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_THROW(multiply.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // UnknownMethod // void UnknownMethod() { cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> unknownMethod(client, "unknownMethod"); unknownMethod.begin(); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { _server->registerMethod("multiply", *this, &BinRpcTest::throwFault); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { _server->registerMethod("multiply", *this, &BinRpcTest::throwException); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { log_trace("ConnectError"); _server->registerMethod("countSize", *this, &BinRpcTest::countSize); cxxtools::bin::RpcClient client(_loop, "", _port); cxxtools::RemoteProcedure<unsigned, std::vector<int> > countSize(client, "countSize"); std::vector<int> v; v.resize(5000); countSize.begin(v); try { countSize.end(2000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector<int>& v) { return v.size(); } }; cxxtools::unit::RegisterTest<BinRpcTest> register_BinRpcTest; ������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/cache-test.cpp������������������������������������������������������������������0000664�0001750�0001750�00000012543�12256773774�014056� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define DEBUG #include "cxxtools/cache.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class CacheTest : public cxxtools::unit::TestSuite { public: CacheTest() : cxxtools::unit::TestSuite("cache") { registerMethod("cacheTest", *this, &CacheTest::cacheTest); registerMethod("erase", *this, &CacheTest::erase); registerMethod("resize", *this, &CacheTest::resize); registerMethod("stats", *this, &CacheTest::stats); } void cacheTest() { cxxtools::Cache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); std::pair<bool, int> result; result = cache.getx(1); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 10); result = cache.getx(8); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 80); cache.put_top(11, 110); cache.put_top(12, 120); cache.put_top(13, 130); cache.put_top(14, 140); result = cache.getx(10); CXXTOOLS_UNIT_ASSERT(!result.first); result = cache.getx(11); CXXTOOLS_UNIT_ASSERT(result.first); CXXTOOLS_UNIT_ASSERT_EQUALS(result.second, 110); } void erase() { cxxtools::Cache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); cache.erase(2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 5); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 3); cache.erase(9); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 3); } void resize() { cxxtools::Cache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 3); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 6); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 4); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 2); cache.setMaxElements(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 4); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.put(6, 60); cache.put(7, 70); cache.put(8, 80); cache.put(9, 90); cache.put(10, 100); cache.setMaxElements(4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.winners(), 2); } void stats() { cxxtools::Cache<int, int> cache(6); cache.put(1, 10); cache.put(2, 20); cache.put(3, 30); cache.put(4, 40); cache.put(5, 50); cache.getx(1); cache.getx(2); cache.getx(8); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getHits(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(cache.getMisses(), 1); } }; cxxtools::unit::RegisterTest<CacheTest> register_CacheTest; �������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/serializationinfo-test.cpp������������������������������������������������������0000664�0001750�0001750�00000047130�12256773774�016544� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include "cxxtools/serializationinfo.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" template <typename T> T siValue(const cxxtools::SerializationInfo& si) { T value; si.getValue(value); return value; } class SerializationInfoTest : public cxxtools::unit::TestSuite { public: SerializationInfoTest() : cxxtools::unit::TestSuite("serializationinfo") { registerMethod("testSiSet", *this, &SerializationInfoTest::testSiSet); registerMethod("testString", *this, &SerializationInfoTest::testString); registerMethod("testString8", *this, &SerializationInfoTest::testString8); registerMethod("testChar", *this, &SerializationInfoTest::testChar); registerMethod("testInt", *this, &SerializationInfoTest::testInt); registerMethod("testUInt", *this, &SerializationInfoTest::testUInt); registerMethod("testDouble", *this, &SerializationInfoTest::testDouble); registerMethod("testSiAssign", *this, &SerializationInfoTest::testSiAssign); registerMethod("testSiCopy", *this, &SerializationInfoTest::testSiCopy); registerMethod("testSiSwap", *this, &SerializationInfoTest::testSiSwap); registerMethod("testStringToBool", *this, &SerializationInfoTest::testStringToBool); registerMethod("testRangeCheck", *this, &SerializationInfoTest::testRangeCheck); } void testSiSet() { cxxtools::SerializationInfo si; si.setValue(static_cast<unsigned short>(42)); CXXTOOLS_UNIT_ASSERT(si.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si), 42); si.setValue("Hello"); CXXTOOLS_UNIT_ASSERT(si.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"Hello")); si.setValue(cxxtools::String(L"World")); CXXTOOLS_UNIT_ASSERT(si.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"World")); si.setValue(-17); CXXTOOLS_UNIT_ASSERT(si.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si), -17); si.setValue(0.0); CXXTOOLS_UNIT_ASSERT(si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert<double>(siValue<std::string>(si)), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert<double>(siValue<cxxtools::String>(si)), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned>(si), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 0); } void testString() { cxxtools::SerializationInfo si; si.setValue(cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT(si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<char>(si), '4'); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned char>(si), static_cast<unsigned char>(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<bool>(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 42.0); } void testString8() { cxxtools::SerializationInfo si; si.setValue(std::string("42")); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<char>(si), '4'); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned char>(si), static_cast<unsigned char>(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<bool>(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 42.0); } void testChar() { cxxtools::SerializationInfo si; si.setValue('7'); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"7")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "7"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<char>(si), '7'); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned char>(si), static_cast<unsigned char>(7)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<bool>(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 7.0); } void testInt() { cxxtools::SerializationInfo si; si.setValue(42); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<char>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned char>(si), static_cast<unsigned char>(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<bool>(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 42.0); } void testUInt() { cxxtools::SerializationInfo si; si.setValue(static_cast<unsigned int>(42)); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(si.isUInt()); CXXTOOLS_UNIT_ASSERT(!si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<char>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned char>(si), static_cast<unsigned char>(42)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<bool>(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 42.0); } void testDouble() { cxxtools::SerializationInfo si; si.setValue(48.0); CXXTOOLS_UNIT_ASSERT(!si.isString()); CXXTOOLS_UNIT_ASSERT(!si.isString8()); CXXTOOLS_UNIT_ASSERT(!si.isChar()); CXXTOOLS_UNIT_ASSERT(!si.isInt()); CXXTOOLS_UNIT_ASSERT(!si.isUInt()); CXXTOOLS_UNIT_ASSERT(si.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert<double>(siValue<std::string>(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::convert<double>(siValue<cxxtools::String>(si)), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<char>(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned char>(si), static_cast<unsigned char>(48)); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<bool>(si), true); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si), 48); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si), 48.0); } void testSiAssign() { cxxtools::SerializationInfo si; cxxtools::SerializationInfo si2; si.setValue(static_cast<unsigned short>(42)); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned>(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si2), 42); si.setValue("Hello"); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"Hello")); si.setValue(cxxtools::String(L"World")); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"World")); si.setValue(-17); si2 = si; CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si2), -17); } void testSiCopy() { cxxtools::SerializationInfo si; { si.setValue(static_cast<unsigned short>(42)); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned>(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si2), 42); } { si.setValue("Hello"); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"Hello")); } { si.setValue(cxxtools::String(L"World")); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"World")); } { si.setValue(-17); cxxtools::SerializationInfo si2(si); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si2), -17); } } void testSiSwap() { cxxtools::SerializationInfo si; cxxtools::SerializationInfo si1; cxxtools::SerializationInfo si2; // simple type <-> simple type si1.setValue(17); si2.setValue(1.5); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si1), 1.5); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si2), 17); // simple type <-> std::string si1.setValue(18); si2.setValue("Hello"); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si1), "Hello"); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si2), 18); // simple type <-> String si1.setValue(19); si2.setValue(cxxtools::String(L"World")); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si1), cxxtools::String(L"World")); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<int>(si2), 19); // std::string <-> simple type si1.setValue("Hi"); si2.setValue(1.5); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si1), 1.5); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hi"); // std::string <-> std::string si1.setValue("Hello"); si2.setValue("World"); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si1), "World"); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hello"); // std::string <-> String si1.setValue("Foo"); si2.setValue(cxxtools::String("Bar")); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si1), cxxtools::String(L"Bar")); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Foo"); // String <-> simple type si1.setValue(cxxtools::String("Hi")); si2.setValue(1.5); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isFloat()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<double>(si1), 1.5); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hi"); // String <-> std::string si1.setValue(cxxtools::String(L"Hello")); si2.setValue("World"); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si1), "World"); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hello"); // String <-> String si1.setValue(cxxtools::String("Foo")); si2.setValue(cxxtools::String("Bar")); si1.swap(si2); CXXTOOLS_UNIT_ASSERT(si1.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si1), cxxtools::String(L"Bar")); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Foo"); // other random tests si.setValue(static_cast<unsigned short>(42)); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si2.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "42"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"42")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<unsigned>(si2), 42); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si2), 42); si.setValue("Hello"); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si.isUInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si), 42); CXXTOOLS_UNIT_ASSERT(si2.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "Hello"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"Hello")); si.setValue(cxxtools::String(L"World")); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si.isString8()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si), "Hello"); CXXTOOLS_UNIT_ASSERT(si2.isString()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "World"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"World")); si.setValue(-17); si.swap(si2); CXXTOOLS_UNIT_ASSERT(si.isString()); CXXTOOLS_UNIT_ASSERT(si2.isInt()); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<std::string>(si2), "-17"); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<cxxtools::String>(si2), cxxtools::String(L"-17")); CXXTOOLS_UNIT_ASSERT_EQUALS(siValue<short>(si2), -17); } void testStringToBool() { cxxtools::SerializationInfo si; si.setValue("78"); CXXTOOLS_UNIT_ASSERT(siValue<bool>(si)); } void testRangeCheck() { cxxtools::SerializationInfo si; si.setValue(-1); CXXTOOLS_UNIT_ASSERT_THROW(siValue<unsigned short>(si), std::range_error); CXXTOOLS_UNIT_ASSERT_THROW(siValue<unsigned>(si), std::range_error); CXXTOOLS_UNIT_ASSERT_THROW(siValue<unsigned long>(si), std::range_error); si.setValue(static_cast<long>(std::numeric_limits<short>::max()) + 1); CXXTOOLS_UNIT_ASSERT_THROW(siValue<short>(si), std::range_error); CXXTOOLS_UNIT_ASSERT_NOTHROW(siValue<long>(si)); } }; cxxtools::unit::RegisterTest<SerializationInfoTest> register_SerializationInfoTest; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/csvserializer-test.cpp����������������������������������������������������������0000664�0001750�0001750�00000015754�12266277345�015701� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/csvserializer.h" #include "cxxtools/log.h" //log_define("cxxtools.test.csvserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } } class CsvSerializerTest : public cxxtools::unit::TestSuite { public: CsvSerializerTest() : cxxtools::unit::TestSuite("csvserializer") { registerMethod("testVectorVector", *this, &CsvSerializerTest::testVectorVector); registerMethod("testObjectVector", *this, &CsvSerializerTest::testObjectVector); registerMethod("testPartialObject", *this, &CsvSerializerTest::testPartialObject); registerMethod("testCustomTitles", *this, &CsvSerializerTest::testCustomTitles); registerMethod("testEmptyCsvWithTitles", *this, &CsvSerializerTest::testEmptyCsvWithTitles); registerMethod("testCustomChars", *this, &CsvSerializerTest::testCustomChars); } void testVectorVector() { std::vector<std::vector<std::string> > data; data.resize(2); data[0].push_back("Hello"); data[0].push_back("World"); data[1].push_back("34"); data[1].push_back("67"); std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "Hello,World\n" "34,67\n"); } void testObjectVector() { std::vector<TestObject> data; data.resize(2); data[0].intValue = 17; data[0].stringValue = "Hi"; data[0].doubleValue = 7.5; data[0].boolValue = true; data[1].intValue = -2; data[1].stringValue = "Foo"; data[1].doubleValue = -8; data[1].boolValue = false; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "intValue,stringValue,doubleValue,boolValue\n" "17,Hi,7.5,true\n" "-2,Foo,-8,false\n"); } void testPartialObject() { std::vector<TestObject> data; data.resize(2); data[0].intValue = 17; data[0].stringValue = "Hi"; data[0].doubleValue = 7.5; data[0].boolValue = true; data[1].intValue = -2; data[1].stringValue = "Foo"; data[1].doubleValue = -8; data[1].boolValue = false; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.selectColumn("stringValue"); serializer.selectColumn("intValue"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "stringValue,intValue\n" "Hi,17\n" "Foo,-2\n"); } void testCustomTitles() { std::vector<TestObject> data; data.resize(2); data[0].intValue = 17; data[0].stringValue = "Hi"; data[0].doubleValue = 7.5; data[0].boolValue = true; data[1].intValue = -2; data[1].stringValue = "Foo"; data[1].doubleValue = -8; data[1].boolValue = false; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.selectColumn("stringValue", "col1"); serializer.selectColumn("intValue", "col2"); serializer.selectColumn("doubleValue", "col3"); serializer.selectColumn("boolValue", "col4"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "col1,col2,col3,col4\n" "Hi,17,7.5,true\n" "Foo,-2,-8,false\n"); } void testEmptyCsvWithTitles() { std::vector<TestObject> data; std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.selectColumn("stringValue", "col1"); serializer.selectColumn("intValue", "col2"); serializer.selectColumn("doubleValue", "col3"); serializer.selectColumn("boolValue", "col4"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "col1,col2,col3,col4\n"); } void testCustomChars() { std::vector<std::vector<std::string> > data; data.resize(2); data[0].push_back("Hello"); data[0].push_back("fWorld"); data[1].push_back("34"); data[1].push_back("67"); std::ostringstream out; cxxtools::CsvSerializer serializer(out); serializer.delimiter('l'); serializer.quote('f'); serializer.lineEnding(L"Tab"); serializer.serialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), "fHelloflfffWorldfTab" "34l67Tab"); } }; cxxtools::unit::RegisterTest<CsvSerializerTest> register_CsvSerializerTest; ��������������������cxxtools-2.2.1/test/rpcbenchserver.cpp��������������������������������������������������������������0000664�0001750�0001750�00000007606�12256773774�015055� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <vector> #include <cxxtools/log.h> #include <cxxtools/arg.h> #include <cxxtools/eventloop.h> #include <cxxtools/http/server.h> #include <cxxtools/xmlrpc/service.h> #include <cxxtools/bin/rpcserver.h> #include <cxxtools/json/rpcserver.h> #include <cxxtools/json/httpservice.h> std::string echo(const std::string& msg) { return msg; } std::vector<int> seq(int from, int to) { std::vector<int> ret; for (int n = from; n <= to; ++n) ret.push_back(n); return ret; } int main(int argc, char* argv[]) { try { log_init("rpcbenchserver.properties"); cxxtools::Arg<std::string> ip(argc, argv, 'i'); cxxtools::Arg<unsigned short> port(argc, argv, 'p', 7002); cxxtools::Arg<unsigned short> bport(argc, argv, 'b', 7003); cxxtools::Arg<unsigned short> jport(argc, argv, 'j', 7004); cxxtools::Arg<unsigned> threads(argc, argv, 't', 4); cxxtools::Arg<unsigned> maxThreads(argc, argv, 'T', 200); std::cout << "rpc echo server running on port " << port.getValue() << "\n\n" "options:\n\n" " -i ip set interface address to listen on (default: all interfaces)\n" " -p number set port number for http (xmlrpc and json over http, default: 7002)\n" " -b number set port number run binary rpc server (default: 7003)\n" " -j number set port number run json rpc server (default: 7004)\n" " -t number set minimum number of threads (default: 4)\n" " -T number set maximum number of threads (default: 200)\n" << std::endl; cxxtools::EventLoop loop; cxxtools::http::Server server(loop, ip, port); server.minThreads(threads); server.maxThreads(maxThreads); cxxtools::xmlrpc::Service service; service.registerFunction("echo", echo); service.registerFunction("seq", seq); server.addService("/xmlrpc", service); cxxtools::bin::RpcServer binServer(loop, ip, bport); binServer.minThreads(threads); binServer.maxThreads(maxThreads); binServer.addService("", service); cxxtools::json::RpcServer jsonServer(loop, ip, jport); jsonServer.minThreads(threads); jsonServer.maxThreads(maxThreads); jsonServer.addService("", service); cxxtools::json::HttpService jsonhttpService; jsonhttpService.registerFunction("echo", echo); jsonhttpService.registerFunction("seq", seq); server.addService("/jsonrpc", jsonhttpService); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ��������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/md5-test.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000006245�12256773774�013502� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/md5stream.h" #include "cxxtools/md5.h" #include "cxxtools/hmac.h" class MD5Test : public cxxtools::unit::TestSuite { public: MD5Test() : cxxtools::unit::TestSuite("md5") { registerMethod("testMD5", *this, &MD5Test::testMD5); registerMethod("testMD5stream", *this, &MD5Test::testMD5stream); registerMethod("testHMAC_MD5", *this, &MD5Test::testHMAC_MD5); } void testMD5stream() { cxxtools::Md5stream md5; std::string hexDigest; hexDigest = md5.getHexDigest(); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "d41d8cd98f00b204e9800998ecf8427e"); md5 << "The quick brown fox jumps over the lazy dog."; hexDigest = md5.getHexDigest(); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "e4d909c290d0fb1ca068ffaddf22cbd0"); } void testMD5() { std::string hexDigest; hexDigest = cxxtools::md5(""); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "d41d8cd98f00b204e9800998ecf8427e"); hexDigest = cxxtools::md5("The quick brown fox jumps over the lazy dog."); CXXTOOLS_UNIT_ASSERT_EQUALS(hexDigest, "e4d909c290d0fb1ca068ffaddf22cbd0"); } void testHMAC_MD5() { std::string hmac; hmac = cxxtools::hmac<cxxtools::md5_hash<std::string> >("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(hmac, "74e6f7298a9c2d168935f58c001bad88"); hmac = cxxtools::hmac<cxxtools::md5_hash<std::string> >("key", "The quick brown fox jumps over the lazy dog"); CXXTOOLS_UNIT_ASSERT_EQUALS(hmac, "80070713463e7749b90c2dc24911e275"); } }; cxxtools::unit::RegisterTest<MD5Test> register_MD5Test; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/xmlrpccallback-test.cpp���������������������������������������������������������0000664�0001750�0001750�00000065633�12266277345�015777� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/xmlrpc/service.h" #include "cxxtools/xmlrpc/httpclient.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/http/server.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include <stdlib.h> #include <sstream> log_define("cxxtools.test.xmlrpc.callback") namespace { struct Color { int red; int green; int blue; }; typedef std::set<int> IntSet; typedef std::multiset<int> IntMultiset; typedef std::map<int, int> IntMap; typedef std::multimap<int, int> IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class XmlRpcCallbackTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::http::Server* _server; unsigned _count; unsigned short _port; public: XmlRpcCallbackTest() : cxxtools::unit::TestSuite("xmlrpccallback"), _port(8001) { registerMethod("Nothing", *this, &XmlRpcCallbackTest::Nothing); registerMethod("Boolean", *this, &XmlRpcCallbackTest::Boolean); registerMethod("Integer", *this, &XmlRpcCallbackTest::Integer); registerMethod("Double", *this, &XmlRpcCallbackTest::Double); registerMethod("String", *this, &XmlRpcCallbackTest::String); registerMethod("EmptyValues", *this, &XmlRpcCallbackTest::EmptyValues); registerMethod("Array", *this, &XmlRpcCallbackTest::Array); registerMethod("EmptyArray", *this, &XmlRpcCallbackTest::EmptyArray); registerMethod("Struct", *this, &XmlRpcCallbackTest::Struct); registerMethod("Set", *this, &XmlRpcCallbackTest::Set); registerMethod("Multiset", *this, &XmlRpcCallbackTest::Multiset); registerMethod("Map", *this, &XmlRpcCallbackTest::Map); registerMethod("Multimap", *this, &XmlRpcCallbackTest::Multimap); registerMethod("UnknownMethod", *this, &XmlRpcCallbackTest::UnknownMethod); registerMethod("Fault", *this, &XmlRpcCallbackTest::Fault); registerMethod("Exception", *this, &XmlRpcCallbackTest::Exception); registerMethod("CallbackException", *this, &XmlRpcCallbackTest::CallbackException); registerMethod("ConnectError", *this, &XmlRpcCallbackTest::ConnectError); registerMethod("BigRequest", *this, &XmlRpcCallbackTest::BigRequest); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &XmlRpcCallbackTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); _server = new cxxtools::http::Server(_loop, "", _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onNothingFinished ); multiply.begin(); _loop.run(); } void onNothingFinished(const cxxtools::RemoteResult<bool>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), false); _loop.exit(); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(const cxxtools::RemoteResult<bool>& r) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::xmlrpc::HttpClient client(_loop, "", _port + 1, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(const cxxtools::RemoteResult<bool>& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyBoolean); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool, bool, bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onBooleanFinished ); multiply.begin(true, true); _loop.run(); } void onBooleanFinished(const cxxtools::RemoteResult<bool>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), true); _loop.exit(); } bool multiplyBoolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyInt); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onIntegerFinished ); multiply.begin(2, 3); _loop.run(); } void onIntegerFinished(const cxxtools::RemoteResult<int>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), 6); _loop.exit(); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyDouble); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<double, double, double> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onDoubleFinished ); multiply.begin(2.0, 3.0); _loop.run(); } void onDoubleFinished(const cxxtools::RemoteResult<double>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), 6.0); _loop.exit(); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { cxxtools::xmlrpc::Service service; service.registerMethod("echoString", *this, &XmlRpcCallbackTest::echoString); _server->addService("/foo", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/foo"); cxxtools::RemoteProcedure<std::string, std::string> echo(client, "echoString"); connect( echo.finished, *this, &XmlRpcCallbackTest::onStringEchoFinished ); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); _loop.run(); } void onStringEchoFinished(const cxxtools::RemoteResult<std::string>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); _loop.exit(); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyEmpty); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<std::string, std::string, std::string> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onEmptyFinished ); multiply.begin("", ""); _loop.run(); } void onEmptyFinished(const cxxtools::RemoteResult<std::string>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), "4"); _loop.exit(); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onArrayFinished ); std::vector<int> vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); _loop.run(); } std::vector<int> multiplyVector(const std::vector<int>& a, const std::vector<int>& b) { std::vector<int> r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } void onArrayFinished(const cxxtools::RemoteResult<std::vector<int> >& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().at(1), 400); _loop.exit(); } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onEmptyArrayFinished ); std::vector<int> vec; multiply.begin(vec, vec); _loop.run(); } void onEmptyArrayFinished(const cxxtools::RemoteResult<std::vector<int> >& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get().size(), 0); _loop.exit(); } //////////////////////////////////////////////////////////// // Struct // void Struct() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::multiplyColor); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onStuctFinished ); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); _loop.run(); } void onStuctFinished(const cxxtools::RemoteResult<Color>& color) { CXXTOOLS_UNIT_ASSERT_EQUALS(color.get().red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(color.get().green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(color.get().blue, 20); _loop.exit(); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcCallbackTest::multiplySet); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntSet, IntSet, int> multiply(client, "multiplyset"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onSetFinished ); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); _loop.run(); } void onSetFinished(const cxxtools::RemoteResult<IntSet>& result) { const IntSet& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); _loop.exit(); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcCallbackTest::multiplyMultiset); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMultiset, IntMultiset, int> multiply(client, "multiplyset"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onMultisetFinished ); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); _loop.run(); } void onMultisetFinished(const cxxtools::RemoteResult<IntMultiset>& result) { const IntMultiset& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); _loop.exit(); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymap", *this, &XmlRpcCallbackTest::multiplyMap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMap, IntMap, int> multiply(client, "multiplymap"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onMultiplyMapFinished ); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); _loop.run(); } void onMultiplyMapFinished(const cxxtools::RemoteResult<IntMap>& result) { const IntMap& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); _loop.exit(); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymultimap", *this, &XmlRpcCallbackTest::multiplyMultimap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMultimap, IntMultimap, int> multiply(client, "multiplymultimap"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onMultiplyMultimapFinished ); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); _loop.run(); } void onMultiplyMultimapFinished(const cxxtools::RemoteResult<IntMultimap>& result) { const IntMultimap& v = result.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); _loop.exit(); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } void UnknownMethod() { cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<bool, bool, bool> unknownMethod(client, "unknownMethod"); connect( unknownMethod.finished, *this, &XmlRpcCallbackTest::onBooleanFinished ); unknownMethod.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::exception); } //////////////////////////////////////////////////////////// // Fault // void Fault() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::throwFault); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onFault ); multiply.begin(); _loop.run(); } void onFault(const cxxtools::RemoteResult<bool>& result) { try { result.get(); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } _loop.exit(); } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcCallbackTest::throwException); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcCallbackTest::onException ); multiply.begin(); _loop.run(); } void onException(const cxxtools::RemoteResult<bool>& result) { try { result.get(); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } _loop.exit(); } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { log_trace("ConnectError"); cxxtools::xmlrpc::Service service; service.registerMethod("countSize", *this, &XmlRpcCallbackTest::countSize); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<unsigned, std::vector<int> > countSize(client, "countSize"); connect( countSize.finished, *this, &XmlRpcCallbackTest::onCountSizeFinished ); std::vector<int> v; v.resize(5000); countSize.begin(v); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onCountSizeFinished(const cxxtools::RemoteResult<unsigned>& r) { CXXTOOLS_UNIT_ASSERT_EQUALS(r.get(), 5000); _loop.exit(); } unsigned countSize(const std::vector<int>& v) { return v.size(); } }; cxxtools::unit::RegisterTest<XmlRpcCallbackTest> register_XmlRpcCallbackTest; �����������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/trim-test.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000007340�12256773774�013765� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/trim.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/string.h" static const std::string ws = " \t"; static const cxxtools::String wsu = L" \t"; class TrimTest : public cxxtools::unit::TestSuite { public: TrimTest() : cxxtools::unit::TestSuite("trim") { registerMethod("ltrimTest", *this, &TrimTest::ltrimTest); registerMethod("rtrimTest", *this, &TrimTest::rtrimTest); registerMethod("trimTest", *this, &TrimTest::trimTest); registerMethod("trimTestU", *this, &TrimTest::trimTestU); } void ltrimTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t foo bar ")), "foo bar "); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t\n foo bar ")), "foo bar "); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t\n foo bar "), ws), "\n foo bar "); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::ltrim(std::string(" \t ")), ""); } void rtrimTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t foo bar ")), " \t foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t\n foo bar \n ")), " \t\n foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t\n foo bar \n "), ws), " \t\n foo bar \n"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::rtrim(std::string(" \t ")), ""); } void trimTest() { CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t foo bar ")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t\n foo bar \n ")), "foo bar"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t\n foo bar \n "), ws), "\n foo bar \n"); CXXTOOLS_UNIT_ASSERT_EQUALS(cxxtools::trim(std::string(" \t ")), ""); } void trimTestU() { CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t foo bar ")) == L"foo bar"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t\n foo bar \n ")) == L"foo bar"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t\n foo bar \n "), wsu) == L"\n foo bar \n"); CXXTOOLS_UNIT_ASSERT(cxxtools::trim(cxxtools::String(" \t ")) == L""); } }; cxxtools::unit::RegisterTest<TrimTest> register_TrimTest; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/join-test.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000005002�12256773774�013742� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/join.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class JoinTest : public cxxtools::unit::TestSuite { public: JoinTest() : cxxtools::unit::TestSuite("join") { registerMethod("joinString", *this, &JoinTest::joinString); registerMethod("joinInt", *this, &JoinTest::joinInt); registerMethod("emptyJoin", *this, &JoinTest::emptyJoin); } void joinString() { std::vector<std::string> d; d.push_back("Hello"); d.push_back("World"); d.push_back("!"); std::string result = cxxtools::join(d.begin(), d.end(), " "); CXXTOOLS_UNIT_ASSERT_EQUALS(result, "Hello World !"); } void joinInt() { std::vector<int> d; d.push_back(4); d.push_back(17); d.push_back(-12); std::string result = cxxtools::join(d.begin(), d.end(), ", "); CXXTOOLS_UNIT_ASSERT_EQUALS(result, "4, 17, -12"); } void emptyJoin() { std::vector<std::string> d; std::string result = cxxtools::join(d.begin(), d.end(), ", "); CXXTOOLS_UNIT_ASSERT_EQUALS(result, ""); } }; cxxtools::unit::RegisterTest<JoinTest> register_JoinTest; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/smartptr-test.cpp���������������������������������������������������������������0000664�0001750�0001750�00000011673�12256773774�014672� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/smartptr.h" #include "cxxtools/refcounted.h" #include "cxxtools/unit/assertion.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class Object : public cxxtools::RefCounted { public: Object() { ++objectRefs; } ~Object() { --objectRefs; } static std::size_t objectRefs; }; std::size_t Object::objectRefs = 0; class AtomicObject : public cxxtools::AtomicRefCounted { public: AtomicObject() { ++objectRefs; } ~AtomicObject() { --objectRefs; } static std::size_t objectRefs; }; std::size_t AtomicObject::objectRefs = 0; class SmartPtrTest : public cxxtools::unit::TestSuite { public: SmartPtrTest() : cxxtools::unit::TestSuite( "SmartPtr" ) { registerMethod( "RefCounted", *this, &SmartPtrTest::RefCounted ); registerMethod( "InternalRefCounted", *this, &SmartPtrTest::InternalRefCounted ); registerMethod( "AtomicInternalRefCounted", *this, &SmartPtrTest::AtomicInternalRefCounted ); registerMethod( "RefLinked", *this, &SmartPtrTest::RefLinked ); } public: void setUp(); protected: void RefCounted(); void InternalRefCounted(); void AtomicInternalRefCounted(); void RefLinked(); }; cxxtools::unit::RegisterTest<SmartPtrTest> register_SmartPtrTest; void SmartPtrTest::setUp() { Object::objectRefs = 0; AtomicObject::objectRefs = 0; } void SmartPtrTest::RefCounted() { Object* obj = new Object(); typedef cxxtools::SmartPtr<Object, cxxtools::ExternalRefCounted> Ptr; { Ptr smartPtr(obj); CXXTOOLS_UNIT_ASSERT_EQUALS( smartPtr.refs(), 1 ); Ptr second(smartPtr); CXXTOOLS_UNIT_ASSERT_EQUALS( second.refs(), 2); Ptr third; third = second; CXXTOOLS_UNIT_ASSERT_EQUALS( third.refs(), 3); third = third; CXXTOOLS_UNIT_ASSERT_EQUALS( third.refs(), 3); } CXXTOOLS_UNIT_ASSERT_EQUALS(Object::objectRefs, 0); } void SmartPtrTest::InternalRefCounted() { Object* obj = new Object(); typedef cxxtools::SmartPtr<Object, cxxtools::InternalRefCounted> Ptr; { Ptr smartPtr(obj); CXXTOOLS_UNIT_ASSERT_EQUALS( smartPtr->refs(), 1 ); Ptr second(smartPtr); CXXTOOLS_UNIT_ASSERT_EQUALS( second->refs(), 2); Ptr third; third = second; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); third = third; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); } CXXTOOLS_UNIT_ASSERT_EQUALS(Object::objectRefs, 0); } void SmartPtrTest::AtomicInternalRefCounted() { AtomicObject* obj = new AtomicObject(); typedef cxxtools::SmartPtr<AtomicObject, cxxtools::InternalRefCounted> Ptr; { Ptr smartPtr(obj); CXXTOOLS_UNIT_ASSERT_EQUALS( smartPtr->refs(), 1 ); Ptr second(smartPtr); CXXTOOLS_UNIT_ASSERT_EQUALS( second->refs(), 2); Ptr third; third = second; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); third = third; CXXTOOLS_UNIT_ASSERT_EQUALS( third->refs(), 3); } CXXTOOLS_UNIT_ASSERT_EQUALS(AtomicObject::objectRefs, 0); } void SmartPtrTest::RefLinked() { Object* obj = new Object(); typedef cxxtools::SmartPtr<Object, cxxtools::RefLinked> Ptr; { Ptr smartPtr(obj); Ptr second(smartPtr); Ptr third; Ptr fourth(third); third = second; } CXXTOOLS_UNIT_ASSERT(Object::objectRefs == 0); } ���������������������������������������������������������������������cxxtools-2.2.1/test/xmlreader-test.cpp��������������������������������������������������������������0000664�0001750�0001750�00000011733�12256773774�014776� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include "cxxtools/xml/entityresolver.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class XmlReaderTest : public cxxtools::unit::TestSuite { public: XmlReaderTest() : cxxtools::unit::TestSuite("xmlreader") { registerMethod("XmlEntity", *this, &XmlReaderTest::XmlEntity); registerMethod("ReverseEntity", *this, &XmlReaderTest::ReverseEntity); registerMethod("AllEntities", *this, &XmlReaderTest::AllEntities); } void setUp() { } void tearDown() { } void XmlEntity() { cxxtools::xml::EntityResolver resolver; cxxtools::String r; r = resolver.resolveEntity(cxxtools::String(L"auml")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0xE4))); r = resolver.resolveEntity(cxxtools::String(L"Ouml")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0xD6))); r = resolver.resolveEntity(cxxtools::String(L"AElig")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0xC6))); r = resolver.resolveEntity(cxxtools::String(L"zwnj")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0x200C))); r = resolver.resolveEntity(cxxtools::String(L"#x200C")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(0x200C))); r = resolver.resolveEntity(cxxtools::String(L"#1234")); CXXTOOLS_UNIT_ASSERT(r == cxxtools::String(1, cxxtools::Char(1234))); CXXTOOLS_UNIT_ASSERT_THROW(resolver.resolveEntity(cxxtools::String(L"zwnjj")), std::exception); CXXTOOLS_UNIT_ASSERT_THROW(resolver.resolveEntity(cxxtools::String(L"AEli")), std::exception); } void ReverseEntity() { cxxtools::xml::EntityResolver resolver; cxxtools::String r; r = resolver.getEntity(cxxtools::Char(L'&')); CXXTOOLS_UNIT_ASSERT_MSG(r == cxxtools::String(L"&"), "failed to get entity for character '&'; expected \"&\" returned \"" << r.narrow() << '"'); r = resolver.getEntity(cxxtools::Char(0x0022)); CXXTOOLS_UNIT_ASSERT_MSG(r == cxxtools::String(L"""), "failed to get entity for character code 0x0022; expected \""\" returned \"" << r.narrow() << '"'); r = resolver.getEntity(cxxtools::Char(1234)); CXXTOOLS_UNIT_ASSERT_MSG(r == cxxtools::String(L"Ӓ"), "failed to get entity for character code 1234; expected \"Ӓ\" returned \"" << r.narrow() << '"'); } void AllEntities() { cxxtools::xml::EntityResolver resolver; for (cxxtools::Char::value_type n = 0; n <= 0xFFFF; ++n) { cxxtools::String r = resolver.getEntity(cxxtools::Char(n)); if (r.size() > 2 && r[0] == '&' && r[r.size() - 1] == ';') { cxxtools::String rr = resolver.resolveEntity(r.substr(1, r.size() - 2)); CXXTOOLS_UNIT_ASSERT_MSG( rr == cxxtools::String(1, cxxtools::Char(n)), "resolving char code " << n << " failed; entity \"" << r.narrow() << '"'); } else { CXXTOOLS_UNIT_ASSERT_MSG(r[0] == cxxtools::Char(n), "resolving char code " << n << " failed"); } } } }; cxxtools::unit::RegisterTest<XmlReaderTest> register_XmlReaderTest; �������������������������������������cxxtools-2.2.1/test/xmlserializer-test.cpp����������������������������������������������������������0000664�0001750�0001750�00000034120�12256773774�015700� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/xml/xmlserializer.h" #include "cxxtools/xml/xmldeserializer.h" #include "cxxtools/log.h" #include "cxxtools/hdstream.h" #include <limits> #include <stdint.h> #include <config.h> log_define("cxxtools.test.xmlserializer") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue; } struct TestObject2 : public TestObject { typedef std::set<unsigned> SetType; typedef std::map<unsigned, std::string> MapType; SetType setValue; MapType mapValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast<TestObject&>(obj); si.getMember("setValue") >>= obj.setValue; si.getMember("mapValue") >>= obj.mapValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject2& obj) { si <<= static_cast<const TestObject&>(obj); si.addMember("setValue") <<= obj.setValue; si.addMember("mapValue") <<= obj.mapValue; si.setTypeName("TestObject2"); } bool operator== (const TestObject2& obj1, const TestObject2& obj2) { return static_cast<const TestObject&>(obj1) == static_cast<const TestObject&>(obj2) && obj1.setValue == obj2.setValue && obj1.mapValue == obj2.mapValue; } } class XmlSerializerTest : public cxxtools::unit::TestSuite { public: XmlSerializerTest() : cxxtools::unit::TestSuite("xmlserializer") { registerMethod("testScalar", *this, &XmlSerializerTest::testScalar); registerMethod("testInt", *this, &XmlSerializerTest::testInt); registerMethod("testDouble", *this, &XmlSerializerTest::testDouble); registerMethod("testArray", *this, &XmlSerializerTest::testArray); registerMethod("testObject", *this, &XmlSerializerTest::testObject); registerMethod("testComplexObject", *this, &XmlSerializerTest::testComplexObject); registerMethod("testObjectVector", *this, &XmlSerializerTest::testObjectVector); registerMethod("testBinaryData", *this, &XmlSerializerTest::testBinaryData); } void testScalar() { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); int value = 5; serializer.serialize(value, "value"); serializer.finish(); int value2 = 0; deserializer.deserialize(value2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, value2); } template <typename IntT> void testIntValue(IntT value) { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); serializer.serialize(value, "value"); serializer.finish(); IntT result = 0; deserializer.deserialize(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } void testInt() { testIntValue(30); testIntValue(300); testIntValue(100000); testIntValue(-30); testIntValue(-300); testIntValue(-100000); testIntValue(static_cast<int16_t>(std::numeric_limits<int8_t>::max()) + 1); testIntValue(static_cast<int32_t>(std::numeric_limits<int16_t>::max()) + 1); testIntValue(std::numeric_limits<int32_t>::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1); testIntValue(std::numeric_limits<int64_t>::max()); #endif testIntValue(static_cast<int16_t>(std::numeric_limits<int8_t>::min()) - 1); testIntValue(static_cast<int32_t>(std::numeric_limits<int16_t>::min()) - 1); testIntValue(std::numeric_limits<int32_t>::min()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<int64_t>(std::numeric_limits<int32_t>::min()) - 1); testIntValue(std::numeric_limits<int64_t>::min()); #endif testIntValue(static_cast<uint16_t>(std::numeric_limits<uint8_t>::max()) + 1); testIntValue(static_cast<uint32_t>(std::numeric_limits<uint16_t>::max()) + 1); testIntValue(std::numeric_limits<uint32_t>::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<uint64_t>(std::numeric_limits<uint32_t>::max()) + 1); testIntValue(std::numeric_limits<uint64_t>::max()); #endif } void testDoubleValue(double value) { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); serializer.serialize(value, "value"); serializer.finish(); double result = 0.0; deserializer.deserialize(result); log_debug("test double value " << value << " => " << result); if (value != value) // check for nan CXXTOOLS_UNIT_ASSERT(result != result); else if (value == std::numeric_limits<double>::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::numeric_limits<double>::infinity()); else if (value == -std::numeric_limits<double>::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, -std::numeric_limits<double>::infinity()); else CXXTOOLS_UNIT_ASSERT(value / result < 1.00001 && value / result > 0.99999); } void testDouble() { testDoubleValue(-3.877e-123); testDoubleValue(std::numeric_limits<double>::max()); //testDoubleValue(std::numeric_limits<double>::min()); testDoubleValue(std::numeric_limits<double>::infinity()); testDoubleValue(-std::numeric_limits<double>::infinity()); testDoubleValue(std::numeric_limits<double>::quiet_NaN()); std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); serializer.serialize(std::numeric_limits<double>::quiet_NaN(), "value"); serializer.finish(); double result = 0.0; deserializer.deserialize(result); CXXTOOLS_UNIT_ASSERT(result != result); } void testArray() { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); std::vector<int> intvector; intvector.push_back(4711); intvector.push_back(4712); intvector.push_back(-3); intvector.push_back(-257); serializer.serialize(intvector, "intvector"); serializer.finish(); log_debug("intvector: " << cxxtools::hexDump(data.str())); std::vector<int> intvector2; deserializer.deserialize(intvector2); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector.size(), intvector2.size()); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[0], intvector2[0]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[1], intvector2[1]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[2], intvector2[2]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[3], intvector2[3]); } void testObject() { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); TestObject obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = true; serializer.serialize(obj, "obj"); serializer.finish(); TestObject obj2; deserializer.deserialize(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, obj2.intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, obj2.stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, obj2.doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, obj2.boolValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testComplexObject() { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); std::vector<TestObject2> v; TestObject2 obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = false; obj.setValue.insert(17); obj.setValue.insert(23); obj.mapValue[45] = "fourtyfive"; obj.mapValue[88] = "eightyeight"; obj.mapValue[100] = "onehundred"; v.push_back(obj); obj.setValue.insert(88); v.push_back(obj); serializer.serialize(v, "v"); serializer.finish(); std::vector<TestObject2> v2; deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT(v == v2); } void testObjectVector() { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); std::vector<TestObject> obj; obj.resize(2); obj[0].intValue = 17; obj[0].stringValue = "foobar"; obj[0].doubleValue = 3.125; obj[0].boolValue = true; obj[1].intValue = 18; obj[1].stringValue = "hi there"; obj[1].doubleValue = -17.25; obj[1].boolValue = false; serializer.serialize(obj, "v"); serializer.finish(); std::vector<TestObject> obj2; deserializer.deserialize(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj2.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].intValue, obj2[0].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].stringValue, obj2[0].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].doubleValue, obj2[0].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].boolValue, obj2[0].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].intValue, obj2[1].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].stringValue, obj2[1].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].doubleValue, obj2[1].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].boolValue, obj2[1].boolValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testBinaryData() { std::stringstream data; cxxtools::xml::XmlSerializer serializer(data); cxxtools::xml::XmlDeserializer deserializer(data); std::string v; for (unsigned n = 0; n < 1024; ++n) v.push_back(static_cast<char>(n)); serializer.serialize(v, "v"); serializer.finish(); log_debug("v.data=" << cxxtools::hexDump(data.str())); std::string v2; deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 1024); CXXTOOLS_UNIT_ASSERT(v == v2); data.str(std::string()); deserializer.clear(); for (unsigned n = 0; n < 0xffff; ++n) v.push_back(static_cast<char>(n)); serializer.serialize(v, "v"); serializer.finish(); deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT(v == v2); } }; cxxtools::unit::RegisterTest<XmlSerializerTest> register_XmlSerializerTest; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/Makefile.in���������������������������������������������������������������������0000664�0001750�0001750�00000057666�12266277545�013412� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = alltests$(EXEEXT) serializer-bench$(EXEEXT) \ rpcbenchclient$(EXEEXT) rpcbenchserver$(EXEEXT) @MAKE_ICONVSTREAM_TRUE@am__append_1 = \ @MAKE_ICONVSTREAM_TRUE@ iconvstream-test.cpp subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__alltests_SOURCES_DIST = arg-test.cpp base64-test.cpp \ binrpc-test.cpp binserializer-test.cpp cache-test.cpp \ clock-test.cpp csvdeserializer-test.cpp csvserializer-test.cpp \ convert-test.cpp join-test.cpp json-test.cpp \ jsondeserializer-test.cpp jsonrpc-test.cpp \ jsonrpchttp-test.cpp jsonserializer-test.cpp lrucache-test.cpp \ md5-test.cpp pool-test.cpp properties-test.cpp \ query_params-test.cpp regex-test.cpp \ serializationinfo-test.cpp smartptr-test.cpp split-test.cpp \ string-test.cpp test-main.cpp trim-test.cpp uri-test.cpp \ xmlreader-test.cpp xmlrpc-test.cpp xmlrpccallback-test.cpp \ xmlserializer-test.cpp iconvstream-test.cpp @MAKE_ICONVSTREAM_TRUE@am__objects_1 = iconvstream-test.$(OBJEXT) am_alltests_OBJECTS = arg-test.$(OBJEXT) base64-test.$(OBJEXT) \ binrpc-test.$(OBJEXT) binserializer-test.$(OBJEXT) \ cache-test.$(OBJEXT) clock-test.$(OBJEXT) \ csvdeserializer-test.$(OBJEXT) csvserializer-test.$(OBJEXT) \ convert-test.$(OBJEXT) join-test.$(OBJEXT) json-test.$(OBJEXT) \ jsondeserializer-test.$(OBJEXT) jsonrpc-test.$(OBJEXT) \ jsonrpchttp-test.$(OBJEXT) jsonserializer-test.$(OBJEXT) \ lrucache-test.$(OBJEXT) md5-test.$(OBJEXT) pool-test.$(OBJEXT) \ properties-test.$(OBJEXT) query_params-test.$(OBJEXT) \ regex-test.$(OBJEXT) serializationinfo-test.$(OBJEXT) \ smartptr-test.$(OBJEXT) split-test.$(OBJEXT) \ string-test.$(OBJEXT) test-main.$(OBJEXT) trim-test.$(OBJEXT) \ uri-test.$(OBJEXT) xmlreader-test.$(OBJEXT) \ xmlrpc-test.$(OBJEXT) xmlrpccallback-test.$(OBJEXT) \ xmlserializer-test.$(OBJEXT) $(am__objects_1) alltests_OBJECTS = $(am_alltests_OBJECTS) alltests_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la \ $(top_builddir)/src/unit/libcxxtools-unit.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la am_rpcbenchclient_OBJECTS = rpcbenchclient.$(OBJEXT) rpcbenchclient_OBJECTS = $(am_rpcbenchclient_OBJECTS) rpcbenchclient_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la am_rpcbenchserver_OBJECTS = rpcbenchserver.$(OBJEXT) rpcbenchserver_OBJECTS = $(am_rpcbenchserver_OBJECTS) rpcbenchserver_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la am_serializer_bench_OBJECTS = serializer-bench.$(OBJEXT) serializer_bench_OBJECTS = $(am_serializer_bench_OBJECTS) serializer_bench_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(alltests_SOURCES) $(rpcbenchclient_SOURCES) \ $(rpcbenchserver_SOURCES) $(serializer_bench_SOURCES) DIST_SOURCES = $(am__alltests_SOURCES_DIST) $(rpcbenchclient_SOURCES) \ $(rpcbenchserver_SOURCES) $(serializer_bench_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include alltests_SOURCES = arg-test.cpp base64-test.cpp binrpc-test.cpp \ binserializer-test.cpp cache-test.cpp clock-test.cpp \ csvdeserializer-test.cpp csvserializer-test.cpp \ convert-test.cpp join-test.cpp json-test.cpp \ jsondeserializer-test.cpp jsonrpc-test.cpp \ jsonrpchttp-test.cpp jsonserializer-test.cpp lrucache-test.cpp \ md5-test.cpp pool-test.cpp properties-test.cpp \ query_params-test.cpp regex-test.cpp \ serializationinfo-test.cpp smartptr-test.cpp split-test.cpp \ string-test.cpp test-main.cpp trim-test.cpp uri-test.cpp \ xmlreader-test.cpp xmlrpc-test.cpp xmlrpccallback-test.cpp \ xmlserializer-test.cpp $(am__append_1) alltests_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/json/libcxxtools-json.la \ $(top_builddir)/src/unit/libcxxtools-unit.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la serializer_bench_SOURCES = serializer-bench.cpp serializer_bench_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/bin/libcxxtools-bin.la rpcbenchclient_SOURCES = rpcbenchclient.cpp rpcbenchclient_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la rpcbenchserver_SOURCES = rpcbenchserver.cpp rpcbenchserver_LDADD = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la \ $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la \ $(top_builddir)/src/bin/libcxxtools-bin.la \ $(top_builddir)/src/json/libcxxtools-json.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list alltests$(EXEEXT): $(alltests_OBJECTS) $(alltests_DEPENDENCIES) $(EXTRA_alltests_DEPENDENCIES) @rm -f alltests$(EXEEXT) $(CXXLINK) $(alltests_OBJECTS) $(alltests_LDADD) $(LIBS) rpcbenchclient$(EXEEXT): $(rpcbenchclient_OBJECTS) $(rpcbenchclient_DEPENDENCIES) $(EXTRA_rpcbenchclient_DEPENDENCIES) @rm -f rpcbenchclient$(EXEEXT) $(CXXLINK) $(rpcbenchclient_OBJECTS) $(rpcbenchclient_LDADD) $(LIBS) rpcbenchserver$(EXEEXT): $(rpcbenchserver_OBJECTS) $(rpcbenchserver_DEPENDENCIES) $(EXTRA_rpcbenchserver_DEPENDENCIES) @rm -f rpcbenchserver$(EXEEXT) $(CXXLINK) $(rpcbenchserver_OBJECTS) $(rpcbenchserver_LDADD) $(LIBS) serializer-bench$(EXEEXT): $(serializer_bench_OBJECTS) $(serializer_bench_DEPENDENCIES) $(EXTRA_serializer_bench_DEPENDENCIES) @rm -f serializer-bench$(EXEEXT) $(CXXLINK) $(serializer_bench_OBJECTS) $(serializer_bench_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binrpc-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binserializer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvdeserializer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvserializer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvstream-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/join-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsondeserializer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonrpc-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonrpchttp-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonserializer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lrucache-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query_params-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbenchclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcbenchserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializationinfo-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializer-bench.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smartptr-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/split-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlreader-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrpc-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlrpccallback-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlserializer-test.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������������������������������������������������cxxtools-2.2.1/test/json-test.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000033544�12256773774�013770� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/serializationinfo.h" #include "cxxtools/jsonserializer.h" #include "cxxtools/jsondeserializer.h" #include "cxxtools/log.h" #include "cxxtools/hdstream.h" #include <limits> #include <stdint.h> #include <config.h> log_define("cxxtools.test.json") namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; const cxxtools::SerializationInfo* p = si.findMember("nullValue"); obj.nullValue = p != 0 && p->isNull(); } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.addMember("nullValue"); si.setTypeName("TestObject"); } bool operator== (const TestObject& obj1, const TestObject& obj2) { return obj1.intValue == obj2.intValue && obj1.stringValue == obj2.stringValue && obj1.doubleValue == obj2.doubleValue && obj1.boolValue == obj2.boolValue && obj1.nullValue == obj2.nullValue; } struct TestObject2 : public TestObject { typedef std::set<unsigned> SetType; typedef std::map<unsigned, std::string> MapType; SetType setValue; MapType mapValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast<TestObject&>(obj); si.getMember("setValue") >>= obj.setValue; si.getMember("mapValue") >>= obj.mapValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject2& obj) { si <<= static_cast<const TestObject&>(obj); si.addMember("setValue") <<= obj.setValue; si.addMember("mapValue") <<= obj.mapValue; si.setTypeName("TestObject2"); } bool operator== (const TestObject2& obj1, const TestObject2& obj2) { return static_cast<const TestObject&>(obj1) == static_cast<const TestObject&>(obj2) && obj1.setValue == obj2.setValue && obj1.mapValue == obj2.mapValue; } } class JsonTest : public cxxtools::unit::TestSuite { public: JsonTest() : cxxtools::unit::TestSuite("json") { registerMethod("testScalar", *this, &JsonTest::testScalar); registerMethod("testInt", *this, &JsonTest::testInt); registerMethod("testDouble", *this, &JsonTest::testDouble); registerMethod("testArray", *this, &JsonTest::testArray); registerMethod("testObject", *this, &JsonTest::testObject); registerMethod("testComplexObject", *this, &JsonTest::testComplexObject); registerMethod("testObjectVector", *this, &JsonTest::testObjectVector); registerMethod("testBinaryData", *this, &JsonTest::testBinaryData); } void testScalar() { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); int value = 5; serializer.serialize(value); serializer.finish(); log_debug("scalar: " << data.str()); int value2 = 0; deserializer.deserialize(value2); CXXTOOLS_UNIT_ASSERT_EQUALS(value, value2); } template <typename IntT> void testIntValue(IntT value) { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); serializer.serialize(value); serializer.finish(); log_debug("int: " << data.str()); IntT result = 0; deserializer.deserialize(result); CXXTOOLS_UNIT_ASSERT_EQUALS(value, result); } void testInt() { testIntValue(30); testIntValue(300); testIntValue(100000); testIntValue(-30); testIntValue(-300); testIntValue(-100000); testIntValue(static_cast<int16_t>(std::numeric_limits<int8_t>::max()) + 1); testIntValue(static_cast<int32_t>(std::numeric_limits<int16_t>::max()) + 1); testIntValue(std::numeric_limits<int32_t>::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1); testIntValue(std::numeric_limits<int64_t>::max()); #endif testIntValue(static_cast<int16_t>(std::numeric_limits<int8_t>::min()) - 1); testIntValue(static_cast<int32_t>(std::numeric_limits<int16_t>::min()) - 1); testIntValue(std::numeric_limits<int32_t>::min()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<int64_t>(std::numeric_limits<int32_t>::min()) - 1); testIntValue(std::numeric_limits<int64_t>::min()); #endif testIntValue(static_cast<uint16_t>(std::numeric_limits<uint8_t>::max()) + 1); testIntValue(static_cast<uint32_t>(std::numeric_limits<uint16_t>::max()) + 1); testIntValue(std::numeric_limits<uint32_t>::max()); #ifdef INT64_IS_BASETYPE testIntValue(static_cast<uint64_t>(std::numeric_limits<uint32_t>::max()) + 1); testIntValue(std::numeric_limits<uint64_t>::max()); #endif } void testDoubleValue(double value) { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); serializer.serialize(value); serializer.finish(); double result = 0.0; deserializer.deserialize(result); log_debug("test double value " << value << " => " << result); if (value != value) // check for nan CXXTOOLS_UNIT_ASSERT(result != result); else if (value == std::numeric_limits<double>::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, std::numeric_limits<double>::infinity()); else if (value == -std::numeric_limits<double>::infinity()) CXXTOOLS_UNIT_ASSERT_EQUALS(result, -std::numeric_limits<double>::infinity()); else CXXTOOLS_UNIT_ASSERT(value / result < 1.00001 && value / result > 0.99999); } void testDouble() { testDoubleValue(3.14159); testDoubleValue(-3.877e-12); } void testArray() { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); std::vector<int> intvector; intvector.push_back(4711); intvector.push_back(4712); intvector.push_back(-3); intvector.push_back(-257); serializer.serialize(intvector); serializer.finish(); log_debug("intvector: " << data.str()); std::vector<int> intvector2; deserializer.deserialize(intvector2); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector.size(), intvector2.size()); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[0], intvector2[0]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[1], intvector2[1]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[2], intvector2[2]); CXXTOOLS_UNIT_ASSERT_EQUALS(intvector[3], intvector2[3]); } void testObject() { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); TestObject obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = true; obj.nullValue = true; serializer.serialize(obj); serializer.finish(); TestObject obj2; deserializer.deserialize(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.intValue, obj2.intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.stringValue, obj2.stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.doubleValue, obj2.doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.boolValue, obj2.boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj.nullValue, obj2.nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testComplexObject() { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); std::vector<TestObject2> v; TestObject2 obj; obj.intValue = 17; obj.stringValue = "foobar"; obj.doubleValue = 3.125; obj.boolValue = false; obj.nullValue = true; obj.setValue.insert(17); obj.setValue.insert(23); obj.mapValue[45] = "fourtyfive"; obj.mapValue[88] = "eightyeight"; obj.mapValue[100] = "onehundred"; v.push_back(obj); obj.setValue.insert(88); v.push_back(obj); serializer.serialize(v); serializer.finish(); std::vector<TestObject2> v2; deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT(v == v2); } void testObjectVector() { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); std::vector<TestObject> obj; obj.resize(2); obj[0].intValue = 17; obj[0].stringValue = "foobar"; obj[0].doubleValue = 3.125; obj[0].boolValue = true; obj[0].nullValue = true; obj[1].intValue = 18; obj[1].stringValue = "hi there"; obj[1].doubleValue = -17.25; obj[1].boolValue = false; obj[1].nullValue = true; serializer.serialize(obj); serializer.finish(); std::vector<TestObject> obj2; deserializer.deserialize(obj2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj2.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].intValue, obj2[0].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].stringValue, obj2[0].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].doubleValue, obj2[0].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].boolValue, obj2[0].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[0].nullValue, obj2[0].nullValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].intValue, obj2[1].intValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].stringValue, obj2[1].stringValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].doubleValue, obj2[1].doubleValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].boolValue, obj2[1].boolValue); CXXTOOLS_UNIT_ASSERT_EQUALS(obj[1].nullValue, obj2[1].nullValue); CXXTOOLS_UNIT_ASSERT(obj == obj2); } void testBinaryData() { std::stringstream data; cxxtools::JsonSerializer serializer(data); cxxtools::JsonDeserializer deserializer(data); std::string v; for (unsigned n = 0; n < 1024; ++n) v.push_back(static_cast<char>(n)); serializer.serialize(v); serializer.finish(); log_debug("v.data=" << cxxtools::hexDump(data.str())); std::string v2; deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 1024); CXXTOOLS_UNIT_ASSERT(v == v2); data.str(std::string()); deserializer.clear(); for (unsigned n = 0; n < 0xffff; ++n) v.push_back(static_cast<char>(n)); serializer.serialize(v); serializer.finish(); log_debug("v.data=" << cxxtools::hexDump(data.str())); deserializer.deserialize(v2); CXXTOOLS_UNIT_ASSERT_EQUALS(v2.size(), 0xffff + 1024); CXXTOOLS_UNIT_ASSERT(v == v2); } }; cxxtools::unit::RegisterTest<JsonTest> register_JsonTest; ������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/test-main.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000002565�12256773774�013742� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testmain.h" �������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/iconvstream-test.cpp������������������������������������������������������������0000664�0001750�0001750�00000005665�12256773774�015354� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/iconvstream.h" class IconvstreamTest : public cxxtools::unit::TestSuite { public: IconvstreamTest() : cxxtools::unit::TestSuite("iconvstream") { registerMethod("testIconvstream", *this, &IconvstreamTest::testIconvstream); } void testIconvstream() { const std::string src("iconv error for Ω test"); const std::string res_cut("iconv error for "); const std::string res_skip("iconv error for test"); std::ostringstream out; cxxtools::iconvstreambuf ic; ic.open(out, "ascii", "UTF-8"); ic.sputn(src.data(), src.size()); ic.sync(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), res_cut); out.str(""); ic.open(out, "ascii", "UTF-8", cxxtools::iconvstreambuf::mode_skip); ic.sputn(src.data(), src.size()); ic.sync(); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), res_skip); CXXTOOLS_UNIT_ASSERT_EQUALS( ic.pubseekoff(0, std::ios_base::cur, std::ios_base::in), res_skip.size()); out.str(""); ic.open(out, "ascii", "UTF-8", cxxtools::iconvstreambuf::mode_throw); ic.sputn(src.data(), src.size()); CXXTOOLS_UNIT_ASSERT_THROW(ic.sync(), cxxtools::iconv_error); CXXTOOLS_UNIT_ASSERT_EQUALS(out.str(), res_cut); } }; cxxtools::unit::RegisterTest<IconvstreamTest> register_IconvstreamTest; ���������������������������������������������������������������������������cxxtools-2.2.1/test/pool-test.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000007247�12256773774�013771� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/pool.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class PoolTest : public cxxtools::unit::TestSuite { struct Object { static unsigned instCount; static unsigned ctorCount; Object() { ++instCount; ++ctorCount; } ~Object() { --instCount; } }; public: PoolTest() : cxxtools::unit::TestSuite("pool") { registerMethod("poolTest", *this, &PoolTest::poolTest); registerMethod("maxspareTest", *this, &PoolTest::maxspareTest); } void setUp() { Object::instCount = 0; Object::ctorCount = 0; } void poolTest() { { typedef cxxtools::Pool<Object> PoolType; PoolType pool; { PoolType::Ptr p = pool.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 1); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); { PoolType::Ptr p = pool.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 1); } CXXTOOLS_UNIT_ASSERT_EQUALS(Object::instCount, 0); } void maxspareTest() { typedef cxxtools::Pool<Object> PoolType; PoolType pool(3); { std::vector<PoolType::Ptr> p; while (p.size() < 10) p.push_back(pool.get()); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 10); p.pop_back(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); p.pop_back(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 2); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 3); { PoolType::Ptr b = pool.get(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 2); } CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::ctorCount, 10); pool.drop(1); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 1); pool.drop(); CXXTOOLS_UNIT_ASSERT_EQUALS(pool.size(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(Object::instCount, 0); } }; unsigned PoolTest::Object::instCount = 0; unsigned PoolTest::Object::ctorCount = 0; cxxtools::unit::RegisterTest<PoolTest> register_PoolTest; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/rpcbenchclient.cpp��������������������������������������������������������������0000664�0001750�0001750�00000016213�12256773774�015017� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/log.h> #include <cxxtools/arg.h> #include <cxxtools/remoteprocedure.h> #include <cxxtools/xmlrpc/httpclient.h> #include <cxxtools/bin/rpcclient.h> #include <cxxtools/json/rpcclient.h> #include <cxxtools/json/httpclient.h> #include <cxxtools/thread.h> #include <cxxtools/mutex.h> #include <cxxtools/clock.h> #include <cxxtools/timespan.h> #include <cxxtools/atomicity.h> class BenchClient { void exec(); cxxtools::RemoteClient* client; cxxtools::AttachedThread thread; static unsigned _numRequests; static unsigned _vectorSize; static cxxtools::atomic_t _requestsStarted; static cxxtools::atomic_t _requestsFinished; static cxxtools::atomic_t _requestsFailed; public: explicit BenchClient(cxxtools::RemoteClient* client_) : client(client_), thread(cxxtools::callable(*this, &BenchClient::exec)) { } ~BenchClient() { delete client; } static unsigned numRequests() { return _numRequests; } static void numRequests(unsigned n) { _numRequests = n; } static unsigned vectorSize() { return _vectorSize; } static void vectorSize(unsigned n) { _vectorSize = n; } static unsigned requestsStarted() { return static_cast<unsigned>(cxxtools::atomicGet(_requestsStarted)); } static unsigned requestsFinished() { return static_cast<unsigned>(cxxtools::atomicGet(_requestsFinished)); } static unsigned requestsFailed() { return static_cast<unsigned>(cxxtools::atomicGet(_requestsFailed)); } void start() { thread.start(); } void join() { thread.join(); } }; cxxtools::atomic_t BenchClient::_requestsStarted(0); cxxtools::atomic_t BenchClient::_requestsFinished(0); cxxtools::atomic_t BenchClient::_requestsFailed(0); unsigned BenchClient::_numRequests = 0; unsigned BenchClient::_vectorSize = 0; typedef std::vector<BenchClient*> BenchClients; static cxxtools::Mutex mutex; void BenchClient::exec() { cxxtools::RemoteProcedure<std::string, std::string> echo(*client, "echo"); cxxtools::RemoteProcedure<std::vector<int>, int, int> seq(*client, "seq"); while (static_cast<unsigned>(cxxtools::atomicIncrement(_requestsStarted)) <= _numRequests) { try { if (_vectorSize > 0) { std::vector<int> ret = seq(1, _vectorSize); cxxtools::atomicIncrement(_requestsFinished); if (ret.size() != _vectorSize) { std::cerr << "wrong response result size " << ret.size() << std::endl; cxxtools::atomicIncrement(_requestsFailed); } } else { std::string ret = echo("hi"); cxxtools::atomicIncrement(_requestsFinished); if (ret != "hi") { std::cerr << "wrong response result \"" << ret << '"' << std::endl; cxxtools::atomicIncrement(_requestsFailed); } } } catch (const std::exception& e) { { cxxtools::MutexLock lock(mutex); std::cerr << "request failed with error message \"" << e.what() << '"' << std::endl; } cxxtools::atomicIncrement(_requestsFailed); } } } int main(int argc, char* argv[]) { try { log_init("rpcbenchclient.properties"); cxxtools::Arg<std::string> ip(argc, argv, 'i'); cxxtools::Arg<unsigned> threads(argc, argv, 't', 4); cxxtools::Arg<bool> xmlrpc(argc, argv, 'x'); cxxtools::Arg<bool> binary(argc, argv, 'b'); cxxtools::Arg<bool> json(argc, argv, 'j'); cxxtools::Arg<bool> jsonhttp(argc, argv, 'J'); cxxtools::Arg<unsigned short> port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); BenchClient::numRequests(cxxtools::Arg<unsigned>(argc, argv, 'n', 10000)); BenchClient::vectorSize(cxxtools::Arg<unsigned>(argc, argv, 'v', 0)); if (!xmlrpc && !binary && !json && !jsonhttp) { std::cerr << "usage: " << argv[0] << " [options]\n" "options:\n" " -l ip set ip address of server (default: localhost)\n" " -p number set port number of server (default: 7002 for http, 7003 for binary and 7004 for json)\n" " -x use xmlrpc protocol\n" " -b use binary rpc protocol\n" " -j use json rpc protocol\n" " -J use json rpc over http protocol\n" " -t number set number of threads (default: 4)\n" " -n number set number of requests (default: 10000)\n" "one protocol must be selected\n" << std::endl; return -1; } BenchClients clients; while (clients.size() < threads) { cxxtools::RemoteClient* client; if (binary) client = new cxxtools::bin::RpcClient(ip, port); else if (json) client = new cxxtools::json::RpcClient(ip, port); else if (jsonhttp) client = new cxxtools::json::HttpClient(ip, port, "/jsonrpc"); else // if (xmlrpc) client = new cxxtools::xmlrpc::HttpClient(ip, port, "/xmlrpc"); clients.push_back(new BenchClient(client)); } cxxtools::Clock cl; cl.start(); for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) (*it)->start(); for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) (*it)->join(); cxxtools::Timespan t = cl.stop(); std::cout << BenchClient::numRequests() << " requests in " << t.totalMSecs()/1e3 << " s => " << (BenchClient::requestsStarted() / (t.totalMSecs()/1e3)) << "#/s\n" << BenchClient::requestsFinished() << " finished " << BenchClient::requestsFailed() << " failed" << std::endl; for (BenchClients::iterator it = clients.begin(); it != clients.end(); ++it) delete *it; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/xmlrpc-test.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000056220�12266277345�014312� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/xmlrpc/service.h" #include "cxxtools/xmlrpc/httpclient.h" #include "cxxtools/remoteexception.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/http/server.h" #include "cxxtools/eventloop.h" #include "cxxtools/log.h" #include <stdlib.h> #include <sstream> log_define("cxxtools.test.xmlrpc") namespace { struct Color { int red; int green; int blue; }; typedef std::set<int> IntSet; typedef std::multiset<int> IntMultiset; typedef std::map<int, int> IntMap; typedef std::multimap<int, int> IntMultimap; void operator >>=(const cxxtools::SerializationInfo& si, Color& color) { si.getMember("red") >>= color.red; si.getMember("green") >>= color.green; si.getMember("blue") >>= color.blue; } void operator <<=(cxxtools::SerializationInfo& si, const Color& color) { si.addMember("red") <<= color.red; si.addMember("green") <<= color.green; si.addMember("blue") <<= color.blue; } } class XmlRpcTest : public cxxtools::unit::TestSuite { private: cxxtools::EventLoop _loop; cxxtools::http::Server* _server; unsigned _count; unsigned short _port; public: XmlRpcTest() : cxxtools::unit::TestSuite("xmlrpc"), _port(8001) { registerMethod("Nothing", *this, &XmlRpcTest::Nothing); registerMethod("Boolean", *this, &XmlRpcTest::Boolean); registerMethod("Integer", *this, &XmlRpcTest::Integer); registerMethod("Double", *this, &XmlRpcTest::Double); registerMethod("String", *this, &XmlRpcTest::String); registerMethod("EmptyValues", *this, &XmlRpcTest::EmptyValues); registerMethod("Array", *this, &XmlRpcTest::Array); registerMethod("EmptyArray", *this, &XmlRpcTest::EmptyArray); registerMethod("Struct", *this, &XmlRpcTest::Struct); registerMethod("Set", *this, &XmlRpcTest::Set); registerMethod("Multiset", *this, &XmlRpcTest::Multiset); registerMethod("Map", *this, &XmlRpcTest::Map); registerMethod("Multimap", *this, &XmlRpcTest::Multimap); registerMethod("UnknownMethod", *this, &XmlRpcTest::UnknownMethod); registerMethod("Fault", *this, &XmlRpcTest::Fault); registerMethod("Exception", *this, &XmlRpcTest::Exception); registerMethod("CallbackException", *this, &XmlRpcTest::CallbackException); registerMethod("ConnectError", *this, &XmlRpcTest::ConnectError); registerMethod("BigRequest", *this, &XmlRpcTest::BigRequest); char* PORT = getenv("UTEST_PORT"); if (PORT) { std::istringstream s(PORT); s >> _port; } _loop.setIdleTimeout(2000); connect(_loop.timeout, *this, &XmlRpcTest::failTest); connect(_loop.timeout, _loop, &cxxtools::EventLoop::exit); } void failTest() { throw cxxtools::unit::Assertion("test timed out", CXXTOOLS_SOURCEINFO); } void setUp() { _server = new cxxtools::http::Server(_loop, _port); _server->minThreads(1); } void tearDown() { delete _server; } //////////////////////////////////////////////////////////// // Nothing // void Nothing() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), false); } bool multiplyNothing() { return false; } //////////////////////////////////////////////////////////// // CallbackException // void CallbackException() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyNothing); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcTest::onExceptionCallback ); multiply.begin(); _count = 0; CXXTOOLS_UNIT_ASSERT_THROW(_loop.run(), std::runtime_error); CXXTOOLS_UNIT_ASSERT_EQUALS(_count, 1); } void onExceptionCallback(const cxxtools::RemoteResult<bool>& r) { log_warn("exception callback"); ++_count; _loop.exit(); throw std::runtime_error("my error"); } //////////////////////////////////////////////////////////// // ConnectError // void ConnectError() { log_trace("ConnectError"); cxxtools::xmlrpc::HttpClient client(_loop, "", _port + 1, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); connect( multiply.finished, *this, &XmlRpcTest::onConnectErrorCallback ); multiply.begin(); try { _loop.run(); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } void onConnectErrorCallback(const cxxtools::RemoteResult<bool>& r) { log_debug("onConnectErrorCallback"); _loop.exit(); CXXTOOLS_UNIT_ASSERT_THROW(r.get(), std::exception); } //////////////////////////////////////////////////////////// // Boolean // void Boolean() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyBoolean); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool, bool, bool> multiply(client, "multiply"); multiply.begin(true, true); bool r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r, true); } bool multiplyBoolean(bool a, bool b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, true); CXXTOOLS_UNIT_ASSERT_EQUALS(b, true); return true; } //////////////////////////////////////////////////////////// // Integer // void Integer() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyInt); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<int, int, int> multiply(client, "multiply"); multiply.begin(2, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6); } int multiplyInt(int a, int b) { return a*b; } //////////////////////////////////////////////////////////// // Double // void Double() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyDouble); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<double, double, double> multiply(client, "multiply"); multiply.begin(2.0, 3.0); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), 6.0); } double multiplyDouble(double a, double b) { return a*b; } //////////////////////////////////////////////////////////// // String // void String() { cxxtools::xmlrpc::Service service; service.registerMethod("echoString", *this, &XmlRpcTest::echoString); _server->addService("/foo", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/foo"); cxxtools::RemoteProcedure<std::string, std::string> echo(client, "echoString"); echo.begin("\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); CXXTOOLS_UNIT_ASSERT_EQUALS(echo.end(2000), "\xc3\xaf\xc2\xbb\xc2\xbf'\"&<> foo?"); } std::string echoString(std::string a) { return a; } //////////////////////////////////////////////////////////// // EmptyValues // void EmptyValues() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyEmpty); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<std::string, std::string, std::string> multiply(client, "multiply"); multiply.begin("", ""); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000), "4"); } std::string multiplyEmpty(std::string a, std::string b) { CXXTOOLS_UNIT_ASSERT_EQUALS(a, ""); CXXTOOLS_UNIT_ASSERT_EQUALS(b, ""); return "4"; } //////////////////////////////////////////////////////////// // Array // void Array() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; vec.push_back(10); vec.push_back(20); multiply.begin(vec, vec); std::vector<int> r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(0), 100); CXXTOOLS_UNIT_ASSERT_EQUALS(r.at(1), 400); } std::vector<int> multiplyVector(const std::vector<int>& a, const std::vector<int>& b) { std::vector<int> r; if( a.size() ) { r.push_back( a.at(0) * b.at(0) ); r.push_back( a.at(1) * b.at(1) ); } return r; } //////////////////////////////////////////////////////////// // EmptyArray // void EmptyArray() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyVector); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure< std::vector<int>, std::vector<int>, std::vector<int> > multiply(client, "multiply"); std::vector<int> vec; multiply.begin(vec, vec); CXXTOOLS_UNIT_ASSERT_EQUALS(multiply.end(2000).size(), 0); } //////////////////////////////////////////////////////////// // Struct // void Struct() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::multiplyColor); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure< Color, Color, Color > multiply(client, "multiply"); Color a; a.red = 2; a.green = 3; a.blue = 4; Color b; b.red = 3; b.green = 4; b.blue = 5; multiply.begin(a, b); Color r = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(r.red, 6); CXXTOOLS_UNIT_ASSERT_EQUALS(r.green, 12); CXXTOOLS_UNIT_ASSERT_EQUALS(r.blue, 20); } Color multiplyColor(const Color& a, const Color& b) { Color color; color.red = a.red * b.red; color.green = a.green * b.green; color.blue = a.blue * b.blue; return color; } //////////////////////////////////////////////////////////// // Set // void Set() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcTest::multiplySet); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntSet, IntSet, int> multiply(client, "multiplyset"); IntSet myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntSet& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(8) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(10) != v.end()); CXXTOOLS_UNIT_ASSERT(v.find(22) != v.end()); } IntSet multiplySet(const IntSet& s, int f) { IntSet ret; for (IntSet::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Multiset // void Multiset() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplyset", *this, &XmlRpcTest::multiplyMultiset); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMultiset, IntMultiset, int> multiply(client, "multiplyset"); IntMultiset myset; myset.insert(4); myset.insert(5); myset.insert(11); myset.insert(5); multiply.begin(myset, 2); const IntMultiset& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(8), 1); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(10), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(v.count(22), 1); } IntMultiset multiplyMultiset(const IntMultiset& s, int f) { IntMultiset ret; for (IntMultiset::const_iterator it = s.begin(); it != s.end(); ++it) ret.insert(*it * f); return ret; } //////////////////////////////////////////////////////////// // Map // void Map() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymap", *this, &XmlRpcTest::multiplyMap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMap, IntMap, int> multiply(client, "multiplymap"); IntMap mymap; mymap[2] = 4; mymap[7] = 7; mymap[1] = -1; multiply.begin(mymap, 2); const IntMap& v = multiply.end(2000); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 3); CXXTOOLS_UNIT_ASSERT(v.find(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.find(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(7)->second, 14); CXXTOOLS_UNIT_ASSERT(v.find(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.find(1)->second, -2); } IntMap multiplyMap(const IntMap& m, int f) { IntMap ret; for (IntMap::const_iterator it = m.begin(); it != m.end(); ++it) { ret[it->first] = it->second * f; } return ret; } //////////////////////////////////////////////////////////// // Multimap // void Multimap() { cxxtools::xmlrpc::Service service; service.registerMethod("multiplymultimap", *this, &XmlRpcTest::multiplyMultimap); _server->addService("/test", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/test"); cxxtools::RemoteProcedure<IntMultimap, IntMultimap, int> multiply(client, "multiplymultimap"); IntMultimap mymap; mymap.insert(IntMultimap::value_type(2, 4)); mymap.insert(IntMultimap::value_type(7, 7)); mymap.insert(IntMultimap::value_type(7, 8)); mymap.insert(IntMultimap::value_type(1, -1)); multiply.begin(mymap, 2); const IntMultimap& v = multiply.end(200); CXXTOOLS_UNIT_ASSERT_EQUALS(v.size(), 4); CXXTOOLS_UNIT_ASSERT(v.lower_bound(2) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(2)->second, 8); CXXTOOLS_UNIT_ASSERT(v.lower_bound(7) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(7)->second, 14); IntMultimap::const_iterator it = v.lower_bound(7); ++it; CXXTOOLS_UNIT_ASSERT(it != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(it->first, 7); CXXTOOLS_UNIT_ASSERT_EQUALS(it->second, 16); CXXTOOLS_UNIT_ASSERT(v.lower_bound(1) != v.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(v.lower_bound(1)->second, -2); } IntMultimap multiplyMultimap(const IntMultimap& m, int f) { IntMultimap ret; for (IntMultimap::const_iterator it = m.begin(); it != m.end(); ++it) { ret.insert(IntMultimap::value_type(it->first, it->second * f)); } return ret; } //////////////////////////////////////////////////////////// // UnknownMethod // void UnknownMethod() { cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::xmlrpc::Service service; _server->addService("/rpc", service); cxxtools::RemoteProcedure<bool, bool, bool> unknownMethod(client, "unknownMethod"); unknownMethod.begin(true, true); CXXTOOLS_UNIT_ASSERT_THROW(unknownMethod.end(2000), cxxtools::RemoteException); } //////////////////////////////////////////////////////////// // Fault // void Fault() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::throwFault); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT_MSG(false, "cxxtools::RemoteException exception expected"); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 7); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Fault"); } } bool throwFault() { throw cxxtools::RemoteException("Fault", 7); return false; } //////////////////////////////////////////////////////////// // Exception // void Exception() { cxxtools::xmlrpc::Service service; service.registerMethod("multiply", *this, &XmlRpcTest::throwException); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<bool> multiply(client, "multiply"); multiply.begin(); try { multiply.end(2000); CXXTOOLS_UNIT_ASSERT(false); } catch (const cxxtools::RemoteException& e) { CXXTOOLS_UNIT_ASSERT_EQUALS(e.rc(), 0); CXXTOOLS_UNIT_ASSERT_EQUALS(e.text(), "Exception"); } } bool throwException() { throw std::runtime_error("Exception"); return false; } //////////////////////////////////////////////////////////// // BigRequest // void BigRequest() { log_trace("ConnectError"); cxxtools::xmlrpc::Service service; service.registerMethod("countSize", *this, &XmlRpcTest::countSize); _server->addService("/rpc", service); cxxtools::xmlrpc::HttpClient client(_loop, "", _port, "/rpc"); cxxtools::RemoteProcedure<unsigned, std::vector<int> > countSize(client, "countSize"); std::vector<int> v; v.resize(5000); countSize.begin(v); try { CXXTOOLS_UNIT_ASSERT_EQUALS(countSize.end(2000), 5000); } catch (const std::exception& e) { log_error("loop exited with exception: " << e.what()); CXXTOOLS_UNIT_ASSERT_MSG(false, std::string("unexpected exception ") + typeid(e).name() + ": " + e.what()); } } unsigned countSize(const std::vector<int>& v) { return v.size(); } }; cxxtools::unit::RegisterTest<XmlRpcTest> register_XmlRpcTest; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/jsondeserializer-test.cpp�������������������������������������������������������0000664�0001750�0001750�00000023755�12266277345�016370� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" #include "cxxtools/jsondeserializer.h" #include "cxxtools/log.h" //log_define("cxxtools.test.jsondeserializer") // namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; bool nullValue; TestObject() : intValue(0), doubleValue(0), boolValue(false), nullValue(false) { } }; inline void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; const cxxtools::SerializationInfo* p = si.findMember("nullValue"); obj.nullValue = p != 0 && p->isNull(); } struct TestObject2 : public TestObject { std::set<short> setValue; struct { unsigned n; cxxtools::String s; } structValue; }; inline void operator>>= (const cxxtools::SerializationInfo& si, TestObject2& obj) { si >>= static_cast<TestObject&>(obj); si.getMember("setValue") >>= obj.setValue; const cxxtools::SerializationInfo& ssi = si.getMember("structValue"); ssi.getMember("n") >>= obj.structValue.n; ssi.getMember("s") >>= obj.structValue.s; } struct EmptyObject { }; inline void operator>>= (const cxxtools::SerializationInfo& si, EmptyObject& obj) { } } class JsonDeserializerTest : public cxxtools::unit::TestSuite { public: JsonDeserializerTest() : cxxtools::unit::TestSuite("jsondeserializer") { registerMethod("testInt", *this, &JsonDeserializerTest::testInt); registerMethod("testObject", *this, &JsonDeserializerTest::testObject); registerMethod("testEmptyObject", *this, &JsonDeserializerTest::testEmptyObject); registerMethod("testArray", *this, &JsonDeserializerTest::testArray); registerMethod("testEmptyArrays", *this, &JsonDeserializerTest::testEmptyArrays); registerMethod("testStrings", *this, &JsonDeserializerTest::testStrings); registerMethod("testComplexObject", *this, &JsonDeserializerTest::testComplexObject); registerMethod("testCommentLine", *this, &JsonDeserializerTest::testCommentLine); registerMethod("testCommentMultiline", *this, &JsonDeserializerTest::testCommentMultiline); } void testInt() { int data = 0; std::istringstream in("-4711"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, -4711); } void testObject() { TestObject data; std::istringstream in(" {" "\"intValue\": 17, " "\"stringValue\": \"foo bar\t\"," "\"doubleValue\": \"1000\", " "\"boolValue\" : true," "\"nullValue\" : null" "}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); } void testEmptyObject() { EmptyObject data; std::istringstream in("{}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); } void testArray() { std::vector<int> data; std::istringstream in(" [ 3,4, -3]"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], 4); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2], -3); } void testEmptyArrays() { std::vector<int> data; std::istringstream in("[[],[]]"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], 0); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], 0); } void testStrings() { std::vector<cxxtools::String> data; std::istringstream in(" [ \"3\", \"\\t\\b\", \"\", \"\\u1e044\"]"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.size(), 4); CXXTOOLS_UNIT_ASSERT_EQUALS(data[0], "3"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[1], "\t\b"); CXXTOOLS_UNIT_ASSERT_EQUALS(data[2], ""); CXXTOOLS_UNIT_ASSERT_EQUALS(data[3].size(), 2); CXXTOOLS_UNIT_ASSERT_EQUALS(data[3][0].value(), 0x1e04); CXXTOOLS_UNIT_ASSERT_EQUALS(data[3][1], '4'); } void testComplexObject() { TestObject2 data; std::istringstream in(" {" "\"intValue\": 17, " "\"stringValue\": \"foo bar\t\"," "\"doubleValue\": \"1000\", " "\"boolValue\" : true," "\"nullValue\" : null," "\"setValue\":[5,7,8]," "\"structValue\" : { \"n\":3,\"s\":\"sss\"}" "}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.setValue.size(), 3); CXXTOOLS_UNIT_ASSERT(data.setValue.find(5) != data.setValue.end()); CXXTOOLS_UNIT_ASSERT(data.setValue.find(7) != data.setValue.end()); CXXTOOLS_UNIT_ASSERT(data.setValue.find(8) != data.setValue.end()); CXXTOOLS_UNIT_ASSERT_EQUALS(data.structValue.n, 3); CXXTOOLS_UNIT_ASSERT_EQUALS(data.structValue.s, "sss"); } void testCommentLine() { TestObject data; std::istringstream in("// \n { //\n" "\"intValue\"//\n: //\n 17 //\n, " "\"stringValue\": //\n\"foo bar\t\"//\n," "\"doubleValue\": \"1000\", " "\"boolValue\" : //\n true," "\"nullValue\" : null" "//\n}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); { int data = 0; std::istringstream in("//\n-4711"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data, -4711); } } void testCommentMultiline() { TestObject data; std::istringstream in("/* */ { /* */" "\"intValue\"/* */: /* */ 17 /* */, " "\"stringValue\": /* */\"foo bar\t\"/* */," "\"doubleValue\": \"1000\", " "\"boolValue\" : /* \n */ true," "\"nullValue\" : null" "/* */}"); cxxtools::JsonDeserializer deserializer(in); deserializer.deserialize(data); CXXTOOLS_UNIT_ASSERT_EQUALS(data.intValue, 17); CXXTOOLS_UNIT_ASSERT_EQUALS(data.stringValue, "foo bar\t"); CXXTOOLS_UNIT_ASSERT_EQUALS(data.doubleValue, 1000.0); CXXTOOLS_UNIT_ASSERT_EQUALS(data.boolValue, true); CXXTOOLS_UNIT_ASSERT_EQUALS(data.nullValue, true); } }; cxxtools::unit::RegisterTest<JsonDeserializerTest> register_JsonDeserializerTest; �������������������cxxtools-2.2.1/test/serializer-bench.cpp������������������������������������������������������������0000664�0001750�0001750�00000016530�12266277345�015256� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <fstream> #include <math.h> #include <cxxtools/xml/xmlserializer.h> #include <cxxtools/xml/xmldeserializer.h> #include <cxxtools/jsonserializer.h> #include <cxxtools/jsondeserializer.h> #include <cxxtools/bin/serializer.h> #include <cxxtools/bin/deserializer.h> #include <cxxtools/arg.h> #include <cxxtools/clock.h> #include <cxxtools/convert.h> #include <cxxtools/tee.h> #include <cxxtools/log.h> namespace { struct TestObject { int intValue; std::string stringValue; double doubleValue; bool boolValue; }; void operator>>= (const cxxtools::SerializationInfo& si, TestObject& obj) { si.getMember("intValue") >>= obj.intValue; si.getMember("stringValue") >>= obj.stringValue; si.getMember("doubleValue") >>= obj.doubleValue; si.getMember("boolValue") >>= obj.boolValue; } void operator<<= (cxxtools::SerializationInfo& si, const TestObject& obj) { si.addMember("intValue") <<= obj.intValue; si.addMember("stringValue") <<= obj.stringValue; si.addMember("doubleValue") <<= obj.doubleValue; si.addMember("boolValue") <<= obj.boolValue; si.setTypeName("TestObject"); } class JsonSerializer2 : public cxxtools::JsonSerializer { public: JsonSerializer2() { } explicit JsonSerializer2(std::basic_ostream<cxxtools::Char>& ts) : cxxtools::JsonSerializer(ts) { } explicit JsonSerializer2(std::ostream& os, cxxtools::TextCodec<cxxtools::Char, char>* codec = 0) : cxxtools::JsonSerializer(os, codec) { } template <typename T> JsonSerializer2& serialize(const T& v, const std::string& name) { cxxtools::JsonSerializer::serialize(v); return *this; } }; } template <typename T, typename Serializer, typename Deserializer> void benchSerialization(const T& d, const char* fname = 0) { std::stringstream data; Serializer serializer(data); Deserializer deserializer(data); cxxtools::Clock clock; clock.start(); serializer.serialize(d, "d"); serializer.finish(); cxxtools::Timespan ts = clock.stop(); if (fname) { std::ofstream f(fname); f << data.str(); } T v2; clock.start(); deserializer.deserialize(v2); cxxtools::Timespan td = clock.stop(); std::cout << "\tserialization: " << ts.toUSecs() / 1e6 << " sec\n" "\tdeserialization: " << td.toUSecs() / 1e6 << " sec\n" "\tsize: " << data.str().size() << " bytes" << std::endl; } template <typename T> void benchXmlSerialization(const T& d, const char* fname = 0) { benchSerialization<T, cxxtools::xml::XmlSerializer, cxxtools::xml::XmlDeserializer>(d, fname); } template <typename T> void benchJsonSerialization(const T& d, const char* fname = 0) { benchSerialization<T, JsonSerializer2, cxxtools::JsonDeserializer>(d, fname); } template <typename T> void benchBinSerialization(const T& d, const char* fname = 0) { benchSerialization<T, cxxtools::bin::Serializer, cxxtools::bin::Deserializer>(d, fname); } template <typename T> void benchVector(const char* typeName, unsigned N, T increment, bool fileoutput) { std::cout << "vector of " << typeName << " values:" << std::endl; std::vector<T> v; T value = 0; for (unsigned n = 0; n < N; ++n, value += increment) v.push_back(value); std::cout << "xml:" << std::endl; benchXmlSerialization(v, fileoutput ? (std::string("vector-") + typeName + ".xml").c_str() : 0); std::cout << "json:" << std::endl; benchJsonSerialization(v, fileoutput ? (std::string("vector-") + typeName + ".json").c_str() : 0); std::cout << "bin:" << std::endl; benchBinSerialization(v, fileoutput ? (std::string("vector-") + typeName + ".bin").c_str() : 0); } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg<unsigned> nn(argc, argv, 'n', 100000); cxxtools::Arg<unsigned> I(argc, argv, 'I', nn); cxxtools::Arg<unsigned> D(argc, argv, 'D', nn); cxxtools::Arg<unsigned> C(argc, argv, 'C', nn); cxxtools::Arg<bool> fileoutput(argc, argv, 'f'); std::cout << "benchmark serializer with " << I.getValue() << " int vector " << D.getValue() << " double vector and " << C.getValue() << " custom vector iterations\n\n" "options:\n" " -n <number> specify number of default iterations\n" " -I <number> specify number of iterations for int vector\n" " -D <number> specify number of iterations for double vector\n" " -C <number> specify number of iterations for custom object\n" " -f write serialized output to files\n" << std::endl; if (I.getValue() > 0) benchVector<int>("int", I, 1, fileoutput); if (D.getValue() > 0) benchVector<double>("double", D, 0.25, fileoutput); if (C.getValue() > 0) { std::cout << "vector of custom objects:" << std::endl; TestObject obj; std::vector<TestObject> v; for (unsigned n = 0; n < C; ++n) { obj.intValue = n; obj.stringValue = cxxtools::convert<std::string>(n); obj.doubleValue = sqrt(static_cast<double>(n)); obj.boolValue = n&1; v.push_back(obj); } std::cout << "xml:" << std::endl; benchXmlSerialization(v, fileoutput ? "custobject.xml" : 0); std::cout << "json:" << std::endl; benchJsonSerialization(v, fileoutput ? "custobject.json" : 0); std::cout << "bin:" << std::endl; benchBinSerialization(v, fileoutput ? "custobject.bin" : 0); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/test/uri-test.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000021642�12256773774�013612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/net/uri.h" #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/registertest.h" class UriTest : public cxxtools::unit::TestSuite { public: UriTest() : cxxtools::unit::TestSuite("uri") { registerMethod("testUri_UPHP", *this, &UriTest::testUri_UPHP); registerMethod("testUri_UHP", *this, &UriTest::testUri_UHP); registerMethod("testUri_UPH", *this, &UriTest::testUri_UPH); registerMethod("testUri_HP", *this, &UriTest::testUri_HP); registerMethod("testUri_H", *this, &UriTest::testUri_H); registerMethod("testUri_UPH6P", *this, &UriTest::testUri_UPH6P); registerMethod("testUri_UH6P", *this, &UriTest::testUri_UH6P); registerMethod("testUri_UPH6", *this, &UriTest::testUri_UPH6); registerMethod("testUri_H6P", *this, &UriTest::testUri_H6P); registerMethod("testUri_H6", *this, &UriTest::testUri_H6); registerMethod("testQuery", *this, &UriTest::testQuery); registerMethod("testFragment", *this, &UriTest::testFragment); registerMethod("testQueryFragment", *this, &UriTest::testQueryFragment); registerMethod("testHttpPort", *this, &UriTest::testHttpPort); registerMethod("testHttpsPort", *this, &UriTest::testHttpsPort); registerMethod("testFtpPort", *this, &UriTest::testFtpPort); registerMethod("testUriStr", *this, &UriTest::testUriStr); } void testUri_UPHP() { cxxtools::net::Uri uri("http://user:password@host:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UHP() { cxxtools::net::Uri uri("http://user@host:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UPH() { cxxtools::net::Uri uri("http://user:password@host/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_HP() { cxxtools::net::Uri uri("http://host:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_H() { cxxtools::net::Uri uri("http://host/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "host"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UPH6P() { cxxtools::net::Uri uri("http://user:password@[::1]:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UH6P() { cxxtools::net::Uri uri("http://user@[::1]:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_UPH6() { cxxtools::net::Uri uri("http://user:password@[::1]/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), "user"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), "password"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_H6P() { cxxtools::net::Uri uri("http://[::1]:56/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 56); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testUri_H6() { cxxtools::net::Uri uri("http://[::1]/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.protocol(), "http"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.user(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.password(), ""); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.host(), "::1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.path(), "/blah.html"); } void testQuery() { cxxtools::net::Uri uri("http://host/?abc=1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.query(), "abc=1"); } void testFragment() { cxxtools::net::Uri uri("http://host/#foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.fragment(), "foo"); } void testQueryFragment() { cxxtools::net::Uri uri("http://host/?abc=1#foo"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.query(), "abc=1"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.fragment(), "foo"); } void testHttpPort() { cxxtools::net::Uri uri("http://host/"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 80); } void testHttpsPort() { cxxtools::net::Uri uri("https://host/"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 443); } void testFtpPort() { cxxtools::net::Uri uri("ftp://host/"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.port(), 21); } void testUriStr() { cxxtools::net::Uri uri("http://user:password@host:80/blah.html"); CXXTOOLS_UNIT_ASSERT_EQUALS(uri.str(), "http://user:password@host/blah.html"); } }; cxxtools::unit::RegisterTest<UriTest> register_UriTest; ����������������������������������������������������������������������������������������������cxxtools-2.2.1/src/���������������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�011211� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/pipeimpl.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000007164�12260037210�013435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "pipeimpl.h" #include "cxxtools/systemerror.h" #include <memory> #include <cerrno> #include <unistd.h> #include <fcntl.h> namespace cxxtools { PipeIODevice::PipeIODevice() : _impl(*this) { } PipeIODevice::~PipeIODevice() { try { IODevice::close(); } catch(...) {} } void PipeIODevice::redirect(int newFd, bool close, bool inherit) { int ret = ::dup2(fd(), newFd); if (ret < 0) throw SystemError("dup2"); if (close) { IODevice::close(); _impl.open(newFd, async(), inherit); } } void PipeIODevice::open(int fd, bool isAsync) { _impl.open(fd, isAsync, true); this->setEnabled(true); this->setAsync(isAsync); this->setEof(false); } bool PipeIODevice::onWait(std::size_t msecs) { return _impl.wait(msecs); } size_t PipeIODevice::onBeginRead(char* buffer, size_t n, bool& eof) { return _impl.beginRead(buffer, n, eof); } size_t PipeIODevice::onEndRead(bool& eof) { return _impl.endRead(eof); } size_t PipeIODevice::onRead(char* buffer, size_t count, bool& eof) { return _impl.read(buffer, count, eof); } size_t PipeIODevice::onBeginWrite(const char* buffer, size_t n) { return _impl.beginWrite(buffer, n); } size_t PipeIODevice::onEndWrite() { return _impl.endWrite(); } size_t PipeIODevice::onWrite(const char* buffer, size_t count) { return _impl.write(buffer, count); } void PipeIODevice::onCancel() { _impl.cancel(); } void PipeIODevice::onSync() const { _impl.sync(); } PipeImpl::PipeImpl(bool isAsync) { int fds[2]; if(-1 == ::pipe(fds) ) throw SystemError("pipe"); _out.open( fds[0], isAsync ); _in.open( fds[1], isAsync ); } PipeIODevice& PipeImpl::out() { return _out; } const PipeIODevice& PipeImpl::out() const { return _out; } PipeIODevice& PipeImpl::in() { return _in; } const PipeIODevice& PipeImpl::in() const { return _in; } void PipeImpl::redirectStdin(bool close, bool inherit) { out().redirect(0, close, inherit); } void PipeImpl::redirectStdout(bool close, bool inherit) { in().redirect(1, close, inherit); } void PipeImpl::redirectStderr(bool close, bool inherit) { in().redirect(2, close, inherit); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/csvformatter.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000015062�12266277345�014356� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/csvformatter.h> #include <cxxtools/log.h> log_define("cxxtools.csv.formatter") namespace cxxtools { CsvFormatter::CsvFormatter(std::ostream& os, TextCodec<Char, char>* codec) : _firstline(true), _collectTitles(true), _level(0), _delimiter(','), _quote('"'), _lineEnding(L"\n"), _ts(new TextOStream(os, codec)), _os(*_ts) { } CsvFormatter::CsvFormatter(TextOStream& os) : _firstline(true), _collectTitles(true), _level(0), _delimiter(','), _quote('"'), _lineEnding(L"\n"), _ts(0), _os(os) { } CsvFormatter::~CsvFormatter() { delete _ts; } void CsvFormatter::selectColumn(const std::string& title) { _titles.resize(_titles.size() + 1); _titles.back()._memberName = title; _titles.back()._title = title; _collectTitles = false; } void CsvFormatter::selectColumn(const std::string& memberName, const std::string& title) { _titles.resize(_titles.size() + 1); _titles.back()._memberName = memberName; _titles.back()._title = title; _collectTitles = false; } void CsvFormatter::toCsvData(String& ret, const std::string& type, const String& value) { if (value.find(Char(_quote)) == String::npos && value.find(Char(_delimiter)) == String::npos) { ret = value; } else { ret.clear(); ret += _quote; for (String::const_iterator it = value.begin(); it != value.end(); ++it) { if (*it == _quote) { ret += _quote; ret += _quote; } else ret += *it; } ret += _quote; } } void CsvFormatter::dataOut() { if (_firstline) { if (!_titles.empty()) { log_debug("print " << _titles.size() << " titles"); for (unsigned n = 0; n < _titles.size(); ++n) { if (n > 0) _os << _delimiter; _os << String(_titles[n]._title); } _os << _lineEnding; } _firstline = false; _collectTitles = false; } log_debug("output " << _data.size() << " columns"); for (unsigned n = 0; n < _data.size(); ++n) { if (n > 0) _os << _delimiter; _os << _data[n]; } _os << _lineEnding; _data.clear(); } void CsvFormatter::addValueString(const std::string& name, const std::string& type, const String& value) { if (_memberName.empty()) { log_debug("addValue plain value \"" << value << '"'); _data.push_back(String()); toCsvData(_data.back(), type, value); } else { log_debug("addValue member \"" << _memberName << "\" value \"" << value << '"'); for (unsigned n = 0; n < _titles.size(); ++n) { if (_titles[n]._memberName == _memberName) { log_debug("column " << n); if (_data.size() <= n) _data.resize(n + 1); toCsvData(_data[n], type, value); _memberName.clear(); break; } } } } void CsvFormatter::beginArray(const std::string& name, const std::string& type) { ++_level; log_debug("beginArray, level=" << _level); } void CsvFormatter::finishArray() { --_level; log_debug("finishArray, level=" << _level); if (_level == 1) dataOut(); } void CsvFormatter::beginObject(const std::string& name, const std::string& type) { ++_level; log_debug("beginObject, level=" << _level); } void CsvFormatter::beginMember(const std::string& name) { log_debug("beginMember " << name); if (_collectTitles && _firstline && _level == 2) { log_debug("add title " << name); _titles.resize(_titles.size() + 1); _titles.back()._title = name; _titles.back()._memberName = name; } _memberName = name; } void CsvFormatter::finishMember() { log_debug("finishMember"); _memberName.clear(); } void CsvFormatter::finishObject() { --_level; log_debug("finishObject, level=" << _level); if (_level == 1) dataOut(); } void CsvFormatter::finish() { log_debug("finish"); if (_firstline && !_titles.empty()) { log_debug("print " << _titles.size() << " titles"); for (unsigned n = 0; n < _titles.size(); ++n) { if (n > 0) _os << _delimiter; _os << String(_titles[n]._title); } _os << _lineEnding; } _os.flush(); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/md5.c����������������������������������������������������������������������������0000664�0001750�0001750�00000024167�12256773774�012000� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include "md5.h" #include <string.h> #define MD5_CTX struct cxxtools_MD5_CTX /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform PROTO_LIST ((UINT4 [4], const unsigned char [64])); static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); static void Decode PROTO_LIST ((UINT4 *, const unsigned char *, unsigned int)); /* static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); */ #define MD5_memcpy memcpy #define MD5_memset memset static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void cxxtools_MD5Init (MD5_CTX* context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void cxxtools_MD5Update ( MD5_CTX *context, const unsigned char *input, /* input block */ unsigned int inputLen) /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ void cxxtools_MD5Final ( unsigned char digest[16], /* message digest */ MD5_CTX *context) /* context */ { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); cxxtools_MD5Update (context, PADDING, padLen); /* Append length (before padding) */ cxxtools_MD5Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ MD5_memset ((POINTER)context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform ( UINT4 state[4], const unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ MD5_memset ((POINTER)x, 0, sizeof (x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode ( unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ static void Decode ( UINT4 *output, const unsigned char *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } #if 0 /* Note: Replace "for loop" with standard memcpy if possible. */ static void MD5_memcpy ( POINTER output, POINTER input, unsigned int len) { unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } /* Note: Replace "for loop" with standard memset if possible. */ static void MD5_memset ( POINTER output, int value, unsigned int len) { unsigned int i; for (i = 0; i < len; i++) ((char *)output)[i] = (char)value; } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/uuencode.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000006534�12256773774�013460� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/uuencode.h" namespace cxxtools { static char cv[65] = "`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; void Uuencode_streambuf::begin(const std::string& filename, unsigned mode) { sinksource->sputn("begin ", 6); sinksource->sputc(((mode >> 6) & 0x7) + '0'); sinksource->sputc(((mode >> 3) & 0x7) + '0'); sinksource->sputc((mode & 0x7) + '0'); sinksource->sputc(' '); sinksource->sputn(filename.data(), filename.size()); sinksource->sputc('\n'); inStream = true; } void Uuencode_streambuf::end() { if (pbase() != pptr()) { sinksource->sputc(cv[pptr() - pbase()]); for (const char* p = pbase(); p < pptr(); p += 3) { char A = p[0]; char B = p < pptr() - 1 ? p[1] : 0; char C = p < pptr() - 2 ? p[2] : 0; sinksource->sputc(cv[(A >> 2) & 0x3F]); sinksource->sputc(cv[((A << 4) | ((B >> 4) & 0xF)) & 0x3F]); sinksource->sputc(cv[((B << 2) | ((C >> 6) & 0x3)) & 0x3F]); sinksource->sputc(cv[( C ) & 0x3F]); } sinksource->sputn("\n`\n", 3); setp(obuffer, obuffer + length); } if (inStream) { sinksource->sputn("end\n", 4); inStream = false; } } std::streambuf::int_type Uuencode_streambuf::overflow(std::streambuf::int_type ch) { if (pbase() != epptr()) { sinksource->sputc(cv[pptr() - pbase()]); for (const char* p = pbase(); p < pptr(); p += 3) { char A = p[0]; char B = p[1]; char C = p[2]; sinksource->sputc(cv[(A >> 2) & 0x3F]); sinksource->sputc(cv[((A << 4) | ((B >> 4) & 0xF)) & 0x3F]); sinksource->sputc(cv[((B << 2) | ((C >> 6) & 0x3)) & 0x3F]); sinksource->sputc(cv[( C ) & 0x3F]); } sinksource->sputc('\n'); } setp(obuffer, obuffer + length); if (ch != traits_type::eof()) { *pptr() = (char_type)ch; pbump(1); } return 0; } std::streambuf::int_type Uuencode_streambuf::underflow() { return traits_type::eof(); } int Uuencode_streambuf::sync() { return 0; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/date.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000010071�12266277345�012547� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/date.h" #include "cxxtools/convert.h" #include "cxxtools/serializationinfo.h" #include <cctype> namespace cxxtools { InvalidDate::InvalidDate() : std::invalid_argument("Invalid date") { } void greg2jul(unsigned& jd, int y, int m, int d) { if( ! Date::isValid(y, m, d) ) { throw InvalidDate(); } jd=(1461*(y+4800+(m-14)/12))/4+(367*(m-2-12*((m-14)/12)))/12-(3*((y+4900+(m-14)/12)/100))/4+d-32075; } void jul2greg(unsigned jd, int& y, int& m, int& d) { register int l,n,i,j; l=jd+68569; n=(4*l)/146097; l=l-(146097*n+3)/4; i=(4000*(l+1))/1461001; l=l-(1461*i)/4+31; j=(80*l)/2447; d=l-(2447*j)/80; l=j/11; m=j+2-(12*l); y=100*(n-49)+i+l; } namespace { unsigned short getNumber2(const char* s) { if (!std::isdigit(s[0]) || !std::isdigit(s[1])) { throw ConversionError("Invalid date format"); } return (s[0] - '0') * 10 + (s[1] - '0'); } unsigned short getNumber4(const char* s) { if ( ! std::isdigit(s[0]) || !std::isdigit(s[1]) || !std::isdigit(s[2]) || !std::isdigit(s[3])) { throw ConversionError("Invalid date format"); } return (s[0] - '0') * 1000 + (s[1] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0'); } } void convert(std::string& str, const Date& date) { // format YYYY-MM-DD // 0....+....1 int year, month, day; jul2greg(date.julian(), year, month, day); char ret[10]; unsigned short n = year; ret[3] = '0' + n % 10; n /= 10; ret[2] = '0' + n % 10; n /= 10; ret[1] = '0' + n % 10; n /= 10; ret[0] = '0' + n % 10; ret[4] = '-'; ret[5] = '0' + month / 10; ret[6] = '0' + month % 10; ret[7] = '-'; ret[8] = '0' + day / 10; ret[9] = '0' + day % 10; str.assign(ret, 10); } void convert(Date& date, const std::string& s) { if (s.size() < 10 || s.at(4) != '-' || s.at(7) != '-') { throw ConversionError("Illegal date format"); } const char* d = s.data(); date = Date(getNumber4(d), getNumber2(d + 5), getNumber2(d + 8)); } void operator>>=(const SerializationInfo& si, Date& date) { if (si.category() == cxxtools::SerializationInfo::Object) { unsigned short year, month, day; si.getMember("year") >>= year; si.getMember("month") >>= month; si.getMember("day") >>= day; date.set(year, month, day); } else { std::string s; si.getValue(s); convert(date, s); } } void operator<<=(SerializationInfo& si, const Date& date) { std::string s; convert(s, date); si.setValue(s); si.setTypeName("Date"); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/settingswriter.h�����������������������������������������������������������������0000664�0001750�0001750�00000004231�12256773774�014403� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SettingsWriter_h #define cxxtools_SettingsWriter_h #include "cxxtools/char.h" #include "cxxtools/serializationinfo.h" #include <iostream> namespace cxxtools { class SettingsWriter { public: SettingsWriter( std::basic_ostream<cxxtools::Char>& os) : _os(&os) { } ~SettingsWriter() {} void write(const cxxtools::SerializationInfo& si); protected: void writeParent(const cxxtools::SerializationInfo& sd, const std::string& prefix); void writeChild(const cxxtools::SerializationInfo& node); void writeEntry(const std::string& name, const cxxtools::String& value, const std::string& type); void writeSection(const cxxtools::String& prefix); private: std::basic_ostream<cxxtools::Char>* _os; }; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/formatter.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000004702�12256773774�013647� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/formatter.h> #include <cxxtools/convert.h> namespace cxxtools { void Formatter::addValueStdString(const std::string& name, const std::string& type, const std::string& value) { addValueString(name, type, String::widen(value)); } void Formatter::addValueBool(const std::string& name, const std::string& type, bool value) { addValueString(name, type, convert<String>(value)); } void Formatter::addValueInt(const std::string& name, const std::string& type, int_type value) { addValueString(name, type, convert<String>(value)); } void Formatter::addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value) { addValueString(name, type, convert<String>(value)); } void Formatter::addValueFloat(const std::string& name, const std::string& type, long double value) { addValueString(name, type, convert<String>(value)); } void Formatter::addNull(const std::string& name, const std::string& type) { addValueString(name, type, String()); } } ��������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.mips.cpp�����������������������������������������������������������0000664�0001750�0001750�00000012564�12256773774�015355� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.mips.h> #include <csignal> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile ("" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& val) { atomic_t tmp, result = 0; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " addu %1, %0, 1\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (val) : "m" (val)); return result + 1; } atomic_t atomicDecrement(volatile atomic_t& val) { atomic_t tmp, result = 0; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " subu %1, %0, 1\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (val) : "m" (val)); return result - 1; } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { atomic_t old, tmp; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " bne %0, %5, 2f\n" " move %1, %4\n" " sc %1, %2\n" " beqz %1, 1b\n" "2: .set mips0\n" : "=&r" (old), "=&r" (tmp), "=m" (dest) : "m" (dest), "r" (exch), "r" (comp)); return(old); } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { atomic_t* old; atomic_t* tmp; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " bne %0, %5, 2f\n" " move %1, %4\n" " sc %1, %2\n" " beqz %1, 1b\n" "2: .set mips0\n" : "=&r" (old), "=&r" (tmp), "=m" (dest) : "m" (dest), "r" (exch), "r" (comp)); return(old); } atomic_t atomicExchange(volatile atomic_t& dest, atomic_t exch) { atomic_t result, tmp; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " move %1, %4\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (dest) : "m" (dest), "r" (exch)); return(result); } void* atomicExchange(void* volatile& val, void* exch) { atomic_t* result, tmp; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " move %1, %4\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (val) : "m" (val), "r" (exch)); return(result); } atomic_t atomicExchangeAdd(volatile atomic_t& dest, atomic_t add) { atomic_t result, tmp; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " addu %1, %0, %4\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (dest) : "m" (dest), "r" (add)); return result; } } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/udp.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000014350�12256773774�012434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/addrinfo.h> #include "addrinfoimpl.h" #include <cxxtools/net/udp.h> #include <cxxtools/log.h> #include <cxxtools/systemerror.h> #include <cxxtools/net/tcpserver.h> #include <netdb.h> #include <sys/poll.h> #include <vector> #include <errno.h> #include <string.h> log_define("cxxtools.net.udp") namespace cxxtools { namespace net { ////////////////////////////////////////////////////////////////////// // UdpSender // UdpSender::UdpSender(const std::string& ipaddr, unsigned short int port, bool bcast) : connected(false) { connect(ipaddr, port, bcast); } void UdpSender::connect(const std::string& ipaddr, unsigned short int port, bool bcast) { struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_DGRAM; AddrInfo ai(new AddrInfoImpl(ipaddr, port, hints)); for (AddrInfoImpl::const_iterator it = ai.impl()->begin(); it != ai.impl()->end(); ++it) { try { Socket::create(it->ai_family, SOCK_DGRAM, 0); } catch (const SystemError&) { continue; } if (bcast) { const int on = 1; if (::setsockopt(getFd(), SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) < 0) throw SystemError("setsockopt"); } if (::connect(getFd(), it->ai_addr, it->ai_addrlen) == 0) { connected = true; return; } } throw SystemError("connect"); } UdpSender::size_type UdpSender::send(const void* message, size_type length, int flags) const { ssize_t ret = ::send(getFd(), message, length, flags); if (ret < 0) throw SystemError("send"); return static_cast<size_type>(ret); } UdpSender::size_type UdpSender::send(const std::string& message, int flags) const { return send(message.data(), message.size(), flags); } UdpSender::size_type UdpSender::recv(void* buffer, size_type length, int flags) const { ssize_t ret = ::recv(getFd(), buffer, length, flags); if (ret < 0 && errno == EAGAIN) { if (getTimeout() == 0) throw IOTimeout(); poll(POLLIN); ret = ::recv(getFd(), buffer, length, flags); } if (ret < 0) throw SystemError("recv"); return static_cast<size_type>(ret); } std::string UdpSender::recv(size_type length, int flags) const { std::vector<char> buffer(length); size_type len = recv(&buffer[0], length, flags); return std::string(&buffer[0], len); } ////////////////////////////////////////////////////////////////////// // UdpReceiver // UdpReceiver::UdpReceiver() { memset(&peeraddr, 0, sizeof(peeraddr)); } UdpReceiver::UdpReceiver(const std::string& ipaddr, unsigned short int port) { memset(&peeraddr, 0, sizeof(peeraddr)); bind(ipaddr, port); } void UdpReceiver::bind(const std::string& ipaddr, unsigned short int port) { AddrInfo ai(ipaddr, port); int reuseAddr = 1; for (AddrInfoImpl::const_iterator it = ai.impl()->begin(); it != ai.impl()->end(); ++it) { try { Socket::create(it->ai_family, SOCK_DGRAM, 0); } catch (const SystemError&) { continue; } log_debug("setsockopt"); if (::setsockopt(getFd(), SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)) < 0) throw SystemError(errno, "setsockopt"); log_debug("bind ip " << ipaddr << " port " << port); if (::bind(getFd(), it->ai_addr, it->ai_addrlen) == 0) { memmove(&peeraddr, it->ai_addr, it->ai_addrlen); peeraddrLen = it->ai_addrlen; return; } } throw SystemError(errno, "bind"); } UdpReceiver::size_type UdpReceiver::recv(void* buffer, size_type length, int flags) { log_debug("recvfrom"); ssize_t ret = ::recvfrom(getFd(), buffer, length, flags, reinterpret_cast <struct sockaddr *> (&peeraddr), &peeraddrLen); if (ret < 0 && errno == EAGAIN) { if (getTimeout() == 0) throw IOTimeout(); poll(POLLIN); ret = ::recvfrom(getFd(), buffer, length, flags, reinterpret_cast <struct sockaddr *> (&peeraddr), &peeraddrLen); } if (ret < 0) throw SystemError("recvfrom"); return static_cast<size_type>(ret); } std::string UdpReceiver::recv(size_type length, int flags) { std::vector<char> buffer(length); size_type len = recv(&buffer[0], length, flags); return std::string(&buffer[0], len); } UdpReceiver::size_type UdpReceiver::send(const void* message, size_type length, int flags) const { ssize_t ret = ::sendto(getFd(), message, length, flags, reinterpret_cast <const struct sockaddr *> (&peeraddr), peeraddrLen); if (ret < 0) throw SystemError("sendto"); return static_cast<size_type>(ret); } UdpReceiver::size_type UdpReceiver::send(const std::string& message, int flags) const { return send(message.data(), message.size(), flags); } } // namespace net } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/clock.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000003446�12266277345�012735� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "clockimpl.h" #include "cxxtools/clock.h" namespace cxxtools { Clock::Clock() { _impl = new ClockImpl(); } Clock::~Clock() { delete _impl; } void Clock::start() { _impl->start(); } Timespan Clock::stop() { return _impl->stop(); } DateTime Clock::getSystemTime() { return ClockImpl::getSystemTime(); } DateTime Clock::getLocalTime() { return ClockImpl::getLocalTime(); } Timespan Clock::getSystemTicks() { return ClockImpl::getSystemTicks(); } } //namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/md5.h����������������������������������������������������������������������������0000664�0001750�0001750�00000007142�12256773774�011777� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* RSAREF types and constants */ /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef SRC_CXXTOOLS_MD5_H #define SRC_CXXTOOLS_MD5_H #ifndef PROTOTYPES #define PROTOTYPES 1 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ typedef unsigned int UINT4; /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif /* MD5 context. */ struct cxxtools_MD5_CTX { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ }; #ifdef __cplusplus extern "C" { #endif void cxxtools_MD5Init PROTO_LIST ((struct cxxtools_MD5_CTX *)); void cxxtools_MD5Update PROTO_LIST ((struct cxxtools_MD5_CTX *, const unsigned char *, unsigned int)); void cxxtools_MD5Final PROTO_LIST ((unsigned char [16], struct cxxtools_MD5_CTX *)); #ifdef __cplusplus } #endif #endif /* SRC_CXXTOOLS_MD5_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.x86_64.cpp���������������������������������������������������������0000664�0001750�0001750�00000007235�12256773774�015342� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.x86_64.h> #include <unistd.h> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("mfence" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile ("mfence" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& val) { static const atomic_t d = 1; atomic_t tmp; asm volatile ("lock; xaddq %0, %1" : "=r" (tmp), "=m" (val) : "0" (d), "m" (val)); return tmp+1; } atomic_t atomicDecrement(volatile atomic_t& val) { static const atomic_t d = -1; volatile register atomic_t tmp; asm volatile ("lock; xaddq %0, %1" : "=r" (tmp), "=m" (val) : "0" (d), "m" (val)); return tmp-1; } atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add) { volatile register atomic_t ret; asm volatile ("lock; xaddq %0, %1" : "=r" (ret), "=m" (val) : "0" (add), "m" (val)); return ret; } atomic_t atomicExchange(volatile atomic_t& val, atomic_t new_val) { volatile register atomic_t ret; // using cmpxchg and a loop here on purpose asm volatile ("1:; lock; cmpxchgq %2, %0; jne 1b" : "=m" (val), "=a" (ret) : "r" (new_val), "m" (val), "a" (val)); return ret; } void* atomicExchange(void* volatile& val, void* new_val) { void* ret; asm volatile ("1:; lock; cmpxchgq %2, %0; jne 1b" : "=m" (val), "=a" (ret) : "r" (new_val), "m" (val), "a" (val)); return ret; } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { volatile register atomic_t old; asm volatile ("lock; cmpxchgq %2, %0" : "=m" (dest), "=a" (old) : "r" (exch), "m" (dest), "a" (comp)); return old; } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { void* old; asm volatile ("lock; cmpxchgq %2, %0" : "=m" (dest), "=a" (old) : "r" (exch), "m" (dest), "a" (comp)); return old; } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/addrinfoimpl.h�������������������������������������������������������������������0000664�0001750�0001750�00000006543�12256773774�013766� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_ADDRINFO_H #define CXXTOOLS_ADDRINFO_H #include <cxxtools/refcounted.h> #include <string> #include <iterator> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> namespace cxxtools { namespace net { class AddrInfoImpl : public cxxtools::RefCounted { std::string _host; unsigned short _port; struct addrinfo* _ai; public: void init(const std::string& host, unsigned short port); void init(const std::string& host, unsigned short port, const addrinfo& hints); AddrInfoImpl() : _ai(0) { } AddrInfoImpl(const std::string& host, unsigned short port) : _ai(0) { init(host, port); } AddrInfoImpl(const std::string& host, unsigned short port, const addrinfo& hints) : _ai(0) { init(host, port, hints); } ~AddrInfoImpl(); class const_iterator : public std::iterator<std::forward_iterator_tag, addrinfo> { struct addrinfo* current; public: explicit const_iterator(struct addrinfo* ai = 0) : current(ai) { } bool operator== (const const_iterator& it) const { return current == it.current; } bool operator!= (const const_iterator& it) const { return current != it.current; } const_iterator& operator++ () { current = current->ai_next; return *this; } const_iterator operator++ (int) { const_iterator ret(current); current = current->ai_next; return ret; } reference operator* () const { return *current; } pointer operator-> () const { return current; } }; const std::string& host() const; unsigned short port() const; const_iterator begin() const { return const_iterator(_ai); } const_iterator end() const { return const_iterator(); } }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_H �������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/eventsource.cpp������������������������������������������������������������������0000664�0001750�0001750�00000011446�12256773774�014211� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/eventsource.h" #include "cxxtools/eventsink.h" namespace cxxtools { RecursiveMutex dmx; struct EventSource::Sentry { Sentry(const EventSource* es) : _es(es) { _es->_sentry = this; _es->_dirty = false; } ~Sentry() { if( _es ) this->detach(); } void detach() { if( _es->_dirty ) { SinkMap::iterator it = _es->_sinks.begin(); while( it != _es->_sinks.end() ) { if( it->second ) { ++it; } else { _es->_sinks.erase(it++); } } } _es->_dirty = false; _es->_sentry = 0; _es = 0; } bool operator!() const { return _es == 0; } const EventSource* _es; }; EventSource::EventSource() : _dmutex(&dmx) , _sentry(0) , _dirty(false) { } EventSource::~EventSource() { RecursiveLock dlock(*_dmutex); while( true ) { RecursiveLock lock( _mutex ); if(_sentry) _sentry->detach(); if( _sinks.empty() ) return; EventSink* sink = _sinks.begin()->second; if( ! this->tryDisconnect(*sink) ) { lock.unlock(); Thread::yield(); } } } void EventSource::connect(EventSink& sink) { RecursiveLock lock( _mutex ); sink.onConnect(*this); const std::type_info* ti = 0; SinkMap::value_type elem(ti, &sink); _sinks.insert( elem ); //_sinks.insert( std::make_pair(ti, &sink) ); } void EventSource::disconnect(EventSink& sink) { RecursiveLock lock( _mutex ); sink.onDisconnect(*this); SinkMap::iterator it = _sinks.begin(); while( it != _sinks.end() ) { if(it->second == &sink) { if(_sentry) { _dirty = true; it->second = 0; } else { _sinks.erase(it++); continue; } } ++it; } } bool EventSource::tryDisconnect(EventSink& sink) { if( _dmutex->tryLock() ) { this->disconnect(sink); _dmutex->unlock(); return true; } return false; } void EventSource::subscribe(EventSink& sink, const std::type_info& ti) { RecursiveLock lock( _mutex ); sink.onConnect(*this); SinkMap::value_type elem(&ti, &sink); _sinks.insert( elem ); //_sinks.insert( std::make_pair(&ti, &sink) ); } void EventSource::unsubscribe(EventSink& sink, const std::type_info& ti) { RecursiveLock lock( _mutex ); sink.onUnsubscribe(*this); SinkMap::iterator it = _sinks.lower_bound(&ti); while( it != _sinks.end() && *(it->first) == ti ) { if(it->second == &sink) { if(_sentry) { _dirty = true; it->second = 0; } else { _sinks.erase(it++); continue; } } ++it; } } void EventSource::send(const cxxtools::Event& ev) { RecursiveLock lock(_mutex); EventSource::Sentry sentry(this); SinkMap::iterator it; for(it = _sinks.begin(); it != _sinks.end(); ++it) { EventSink* sink = it->second; if(sink) sink->commitEvent(ev); if( ! sentry ) return; } } } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/conditionimpl.h������������������������������������������������������������������0000664�0001750�0001750�00000003364�12266277345�014156� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/api.h" #include "cxxtools/mutex.h" #include <pthread.h> namespace cxxtools { class ConditionImpl { public: ConditionImpl(); ~ConditionImpl(); void wait(Mutex& mtx); bool wait(Mutex& mtx, unsigned int ms); void signal(); void broadcast(); private: pthread_cond_t _cond; }; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/textcodec.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000003704�12256773774�013627� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/textcodec.h" #ifdef CXXTOOLS_WITH_STD_LOCALE namespace std { // // codecvt facet for Char/char // std::locale::id codecvt<cxxtools::Char, char, cxxtools::MBState>::id; codecvt<cxxtools::Char, char, cxxtools::MBState>::codecvt(size_t ref) : locale::facet(ref) {} codecvt<cxxtools::Char, char, cxxtools::MBState>::~codecvt() {} // // codecvt facet for char/char // std::locale::id codecvt<char, char, cxxtools::MBState>::id; codecvt<char, char, cxxtools::MBState>::codecvt(size_t ref) : locale::facet(ref) {} codecvt<char, char, cxxtools::MBState>::~codecvt() {} } // namespace std #endif ������������������������������������������������������������cxxtools-2.2.1/src/iostream.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000006006�12256773774�013466� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iostream.h" namespace cxxtools { IStream::IStream(size_t bufferSize, bool extend) : _buffer(bufferSize, extend) { attachBuffer(&_buffer); } IStream::IStream(IODevice& device, size_t bufferSize, bool extend) : _buffer(device, bufferSize, extend) { attachBuffer(&_buffer); } IStream::~IStream() { } StreamBuffer& IStream::buffer() { return _buffer; } IODevice* IStream::attachDevice(IODevice& device) { IODevice* ret = attachedDevice(); _buffer.attach(device); return ret; } IODevice* IStream::attachedDevice() { return _buffer.device(); } OStream::OStream(size_t bufferSize, bool extend) : _buffer(bufferSize, extend) { attachBuffer(&_buffer); } OStream::OStream(IODevice& device, size_t bufferSize, bool extend) : _buffer(device, bufferSize, extend) { attachBuffer(&_buffer); } OStream::~OStream() { } StreamBuffer& OStream::buffer() { return _buffer; } IODevice* OStream::attachDevice(IODevice& device) { IODevice* ret = attachedDevice(); _buffer.attach(device); return ret; } IODevice* OStream::attachedDevice() { return _buffer.device(); } IOStream::IOStream(size_t bufferSize, bool extend) : _buffer(bufferSize, extend) { attachBuffer(&_buffer); } IOStream::~IOStream() { } IOStream::IOStream(IODevice& device, size_t bufferSize, bool extend) : _buffer(device, bufferSize, extend) { attachBuffer(&_buffer); } StreamBuffer& IOStream::buffer() { return _buffer; } IODevice* IOStream::attachDevice(IODevice& device) { IODevice* ret = attachedDevice(); _buffer.attach(device); return ret; } IODevice* IOStream::attachedDevice() { return _buffer.device(); } } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/����������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�012162� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/responder.cpp���������������������������������������������������������������0000664�0001750�0001750�00000010423�12256773774�014613� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "responder.h" #include "rpcserverimpl.h" #include <cxxtools/serviceprocedure.h> #include <cxxtools/serviceregistry.h> #include <cxxtools/remoteexception.h> #include <cxxtools/textstream.h> #include <cxxtools/utf8codec.h> #include <cxxtools/log.h> log_define("cxxtools.json.responder") namespace cxxtools { namespace json { Responder::Responder(ServiceRegistry& serviceRegistry) : _serviceRegistry(serviceRegistry) { } Responder::~Responder() { } void Responder::begin() { _deserializer.begin(); _parser.begin(_deserializer); } void Responder::finalize(std::ostream& out) { log_trace("finalize"); std::string methodName; ServiceProcedure* proc = 0; TextOStream ts(out, new Utf8Codec()); JsonFormatter formatter; formatter.begin(ts); formatter.beginObject(std::string(), std::string()); formatter.addValueString("jsonrpc", "string", L"2.0"); try { _deserializer.si()->getMember("method") >>= methodName; log_debug("method = " << methodName); proc = _serviceRegistry.getProcedure(methodName); if( ! proc ) throw std::runtime_error("no such procedure \"" + methodName + '"'); // compose arguments IComposer** args = proc->beginCall(); // process args const SerializationInfo* paramsPtr = _deserializer.si()->findMember("params"); // params may be ommited in request SerializationInfo emptyParams; const SerializationInfo& params = paramsPtr ? *paramsPtr : emptyParams; SerializationInfo::ConstIterator it = params.begin(); if (args) { for (int a = 0; args[a]; ++a) { if (it == params.end()) throw RemoteException("argument expected"); args[a]->fixup(*it); ++it; } } if (it != params.end()) throw RemoteException("too many arguments"); IDecomposer::formatEach(_deserializer.si()->getMember("id"), formatter); IDecomposer* result; result = proc->endCall(); formatter.beginValue("result"); result->format(formatter); formatter.finishValue(); } catch (const RemoteException& e) { log_debug("method \"" << methodName << "\" exited with RemoteException: " << e.what()); formatter.beginObject("error", std::string()); formatter.addValueInt("code", "int", static_cast<Formatter::int_type>(e.rc())); formatter.addValueStdString("message", std::string(), e.what()); formatter.finishObject(); } catch (const std::exception& e) { log_debug("method \"" << methodName << "\" exited with exception: " << e.what()); formatter.addValueStdString("error", std::string(), e.what()); } formatter.finishObject(); if (proc) _serviceRegistry.releaseProcedure(proc); } bool Responder::advance(char ch) { return _parser.advance(ch) != 0; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/httpservice.cpp�������������������������������������������������������������0000664�0001750�0001750�00000004272�12256773774�015157� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/json/httpservice.h" #include "cxxtools/http/request.h" #include "httpresponder.h" #include "cxxtools/log.h" #include <string.h> log_define("cxxtools.json.httpservice") namespace cxxtools { namespace json { HttpService::~HttpService() { } http::Responder* HttpService::createResponder(const http::Request& request) { const char* contentType = request.header().getHeader("Content-Type"); if (contentType != 0) { if (::strncasecmp(contentType, "application/json", 16) == 0 || ::strncasecmp(contentType, "application/x-www-form-urlencoded", 33) == 0) return new HttpResponder(*this); log_warn("invalid content type " << contentType); } else log_warn("missing content type"); return 0; } void HttpService::releaseResponder(http::Responder* resp) { delete resp; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/worker.cpp������������������������������������������������������������������0000664�0001750�0001750�00000010242�12256773774�014122� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "worker.h" #include "rpcserverimpl.h" #include <cxxtools/log.h> #include "socket.h" log_define("cxxtools.json.worker") namespace cxxtools { namespace json { void Worker::run() { log_info("new thread running"); while (!_server.isTerminating() && _server._queue.numWaiting() < _server.minThreads()) { Socket* socket = _server._queue.get(); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } if (_server._queue.numWaiting() == 0) _server.noWaitingThreads(); try { if (!socket->hasAccepted()) { // do blocking accept socket->accept(); log_debug("connection accepted from " << socket->getPeerAddr()); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } // new connection arrived - create new accept socket log_info("new connection accepted from " << socket->getPeerAddr()); _server._queue.put(new Socket(*socket)); } else if (socket->isConnected()) { log_debug("process available input from " << socket->getPeerAddr()); socket->onInput(socket->buffer()); } else { log_debug("socket is not connected any more; delete " << static_cast<void*>(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; continue; } Connection inputConnection = connect(socket->buffer().inputReady, socket->inputSlot); while (socket->wait(10) && socket->isConnected()) ; if (socket->isConnected()) { log_debug("timeout processing socket"); inputConnection.close(); _server.addIdleSocket(socket); } else if (_server.isTerminating()) { _server._queue.put(socket); } else { log_debug("socket is not connected any more; delete " << static_cast<void*>(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; } } catch (const std::exception& e) { log_debug("error occured in device: " << e.what() << "; delete " << static_cast<void*>(socket)); delete socket; } } log_info("thread terminated"); _server.threadTerminated(this); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/httpclientimpl.h������������������������������������������������������������0000664�0001750�0001750�00000010102�12266277345�015303� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_HTTPCLIENTIMPL_H #define CXXTOOLS_JSON_HTTPCLIENTIMPL_H #include <cxxtools/http/client.h> #include <cxxtools/http/request.h> #include <cxxtools/connectable.h> #include <cxxtools/deserializer.h> #include <cxxtools/formatter.h> #include <string> #include "scanner.h" namespace cxxtools { class IRemoteProcedure; class IComposer; class IDecomposer; namespace net { class AddrInfo; } namespace json { class HttpClientImpl : public Connectable { public: HttpClientImpl(); void connect(const net::AddrInfo& addrinfo, const std::string& url) { _client.connect(addrinfo); _request.url(url); } void connect(const std::string& addr, unsigned short port, const std::string& url) { _client.connect(addr, port); _request.url(url); } void url(const std::string& url) { _request.url(url); } void auth(const std::string& username, const std::string& password) { _client.auth(username, password); } void clearAuth() { _client.clearAuth(); } void setSelector(SelectorBase& selector) { _client.setSelector(selector); } const std::string& url() const { return _request.url(); } void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); std::size_t timeout() const { return _timeout; } void timeout(std::size_t t) { _timeout = t; } const IRemoteProcedure* activeProcedure() const; void cancel(); void wait(std::size_t msecs); private: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void onReplyHeader(http::Client& client); std::size_t onReplyBody(http::Client& client); void onReplyFinished(http::Client& client); static void verifyHeader(const http::ReplyHeader& header); // connection std::size_t _timeout; http::Client _client; http::Request _request; // serialization Scanner _scanner; DeserializerBase _deserializer; // current processing IRemoteProcedure* _proc; bool _exceptionPending; Formatter::int_type _count; }; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/worker.h��������������������������������������������������������������������0000664�0001750�0001750�00000003451�12256773774�013573� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_WORKER_H #define CXXTOOLS_JSON_WORKER_H #include <cxxtools/thread.h> namespace cxxtools { namespace json { class RpcServerImpl; class Worker : public AttachedThread { public: explicit Worker(RpcServerImpl& server) : AttachedThread(callable(*this, &Worker::run)), _server(server) { } private: void run(); RpcServerImpl& _server; }; } } #endif // CXXTOOLS_JSON_WORKER_H �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/scanner.h�������������������������������������������������������������������0000664�0001750�0001750�00000004076�12256773774�013717� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_SCANNER_H #define CXXTOOLS_JSON_SCANNER_H #include <cxxtools/composer.h> #include <cxxtools/jsonparser.h> #include <string> namespace cxxtools { class DeserializerBase; class IComposer; namespace json { class Scanner { public: Scanner() { } void begin(DeserializerBase& handler, IComposer& composer); bool advance(char ch) { return _parser.advance(ch) != 0; } void finalizeReply(); private: JsonParser _parser; DeserializerBase* _deserializer; IComposer* _composer; }; } } #endif // CXXTOOLS_JSON_SCANNER_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/rpcclientimpl.cpp�����������������������������������������������������������0000664�0001750�0001750�00000016467�12266277345�015467� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcclientimpl.h" #include <cxxtools/log.h> #include <cxxtools/remoteprocedure.h> #include <cxxtools/utf8codec.h> #include <cxxtools/jsonformatter.h> #include <cxxtools/ioerror.h> #include <cxxtools/clock.h> #include <stdexcept> log_define("cxxtools.json.rpcclient.impl") namespace cxxtools { namespace json { RpcClientImpl::RpcClientImpl() : _stream(_socket, 8192, true), _exceptionPending(false), _proc(0) { cxxtools::connect(_socket.connected, *this, &RpcClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &RpcClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &RpcClientImpl::onInput); } void RpcClientImpl::connect(const std::string& addr, unsigned short port) { if (_addr != addr || _port != port) { _socket.close(); _addr = addr; _port = port; } } void RpcClientImpl::close() { _socket.close(); } void RpcClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); if (_proc) throw std::logic_error("asyncronous request already running"); _proc = &method; prepareRequest(method.name(), argv, argc); if (_socket.isConnected()) { try { _stream.buffer().beginWrite(); } catch (const IOError&) { log_debug("write failed, connection is not active any more"); _socket.beginConnect(_addr, _port); } } else { log_debug("not yet connected - do it now"); _socket.beginConnect(_addr, _port); } _scanner.begin(_deserializer, r); } void RpcClientImpl::endCall() { _proc = 0; if (_exceptionPending) { _exceptionPending = false; throw; } } void RpcClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _proc = &method; prepareRequest(_proc->name(), argv, argc); if (!_socket.isConnected()) _socket.connect(_addr, _port); try { _stream.flush(); _scanner.begin(_deserializer, r); char ch; while (_stream.get(ch)) { if (_scanner.advance(ch)) { _proc = 0; _scanner.finalizeReply(); break; } } } catch (const RemoteException&) { throw; } catch (const std::exception& e) { cancel(); throw; } _proc = 0; if (!_stream) { cancel(); throw std::runtime_error("reading result failed"); } } void RpcClientImpl::cancel() { _socket.close(); _stream.clear(); _stream.buffer().discard(); _proc = 0; } void RpcClientImpl::wait(std::size_t msecs) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (msecs != RemoteClient::WaitInfinite) clock.start(); std::size_t remaining = msecs; while (activeProcedure() != 0) { if (_socket.selector()->wait(remaining) == false) throw IOTimeout(); if (msecs != RemoteClient::WaitInfinite) { std::size_t diff = static_cast<std::size_t>(clock.stop().totalMSecs()); remaining = diff >= msecs ? 0 : msecs - diff; } } } void RpcClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { TextOStream ts(_stream, new Utf8Codec()); JsonFormatter formatter; formatter.begin(ts); formatter.beginObject(std::string(), std::string()); formatter.addValueStdString("jsonrpc", std::string(), "2.0"); formatter.addValueString("method", std::string(), String(_prefix) + name); formatter.addValueInt("id", "int", ++_count); formatter.beginArray("params", std::string()); for(unsigned n = 0; n < argc; ++n) { argv[n]->format(formatter); } formatter.finishArray(); formatter.finishObject(); formatter.finish(); ts.flush(); } void RpcClientImpl::onConnect(net::TcpSocket& socket) { try { log_trace("onConnect"); _exceptionPending = false; socket.endConnect(); _stream.buffer().beginWrite(); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onOutput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endWrite(); if (sb.out_avail() > 0) sb.beginWrite(); else sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onInput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endRead(); if (sb.device()->eof()) throw IOError("end of input"); char ch; while (_stream.buffer().in_avail() && _stream.get(ch)) { if (_scanner.advance(ch)) { _scanner.finalizeReply(); IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); return; } } if (!_stream) { close(); throw std::runtime_error("reading result failed"); } sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/Makefile.am�����������������������������������������������������������������0000664�0001750�0001750�00000001276�12256773774�014150� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-json.la noinst_HEADERS = \ httpclientimpl.h \ httpresponder.h \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_json_la_SOURCES = \ httpclient.cpp \ httpclientimpl.cpp \ httpresponder.cpp \ httpservice.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ responder.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ socket.cpp \ worker.cpp libcxxtools_json_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_json_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/httpresponder.cpp�����������������������������������������������������������0000664�0001750�0001750�00000004417�12256773774�015521� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "httpresponder.h" #include <cxxtools/http/reply.h> #include <cxxtools/json/httpservice.h> #include <cxxtools/log.h> log_define("cxxtools.json.httpresponder") namespace cxxtools { namespace json { HttpResponder::HttpResponder(HttpService& service) : Responder(service), _responder(service) { } HttpResponder::~HttpResponder() { } void HttpResponder::beginRequest(std::istream& in, http::Request& request) { log_debug("begin request"); _responder.begin(); } std::size_t HttpResponder::readBody(std::istream& is) { log_debug("begin request"); std::size_t n = 0; char ch; while (is.get(ch)) { ++n; if (_responder.advance(ch)) break; } log_debug(n << " bytes processed"); return n; } void HttpResponder::reply(std::ostream& os, http::Request& request, http::Reply& reply) { reply.setHeader("Content-Type", "application/json"); _responder.finalize(os); } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/socket.h��������������������������������������������������������������������0000664�0001750�0001750�00000005123�12256773774�013550� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_SOCKET_H #define CXXTOOLS_JSON_SOCKET_H #include <cxxtools/net/tcpsocket.h> #include <cxxtools/iostream.h> #include <cxxtools/timer.h> #include <cxxtools/connectable.h> #include <cxxtools/signal.h> #include <cxxtools/method.h> #include "responder.h" namespace cxxtools { namespace json { class RpcServerImpl; class Socket : public net::TcpSocket, public Connectable { public: Socket(RpcServerImpl& server, ServiceRegistry& _serviceRegistry, net::TcpServer& tcpServer); explicit Socket(Socket& socket); void accept(); bool hasAccepted() const { return _accepted; } void setSelector(SelectorBase* s); void removeSelector(); void onIODeviceInput(IODevice& iodevice); void onInput(StreamBuffer& sb); bool onOutput(StreamBuffer& sb); Signal<Socket&> inputReady; StreamBuffer& buffer() { return _stream.buffer(); } MethodSlot<void, Socket, StreamBuffer&> inputSlot; Connection inputConnection; Connection timeoutConnection; private: net::TcpServer& _tcpServer; RpcServerImpl& _server; Responder _responder; IOStream _stream; bool _accepted; }; } } #endif // CXXTOOLS_JSON_SOCKET_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/rpcclientimpl.h�������������������������������������������������������������0000664�0001750�0001750�00000006404�12266277345�015122� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCCLIENTIMPL_H #define CXXTOOLS_JSON_RPCCLIENTIMPL_H #include <cxxtools/formatter.h> #include <cxxtools/net/tcpsocket.h> #include <cxxtools/iostream.h> #include <cxxtools/string.h> #include <cxxtools/deserializer.h> #include <cxxtools/connectable.h> #include <cxxtools/selector.h> #include <string> #include "scanner.h" namespace cxxtools { class IRemoteProcedure; class IComposer; class IDecomposer; namespace json { class RpcClientImpl : public Connectable { RpcClientImpl(RpcClientImpl&); void operator= (const RpcClientImpl&); public: RpcClientImpl(); void setSelector(SelectorBase& selector) { selector.add(_socket); } void connect(const std::string& addr, unsigned short port); void close(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); const IRemoteProcedure* activeProcedure() const { return _proc; } void cancel(); void wait(std::size_t msecs); const std::string& prefix() const { return _prefix; } void prefix(const std::string& p) { _prefix = p; } private: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void onConnect(net::TcpSocket& socket); void onOutput(StreamBuffer& sb); void onInput(StreamBuffer& sb); // connection state net::TcpSocket _socket; IOStream _stream; std::string _addr; unsigned short _port; std::string _prefix; // serialization Scanner _scanner; DeserializerBase _deserializer; // current processing bool _exceptionPending; IRemoteProcedure* _proc; Formatter::int_type _count; }; } } #endif // CXXTOOLS_JSON_RPCCLIENTIMPL_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/httpclient.cpp��������������������������������������������������������������0000664�0001750�0001750�00000007614�12266277345�014772� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/json/httpclient.h" #include "cxxtools/net/uri.h" #include "httpclientimpl.h" namespace cxxtools { namespace json { HttpClient::HttpClient() : _impl(new HttpClientImpl()) { } HttpClient::HttpClient(SelectorBase& selector, const std::string& server, unsigned short port, const std::string& url) : _impl(new HttpClientImpl()) { _impl->setSelector(selector); _impl->connect(server, port, url); } HttpClient::HttpClient(SelectorBase& selector, const net::Uri& uri) : _impl(new HttpClientImpl()) { _impl->setSelector(selector); _impl->connect(uri.host(), uri.port(), uri.path()); auth(uri.user(), uri.password()); } HttpClient::HttpClient(const std::string& server, unsigned short port, const std::string& url) : _impl(new HttpClientImpl()) { _impl->connect(server, port, url); } HttpClient::HttpClient(const net::Uri& uri) : _impl(new HttpClientImpl()) { _impl->connect(uri.host(), uri.port(), uri.path()); auth(uri.user(), uri.password()); } HttpClient::~HttpClient() { delete _impl; } void HttpClient::connect(const net::AddrInfo& addrinfo, const std::string& url) { _impl->connect(addrinfo, url); } void HttpClient::connect(const net::Uri& uri) { _impl->connect(uri.host(), uri.port(), uri.path()); auth(uri.user(), uri.password()); } void HttpClient::connect(const std::string& addr, unsigned short port, const std::string& url) { _impl->connect(addr, port, url); } void HttpClient::url(const std::string& url) { _impl->url(url); } void HttpClient::auth(const std::string& username, const std::string& password) { _impl->auth(username, password); } void HttpClient::clearAuth() { _impl->clearAuth(); } void HttpClient::setSelector(SelectorBase& selector) { _impl->setSelector(selector); } void HttpClient::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void HttpClient::endCall() { _impl->endCall(); } void HttpClient::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } std::size_t HttpClient::timeout() const { return _impl->timeout(); } void HttpClient::timeout(std::size_t t) { _impl->timeout(t); } const std::string& HttpClient::url() const { return _impl->url(); } const IRemoteProcedure* HttpClient::activeProcedure() const { return _impl->activeProcedure(); } void HttpClient::cancel() { _impl->cancel(); } void HttpClient::wait(std::size_t msecs) { _impl->wait(msecs); } } } ��������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/httpresponder.h�������������������������������������������������������������0000664�0001750�0001750�00000003663�12256773774�015170� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_HTTPRESPONDER_H #define CXXTOOLS_JSON_HTTPRESPONDER_H #include <cxxtools/http/responder.h> #include "responder.h" namespace cxxtools { namespace json { class HttpService; class HttpResponder : public http::Responder { public: explicit HttpResponder(HttpService& service); ~HttpResponder(); void beginRequest(std::istream& in, http::Request& request); std::size_t readBody(std::istream& is); void reply(std::ostream& os, http::Request& request, http::Reply& reply); private: json::Responder _responder; }; } } #endif �����������������������������������������������������������������������������cxxtools-2.2.1/src/json/httpclientimpl.cpp����������������������������������������������������������0000664�0001750�0001750�00000016273�12266277345�015655� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "httpclientimpl.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/textstream.h" #include "cxxtools/jsonformatter.h" #include "cxxtools/http/replyheader.h" #include "cxxtools/selectable.h" #include "cxxtools/utf8codec.h" #include "cxxtools/ioerror.h" #include "cxxtools/clock.h" #include "cxxtools/log.h" #include <stdexcept> #include <string.h> log_define("cxxtools.json.client.impl") namespace cxxtools { namespace json { HttpClientImpl::HttpClientImpl() : _timeout(Selectable::WaitInfinite), _proc(0), _exceptionPending(false), _count(0) { _request.method("POST"); cxxtools::connect(_client.headerReceived, *this, &HttpClientImpl::onReplyHeader); cxxtools::connect(_client.bodyAvailable, *this, &HttpClientImpl::onReplyBody); cxxtools::connect(_client.replyFinished, *this, &HttpClientImpl::onReplyFinished); } void HttpClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_client.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); if (_proc) throw std::logic_error("asyncronous request already running"); _proc = &method; prepareRequest(method.name(), argv, argc); _client.beginExecute(_request); _scanner.begin(_deserializer, r); } void HttpClientImpl::endCall() { log_debug("end call; errorPending=" << _exceptionPending); if (_exceptionPending) { _exceptionPending = false; throw; } _client.endExecute(); } void HttpClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _proc = &method; prepareRequest(method.name(), argv, argc); _client.execute(_request); _scanner.begin(_deserializer, r); char ch; std::istream& is = _client.in(); while (is.get(ch)) { if (_scanner.advance(ch)) { log_debug("scanner finished"); _proc = 0; _scanner.finalizeReply(); return; } } throw std::runtime_error("unexpected end of data"); } const IRemoteProcedure* HttpClientImpl::activeProcedure() const { return _proc; } void HttpClientImpl::cancel() { _client.cancel(); _proc = 0; } // private members void HttpClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { _request.clear(); _request.setHeader("Content-Type", "application/json"); _request.method("POST"); TextOStream ts(_request.body(), new Utf8Codec()); JsonFormatter formatter; formatter.begin(ts); formatter.beginObject(std::string(), std::string()); formatter.addValueStdString("jsonrpc", std::string(), "2.0"); formatter.addValueString("method", std::string(), name); formatter.addValueInt("id", "int", ++_count); formatter.beginArray("params", std::string()); for(unsigned n = 0; n < argc; ++n) { argv[n]->format(formatter); } formatter.finishArray(); formatter.finishObject(); formatter.finish(); ts.flush(); } void HttpClientImpl::onReplyHeader(http::Client& client) { verifyHeader(client.header()); } std::size_t HttpClientImpl::onReplyBody(http::Client& client) { std::size_t count = 0; char ch; std::istream& is = client.in(); while (is.rdbuf()->in_avail() && is.get(ch)) { ++count; if (_scanner.advance(ch)) { log_debug("scanner finished"); try { _scanner.finalizeReply(); } catch (const RemoteException& e) { _proc->setFault(e.rc(), e.text()); } catch (const std::exception&) { log_warn("exception occured in finalizeReply"); _exceptionPending = true; _proc->onFinished(); } break; } } log_debug("no more data - " << count << " bytes consumed"); return count; } void HttpClientImpl::onReplyFinished(http::Client& client) { log_debug("onReplyFinished; method=" << static_cast<void*>(_proc)); try { _exceptionPending = false; endCall(); } catch (const std::exception& e) { if (!_proc) throw; _exceptionPending = true; IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); if (_exceptionPending) { _exceptionPending = false; throw; } return; } IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); } void HttpClientImpl::wait(std::size_t msecs) { if (!_client.selector()) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (msecs != RemoteClient::WaitInfinite) clock.start(); std::size_t remaining = msecs; while (activeProcedure() != 0) { if (_client.selector()->wait(remaining) == false) throw IOTimeout(); if (msecs != RemoteClient::WaitInfinite) { std::size_t diff = static_cast<std::size_t>(clock.stop().totalMSecs()); remaining = diff >= msecs ? 0 : msecs - diff; } } } void HttpClientImpl::verifyHeader(const http::ReplyHeader& header) { if (header.httpReturnCode() != 200) { std::ostringstream msg; msg << "invalid http return code " << header.httpReturnCode() << ": " << header.httpReturnText(); throw std::runtime_error(msg.str()); } const char* contentType = header.getHeader("Content-Type"); if (contentType == 0) throw std::runtime_error("missing content type header"); if (::strncasecmp(contentType, "application/json", 16) != 0) { std::ostringstream msg; msg << "invalid content type " << contentType; throw std::runtime_error(msg.str()); } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/rpcserver.cpp���������������������������������������������������������������0000664�0001750�0001750�00000005514�12256773774�014632� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/json/rpcserver.h> #include "rpcserverimpl.h" namespace cxxtools { namespace json { RpcServer::RpcServer(EventLoopBase& eventLoop) : _impl(new RpcServerImpl(eventLoop, runmodeChanged, *this)) { } RpcServer::RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, int backlog) : _impl(new RpcServerImpl(eventLoop, runmodeChanged, *this)) { listen(ip, port, backlog); } RpcServer::RpcServer(EventLoopBase& eventLoop, unsigned short int port, int backlog) : _impl(new RpcServerImpl(eventLoop, runmodeChanged, *this)) { listen(port, backlog); } RpcServer::~RpcServer() { delete _impl; } void RpcServer::addService(const std::string& praefix, const ServiceRegistry& service) { std::vector<std::string> procs = service.getProcedureNames(); for (std::vector<std::string>::const_iterator it = procs.begin(); it != procs.end(); ++it) { registerProcedure(praefix + *it, service.getProcedure(*it)); } } void RpcServer::listen(const std::string& ip, unsigned short int port, int backlog) { _impl->listen(ip, port, backlog); } void RpcServer::listen(unsigned short int port, int backlog) { _impl->listen(std::string(), port, backlog); } unsigned RpcServer::minThreads() const { return _impl->minThreads(); } void RpcServer::minThreads(unsigned m) { _impl->minThreads(m); } unsigned RpcServer::maxThreads() const { return _impl->maxThreads(); } void RpcServer::maxThreads(unsigned m) { _impl->maxThreads(m); } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/socket.cpp������������������������������������������������������������������0000664�0001750�0001750�00000007435�12256773774�014113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "socket.h" #include "rpcserverimpl.h" #include <cxxtools/log.h> log_define("cxxtools.json.socket") namespace cxxtools { namespace json { Socket::Socket(RpcServerImpl& server, ServiceRegistry& serviceRegistry, net::TcpServer& tcpServer) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(tcpServer), _server(server), _responder(serviceRegistry), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); _responder.begin(); } Socket::Socket(Socket& socket) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(socket._tcpServer), _server(socket._server), _responder(socket._responder._serviceRegistry), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); _responder.begin(); } void Socket::accept() { net::TcpSocket::accept(_tcpServer, net::TcpSocket::DEFER_ACCEPT); _accepted = true; buffer().beginRead(); } void Socket::setSelector(SelectorBase* s) { s->add(*this); } void Socket::removeSelector() { TcpSocket::setSelector(0); } void Socket::onIODeviceInput(IODevice& iodevice) { log_debug("onIODeviceInput"); inputReady(*this); } void Socket::onInput(StreamBuffer& sb) { log_debug("onInput"); sb.endRead(); if (sb.in_avail() == 0 || sb.device()->eof()) { close(); return; } while (sb.in_avail() > 0) { if (_responder.advance(sb.sbumpc())) { _responder.finalize(_stream); buffer().beginWrite(); onOutput(sb); return; } } sb.beginRead(); } bool Socket::onOutput(StreamBuffer& sb) { log_trace("onOutput"); log_debug("send data to " << getPeerAddr()); try { sb.endWrite(); if ( sb.out_avail() ) { sb.beginWrite(); } else { _responder.begin(); if (sb.in_avail()) onInput(sb); else buffer().beginRead(); } } catch (const std::exception& e) { log_warn("exception occured when processing request: " << e.what()); close(); return false; } return true; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/Makefile.in�����������������������������������������������������������������0000664�0001750�0001750�00000050343�12266277545�014154� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/json DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_json_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la am_libcxxtools_json_la_OBJECTS = httpclient.lo httpclientimpl.lo \ httpresponder.lo httpservice.lo rpcclient.lo rpcclientimpl.lo \ responder.lo rpcserver.lo rpcserverimpl.lo scanner.lo \ socket.lo worker.lo libcxxtools_json_la_OBJECTS = $(am_libcxxtools_json_la_OBJECTS) libcxxtools_json_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libcxxtools_json_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcxxtools_json_la_SOURCES) DIST_SOURCES = $(libcxxtools_json_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-json.la noinst_HEADERS = \ httpclientimpl.h \ httpresponder.h \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_json_la_SOURCES = \ httpclient.cpp \ httpclientimpl.cpp \ httpresponder.cpp \ httpservice.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ responder.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ socket.cpp \ worker.cpp libcxxtools_json_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_json_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/json/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/json/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-json.la: $(libcxxtools_json_la_OBJECTS) $(libcxxtools_json_la_DEPENDENCIES) $(EXTRA_libcxxtools_json_la_DEPENDENCIES) $(libcxxtools_json_la_LINK) -rpath $(libdir) $(libcxxtools_json_la_OBJECTS) $(libcxxtools_json_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclientimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpresponder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclientimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserverimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/rpcclient.cpp���������������������������������������������������������������0000664�0001750�0001750�00000005573�12266277345�014601� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/json/rpcclient.h> #include "rpcclientimpl.h" namespace cxxtools { namespace json { RpcClient::RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port) : _impl(new RpcClientImpl()) { _impl->setSelector(selector); _impl->connect(addr, port); } RpcClient::RpcClient(const std::string& addr, unsigned short port) : _impl(new RpcClientImpl()) { _impl->connect(addr, port); } RpcClient::~RpcClient() { delete _impl; } void RpcClient::setSelector(SelectorBase& selector) { if (!_impl) _impl = new RpcClientImpl(); _impl->setSelector(selector); } void RpcClient::connect(const std::string& addr, unsigned short port) { if (!_impl) _impl = new RpcClientImpl(); _impl->connect(addr, port); } void RpcClient::close() { if (_impl) _impl->close(); } void RpcClient::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void RpcClient::endCall() { _impl->endCall(); } void RpcClient::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } const IRemoteProcedure* RpcClient::activeProcedure() const { return _impl->activeProcedure(); } void RpcClient::cancel() { _impl->cancel(); } void RpcClient::wait(std::size_t msecs) { _impl->wait(msecs); } const std::string& RpcClient::prefix() const { return _impl->prefix(); } void RpcClient::prefix(const std::string& p) { _impl->prefix(p); } } } �������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/rpcserverimpl.h�������������������������������������������������������������0000664�0001750�0001750�00000011235�12256773774�015156� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RPCSERVERIMPL_H #define CXXTOOLS_JSON_RPCSERVERIMPL_H #include <map> #include <set> #include <vector> #include <cxxtools/noncopyable.h> #include <cxxtools/event.h> #include <cxxtools/mutex.h> #include <cxxtools/condition.h> #include <cxxtools/queue.h> #include <cxxtools/signal.h> #include <cxxtools/connectable.h> #include <cxxtools/json/rpcserver.h> namespace cxxtools { class EventLoopBase; class ServiceProcedure; namespace net { class TcpServer; } namespace json { class RpcServerImpl; class Worker; class Socket; class IdleSocketEvent; class ServerStartEvent; class NoWaitingThreadsEvent; class ThreadTerminatedEvent; class ActiveSocketEvent; class RpcServerImpl : private NonCopyable, public Connectable { public: RpcServerImpl(EventLoopBase& eventLoop, Signal<RpcServer::Runmode>& runmodeChanged, ServiceRegistry& serviceRegistry); ~RpcServerImpl(); void listen(const std::string& ip, unsigned short int port, int backlog); unsigned minThreads() const { return _minThreads; } void minThreads(unsigned m) { _minThreads = m; } unsigned maxThreads() const { return _maxThreads; } void maxThreads(unsigned m) { _maxThreads = m; } void terminate(); RpcServer::Runmode runmode() const { return _runmode; } private: void runmode(RpcServer::Runmode runmode) { _runmode = runmode; _runmodeChanged(runmode); } RpcServer::Runmode _runmode; Signal<RpcServer::Runmode>& _runmodeChanged; EventLoopBase& _eventLoop; void noWaitingThreads(); void onInput(Socket& _socket); void addIdleSocket(Socket* socket); void onIdleSocket(const IdleSocketEvent& event); void onActiveSocket(const ActiveSocketEvent& event); void onNoWaitingThreads(const NoWaitingThreadsEvent& event); void onThreadTerminated(const ThreadTerminatedEvent& event); void onServerStart(const ServerStartEvent& event); void start(); friend class Worker; //////////////////////////////////////////////////// MethodSlot<void, RpcServerImpl, Socket&> inputSlot; ServiceRegistry& _serviceRegistry; unsigned _minThreads; unsigned _maxThreads; std::vector<net::TcpServer*> _listener; Queue<Socket*> _queue; typedef std::set<Socket*> IdleSocket; IdleSocket _idleSocket; Mutex _threadMutex; Condition _threadTerminated; typedef std::set<Worker*> Threads; Threads _threads; Threads _terminatedThreads; void threadTerminated(Worker* worker); bool isTerminating() const { return runmode() == RpcServer::Terminating; } }; } } #endif // CXXTOOLS_JSON_RPCSERVERIMPL_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/rpcserverimpl.cpp�����������������������������������������������������������0000664�0001750�0001750�00000021347�12256773774�015516� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcserverimpl.h" #include "socket.h" #include "worker.h" #include <cxxtools/eventloop.h> #include <cxxtools/net/tcpserver.h> #include <cxxtools/log.h> #include <signal.h> log_define("cxxtools.json.rpcserver.impl") namespace cxxtools { namespace json { // Sent from the worker thread when a socket is idle. // The server will take that socket to the event loop. class IdleSocketEvent : public BasicEvent<IdleSocketEvent> { Socket* _socket; public: explicit IdleSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; // Sent from the server when constructed, so that the server // knows, when the event loop is running. class ServerStartEvent : public BasicEvent<ServerStartEvent> { const RpcServerImpl* _server; public: explicit ServerStartEvent(const RpcServerImpl* server) : _server(server) { } const RpcServerImpl* server() const { return _server; } }; // Sent from a worker, when a job was fetched from the queue and // no further threads are left for subsequent jobs. class NoWaitingThreadsEvent : public BasicEvent<NoWaitingThreadsEvent> { }; // Sent from the worker, when he decidid to stop, because there are // enough idle threads waiting on the queue already. class ThreadTerminatedEvent : public BasicEvent<ThreadTerminatedEvent> { Worker* _worker; public: explicit ThreadTerminatedEvent(Worker* worker) : _worker(worker) { } Worker* worker() const { return _worker; } }; RpcServerImpl::RpcServerImpl(EventLoopBase& eventLoop, Signal<RpcServer::Runmode>& runmodeChanged, ServiceRegistry& serviceRegistry) : _runmode(RpcServer::Stopped), _runmodeChanged(runmodeChanged), _eventLoop(eventLoop), inputSlot(slot(*this, &RpcServerImpl::onInput)), _serviceRegistry(serviceRegistry), _minThreads(5), _maxThreads(200) { _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onIdleSocket)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onNoWaitingThreads)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onThreadTerminated)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onServerStart)); connect(_eventLoop.exited, *this, &RpcServerImpl::terminate); _eventLoop.commitEvent(ServerStartEvent(this)); } RpcServerImpl::~RpcServerImpl() { if (runmode() == RpcServer::Running) { try { terminate(); } catch (const std::exception& e) { log_fatal("failed to terminate rpc server: " << e.what()); } } } void RpcServerImpl::listen(const std::string& ip, unsigned short int port, int backlog) { log_info("listen on " << ip << " port " << port); net::TcpServer* listener = new net::TcpServer(ip, port, backlog, net::TcpServer::DEFER_ACCEPT); try { _listener.push_back(listener); _queue.put(new Socket(*this, _serviceRegistry, *listener)); } catch (...) { delete listener; throw; } } void RpcServerImpl::start() { log_trace("start server"); runmode(RpcServer::Starting); MutexLock lock(_threadMutex); while (_threads.size() < minThreads()) { Worker* worker = new Worker(*this); _threads.insert(worker); worker->start(); } runmode(RpcServer::Running); } void RpcServerImpl::terminate() { MutexLock lock(_threadMutex); runmode(RpcServer::Terminating); try { for (unsigned n = 0; n < _listener.size(); ++n) _listener[n]->terminateAccept(); _queue.put(0); while (!_threads.empty() || !_terminatedThreads.empty()) { if (!_threads.empty()) { _threadTerminated.wait(lock); } for (Threads::iterator it = _terminatedThreads.begin(); it != _terminatedThreads.end(); ++it) delete *it; _terminatedThreads.clear(); } for (unsigned n = 0; n < _listener.size(); ++n) delete _listener[n]; _listener.clear(); while (!_queue.empty()) delete _queue.get(); for (IdleSocket::iterator it = _idleSocket.begin(); it != _idleSocket.end(); ++it) delete *it; _idleSocket.clear(); runmode(RpcServer::Stopped); } catch (const std::exception& e) { runmode(RpcServer::Failed); } } void RpcServerImpl::noWaitingThreads() { if (runmode() == RpcServer::Running) _eventLoop.commitEvent(NoWaitingThreadsEvent()); } void RpcServerImpl::threadTerminated(Worker* worker) { MutexLock lock(_threadMutex); _threads.erase(worker); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(ThreadTerminatedEvent(worker)); } else { _terminatedThreads.insert(worker); _threadTerminated.signal(); } } void RpcServerImpl::addIdleSocket(Socket* socket) { log_debug("add idle socket " << static_cast<void*>(socket)); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(IdleSocketEvent(socket)); } else { log_debug("server not running; delete " << static_cast<void*>(socket)); delete socket; } } void RpcServerImpl::onIdleSocket(const IdleSocketEvent& event) { Socket* socket = event.socket(); log_debug("add idle socket " << static_cast<void*>(socket) << " to selector"); _idleSocket.insert(socket); socket->setSelector(&_eventLoop); socket->inputConnection = connect(socket->inputReady, inputSlot); } void RpcServerImpl::onNoWaitingThreads(const NoWaitingThreadsEvent& event) { MutexLock lock(_threadMutex); if (_threads.size() >= maxThreads()) { log_warn("thread limit " << maxThreads() << " reached"); return; } try { Worker* worker = new Worker(*this); try { log_debug("create thread " << static_cast<void*>(worker) << "; running threads=" << _threads.size()); worker->start(); _threads.insert(worker); log_debug(_threads.size() << " threads running"); } catch (const std::exception&) { delete worker; throw; } } catch (const std::exception& e) { log_warn("failed to create thread: " << e.what()); } } void RpcServerImpl::onThreadTerminated(const ThreadTerminatedEvent& event) { MutexLock lock(_threadMutex); log_debug("thread terminated (" << static_cast<void*>(event.worker()) << ") " << _threads.size() << " threads left"); try { event.worker()->join(); } catch (const std::exception& e) { log_error("failed to join thread: " << e.what()); } delete event.worker(); } void RpcServerImpl::onServerStart(const ServerStartEvent& event) { if (event.server() == this) { start(); } } void RpcServerImpl::onInput(Socket& socket) { socket.removeSelector(); log_debug("search socket " << static_cast<void*>(&socket) << " in idle socket"); _idleSocket.erase(&socket); if (socket.isConnected()) { socket.inputConnection.close(); _queue.put(&socket); } else { log_debug("onInput; delete " << static_cast<void*>(&socket)); log_info("client " << socket.getPeerAddr() << " closed connection"); delete &socket; } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/responder.h�����������������������������������������������������������������0000664�0001750�0001750�00000004140�12256773774�014257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_JSON_RESPONDER_H #define CXXTOOLS_JSON_RESPONDER_H #include <cxxtools/deserializer.h> #include <cxxtools/decomposer.h> #include <cxxtools/iostream.h> #include <cxxtools/jsonparser.h> #include <cxxtools/jsonformatter.h> namespace cxxtools { class ServiceRegistry; namespace json { class Socket; class Responder { friend class Socket; public: explicit Responder(ServiceRegistry& serviceRegistry); ~Responder(); void begin(); bool advance(char ch); void finalize(std::ostream& out); private: ServiceRegistry& _serviceRegistry; JsonParser _parser; DeserializerBase _deserializer; bool _failed; std::string _errorMessage; }; } } #endif // CXXTOOLS_JSON_RESPONDER_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/json/scanner.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000004750�12256773774�014251� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "scanner.h" #include <cxxtools/log.h> #include <cxxtools/remoteexception.h> #include <cxxtools/deserializer.h> #include <cxxtools/composer.h> log_define("cxxtools.json.scanner") namespace cxxtools { namespace json { void Scanner::begin(DeserializerBase& handler, IComposer& composer) { _deserializer = &handler; _deserializer->begin(); _composer = &composer; _parser.begin(*_deserializer); } void Scanner::finalizeReply() { const SerializationInfo* s = _deserializer->si()->findMember("error"); if (s && !s->isNull()) { log_debug("remote error detected category=" << s->category() << " type=" << s->typeName()); std::string msg; if (s->category() == SerializationInfo::Object) { int rc = 0; s->getMember("code", rc); s->getMember("message", msg); throw RemoteException(msg, rc); } else { s->getValue(msg); if (msg.empty()) msg = "remote exception"; throw RemoteException(msg); } } _composer->fixup( _deserializer->si()->getMember("result")); } } } ������������������������cxxtools-2.2.1/src/timespan.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000003370�12266277345�013456� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/timespan.h> #include <sys/time.h> #include <time.h> #include <iostream> namespace cxxtools { Timespan Timespan::gettimeofday() { timeval tv; ::gettimeofday(&tv, 0); return Timespan(tv.tv_sec, tv.tv_usec); } std::ostream& operator<< (std::ostream& out, const Timespan& ht) { out << static_cast<double>(ht.toUSecs()) / 1e6; return out; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/jsonparser.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000034355�12266277345�014033� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/jsonparser.h> #include <cxxtools/deserializerbase.h> #include <cxxtools/serializationerror.h> #include <cxxtools/utf8codec.h> #include <cxxtools/log.h> #include <cctype> log_define("cxxtools.json.parser") namespace cxxtools { bool JsonParser::JsonStringParser::advance(Char ch) { switch (_state) { case state_0: if (ch == '\\') _state = state_esc; else if (ch == '"') return true; else _str += ch; break; case state_esc: _state = state_0; if (ch == '"' || ch == '\\' || ch == '/') _str += ch; else if (ch == 'b') _str += '\b'; else if (ch == 'f') _str += '\f'; else if (ch == 'n') _str += '\n'; else if (ch == 'r') _str += '\r'; else if (ch == 't') _str += '\t'; else if (ch == 'u') { _value = 0; _count = 4; _state = state_hex; } else SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + "' in string"); break; case state_hex: if (ch >= '0' && ch <= '9') _value = (_value << 4) | (ch.value() - '0'); else if (ch >= 'a' && ch <= 'f') _value = (_value << 4) | (ch.value() - 'a' + 10); else if (ch >= 'A' && ch <= 'F') _value = (_value << 4) | (ch.value() - 'A' + 10); else SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + "' in hex sequence"); if (--_count == 0) { _str += Char(static_cast<wchar_t>(_value)); _state = state_0; } break; } return false; } JsonParser::JsonParser() : _deserializer(0), _next(0) { } int JsonParser::advance(Char ch) { int ret; switch (_state) { case state_0: if (ch == '{') { _state = state_object; _deserializer->setCategory(SerializationInfo::Object); } else if (ch == '[') { _state = state_array; _deserializer->setCategory(SerializationInfo::Array); } else if (ch == '"') { _state = state_string; _deserializer->setCategory(SerializationInfo::Value); } else if ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-') { _token = ch; _state = state_number; _deserializer->setCategory(SerializationInfo::Value); } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) { _token = ch; _state = state_token; } break; case state_object: if (ch == '"') { _state = state_object_name; _stringParser.clear(); } else if (ch == '}') return 1; else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + '\''); break; case state_object_name: if (_stringParser.advance(ch)) _state = state_object_after_name; break; case state_object_after_name: if (ch == ':') { if (_next == 0) _next = new JsonParser(); log_debug("begin object member " << _stringParser.str()); _deserializer->beginMember(Utf8Codec::encode(_stringParser.str()), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _stringParser.clear(); _state = state_object_value; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + '\''); break; case state_object_value: ret = _next->advance(ch); if (ret != 0) { log_debug("leave member"); _deserializer->leaveMember(); _state = state_object_e; } if (ret != -1) break; case state_object_e: if (ch == ',') _state = state_object_next_member; else if (ch == '}') return 1; else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + '\''); break; case state_object_next_member: if (ch == '"') { _state = state_object_name; _stringParser.clear(); } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + '\''); break; case state_array: if (ch == ']') { return 1; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) { if (_next == 0) _next = new JsonParser(); log_debug("begin array member"); _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _next->advance(ch); _state = state_array_value; } break; case state_array_value: ret = _next->advance(ch); if (ret != 0) _state = state_array_e; if (ret != -1) break; case state_array_e: if (ch == ']') { log_debug("leave member"); _deserializer->leaveMember(); return 1; } else if (ch == ',') { log_debug("leave member"); _deserializer->leaveMember(); log_debug("begin array member"); _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Void); _next->begin(*_deserializer); _state = state_array_value; } else if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + '\''); break; case state_string: if (_stringParser.advance(ch)) { log_debug("set string value \"" << _stringParser.str() << '"'); _deserializer->setValue(_stringParser.str()); _deserializer->setTypeName("string"); _stringParser.clear(); _state = state_end; return 1; } break; case state_number: if (std::isspace(ch.value())) { log_debug("set int value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("int"); _token.clear(); return 1; } else if (ch == '.' || ch == 'e' || ch == 'E') { _token += ch; _state = state_float; } else if (ch >= '0' && ch <= '9') { _token += ch; } else { log_debug("set int value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("int"); _token.clear(); return -1; } break; case state_float: if (std::isspace(ch.value())) { log_debug("set double value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("double"); _token.clear(); return 1; } else if ((ch >= '0' && ch <= '9') || ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E') _token += ch; else { log_debug("set double value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("double"); _token.clear(); return -1; } break; case state_token: if (std::isalpha(ch.value())) _token += Char(std::tolower(ch)); else { if (_token == "true" || _token == "false") { log_debug("set bool value \"" << _token << '"'); _deserializer->setValue(_token); _deserializer->setTypeName("bool"); _token.clear(); } else if (_token == "null") { log_debug("set null value \"" << _token << '"'); _deserializer->setTypeName("null"); _deserializer->setNull(); _token.clear(); } return -1; } break; case state_comment0: if (ch == '/') _state = state_commentline; else if (ch == '*') _state = state_comment; else SerializationError::doThrow(std::string("invalid character '") + ch.narrow() + '\''); break; case state_commentline: if (ch == '\n') _state = _nextState; break; case state_comment: if (ch == '*') _state = state_comment_e; break; case state_comment_e: if (ch == '/') _state = _nextState; else if (ch != '*') _state = state_comment; break; case state_end: if (ch == '/') { _nextState = _state; _state = state_comment0; } else if (!std::isspace(ch.value())) SerializationError::doThrow(std::string("unexpected character '") + ch.narrow() + "\' after end"); break; } return 0; } void JsonParser::finish() { if (_state == state_commentline) _state = _nextState; switch (_state) { case state_0: case state_object: case state_object_name: case state_object_after_name: case state_object_value: case state_object_e: case state_object_next_member: case state_array: case state_array_value: case state_array_e: case state_string: case state_comment0: case state_commentline: case state_comment: case state_comment_e: SerializationError::doThrow("unexpected end"); case state_number: _deserializer->setValue(_token); _deserializer->setTypeName("int"); _token.clear(); break; case state_float: _deserializer->setValue(_token); _deserializer->setTypeName("double"); _token.clear(); break; case state_token: if (_token == "true" || _token == "false") { _deserializer->setValue(_token); _deserializer->setTypeName("bool"); _token.clear(); } else if (_token == "null") { _deserializer->setTypeName("null"); _deserializer->setNull(); _token.clear(); } break; case state_end: break; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/tcpserverimpl.cpp����������������������������������������������������������������0000664�0001750�0001750�00000031024�12266277345�014532� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/addrinfo.h> #include "tcpserverimpl.h" #include "tcpsocketimpl.h" #include "addrinfoimpl.h" #include "error.h" #include <cxxtools/net/tcpserver.h> #include <cxxtools/net/tcpsocket.h> #include <cxxtools/net/net.h> #include <cxxtools/systemerror.h> #include <cxxtools/log.h> #include <cxxtools/ioerror.h> #include <cerrno> #include <cassert> #include <cstring> #include <sys/poll.h> #include <unistd.h> #include <fcntl.h> #include <limits> #include "error.h" #ifdef HAVE_TCP_DEFER_ACCEPT # include <netinet/tcp.h> # include <sys/types.h> # include <sys/socket.h> #endif #ifdef HAVE_SO_NOSIGPIPE # include <sys/types.h> # include <sys/socket.h> #endif log_define("cxxtools.net.tcpserver.impl") namespace cxxtools { namespace net { static const int noPendingAccept = -1; TcpServerImpl::TcpServerImpl(TcpServer& server) : _server(server), _pendingAccept(noPendingAccept), _pfd(0) #ifdef HAVE_TCP_DEFER_ACCEPT , _deferAccept(false) #endif { int ret = ::pipe(_wakePipe); if (ret == 1) throwSystemError("pipe"); log_debug("wake pipe read fd=" << _wakePipe[0] << " write fd=" << _wakePipe[1]); } TcpServerImpl::~TcpServerImpl() { ::close(_wakePipe[0]); ::close(_wakePipe[1]); } int TcpServerImpl::create(int domain, int type, int protocol) { log_debug("create socket"); int fd = ::socket(domain, type, protocol); if (fd < 0) throwSystemError("socket"); return fd; } void TcpServerImpl::close() { for (Listeners::const_iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if (it->_fd >= 0) { log_debug("close socket " << it->_fd); ::close(it->_fd); } } _listeners.clear(); _pfd = 0; #ifdef HAVE_TCP_DEFER_ACCEPT _deferAccept = false; #endif } void TcpServerImpl::listen(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags) { log_debug("listen on " << ipaddr << " port " << port << " backlog " << backlog << " flags " << flags); bool inherit = (flags & TcpServer::INHERIT) != 0; AddrInfo ai(ipaddr, port, true); static const int on = 1; const char* fn = ""; // getaddrinfo() may return more than one addrinfo structure, so work // them all out try { for (AddrInfoImpl::const_iterator it = ai.impl()->begin(); it != ai.impl()->end(); ++it) { int fd; try { fn = "create"; fd = create(it->ai_family, SOCK_STREAM, 0); } catch (const SystemError&) { log_debug("could not create socket: " << getErrnoString()); continue; } log_debug("setsockopt SO_REUSEADDR"); fn = "setsockopt"; if (::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { log_debug("could not set socket option SO_REUSEADDR " << fd << ": " << getErrnoString()); ::close(fd); continue; } #ifdef HAVE_IPV6 if (it->ai_family == AF_INET6) { if (::setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { log_debug("could not set socket option IPV6_V6ONLY " << fd << ": " << getErrnoString()); ::close(fd); continue; } } #endif log_debug("bind " << formatIp(*reinterpret_cast<const sockaddr_in*>(it->ai_addr))); fn = "bind"; if (::bind(fd, it->ai_addr, it->ai_addrlen) != 0) { log_debug("could not bind " << fd << ": " << getErrnoString()); ::close(fd); continue; } log_debug("listen"); fn = "listen"; if ( ::listen(fd, backlog) < 0 ) { close(); continue; } // save our information _listeners.push_back(Listener()); _listeners.back()._fd = fd; std::memmove(&_listeners.back()._servaddr, it->ai_addr, it->ai_addrlen); if (!inherit) { int flags = ::fcntl(fd, F_GETFD); flags |= FD_CLOEXEC ; fn = "fcntl"; int ret = ::fcntl(fd, F_SETFD, flags); if (ret == -1) throw IOError(getErrnoString("Could not set FD_CLOEXEC")); } } } catch (const std::exception& e) { close(); throw; } #ifdef HAVE_TCP_DEFER_ACCEPT deferAccept(flags & TcpServer::DEFER_ACCEPT); #endif if (_listeners.empty()) { if (errno == EADDRINUSE) throw AddressInUse(ipaddr, port); else throwSystemError(fn); } } void TcpServerImpl::terminateAccept() { char ch = 'A'; int ret = ::write(_wakePipe[1], &ch, 1); if (ret == -1) throwSystemError("write(wake pipe)"); } #ifdef HAVE_TCP_DEFER_ACCEPT void TcpServerImpl::deferAccept(bool sw) { if (sw == _deferAccept) return; int deferSecs = sw ? 30 : 0; log_debug("set TCP_DEFER_ACCEPT to " << deferSecs); for (Listeners::const_iterator it = _listeners.begin(); it != _listeners.end(); ++it) { if (::setsockopt(it->_fd, SOL_TCP, TCP_DEFER_ACCEPT, &deferSecs, sizeof(deferSecs)) < 0) throw cxxtools::SystemError("setsockopt(TCP_DEFER_ACCEPT)"); } } #endif template <typename T> class Resetter { T& _t; T _sav; public: explicit Resetter(T& t) : _t(t), _sav(t) { } Resetter(T& t, T value) : _t(t), _sav(value) { } ~Resetter() { _t = _sav; } }; bool TcpServerImpl::wait(std::size_t msecs) { log_debug("wait " << msecs); Resetter<pollfd*> resetter(_pfd); std::vector<pollfd> fds(_listeners.size()); initializePoll(&fds[0], fds.size()); log_debug("poll timeout " << msecs); while (true) { int p = ::poll(&fds[0], fds.size(), msecs); if (p > 0) { break; } else if (p < 0) { if (errno == EINTR) continue; log_error("error in poll; errno=" << errno); throwSystemError("poll"); } else if (p == 0) { log_debug("poll timeout (" << msecs << ')'); throw IOTimeout(); } } return checkPollEvent(); } void TcpServerImpl::attach(SelectorBase& s) { log_debug("attach to selector"); } void TcpServerImpl::detach(SelectorBase& s) { log_debug("detach from selector"); _pfd = 0; } std::size_t TcpServerImpl::pollSize() const { return _listeners.size(); } std::size_t TcpServerImpl::initializePoll(pollfd* pfd, std::size_t pollSize) { assert(pfd != 0); assert(pollSize == _listeners.size()); log_debug("initializePoll " << pollSize); for (std::size_t n = 0; n < pollSize; ++n) { pfd[n].fd = _listeners[n]._fd; pfd[n].revents = 0; pfd[n].events = POLLIN; } _pfd = pfd; return pollSize; } bool TcpServerImpl::checkPollEvent() { assert(_pfd != 0); bool ret = false; Resetter<int> resetter(_pendingAccept, noPendingAccept); for (Listeners::size_type n = 0; n < _listeners.size(); ++n) { if (_pfd[n].revents & POLLIN) { _pendingAccept = n; _server.connectionPending.send(_server); ret = true; } } return ret; } int TcpServerImpl::accept(int flags, struct sockaddr* sa, socklen_t& sa_len) { Resetter<int> resetter(_pendingAccept); if (_pendingAccept == noPendingAccept) { Resetter<pollfd*> resetter(_pfd); std::vector<pollfd> fds(_listeners.size() + 1); fds[0].fd = _wakePipe[0]; fds[0].revents = 0; fds[0].events = POLLIN; initializePoll(&fds[1], _listeners.size()); while (true) { log_debug("poll"); int p = ::poll(&fds[0], fds.size(), -1); if (p > 0) { break; } else if (p < 0) { if (errno == EINTR) continue; log_error("error in poll; errno=" << errno); throwSystemError("poll"); } } if (fds[0].revents & POLLIN) { char buffer; log_debug("wake accept event detected"); int ret = ::read(_wakePipe[0], &buffer, 1); if (ret == -1) throwSystemError("read(wake pipe)"); log_debug("accept terminated"); throw AcceptTerminated(); } for (std::vector<pollfd>::size_type n = 0; n < _listeners.size(); ++n) { if (fds[n + 1].revents & POLLIN) { log_debug("detected accept on fd " << fds[n + 1].fd); _pendingAccept = n; break; } } if (_pendingAccept == noPendingAccept) { // TODO ??? // poll reported activity but there is no POLLIN set??? return -1; } } else if (_pfd != 0) // should be always true here { _pfd[_pendingAccept].revents = 0; } int listenerFd = _listeners[_pendingAccept]._fd; log_debug( "accept fd=" << listenerFd << ", flags=" << flags ); bool inherit = (flags & TcpSocket::INHERIT) != 0; #ifdef HAVE_TCP_DEFER_ACCEPT deferAccept(flags & TcpSocket::DEFER_ACCEPT); #endif #ifdef HAVE_ACCEPT4 int clientFd; static bool useAccept4 = true; if (useAccept4) { int f = SOCK_NONBLOCK; if (!inherit) f |= SOCK_CLOEXEC; do { clientFd = ::accept4(listenerFd, sa, &sa_len, f); } while (clientFd < 0 && errno == EINTR); if( clientFd < 0 ) { if (errno == ENOSYS) { log_info("accept4 system call not available - fallback to accept"); useAccept4 = false; } else throwSystemError("accept4"); } } if (!useAccept4) { do { clientFd = ::accept(listenerFd, sa, &sa_len); } while (clientFd < 0 && errno == EINTR); if( clientFd < 0 ) throwSystemError("accept"); } #else int clientFd; do { clientFd = ::accept(listenerFd, sa, &sa_len); } while (clientFd < 0 && errno == EINTR); if( clientFd < 0 ) throwSystemError("accept"); if (!inherit) { int flags = ::fcntl(clientFd, F_GETFD); flags |= FD_CLOEXEC ; int ret = ::fcntl(clientFd, F_SETFD, flags); if (ret == -1) throw IOError(getErrnoString("Could not set FD_CLOEXEC")); } #endif #ifdef HAVE_SO_NOSIGPIPE static const int on = 1; if (::setsockopt(clientFd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)) < 0) throw cxxtools::SystemError("setsockopt(SO_NOSIGPIPE)"); #endif log_debug( "accepted on " << listenerFd << " => " << clientFd); return clientFd; } } // namespace net } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/tcpsocket.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000013431�12256773774�013642� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "tcpsocketimpl.h" #include "cxxtools/net/tcpsocket.h" #include <stdexcept> #include <memory> #include "cxxtools/log.h" #include <errno.h> #include <cxxtools/systemerror.h> #include <cxxtools/ioerror.h> log_define("cxxtools.net.tcpsocket") namespace cxxtools { namespace net { TcpSocket::TcpSocket() : _impl(0) { _impl = new TcpSocketImpl(*this); } TcpSocket::TcpSocket(const TcpServer& server, unsigned flags) : _impl(0) { _impl = new TcpSocketImpl(*this); std::auto_ptr<TcpSocketImpl> impl(_impl); this->accept(server, flags); impl.release(); } TcpSocket::TcpSocket(const std::string& ipaddr, unsigned short int port) : _impl(0) { _impl = new TcpSocketImpl(*this); std::auto_ptr<TcpSocketImpl> impl(_impl); this->connect(ipaddr, port); impl.release(); } TcpSocket::TcpSocket(const AddrInfo& addrinfo) : _impl(0) { _impl = new TcpSocketImpl(*this); std::auto_ptr<TcpSocketImpl> impl(_impl); this->connect(addrinfo); impl.release(); } TcpSocket::~TcpSocket() { try { this->close(); } catch(const std::exception& e) { log_error("TcpSocket::close failed: " << e.what()); } delete _impl; } std::string TcpSocket::getSockAddr() const { return _impl->getSockAddr(); } std::string TcpSocket::getPeerAddr() const { return _impl->getPeerAddr(); } void TcpSocket::setTimeout(std::size_t msecs) { _impl->setTimeout(msecs); } std::size_t TcpSocket::timeout() const { return _impl->timeout(); } void TcpSocket::connect(const AddrInfo& addrinfo) { this->close(); _impl->connect(addrinfo); this->setEnabled(true); this->setAsync(true); this->setEof(false); } bool TcpSocket::beginConnect(const AddrInfo& addrinfo) { this->close(); bool ret = _impl->beginConnect(addrinfo); this->setEnabled(true); this->setAsync(true); this->setEof(false); if(ret) connected(*this); return ret; } void TcpSocket::endConnect() { try { _impl->endConnect(); } catch (...) { close(); throw; } } bool TcpSocket::isConnected() const { return _impl->isConnected(); } int TcpSocket::getFd() const { return _impl->fd(); } void TcpSocket::accept(const TcpServer& server, unsigned flags) { this->close(); _impl->accept(server, flags); this->setEnabled(true); this->setAsync(true); this->setEof(false); } SelectableImpl& TcpSocket::simpl() { return *_impl; } void TcpSocket::onClose() { cancel(); _impl->close(); } bool TcpSocket::onWait(std::size_t msecs) { return _impl->wait(msecs); } void TcpSocket::onAttach(SelectorBase& sb) { _impl->attach(sb); } void TcpSocket::onDetach(SelectorBase& sb) { _impl->detach(sb); } size_t TcpSocket::onBeginRead(char* buffer, size_t n, bool& eof) { if (!_impl->isConnected()) throw IOPending("connect operation pending"); return _impl->beginRead(buffer, n, eof); } size_t TcpSocket::onEndRead(bool& eof) { return _impl->endRead(eof); } size_t TcpSocket::onRead(char* buffer, size_t count, bool& eof) { return _impl->read(buffer, count, eof); } size_t TcpSocket::onBeginWrite(const char* buffer, size_t n) { if (!_impl->isConnected()) throw IOPending("connect operation pending"); return _impl->beginWrite(buffer, n); } size_t TcpSocket::onEndWrite() { return _impl->endWrite(); } size_t TcpSocket::onWrite(const char* buffer, size_t count) { return _impl->write(buffer, count); } void TcpSocket::onCancel() { if (_impl->isConnected()) { _impl->cancel(); } else if (enabled()) { // we are in connecting state _impl->close(); setEnabled(false); } } IODeviceImpl& TcpSocket::ioimpl() { throw std::runtime_error("TcpSocket::ioimpl() not implemented"); IODeviceImpl* impl = 0; return *impl; } short TcpSocket::poll(short events) const { struct pollfd fds; fds.fd = _impl->fd(); fds.events = events; log_debug("poll timeout " << getTimeout()); int p = ::poll(&fds, 1, getTimeout()); log_debug("poll returns " << p << " revents " << fds.revents); if (p < 0) { log_error("error in poll; errno=" << errno); throw SystemError("poll"); } else if (p == 0) { log_debug("poll timeout (" << getTimeout() << ')'); throw IOTimeout(); } return fds.revents; } } // namespace net } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/pipeimpl.h�����������������������������������������������������������������������0000664�0001750�0001750�00000007366�12260037210�013106� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*************************************************************************** * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef Cxxtools_posix_PipeImpl_h #define Cxxtools_posix_PipeImpl_h #include "iodeviceimpl.h" #include <cxxtools/api.h> #include <cxxtools/iodevice.h> #include <unistd.h> namespace cxxtools { class PipeIODevice : public IODevice { friend class PipeImpl; public: PipeIODevice(); ~PipeIODevice(); int fd() const { return _impl.fd(); } void redirect(int fd, bool close, bool inherit); protected: void open(int fd, bool isAsync); void onClose() { cancel(); _impl.close(); } bool onWait(std::size_t msecs); size_t onBeginRead(char* buffer, size_t n, bool& eof); size_t onEndRead(bool& eof); size_t onRead(char* buffer, size_t count, bool& eof); size_t onBeginWrite(const char* buffer, size_t n); size_t onEndWrite(); size_t onWrite(const char* buffer, size_t count); void onCancel(); void onSync() const; IODeviceImpl& ioimpl() { return _impl; } SelectableImpl& simpl() { return _impl; } void onAttach(SelectorBase& s) { _impl.attach(s); } void onDetach(SelectorBase& s) { _impl.detach(s); } private: IODeviceImpl _impl; }; class PipeImpl { public: PipeImpl(bool isAsync); PipeIODevice& in(); const PipeIODevice& in() const; PipeIODevice& out(); const PipeIODevice& out() const; void redirect(int fd, bool close, bool inherit); int getReadFd() const { return out().fd(); } int getWriteFd() const { return in().fd(); } /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStdout(bool close, bool inherit); /// Redirect read-end to stdin. /// When the close argument is set, closes the original filedescriptor void redirectStdin(bool close, bool inherit); /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void redirectStderr(bool close, bool inherit); private: PipeIODevice _out; PipeIODevice _in; }; } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/connectable.cpp������������������������������������������������������������������0000664�0001750�0001750�00000004042�12256773774�014116� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/connectable.h" #include "cxxtools/connection.h" namespace cxxtools { Connectable::Connectable() {} Connectable::Connectable(const Connectable& c) { this->operator=(c); } Connectable::~Connectable() { this->clear(); } void Connectable::clear() { while( !_connections.empty() ) { Connection connection = _connections.front(); connection.close(); } } Connectable& Connectable::operator=(const Connectable& other) { return (*this); } void Connectable::onConnectionOpen(const Connection& c) { _connections.push_back(c); } void Connectable::onConnectionClose(const Connection& c) { _connections.remove(c); } } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/config.h.in����������������������������������������������������������������������0000664�0001750�0001750�00000007015�12266277562�013156� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* src/config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `accept4' function. */ #undef HAVE_ACCEPT4 /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the <csignal> header file. */ #undef HAVE_CSIGNAL /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H /* defined if IPV6 is supported */ #undef HAVE_IPV6 /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H /* defined if MSG_NOSIGNAL is defined */ #undef HAVE_MSG_NOSIGNAL /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* defined if socket option SO_NOSIGPIPE is supported */ #undef HAVE_SO_NOSIGPIPE /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the <sys/filio.h> header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H /* defined if TCP_DEFER_ACCEPT is defined */ #undef HAVE_TCP_DEFER_ACCEPT /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* defined if int64_t is one of the base types */ #undef INT64_IS_BASETYPE /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.ppc.cpp������������������������������������������������������������0000664�0001750�0001750�00000014114�12256773774�015160� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.ppc.h> #include <csignal> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("sync" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile ("sync" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& val) { atomic_t result = 0, tmp; asm volatile ("\n1:\n\t" "lwarx %0, 0, %2\n\t" "addi %1, %0, 1\n\t" "stwcx. %1, 0, %2\n\t" "bne- 1b\n" "isync\n" : "=&b" (result), "=&b" (tmp): "r" (&val): "cc", "memory"); return result + 1; } atomic_t atomicDecrement(volatile atomic_t& val) { atomic_t result = 0, tmp; asm volatile ("\n1:\n\t" "lwarx %0, 0, %2\n\t" "addi %1, %0, -1\n\t" "stwcx. %1, 0, %2\n\t" "bne- 1b\n" "isync\n" : "=&b" (result), "=&b" (tmp): "r" (&val): "cc", "memory"); return result - 1; } atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add) { /* ALTERNATIVE volatile register atomic_t ret = 0; volatile register atomic_t zero = 0; asm volatile ( "0: lwarx %0, %3, %1\n\t" " add %0, %2, %0\n\t" " stwcx. %0, %3, %1\n\t" " bne- 0b \n\t" " isync " : "=&r"(ret) : "r"(&val), "r"(n), "r"(zero) : "cr0", "memory", "r0" ); */ atomic_t result, tmp; asm volatile ("\n1:\n\t" "lwarx %0, 0, %2\n\t" "add %1, %0, %3\n\t" "stwcx. %1, 0, %2\n\t" "bne 1b\n" "isync\n" : "=&r" (result), "=&r" (tmp) : "r" (&val), "r" (add) : "cc", "memory"); return result; } atomic_t atomicCompareExchange(volatile atomic_t& val, atomic_t exch, atomic_t comp) { /* ALTERNATIVE: atomicCompareExchange( long *dest, long xchg, long compare) long ret = 0; long scratch; __asm__ __volatile__( "0: lwarx %0,0,%2\n" " xor. %1,%4,%0\n" " bne 1f\n" " stwcx. %3,0,%2\n" " bne- 0b\n" " isync\n" "1: " : "=&r"(ret), "=&r"(scratch) : "r"(dest), "r"(xchg), "r"(compare) : "cr0","memory","r0"); return ret; */ atomic_t tmp = 0; asm volatile ("\n1:\n\t" "lwarx %0, 0, %1\n\t" "cmpw %0, %2\n\t" "bne- 2f\n\t" "stwcx. %3, 0, %1\n\t" "bne- 1b\n" "2:\n" "isync\n" : "=&r" (tmp) : "b" (&val), "r" (comp), "r" (exch): "cc", "memory"); return tmp; } void* atomicCompareExchange(void* volatile& ptr, void* exch, void* comp) { /* ALTERNATIVE: atomicCompareExchange( void **dest, void* xchg, void* compare) long ret = 0; long scratch; __asm__ __volatile__( "0: lwarx %0,0,%2\n" " xor. %1,%4,%0\n" " bne 1f\n" " stwcx. %3,0,%2\n" " bne- 0b\n" " isync\n" "1: " : "=&r"(ret), "=&r"(scratch) : "r"(dest), "r"(xchg), "r"(compare) : "cr0","memory"); return (void*)ret; */ void* tmp = 0; asm volatile ("\n1:\n\t" "lwarx %0, 0, %1\n\t" "cmpw %0, %2\n\t" "bne- 2f\n\t" "stwcx. %3, 0, %1\n\t" "bne- 1b\n" "2:" "isync\n" : "=&r" (tmp) : "b" (&ptr), "r" (comp), "r" (exch): "cc", "memory"); return tmp; } atomic_t atomicExchange(volatile atomic_t& val, atomic_t exch) { volatile atomic_t ret = 0; /* asm volatile ( "0: lwarx %0, 0, %1\n\t" " stwcx. %2, 0, %1\n\t" " bne- 0b \n\t" " isync " : "=&r"(ret) : "r"(&val), "r"(exch) : "cr0","memory", "r0" ); */ asm volatile ( "\n1:\n\t" "lwarx %0, 0, %2\n\t" "stwcx. %3, 0, %2\n\t" "bne 1b\n" "isync\n" : "=r" (ret) : "0" (ret), "b" (&val), "r" (exch): "cc", "memory"); return ret; } void* atomicExchange(void* volatile& dest, void* exch) { void* ret = 0; asm volatile ( "0: lwarx %0, 0, %1\n\t" " stwcx. %2, 0, %1\n\t" " bne- 0b \n\t" " isync" : "=&r"(ret) : "r"(&dest), "r"(exch) : "cr0","memory", "r0" ); return ret; } } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/multifstream.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000006044�12256773774�014361� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/multifstream.h" namespace cxxtools { multifstreambuf::multifstreambuf() : current(0) { mglob.gl_pathv = 0; } multifstreambuf::multifstreambuf(const char* pattern, int flags) : current(0) { int ret = glob(pattern, flags, 0, &mglob); if (ret == 0 && mglob.gl_pathv && mglob.gl_pathv[current]) file.open(mglob.gl_pathv[current], std::ios::in); else mglob.gl_pathv = 0; } multifstreambuf::~multifstreambuf() { if (mglob.gl_pathv) globfree(&mglob); } std::streambuf::int_type multifstreambuf::overflow(std::streambuf::int_type c) { return traits_type::eof(); } std::streambuf::int_type multifstreambuf::underflow() { if (mglob.gl_pathv == 0 || mglob.gl_pathv[current] == 0) open_next(); int_type r; do { r = file.sbumpc(); } while (r == traits_type::eof() && open_next()); if (r != traits_type::eof()) { ch = static_cast<char>(r); setg(&ch, &ch, &ch + 1); } return r; } int multifstreambuf::sync() { return 0; } bool multifstreambuf::open_next() { if (file.is_open()) file.close(); if (mglob.gl_pathv && mglob.gl_pathv[current + 1]) { ++current; file.open(mglob.gl_pathv[current], std::ios::in); // error-handling is done in underflow() return true; } else { if (mglob.gl_pathv) globfree(&mglob); if (!patterns.empty()) { glob(patterns.front().first.c_str(), patterns.front().second, 0, &mglob); current = 0; if (mglob.gl_pathv && mglob.gl_pathv[0]) file.open(mglob.gl_pathv[0], std::ios::in); patterns.pop(); // error-handling is done in underflow() return true; } else { mglob.gl_pathv = 0; return false; } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/filedeviceimpl.cpp���������������������������������������������������������������0000664�0001750�0001750�00000006065�12256773774�014631� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Marc Boris Drner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "filedeviceimpl.h" #include "cxxtools/iodevice.h" #include "error.h" #include <sys/types.h> #include <sys/stat.h> #include <limits.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> namespace cxxtools { FileDeviceImpl::FileDeviceImpl(FileDevice& device) : IODeviceImpl(device) { } FileDeviceImpl::~FileDeviceImpl() { } bool FileDeviceImpl::seekable() const { struct stat s; int ret = fstat(_fd, &s); if(ret == 0) { if(S_ISREG(s.st_mode) || S_ISBLK(s.st_mode)) return true; } return false; } FileDeviceImpl::pos_type FileDeviceImpl::seek(off_type offset, std::ios::seekdir sd ) { int whence = std::ios::cur; switch(sd) { case std::ios::beg: whence = SEEK_SET; break; case std::ios::cur: whence = SEEK_CUR; break; case std::ios::end: whence = SEEK_END; break; default: break; } off_t ret = lseek(fd(), offset, whence); if( ret == (off_t)-1 ) throw IOError(getErrnoString("lseek failed")); return ret; } void FileDeviceImpl::resize(off_type size) { int ret = ::ftruncate(fd(), size); if(ret != 0) throw IOError(getErrnoString("ftruncate failed")); } size_t FileDeviceImpl::size() { struct stat buff; int ret = fstat(fd(), &buff); if(ret != 0) throw IOError(getErrnoString("fstat failed")); return buff.st_size; } size_t FileDeviceImpl::peek(char* buffer, size_t count) { bool eof; size_t ret = this->read(buffer, count, eof); // if we could read data seek back if(ret > 0) this->seek(-((off_type)ret), std::ios::cur); return ret; } } //namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/properties.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000021201�12266277345�014023� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/properties.h> #include <cxxtools/utf8codec.h> #include <iostream> #include <fstream> #include <sstream> #include <cctype> namespace cxxtools { namespace { class PropertiesEvent : public PropertiesParser::Event { Properties& properties; String key; public: PropertiesEvent(Properties& properties_) : properties(properties_) { } bool onKeyPart(const String& key); bool onKey(const String& key); bool onValue(const String& value); }; bool PropertiesEvent::onKeyPart(const String&) { return false; } bool PropertiesEvent::onKey(const String& key_) { key = key_; return false; } bool PropertiesEvent::onValue(const String& value) { properties.setValue(key, value); return false; } inline bool isKeyChar(Char ch) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_'; } std::string mkErrorMessage(const std::string& msg, unsigned lineNo) { std::ostringstream s; s << "parsing properties failed in line " << lineNo << ": " << msg; return s.str(); } } PropertiesParserError::PropertiesParserError(const std::string& msg, unsigned lineNo) : SerializationError(mkErrorMessage(msg, lineNo)) { } Properties::Properties(const std::string& filename) { PropertiesEvent ev(*this); std::ifstream in(filename.c_str()); if (!in) throw PropertiesParserError("could not open properties file \"" + filename + '"'); PropertiesParser(ev).parse(in); } Properties::Properties(std::istream& in) { PropertiesEvent ev(*this); PropertiesParser(ev).parse(in); } void PropertiesParser::parse(std::istream& in, TextCodec<Char, char>* codec) { TextIStream ts(in, codec ? codec : new Utf8Codec()); parse(ts); } void PropertiesParser::parse(TextIStream& in) { Char ch; while (in.get(ch) && !parse(ch)) ; end(); } bool PropertiesParser::parse(Char ch) { bool ret = false; if (ch == '\n') ++lineNo; switch (state) { case state_0: if (ch == '#' || ch == '!') state = state_comment; else if (isKeyChar(ch)) { key = ch; keypart = ch; state = state_key; } else if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n') ; else if (ch == '\\') { key.clear(); keypart.clear(); state = state_key_esc; } else if (!std::isspace(ch.value()) && ch != '\n' && ch != '\r') throw PropertiesParserError("format error", lineNo); break; case state_key: if (ch == '.') { event.onKeyPart(keypart); keypart.clear(); key += ch; } else if (isKeyChar(ch)) { keypart += ch; key += ch; } else if (std::isspace(ch.value())) { ret = event.onKeyPart(keypart) || event.onKey(key); state = state_key_sp; } else if (ch == '=') { ret = event.onKeyPart(keypart) || event.onKey(key); state = state_value; } else if (ch == '\\') { state = state_key_esc; } else throw PropertiesParserError("parse error in properties while reading key " + Utf8Codec::encode(key), lineNo); break; case state_key_esc: if (ch == 'u') { unicode = 0; unicodeCount = 0; state = state_key_unicode; } else if (ch == 'n') { keypart += '\n'; key += '\n'; state = state_key; } else if (ch == 'r') { keypart += '\r'; key += '\r'; state = state_key; } else if (ch == 't') { keypart += '\t'; key += '\t'; state = state_key; } else { keypart += ch; key += ch; state = state_key; } break; case state_key_sp: if (ch == '=') { state = state_value; } else if (!std::isspace(ch.value())) throw PropertiesParserError("parse error while reading key " + Utf8Codec::encode(key), lineNo); break; case state_value: if (ch == '\n') { ret = event.onValue(value); value.clear(); state = state_0; } else if (ch == '\\') state = state_value_esc; else if (!value.empty() || !std::isspace(ch.value())) value += ch; break; case state_value_esc: if (ch == 'u') { unicode = 0; unicodeCount = 0; state = state_unicode; } else if (ch == 'n') { value += '\n'; state = state_value; } else if (ch == 'r') { value += '\r'; state = state_value; } else if (ch == 't') { value += '\t'; state = state_value; } else { value += ch; state = state_value; } break; case state_unicode: case state_key_unicode: if (ch >= '0' && ch <= '9') { unicode = (unicode << 4) | (ch - '0'); ++unicodeCount; } else if (ch >= 'a' && ch <= 'f') { unicode = (unicode << 4) | (ch - 'a' + 10); ++unicodeCount; } else if (ch >= 'A' && ch <= 'F') { unicode = (unicode << 4) | (ch - 'A' + 10); ++unicodeCount; } else if (unicodeCount == 0) throw PropertiesParserError(std::string("invalid unicode sequence \\u") + ch.narrow(), lineNo); else { if (state == state_unicode) { state = state_value; value += Char(unicode); } else { state = state_key; key += Char(unicode); } return parse(ch); } if (unicodeCount >= 8) { if (state == state_unicode) { state = state_value; value += Char(unicode); } else { state = state_key; key += Char(unicode); } return false; } break; case state_comment: if (ch == '\n') state = state_0; break; } return ret; } void PropertiesParser::end() { switch (state) { case state_value: case state_value_esc: event.onValue(value); value.clear(); break; case state_unicode: if (unicodeCount == 0) throw PropertiesParserError("invalid unicode sequence at end", lineNo); value += Char(unicode); event.onValue(value); value.clear(); break; case state_0: case state_comment: break; case state_key: case state_key_esc: case state_key_unicode: case state_key_sp: throw PropertiesParserError("parse error while reading key " + Utf8Codec::encode(key), lineNo); } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/clockimpl.h����������������������������������������������������������������������0000664�0001750�0001750�00000003623�12266277345�013261� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/datetime.h" #include "cxxtools/timespan.h" #include <sys/time.h> #include <time.h> #include "config.h" namespace cxxtools { class ClockImpl { public: ClockImpl(); ~ClockImpl(); void start (); Timespan stop(); static DateTime getSystemTime(); static DateTime getLocalTime(); static Timespan getSystemTicks(); private: #ifdef HAVE_CLOCK_GETTIME struct timespec _startTime; struct timespec _stopTime; #else struct timeval _startTime; struct timeval _stopTime; #endif }; } // namespace cxxtools �������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.sparc64.cpp��������������������������������������������������������0000664�0001750�0001750�00000014123�12256773774�015660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.sparc64.h> #include <csignal> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile ("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " add %%o4, 1, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); return ret; } atomic_t atomicDecrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " sub %%o4, 1, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " sub %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); return ret; } atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " add %%o4, %3, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, %3, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest), "r" (add) : "memory", "cc"); return ret; } atomic_t atomicCompareExchange(volatile atomic_t& val, atomic_t exch, atomic_t comp) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t _comp asm("o4") = comp; register atomic_t _exch asm("o5") = exch; asm volatile( /* cas [%%g1], %%o4, %%o5 */ ".word 0xdbe0500c" : "=r" (_exch) : "0" (_exch), "r" (dest), "r" (_comp) : "memory"); return exch; } void* atomicCompareExchange(void* volatile& ptr, void* exch, void* comp) { register void* volatile* dest asm("g1") = &ptr; register void* _comp asm("o4") = comp; register void* _exch asm("o5") = exch; asm volatile( #if defined(__sparcv9) /* casx [%%g1], %%o4, %%o5 */ ".word 0xdbf0500c" #else /* cas [%%g1], %%o4, %%o5 */ ".word 0xdbe0500c" #endif : "=r" (_exch) : "0" (_exch), "r" (dest), "r" (_comp) : "memory"); return exch; } atomic_t atomicExchange(volatile atomic_t& val, atomic_t exch) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " mov %3, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " nop" : "=&r" (tmp), "=&r" (ret) : "r" (dest), "r" (exch) : "memory", "cc"); return ret; } void* atomicExchange(void* volatile& ptr, void* exch) { register void* volatile* dest asm("g1") = &ptr; register void* tmp asm("o4"); register void* ret asm("o5"); asm volatile( #if defined(__sparcv9) "1: ldx [%%g1], %%o4\n\t" #else "1: ld [%%g1], %%o4\n\t" #endif " mov %3, %%o5\n\t" #if defined(__sparcv9) /* casx [%%g1], %%o4, %%o5 */ " .word 0xdbf0500c\n\t" #else /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" #endif " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " nop" : "=&r" (tmp), "=&r" (ret) : "r" (dest), "r" (exch) : "memory", "cc"); return ret; } } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/systemerror.cpp������������������������������������������������������������������0000664�0001750�0001750�00000005157�12256773774�014247� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2005-2007 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/systemerror.h" #include "cxxtools/log.h" #include <errno.h> #include "error.h" log_define("cxxtools.systemerror") namespace cxxtools { SystemError::SystemError(int err, const char* fn) : std::runtime_error( getErrnoString(err, fn) ) , m_errno(err) { //log_debug("system error; " << what()); } SystemError::SystemError(const char* fn) : std::runtime_error( getErrnoString(fn) ) , m_errno(errno) { //log_debug("system error; " << what()); } SystemError::SystemError(const char* fn, const std::string& what) : std::runtime_error(fn && fn[0] ? (std::string("error in function ") + fn + ": " + what) : what), m_errno(0) { //log_debug("system error; " << std::exception::what()); } SystemError::~SystemError() throw() { } void throwSystemError(const char* msg) { throw SystemError(msg); } void throwSystemError(int errnum, const char* msg) { throw SystemError(errnum, msg); } OpenLibraryFailed::OpenLibraryFailed(const std::string& msg) : SystemError(0, msg) { log_debug("open library failed; " << what()); } SymbolNotFound::SymbolNotFound(const std::string& sym) : SystemError(0, "symbol not found: " + sym) , _symbol(sym) { log_debug("symbol " << sym << " not found; " << what()); } } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/settingsreader.h�����������������������������������������������������������������0000664�0001750�0001750�00000064741�12256773774�014345� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SettingsReader_h #define cxxtools_SettingsReader_h #include "cxxtools/settings.h" #include "cxxtools/char.h" #include "cxxtools/serializationinfo.h" #include <iostream> #include <cctype> namespace cxxtools { class SettingsReader { public: class State { public: virtual State* onChar(cxxtools::Char c, SettingsReader& reader) { if( c == std::char_traits<cxxtools::Char>::to_char_type( std::char_traits<cxxtools::Char>::eof() ) ) { return this->onEof(reader); } switch( c.value() ) { case '\n': case ' ': case '\t': case '\r': return this->onSpace(c, reader); case '"': return this->onQuote(c, reader); case ',': return this->onComma(c, reader); case '=': return this->onEqual(c, reader); case '#': case ';': return this->onHash(c, reader); case '{': return this->onOpenCurlyBrace(c, reader); case '}': return this->onCloseCurlyBrace(c, reader); case '(': return this->onOpenBrace(c, reader); case ')': return this->onCloseBrace(c, reader); case '[': return this->onOpenSquareBrace(c, reader); case ']': return this->onCloseSquareBrace(c, reader); default: return this->onAlpha(c, reader); } this->syntaxError(reader.line()); return 0; } virtual State* onEof(SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual ~State() {} private: virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onEqual(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onOpenBrace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onCloseBrace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onCloseSquareBrace(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } virtual State* onHash(cxxtools::Char c, SettingsReader& reader) { reader.beginComment(); // save current state return OnComment::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } protected: void syntaxError(unsigned line); }; class OnComment : public State { public: State* onChar(cxxtools::Char c, SettingsReader& reader) { if( c == '\n' ) { // restore state before comment return reader.endComment(); } return this; } static State* instance() { static OnComment _state; return &_state; } }; class BeginStatement : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { if(reader.depth() == 0) this->syntaxError(reader.line()); return OnQuotedValue::instance(); } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.beginSection(); return OnSection::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.enterMember(); return OnCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return BeginType::instance(); } virtual State* onEof(SettingsReader& reader) { return this; } public: static State* instance() { static BeginStatement _state; return &_state; } }; class OnSection : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onCloseSquareBrace(cxxtools::Char c, SettingsReader& reader) { return BeginStatement::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildSection(c); return this; } public: static State* instance() { static OnSection _state; return &_state; } }; class BeginType : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return AfterName::instance(); } virtual State* onEqual(cxxtools::Char c, SettingsReader& reader) { if(reader.depth() == 0) reader.enterMember(); else reader.pushName(); return OnEqual::instance(); } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.enterMember(); return BeginStatement::instance(); } virtual State* onOpenBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushTypeName(); return BeginTypedValue::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { if(reader.depth() == 0) this->syntaxError(reader.line()); reader.pushTypeName(); reader.enterMember(); return OnCurly::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } public: static State* instance() { static BeginType _state; return &_state; } }; class AfterName : public BeginType { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } public: static State* instance() { static AfterName _state; return &_state; } }; class OnEqual : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { if (c.value() == '\n') { reader.pushValue(); return AfterRValue::instance(); } else return this; } virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { return OnQuotedValue::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.enterMember(); return OnCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return OnRValue::instance(); } public: static State* instance() { static OnEqual _state; return &_state; } }; class OnQuotedValue : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); return AfterQuotedValue::instance(); } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onEqual(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onHash(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onOpenBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onCloseBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onCloseSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { if(c == '\\') c = reader.getEscaped(); reader.buildToken(c); return this; } public: static State* instance() { static OnQuotedValue _state; return &_state; } }; class AfterValue : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); reader.enterMember(); return BeginStatement::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); reader.buildToken(c); return BeginType::instance(); } virtual State* onEof(SettingsReader& reader) { reader.leaveMember(); if(reader.depth() > 1) this->syntaxError(reader.line()); return this; } public: static State* instance() { static AfterValue _state; return &_state; } }; class AfterQuotedValue : public AfterValue { virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { /// TODO: multi-line strings return this; } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); reader.beginSection(); return OnSection::instance(); } public: static State* instance() { static AfterQuotedValue _state; return &_state; } }; class OnRValue : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return AfterRValue::instance(); } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.beginSection(); return OnSection::instance(); } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushTypeName(); reader.enterMember(); return OnCurly::instance(); } virtual State* onOpenBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushTypeName(); return BeginTypedValue::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.enterMember(); return BeginStatement::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } virtual State* onEof(SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); return BeginStatement::instance(); } public: static State* instance() { static OnRValue _state; return &_state; } }; class AfterRValue : public OnRValue { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); reader.leaveMember(); reader.buildToken(c); return BeginType::instance(); } public: static State* instance() { static AfterRValue _state; return &_state; } }; class OnCurly : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onOpenCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.enterMember(); return OnCurly::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); return OnCloseCurly::instance(); } virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { return OnQuotedValue::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return BeginType::instance(); } public: static State* instance() { static OnCurly _state; return &_state; } }; class OnCloseCurly : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onOpenSquareBrace(cxxtools::Char c, SettingsReader& reader) { reader.beginSection(); return OnSection::instance(); } virtual State* onCloseCurlyBrace(cxxtools::Char c, SettingsReader& reader) { reader.leaveMember(); return this; } virtual State* onComma(cxxtools::Char c, SettingsReader& reader) { if(reader.depth() == 0) { this->syntaxError(reader.line()); } reader.enterMember(); return BeginStatement::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return BeginType::instance(); } virtual State* onEof(SettingsReader& reader) { if(reader.depth() != 0) this->syntaxError(reader.line()); return this; } public: static State* instance() { static OnCloseCurly _state; return &_state; } }; class BeginTypedValue : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return this; } virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { return OnQuotedTypedValue::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return OnTypedValue::instance(); } public: static State* instance() { static BeginTypedValue _state; return &_state; } }; class OnTypedValue : public State { virtual State* onSpace(cxxtools::Char c, SettingsReader& reader) { return EndTypedValue::instance(); } virtual State* onCloseBrace(cxxtools::Char c, SettingsReader& reader) { reader.pushValue(); return AfterValue::instance(); } virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { reader.buildToken(c); return this; } public: static State* instance() { static OnTypedValue _state; return &_state; } }; class OnQuotedTypedValue : public OnQuotedValue { virtual State* onQuote(cxxtools::Char c, SettingsReader& reader) { return EndTypedValue::instance(); } public: static State* instance() { static OnQuotedTypedValue _state; return &_state; } }; class EndTypedValue : public OnTypedValue { virtual State* onAlpha(cxxtools::Char c, SettingsReader& reader) { this->syntaxError(reader.line()); return this; } public: static State* instance() { static EndTypedValue _state; return &_state; } }; public: SettingsReader(std::basic_istream<cxxtools::Char>& is) : state(0) , _beforeComment(0) , _current(0) , _is(&is) , _line(1) , _depth(0) , _isDotted(false) { } void parse(cxxtools::SerializationInfo& si); protected: void buildToken(cxxtools::Char c) { _token += c; } void beginSection() { _section.clear(); } void buildSection(cxxtools::Char c) { _section += c; } size_t depth() const { return _depth; } size_t line() const { return _line; } void enterMember(); void leaveMember(); void pushValue(); void pushTypeName(); void pushName(); void beginComment() { _beforeComment = state; } State* endComment() const { return _beforeComment; } cxxtools::Char getEscaped(); private: State* state; State* _beforeComment; cxxtools::SerializationInfo* _current; std::basic_istream<cxxtools::Char>* _is; size_t _line; size_t _depth; bool _isDotted; cxxtools::String _token; cxxtools::String _section; }; static struct SettingsReaderInit { SettingsReaderInit() { SettingsReader::OnComment::instance(); SettingsReader::BeginStatement::instance(); SettingsReader::OnSection::instance(); SettingsReader::BeginType::instance(); SettingsReader::AfterName::instance(); SettingsReader::OnEqual::instance(); SettingsReader::OnCurly::instance(); SettingsReader::OnCloseCurly::instance(); SettingsReader::OnQuotedValue::instance(); SettingsReader::AfterQuotedValue::instance(); SettingsReader::OnRValue::instance(); SettingsReader::AfterRValue::instance(); SettingsReader::BeginTypedValue::instance(); SettingsReader::OnTypedValue::instance(); SettingsReader::OnQuotedTypedValue::instance(); SettingsReader::EndTypedValue::instance(); SettingsReader::AfterValue::instance(); } } settingsReaderInit; } // namespace cxxtools #endif �������������������������������cxxtools-2.2.1/src/hdstream.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000004677�12256773774�013466� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/hdstream.h" #include <ios> #include <iomanip> #include <cctype> namespace cxxtools { const unsigned Hdstreambuf::BUFFERSIZE; std::streambuf::int_type Hdstreambuf::overflow(std::streambuf::int_type ch) { static char hexdigit[] = "0123456789abcdef"; std::ostream out(Dest); size_t count = pptr() - pbase(); if(count > 0) { out << std::setw(7) << std::setfill('0') << std::hex << offset << '|'; offset += count; size_t i; for(i = 0; i < count; ++i) { unsigned char ch = static_cast<unsigned char>(pbase()[i]); out << hexdigit[ch >> 4] << hexdigit[ch & 0xf] << (i == 7 ? ':' : ' '); } for( ; i < BUFFERSIZE; ++i) out << " "; out << '|'; for(i = 0; i < count; ++i) out << (char)(std::isprint(pbase()[i]) ? pbase()[i] : '.'); for( ; i < BUFFERSIZE; ++i) out << ' '; out << std::endl; } setp(pbase(), epptr()); if (ch != -1) return sputc(ch); return 0; } std::streambuf::int_type Hdstreambuf::underflow() { return traits_type::eof(); } int Hdstreambuf::sync() { return overflow(traits_type::eof()); } } �����������������������������������������������������������������cxxtools-2.2.1/src/filedeviceimpl.h�����������������������������������������������������������������0000664�0001750�0001750�00000004054�12256773774�014272� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 PTV AG * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/api.h" #include "cxxtools/ioerror.h" #include "cxxtools/filedevice.h" #include "cxxtools/iodevice.h" #include "iodeviceimpl.h" namespace cxxtools { class FileDeviceImpl : public IODeviceImpl { public: typedef FileDevice::pos_type pos_type; typedef FileDevice::off_type off_type; public: FileDeviceImpl(FileDevice& device); ~FileDeviceImpl(); bool seekable() const; pos_type seek(off_type offset, std::ios::seekdir sd); void resize(off_type size); size_t size(); size_t peek(char* buffer, size_t count); }; } //namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/udpstream.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000004144�12256773774�013650� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/net/udpstream.h" namespace cxxtools { namespace net { void UdpStreambuf::sendBuffer() { try { sender.send(pbase(), pptr() - pbase(), flags); } catch (...) { } } std::streambuf::int_type UdpStreambuf::overflow(std::streambuf::int_type ch) { if (pptr() != pbase()) sendBuffer(); setp(message, message + msgsize); if (ch != traits_type::eof()) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type UdpStreambuf::underflow() { return traits_type::eof(); } int UdpStreambuf::sync() { if (pptr() != pbase()) sendBuffer(); setp(message, message + msgsize); return 0; } } // namespace net } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/tee.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000004621�12256773774�012421� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/tee.h" namespace cxxtools { std::streambuf::int_type Teestreambuf::overflow(std::streambuf::int_type ch) { if(ch != traits_type::eof()) { if(streambuf1 && streambuf1->sputc(ch) == traits_type::eof()) return traits_type::eof(); if(streambuf2 && streambuf2->sputc(ch) == traits_type::eof()) return traits_type::eof(); } return 0; } std::streambuf::int_type Teestreambuf::underflow() { return traits_type::eof(); } int Teestreambuf::sync() { if(streambuf1 && streambuf1->pubsync() == traits_type::eof()) return traits_type::eof(); if(streambuf2 && streambuf2->pubsync() == traits_type::eof()) return traits_type::eof(); return 0; } ///////////////////////////////////////////////////////////////////////////// void Tee::assign(std::ostream& s1, std::ostream& s2) { Teestreambuf* buf = dynamic_cast<Teestreambuf*>(rdbuf()); if(buf) buf->tie(s1.rdbuf(), s2.rdbuf()); } void Tee::assign_single(std::ostream& s) { Teestreambuf* buf = dynamic_cast<Teestreambuf*>(rdbuf()); if(buf) buf->tie(s.rdbuf()); } } ���������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/datetime.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000015553�12266277345�013440� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/datetime.h" #include "cxxtools/convert.h" #include "cxxtools/serializationinfo.h" #include <algorithm> #include <sstream> #include <stdexcept> #include <cctype> #include <cmath> #include <cassert> namespace cxxtools { namespace { unsigned short getNumber2(const char* s) { if( ! std::isdigit(s[0]) || !std::isdigit(s[1]) ) throw ConversionError("Invalid DateTime format"); return (s[0] - '0') * 10 + (s[1] - '0'); } unsigned short getNumber3(const char* s) { if (!std::isdigit(s[0]) || !std::isdigit(s[1]) || !std::isdigit(s[2])) throw ConversionError("Invalid DateTime format"); return (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0'); } unsigned short getNumber4(const char* s) { if( ! std::isdigit(s[0]) || ! std::isdigit(s[1]) || ! std::isdigit(s[2]) || ! std::isdigit(s[3]) ) throw ConversionError("Invalid DateTime format"); return (s[0] - '0') * 1000 + (s[1] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0'); } } int64_t DateTime::msecsSinceEpoch() const { static const DateTime dt(1970, 1, 1); return (*this - dt).totalMSecs(); } DateTime& DateTime::operator+=(const Timespan& ts) { int64_t totalMSecs = ts.totalMSecs(); int64_t days = totalMSecs / Time::MSecsPerDay; int64_t overrun = totalMSecs % Time::MSecsPerDay; if( (-overrun) > _time.totalMSecs() ) { days -= 1; } else if( overrun + _time.totalMSecs() > Time::MSecsPerDay) { days += 1; } _date += static_cast<int>(days); _time += Timespan(overrun * 1000); return *this; } DateTime& DateTime::operator-=(const Timespan& ts) { int64_t totalMSecs = ts.totalMSecs(); int64_t days = totalMSecs / Time::MSecsPerDay; int64_t overrun = totalMSecs % Time::MSecsPerDay; if( overrun > _time.totalMSecs() ) { days += 1; } else if(_time.totalMSecs() - overrun > Time::MSecsPerDay) { days -= 1; } _date -= static_cast<int>(days); _time -= Timespan( overrun * 1000 ); return *this; } Timespan operator-(const DateTime& first, const DateTime& second) { int64_t dayDiff = int64_t( first.date().julian() ) - int64_t( second.date().julian() ); int64_t milliSecDiff = int64_t( first.time().totalMSecs() ) - int64_t( second.time().totalMSecs() ); int64_t result = (dayDiff * Time::MSecsPerDay + milliSecDiff) * 1000; return result; } DateTime operator+(const DateTime& dt, const Timespan& ts) { DateTime tmp = dt; tmp += ts; return tmp; } DateTime operator-(const DateTime& dt, const Timespan& ts) { DateTime tmp = dt; tmp -= ts; return tmp; } void convert(DateTime& dt, const std::string& s) { if (s.size() < 23 || s.at(4) != '-' || s.at(7) != '-' || s.at(10) != ' ' || s.at(13) != ':' || s.at(16) != ':' || s.at(19) != '.') throw ConversionError("Invalid DateTime format"); const char* d = s.data(); dt= DateTime( getNumber4(d), getNumber2(d + 5), getNumber2(d + 8), getNumber2(d + 11), getNumber2(d + 14), getNumber2(d + 17), getNumber3(d + 20) ); } void convert(std::string& str, const DateTime& dt) { // format YYYY-MM-DD hh:mm:ss.sss // 0....+....1....+....2....+ char ret[24]; unsigned short n = dt.date().year(); ret[3] = '0' + n % 10; n /= 10; ret[2] = '0' + n % 10; n /= 10; ret[1] = '0' + n % 10; n /= 10; ret[0] = '0' + n % 10; ret[4] = '-'; ret[5] = '0' + dt.date().month() / 10; ret[6] = '0' + dt.date().month() % 10; ret[7] = '-'; ret[8] = '0' + dt.date().day() / 10; ret[9] = '0' + dt.date().day() % 10; ret[10] = ' '; ret[11] = '0' + dt.time().hour() / 10; ret[12] = '0' + dt.time().hour() % 10; ret[13] = ':'; ret[14] = '0' + dt.time().minute() / 10; ret[15] = '0' + dt.time().minute() % 10; ret[16] = ':'; ret[17] = '0' + dt.time().second() / 10; ret[18] = '0' + dt.time().second() % 10; ret[19] = '.'; n = dt.time().msec(); ret[22] = '0' + n % 10; n /= 10; ret[21] = '0' + n % 10; n /= 10; ret[20] = '0' + n % 10; str.assign(ret, 23); } void operator >>=(const SerializationInfo& si, DateTime& datetime) { if (si.category() == cxxtools::SerializationInfo::Object) { unsigned short year, month, day, hour, min, sec, msec; si.getMember("year") >>= year; si.getMember("month") >>= month; si.getMember("day") >>= day; si.getMember("hour") >>= hour; const cxxtools::SerializationInfo* p; if ((p = si.findMember("minute")) != 0) *p >>= min; else si.getMember("min") >>= min; if ((p = si.findMember("second")) != 0) *p >>= sec; else si.getMember("sec") >>= sec; if ((p = si.findMember("millisecond")) != 0 || (p = si.findMember("msec")) != 0) *p >>= msec; else msec = 0; datetime.set(year, month, day, hour, min, sec, msec); } else { std::string s; si.getValue(s); convert(datetime, s); } } void operator <<=(SerializationInfo& si, const DateTime& datetime) { std::string s; convert(s, datetime); si.setValue(s); si.setTypeName( "DateTime"); } } �����������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/iodevice.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000012723�12256773774�013435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iodevice.h" #include <string.h> namespace cxxtools { IODevice::IODevice() : _eof(false) , _async(false) , _rbuf(0) , _rbuflen(0) , _ravail(0) , _wbuf(0) , _wbuflen(0) , _wavail(0) , _reserved(0) { } IODevice::~IODevice() { } void IODevice::beginRead(char* buffer, size_t n) { if (!async()) throw std::logic_error("Device not in async mode"); if (!enabled()) throw DeviceClosed("Device closed"); if (_rbuf) throw IOPending("read operation pending"); size_t r = this->onBeginRead(buffer, n, _eof); if(r > 0 || _eof || _wavail) this->setState(Selectable::Avail); else this->setState(Selectable::Busy); _rbuf = buffer; _rbuflen = n; _ravail = r; } size_t IODevice::endRead() { if( ! _rbuf ) return 0; size_t n; try { n = this->onEndRead(_eof); } catch (...) { _rbuf = 0; _rbuflen = 0; _ravail = 0; throw; } if(_wavail > 0) this->setState(Selectable::Avail); else if(_wbuf) this->setState(Selectable::Busy); else this->setState(Selectable::Idle); _rbuf = 0; _rbuflen = 0; _ravail = 0; return n; } size_t IODevice::read(char* buffer, size_t n) { if (async()) { if( _rbuf ) throw IOPending("read operation pending"); try // TODO pass buffer pointer/length to onEndRead { this->beginRead(buffer, n); size_t n = this->onEndRead(_eof); _rbuf = 0; _rbuflen = 0; _ravail = 0; return n; } catch(...) { _rbuf = 0; _rbuflen = 0; _ravail = 0; throw; } } return this->onRead(buffer, n, _eof); } size_t IODevice::beginWrite(const char* buffer, size_t n) { if (!async()) throw std::logic_error("Device not in async mode"); if (!enabled()) throw std::logic_error("Device not enabled"); if (_wbuf) throw IOPending("write operation pending"); size_t r = this->onBeginWrite(buffer, n); if(r > 0 || _ravail) this->setState(Selectable::Avail); else this->setState(Selectable::Busy); _wbuf = buffer; _wbuflen = n; _wavail = r; return r; } size_t IODevice::endWrite() { if( ! _wbuf ) return 0; size_t n; try { n = onEndWrite(); } catch (...) { _wbuf = 0; _wbuflen = 0; _wavail = 0; throw; } if(_ravail > 0 || (_rbuf && _eof) ) this->setState(Selectable::Avail); else if(_rbuf) this->setState(Selectable::Busy); else this->setState(Selectable::Idle); _wbuf = 0; _wbuflen = 0; _wavail = 0; return n; } size_t IODevice::write(const char* buffer, size_t n) { if( async() ) { if( _wbuf ) { throw IOPending("write operation pending"); } try { this->beginWrite(buffer, n); size_t c = endWrite(); _wbuf = 0; _wbuflen = 0; _wavail = 0; return c; } catch(...) { _wbuf = 0; _wbuflen = 0; _wavail = 0; throw; } } return this->onWrite(buffer, n); } void IODevice::cancel() { onCancel(); setState(Selectable::Idle); _rbuf = 0; _rbuflen = 0; _ravail = 0; _wbuf = 0; _wbuflen = 0; _wavail = 0; } bool IODevice::seekable() const { return onSeekable(); } IODevice::pos_type IODevice::seek(off_type offset, std::ios::seekdir sd) { off_type ret = this->onSeek(offset, sd); if( ret != off_type(-1) ) setEof(false); return ret; } size_t IODevice::peek(char* buffer, size_t n) { return this->onPeek(buffer, n); } void IODevice::sync() { return this->onSync(); } IODevice::pos_type IODevice::position() { return this->seek(0, std::ios::cur); } bool IODevice::eof() const { return _eof; } bool IODevice::async() const { return _async; } void IODevice::setEof(bool eof) { _eof = eof; } void IODevice::setAsync(bool async) { _async = async; } } ���������������������������������������������cxxtools-2.2.1/src/applicationimpl.h����������������������������������������������������������������0000664�0001750�0001750�00000003330�12256773774�014472� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_APPLICATION_IMPL_H #define CXXTOOLS_APPLICATION_IMPL_H #include <cxxtools/api.h> namespace cxxtools { class SelectorBase; class ApplicationImpl { public: ApplicationImpl(); virtual ~ApplicationImpl(); void init(SelectorBase& s); bool catchSystemSignal(int sig); bool raiseSystemSignal(int sig); //int signalFd() const; }; } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.avr32.cpp����������������������������������������������������������0000664�0001750�0001750�00000011126�12256773774�015333� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.avr32.h> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile("sync 0" : : : "memory") } atomic_t atomicIncrement(volatile atomic_t& val) { volatile uint8_t tmp; asm volatile( "in %0, __SREG__" "\n\t" "cli" "\n\t" "ld __tmp_reg__, %a1" "\n\t" "inc __tmp_reg__" "\n\t" "st %a1, __tmp_reg__" "\n\t" "out __SREG__, %0" "\n\t" : "=&r" (tmp) : "e" (&val) : "memory" ); return tmp-1; } atomic_t atomicDecrement(volatile atomic_t& val) { volatile uint8_t tmp; asm volatile( "in %0, __SREG__" "\n\t" "cli" "\n\t" "ld __tmp_reg__, %a1" "\n\t" "dec __tmp_reg__" "\n\t" "st %a1, __tmp_reg__" "\n\t" "out __SREG__, %0" "\n\t" : "=&r" (tmp) : "e" (&val) : "memory" ); return tmp+1; } atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add) { atomic_t result; asm volatile("1: ssrf 5\n" " ld.w %0, %1\n" " add %0, %3\n" " stcond %2, %0\n" " brne 1b" : "=&r"(result), "=o"(val) : "m"(val), "r"(add) : "cc", "memory"); return result; } atomic_t atomicExchange(volatile atomic_t& val, atomic_t new_val) { atomic_t ret; asm volatile("xchg %[ret], %[val], %[new_val]" : [ret] "=&r"(ret), "=m"(val) : "m"(val), [val] "r"(&val), [new_val] "r"(new_val) : "memory"); return ret; } void* atomicExchange(void* volatile& val, void* new_val) { atomic_t ret; asm volatile("xchg %[ret], %[val], %[new_val]" : [ret] "=&r"(ret), "=m"(val) : "m"(val), [val] "r"(&val), [new_val] "r"(new_val) : "memory"); return ret; } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { volatile atomic_t ret; asm volatile( "1: ssrf 5\n" " ld.w %[ret], %[dest]\n" " cp.w %[ret], %[comp]\n" " brne 2f\n" " stcond %[dest], %[exch]\n" " brne 1b\n" "2:\n" : [ret] "=&r"(ret), [dest] "=m"(dest) : "m"(&dest), [comp] "ir"(comp), [exch] "r"(exch) : "memory", "cc"); return ret; } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { volatile atomic_t ret; asm volatile( "1: ssrf 5\n" " ld.w %[ret], %[dest]\n" " cp.w %[ret], %[comp]\n" " brne 2f\n" " stcond %[dest], %[exch]\n" " brne 1b\n" "2:\n" : [ret] "=&r"(ret), [dest] "=m"(dest) : "m"(&dest), [comp] "ir"(comp), [exch] "r"(exch) : "memory", "cc"); return ret; } } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmltag.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000004444�12256773774�013143� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmltag.h" #include <iostream> namespace cxxtools { std::ostream* Xmltag::default_out = &std::cout; Xmltag::Xmltag(const std::string& tag_, std::ostream& out_) : tag(tag_), out(out_) { if (!tag.empty()) { if (tag.at(0) == '<' && tag.at(tag.size() - 1) == '>') tag = tag.substr(1, tag.size() - 2); out << '<' << tag << '>'; } } Xmltag::Xmltag(const std::string& tag_, const std::string& parameter, std::ostream& out_) : tag(tag_), out(out_) { if (!tag.empty()) { if (tag.at(0) == '<' && tag.at(tag.size() - 1) == '>') tag = tag.substr(1, tag.size() - 2); out << '<' << tag; if (!parameter.empty()) out << ' ' << parameter; out << '>'; } } void Xmltag::close() { if (!tag.empty()) { out << "</"; std::string::size_type p = tag.find(' '); if (p != std::string::npos) out.write(tag.data(), p); else out << tag; out << '>'; tag.clear(); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/md5stream.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000007546�12256773774�013556� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/md5stream.h" #include "cxxtools/log.h" #include "md5.h" #include <cstring> log_define("cxxtools.md5stream") namespace cxxtools { //////////////////////////////////////////////////////////////////////// // Md5streambuf // Md5streambuf::Md5streambuf() : context(new cxxtools_MD5_CTX()) { log_debug("initialize MD5"); cxxtools_MD5Init(context); } Md5streambuf::~Md5streambuf() { delete context; } std::streambuf::int_type Md5streambuf::overflow( std::streambuf::int_type ch) { if (pptr() == 0) { // Ausgabepuffer ist leer - initialisieren log_debug("initialize MD5"); cxxtools_MD5Init(context); } else { // konsumiere Zeichen aus dem Puffer log_debug("process " << (pptr() - pbase()) << " bytes of data"); cxxtools_MD5Update(context, (const unsigned char*)pbase(), pptr() - pbase()); } // setze Ausgabepuffer setp(buffer, buffer + bufsize); if (ch != traits_type::eof()) { // das Zeichen, welches den overflow ausgelöst hat, stecken // wir in den Puffer. *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type Md5streambuf::underflow() { // nur Ausgabestrom return traits_type::eof(); } int Md5streambuf::sync() { if (pptr() != pbase()) { // konsumiere Zeichen aus dem Puffer log_debug("process " << (pptr() - pbase()) << " bytes of data"); cxxtools_MD5Update(context, (const unsigned char*)pbase(), pptr() - pbase()); // leere Ausgabepuffer setp(buffer, buffer + bufsize); } return 0; } void Md5streambuf::getDigest(unsigned char digest_[16]) { if (pptr()) { if (pptr() != pbase()) { // konsumiere Zeichen aus dem Puffer log_debug("process " << (pptr() - pbase()) << " bytes of data"); cxxtools_MD5Update(context, (const unsigned char*)pbase(), pptr() - pbase()); } // deinitialisiere Ausgabepuffer setp(0, 0); } else { log_debug("initialize MD5"); cxxtools_MD5Init(context); } log_debug("finalize MD5"); cxxtools_MD5Final(digest, context); std::memcpy(digest_, digest, 16); } //////////////////////////////////////////////////////////////////////// // Md5stream // const char* Md5stream::getHexDigest() { static const char hexDigits[] = "0123456789abcdef"; unsigned char md5[16]; getDigest(md5); int i; char* p = hexdigest; for (i = 0; i < 16; ++i) { *p++ = hexDigits[md5[i] >> 4]; *p++ = hexDigits[md5[i] & 0xf]; } *p = '\0'; log_debug("md5: " << hexdigest); return hexdigest; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/application.cpp������������������������������������������������������������������0000664�0001750�0001750�00000005725�12256773774�014155� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "applicationimpl.h" #include "cxxtools/application.h" #include "cxxtools/event.h" #include <string> #include <iostream> #include <stdexcept> namespace { cxxtools::Application*& getSystemAppPtr() { static cxxtools::Application* _app = 0; return _app; } } namespace cxxtools { void Application::construct() { if( getSystemAppPtr() ) throw std::logic_error("application already initialized"); // base class already throws if constructed twice ::getSystemAppPtr() = this; _impl = new ApplicationImpl; _owner = new EventLoop(); init(*_owner); } Application::Application() : _argc(0) , _argv(0) , _loop(0) , _owner(0) { construct(); } Application::Application(int argc, char** argv) : _argc(argc) , _argv(argv) , _loop(0) , _owner(0) { construct(); } Application::Application(EventLoopBase* loop) : _argc(0) , _argv(0) , _loop(loop) , _owner(0) { construct(); } Application::Application(EventLoopBase* loop, int argc, char** argv) : _argc(argc) , _argv(argv) , _loop(loop) , _owner(0) { construct(); } Application::~Application() { delete _owner; ::getSystemAppPtr() = 0; delete _impl; } Application& Application::instance() { Application* app = ::getSystemAppPtr(); if( ! app ) throw std::logic_error("application not initialized"); return *app; } bool Application::catchSystemSignal(int sig) { return _impl->catchSystemSignal(sig); } bool Application::raiseSystemSignal(int sig) { return _impl->raiseSystemSignal(sig); } void Application::init(EventLoopBase& loop) { _loop = &loop; _impl->init(*_loop); } } // namespace cxxtools �������������������������������������������cxxtools-2.2.1/src/tcpsocketimpl.h������������������������������������������������������������������0000664�0001750�0001750�00000006252�12266277345�014166� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TcpSocketImpl_H #define CXXTOOLS_NET_TcpSocketImpl_H #include "cxxtools/signal.h" #include "iodeviceimpl.h" #include "cxxtools/net/addrinfo.h" #include "addrinfoimpl.h" #include <string> #include <sys/types.h> #include <sys/socket.h> #include <sys/poll.h> #include <sys/time.h> #include <netinet/in.h> #include <unistd.h> namespace cxxtools { class SelectorBase; namespace net { class TcpServer; class TcpSocket; void formatIp(const sockaddr_in& addr, std::string& str); inline std::string formatIp(const sockaddr_in& addr) { std::string ret; formatIp(addr, ret); return ret; } std::string getSockAddr(int fd); class TcpSocketImpl : public IODeviceImpl { private: TcpSocket& _socket; bool _isConnected; struct sockaddr_storage _peeraddr; AddrInfo _addrInfo; AddrInfoImpl::const_iterator _addrInfoPtr; int checkConnect(); void checkPendingError(); std::string tryConnect(); std::string _connectResult; public: explicit TcpSocketImpl(TcpSocket& socket); ~TcpSocketImpl(); void close(); std::string getSockAddr() const; std::string getPeerAddr() const; bool isConnected() const { return _isConnected; } void connect(const AddrInfo& addrinfo); bool beginConnect(const AddrInfo& addrinfo); void endConnect(); void accept(const TcpServer& server, unsigned flags); void terminateAccept(); // implementation using poll void initWait(pollfd& pfd); // implementation using poll bool checkPollEvent(pollfd& pfd); // overrid beginWrite to use send(2) instead of write(2) virtual size_t beginWrite(const char* buffer, size_t n); }; } // namespace net } // namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/eventsink.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000004713�12256773774�013654� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Marc Boris Duerner * Copyright (C) 2007 Laurentiu-Gheorghe Crisan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/eventsink.h" #include "cxxtools/eventsource.h" namespace cxxtools { EventSink::EventSink() { } EventSink::~EventSink() { while( true ) { RecursiveLock lock( _mutex ); if( _sources.empty() ) return; EventSource* source = _sources.front(); if( ! source->tryDisconnect(*this) ) { lock.unlock(); Thread::yield(); } } } void EventSink::commitEvent(const Event& event) { this->onCommitEvent(event); } void EventSink::onConnect(EventSource& source) { RecursiveLock lock1( _mutex ); _sources.push_back(&source); } void EventSink::onDisconnect(EventSource& source) { RecursiveLock lock1( _mutex ); _sources.remove(&source); } void EventSink::onUnsubscribe(EventSource& source) { RecursiveLock lock1( _mutex ); std::list<EventSource*>::iterator it; for(it = _sources.begin(); it != _sources.end(); ++it) { if(&source == *it) { _sources.erase(it); return; } } } } // namespace cxxtools �����������������������������������������������������cxxtools-2.2.1/src/fileimpl.h�����������������������������������������������������������������������0000664�0001750�0001750�00000003671�12266277345�013110� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <string> namespace cxxtools { class FileImpl { public: FileImpl(); ~FileImpl(); static std::size_t size(const std::string& path); static void resize(const std::string& path, std::size_t n); static void remove(const std::string& path); static void move(const std::string& path, const std::string& to); static void link(const std::string& path, const std::string& to); static void symlink(const std::string& path, const std::string& to); static void create(const std::string& path); }; } // namespace cxxtools �����������������������������������������������������������������������cxxtools-2.2.1/src/string.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000043133�12256773774�013153� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 Marc Boris Duerner * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/string.h> #include <cxxtools/utf8codec.h> #include <iostream> #include <algorithm> namespace std { void basic_string<cxxtools::Char>::resize(size_t n, cxxtools::Char ch) { size_type size = this->size(); if(size < n) { this->append(n - size, ch); } else if(n < size) { this->erase(n); } } void basic_string<cxxtools::Char>::reserve(size_t n) { if (capacity() < n) { // since capacity is always at least shortStringCapacity, we need to use long string // to ensure the requested capacity if the current is not enough cxxtools::Char* p = _data.allocate(n + 1); size_type l = length(); const cxxtools::Char* oldData = privdata_ro(); traits_type::copy(p, oldData, l); if (isShortString()) markLongString(); else _data.deallocate(longStringData(), longStringCapacity() + 1); _data.u.ptr._begin = p; _data.u.ptr._end = p + l; _data.u.ptr._capacity = p + n; *_data.u.ptr._end = cxxtools::Char::null(); } } void basic_string<cxxtools::Char>::privreserve(size_t n) { if (capacity() < n) { size_type nn = 16; while (nn < n) nn += (nn >> 1); reserve(nn); } } void basic_string<cxxtools::Char>::swap(basic_string& str) { if (isShortString()) { if (str.isShortString()) { for (unsigned nn = 0; nn < _shortStringSize; ++nn) std::swap(shortStringData()[nn], str.shortStringData()[nn]); } else { Ptr p = str._data.u.ptr; for (unsigned nn = 0; nn < _shortStringSize; ++nn) str.shortStringData()[nn] = shortStringData()[nn]; markLongString(); _data.u.ptr = p; } } else { if (str.isShortString()) { Ptr p = _data.u.ptr; for (unsigned nn = 0; nn < _shortStringSize; ++nn) shortStringData()[nn] = str.shortStringData()[nn]; str.markLongString(); str._data.u.ptr = p; } else { std::swap(_data.u.ptr, str._data.u.ptr); } } } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::copy(cxxtools::Char* a, size_type n, size_type pos) const { if( pos > this->size() ) { throw out_of_range("basic_string::copy"); } if(n > this->size() - pos) { n = this->size() - pos; } traits_type::copy(a, privdata_ro() + pos, n); return n; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const basic_string<cxxtools::Char>& str) { // self-assignment check if (this == &str) { return *this; } privreserve(str.size()); cxxtools::Char* p = privdata_rw(); size_type l = str.length(); traits_type::copy(p, str.data(), l); setLength(l); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const std::string& str) { size_type len = str.length(); privreserve(len); cxxtools::Char* p = privdata_rw(); for (size_type n = 0; n < len; ++n) p[n] = cxxtools::Char( str[n] ); setLength(len); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const std::string& str, size_type pos, size_type len) { privreserve(len); cxxtools::Char* p = privdata_rw(); for (size_type n = 0; n < len; ++n) p[n] = cxxtools::Char( str[pos + n] ); setLength(len); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const wchar_t* str) { size_type length = 0; while (str[length]) ++length; assign(str, length); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const wchar_t* str, size_type length) { privreserve(length); cxxtools::Char* d = privdata_rw(); for (unsigned n = 0; n < length; ++n) { d[n] = str[n]; } setLength(length); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const char* str) { size_type length = 0; while (str[length]) ++length; assign(str, length); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const char* str, size_type length) { privreserve(length); cxxtools::Char* d = privdata_rw(); for (unsigned n = 0; n < length; ++n) { d[n] = cxxtools::Char(str[n]); } setLength(length); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(const cxxtools::Char* str, size_type length) { // self-assignment check if (str != privdata_ro()) { privreserve(length); traits_type::copy(privdata_rw(), str, length); } setLength(length); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::assign(size_type n, cxxtools::Char ch) { privreserve(n); cxxtools::Char* p = privdata_rw(); for (size_type nn = 0; nn < n; ++nn) p[nn] = ch; setLength(n); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::append(const cxxtools::Char* str, size_type n) { size_type l = length(); privreserve(l + n); traits_type::copy(privdata_rw() + l, str, n); setLength(l + n); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::append(size_type n, cxxtools::Char ch) { size_type l = length(); privreserve(l + n); cxxtools::Char* p = privdata_rw(); for (size_type nn = 0; nn < n; ++nn) p[l + nn] = ch; setLength(l + n); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::insert(size_type pos, const cxxtools::Char* str, size_type n) { size_type l = length(); privreserve(l + n); cxxtools::Char* p = privdata_rw(); traits_type::move(p + pos + n, p + pos, l - pos); traits_type::copy(p + pos, str, n); setLength(l + n); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::insert(size_type pos, size_type n, cxxtools::Char ch) { size_type l = length(); privreserve(l + n); cxxtools::Char* p = privdata_rw(); traits_type::move(p + pos + n, p + pos, l - pos); for (size_type nn = 0; nn < n; ++nn) p[pos + nn] = ch; setLength(l + n); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::erase(size_type pos, size_type n) { cxxtools::Char* p = privdata_rw(); size_type l = length(); if (n == npos || pos + n > l) n = l - pos; traits_type::move(p + pos, p + pos + n, l - pos - n); setLength(l - n); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::replace(size_type pos, size_type n, const cxxtools::Char* str, size_type n2) { cxxtools::Char* p; if (n != n2) { size_type l = length(); privreserve(l - n + n2); p = privdata_rw(); traits_type::move(p + pos + n2, p + pos + n, l - pos - n); setLength(l - n + n2); } else { p = privdata_rw(); } traits_type::copy(p + pos, str, n2); return *this; } basic_string<cxxtools::Char>& basic_string<cxxtools::Char>::replace(size_type pos, size_type n, size_type n2, cxxtools::Char ch) { cxxtools::Char* p; if (n != n2) { size_type l = length(); privreserve(l - n + n2); p = privdata_rw(); traits_type::move(p + pos + n2, p + pos + n, l - pos - n); setLength(l - n + n2); } else { p = privdata_rw(); } for (size_type nn = 0; nn < n2; ++nn) p[pos + nn] = ch; return *this; } int basic_string<cxxtools::Char>::compare(const basic_string& str) const { const size_type size = this->size(); const size_type osize = str.size(); size_type n = min(size , osize); const int result = traits_type::compare(privdata_ro(), str.privdata_ro(), n); // unlike real life, size only matters when the quality is equal if (result == 0) { return static_cast<int>(size - osize); } return result; } int basic_string<cxxtools::Char>::compare(const char* str) const { size_type size = length(); size_type n; const cxxtools::Char* p = privdata_ro(); for (n = 0; n < size && str[n]; ++n) { cxxtools::Char ch(str[n]); if (p[n] != ch) return p[n] > ch ? 1 : -1; } return n < size ? 1 : str[n] ? -1 : 0; } int basic_string<cxxtools::Char>::compare(const char* str, size_type len) const { size_type size = length(); size_type n; const cxxtools::Char* p = privdata_ro(); for (n = 0; n < size && n < len; ++n) { cxxtools::Char ch(str[n]); if (p[n] != ch) return p[n] > ch ? 1 : -1; } return n < size ? 1 : n < len ? -1 : 0; } int basic_string<cxxtools::Char>::compare(const cxxtools::Char* str, size_type osize) const { const size_type size = this->size(); size_type n = min(size , osize); const int result = traits_type::compare(privdata_ro(), str, n); // unlike real life, size only matters when the quality is equal if (result == 0) { return static_cast<int>(size - osize); } return result; } int basic_string<cxxtools::Char>::compare(const wchar_t* str) const { const cxxtools::Char* self = privdata_ro(); while(self->toWchar() != L'\0' && *str != L'\0') { if( *self != *str ) return *self < cxxtools::Char(*str) ? -1 : +1; ++self; ++str; } return static_cast<int>(self->value()) - static_cast<int>(*str); } int basic_string<cxxtools::Char>::compare(const wchar_t* str, size_type n) const { const cxxtools::Char* self = privdata_ro(); size_type nn; for (nn = 0; nn < n; ++nn) { if(*self != str[nn]) return *self < cxxtools::Char(str[nn]) ? -1 : +1; ++self; } return self->value() != 0 ? 1 : nn < n ? -1 : 0; } int basic_string<cxxtools::Char>::compare(size_type pos, size_type n, const cxxtools::Char* str, size_type n2) const { const size_type size = n; const size_type osize = n2; size_type len = min(size , osize); const int result = traits_type::compare(privdata_ro() + pos, str, len); // unlike real life, size only matters when the quality is equal if (result == 0) { return static_cast<int>(size - osize); } return result; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find(const cxxtools::Char* token, size_type pos, size_type n) const { const size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); for( ; pos + n <= size; ++pos) { if( 0 == traits_type::compare( str + pos, token, n ) ) { return pos; } } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find(cxxtools::Char ch, size_type pos) const { const size_type size = this->size(); if(pos > size) { return npos; } const cxxtools::Char* str = privdata_ro(); const size_type n = size - pos; const cxxtools::Char* found = traits_type::find(str + pos, n, ch); if(found) { return found - str; } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::rfind(const cxxtools::Char* token, size_type pos, size_type n) const { // FIXME: check length const size_type size = this->size(); if (n > size) { return npos; } pos = min(size_type(size - n), pos); const cxxtools::Char* str = privdata_ro(); do { if (traits_type::compare(str + pos, token, n) == 0) return pos; } while (pos-- > 0); return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::rfind(cxxtools::Char ch, size_type pos) const { const cxxtools::Char* str = privdata_ro(); size_type size = this->size(); if(size == 0) return npos; if(--size > pos) size = pos; for(++size; size-- > 0; ) { if( traits_type::eq(str[size], ch) ) return size; } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find_first_of(const cxxtools::Char* s, size_type pos, size_type n) const { // check length os s against n const cxxtools::Char* str = privdata_ro(); const size_type size = this->size(); for (; n && pos < size; ++pos) { if( traits_type::find(s, n, str[pos]) ) return pos; } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find_last_of(const cxxtools::Char* s, size_type pos, size_type n) const { // check length os s against n size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); if (size == 0 || n == 0) { return npos; } if (--size > pos) { size = pos; } do { if( traits_type::find(s, n, str[size]) ) return size; } while (size-- != 0); return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find_first_not_of(const cxxtools::Char* tok, size_type pos, size_type n) const { const cxxtools::Char* str = privdata_ro(); for (; pos < this->size(); ++pos) { if ( !traits_type::find(tok, n, str[pos]) ) return pos; } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find_first_not_of(const cxxtools::Char ch, size_type pos) const { const cxxtools::Char* str = privdata_ro(); for (; pos < this->size(); ++pos) { if ( !traits_type::eq(str[pos], ch) ) { return pos; } } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find_last_not_of(const cxxtools::Char* tok, size_type pos, size_type n) const { size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); if(size) { if (--size > pos) size = pos; do { if ( !traits_type::find(tok, n, str[size]) ) { return size; } } while(size--); } return npos; } basic_string<cxxtools::Char>::size_type basic_string<cxxtools::Char>::find_last_not_of(cxxtools::Char ch, size_type pos) const { size_type size = this->size(); const cxxtools::Char* str = privdata_ro(); if (size) { if (--size > pos) size = pos; do { if( !traits_type::eq(str[size], ch) ) { return size; } } while (size--); } return npos; } std::string basic_string<cxxtools::Char>::narrow(char dfault) const { std::string ret; size_type len = this->length(); const cxxtools::Char* s = privdata_ro(); ret.reserve(len); for (size_type n = 0; n < len; ++n) ret.append( 1, s[n].narrow(dfault) ); return ret; } basic_string<cxxtools::Char> basic_string<cxxtools::Char>::widen(const char* str) { std::basic_string<cxxtools::Char> ret; size_type len = std::char_traits<char>::length(str); ret.privreserve(len); for (size_type n = 0; n < len; ++n) ret += cxxtools::Char( str[n] ); return ret; } basic_string<cxxtools::Char> basic_string<cxxtools::Char>::widen(const std::string& str) { std::basic_string<cxxtools::Char> ret; size_type len = str.length(); ret.privreserve(len); for (size_type n = 0; n < len; ++n) ret += cxxtools::Char( str[n] ); return ret; } ostream& operator<< (ostream& out, const basic_string<cxxtools::Char>& str) { cxxtools::Utf8Codec codec; char to[64]; cxxtools::MBState state; cxxtools::Utf8Codec::result r; const cxxtools::Char* from = str.data(); cxxtools::String::size_type size = str.size(); do{ const cxxtools::Char* from_next; char* to_next = to; r = codec.out(state, from, from + size, from_next, to, to + sizeof(to), to_next); if (r == cxxtools::Utf8Codec::error) { out.setstate(std::ios::failbit); break; } out.write(to, to_next - to); size -= (from_next - from); from = from_next; } while (out.good() && r == cxxtools::Utf8Codec::partial); return out; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.sun.cpp����������������������������������������������������������������0000664�0001750�0001750�00000006273�12256773774�014457� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by PTV AG * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.sun.h> #include <sys/types.h> #include <sys/atomic.h> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { membar_consumer(); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; membar_producer(); } atomic_t atomicIncrement(volatile atomic_t& value) { volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&value); return atomic_inc_ulong_nv( uvalue ); } atomic_t atomicDecrement(volatile atomic_t& value) { volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&value); return atomic_dec_ulong_nv( uvalue); } atomic_t atomicExchangeAdd(volatile atomic_t& value, atomic_t n) { volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&value); volatile ulong_t& un = reinterpret_cast<volatile ulong_t&>(n); volatile atomic_t result = atomic_add_long_nv(uvalue, un); return result - n; } atomic_t atomicExchange(volatile atomic_t& value, atomic_t newval) { volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&value); volatile ulong_t& unewval = reinterpret_cast<volatile ulong_t&>(newval); return atomic_swap_ulong(uvalue, unewval); } void* atomicExchange(void* volatile& ptr, void* new_val) { return atomic_swap_ptr(&ptr, new_val); } atomic_t atomicCompareExchange(volatile atomic_t& value, atomic_t ex, atomic_t cmp) { volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&value); volatile ulong_t& uex = reinterpret_cast<volatile ulong_t&>(ex); volatile ulong_t& ucmp = reinterpret_cast<volatile ulong_t&>(cmp); return atomic_cas_ulong(uvalue, ucmp, uex); } void* atomicCompareExchange(void* volatile& ptr, void* ex, void* cmp) { return atomic_cas_ptr(&ptr, cmp, ex); } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.x86.cpp������������������������������������������������������������0000664�0001750�0001750�00000007236�12256773774�015032� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.x86.h> #include <csignal> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("lock; addl $0,0(%%esp)" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile ("lock; addl $0,0(%%esp)" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& val) { atomic_t tmp; asm volatile ("lock; xaddl %0, %1" : "=r" (tmp), "=m" (val) : "0" (1), "m" (val)); return tmp+1; } atomic_t atomicDecrement(volatile atomic_t& val) { volatile register atomic_t tmp; asm volatile ("lock; xaddl %0, %1" : "=r" (tmp), "=m" (val) : "0" (-1), "m" (val)); return tmp-1; } atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add) { volatile register atomic_t ret; asm volatile ("lock; xaddl %0, %1" : "=r" (ret), "=m" (val) : "0" (add), "m" (val)); return ret; } atomic_t atomicExchange(volatile atomic_t& val, atomic_t new_val) { volatile register atomic_t ret; // using cmpxchg and a loop here on purpose asm volatile ("1:; lock; cmpxchgl %2, %0; jne 1b" : "=m" (val), "=a" (ret) : "r" (new_val), "m" (val), "a" (val)); return ret; } void* atomicExchange(void* volatile& val, void* new_val) { void* ret; asm volatile ("1:; lock; cmpxchgl %2, %0; jne 1b" : "=m" (val), "=a" (ret) : "r" (new_val), "m" (val), "a" (val)); return ret; } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { volatile register atomic_t old; asm volatile ("lock; cmpxchgl %2, %0" : "=m" (dest), "=a" (old) : "r" (exch), "m" (dest), "a" (comp)); return old; } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { void* old; asm volatile ("lock; cmpxchgl %2, %0" : "=m" (dest), "=a" (old) : "r" (exch), "m" (dest), "a" (comp)); return old; } } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/convert.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000032504�12256773774�013325� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/convert.h> #include <iomanip> #include <limits> #include <cctype> namespace cxxtools { template <typename IterT> void _skipws(IterT& it, IterT end) { while (it != end && isspace(*it)) ++it; } template<typename T> class nullterm_array_iterator : public std::iterator<std::input_iterator_tag, T> { public: nullterm_array_iterator() : _ptr(0) { } explicit nullterm_array_iterator(const T* ptr) : _ptr(ptr) { if(*_ptr == '\0') _ptr = 0; } nullterm_array_iterator<T>& operator=(const nullterm_array_iterator<T>& it) { _ptr = it._ptr; return *this; } bool operator==(const nullterm_array_iterator<T>& it) const { return _ptr == it._ptr; } bool operator!=(const nullterm_array_iterator<T>& it) const { return _ptr != it._ptr; } const T& operator*() const { return *_ptr; } nullterm_array_iterator<T>& operator++() { if(*++_ptr == '\0') _ptr = 0; return *this; } nullterm_array_iterator<T> operator++(int) { if(*++_ptr == '\0') _ptr = 0; return *this; } private: const T* _ptr; }; template <typename T> void convertInt(T& n, const String& str, const char* typeto) { bool ok = false; String::const_iterator r = getInt( str.begin(), str.end(), ok, n, DecimalFormat<Char>() ); if (ok) _skipws(r, str.end()); if( r != str.end() || ! ok ) ConversionError::doThrow(typeto, "String", str.narrow().c_str()); } template <typename T> void convertInt(T& n, const std::string& str, const char* typeto) { bool ok = false; std::string::const_iterator r = getInt( str.begin(), str.end(), ok, n ); if (ok) _skipws(r, str.end()); if( r != str.end() || ! ok ) ConversionError::doThrow(typeto, "string", str.c_str()); } template <typename T> void convertInt(T& n, const char* str, const char* typeto) { bool ok = false; nullterm_array_iterator<char> it(str); nullterm_array_iterator<char> end; it = getInt( it, end, ok, n ); if (ok) _skipws(it, end); if( it != end || ! ok ) ConversionError::doThrow(typeto, "char*"); } template <typename T> void convertFloat(T& n, const String& str, const char* typeto) { bool ok = false; String::const_iterator r = getFloat(str.begin(), str.end(), ok, n, FloatFormat<Char>() ); if (ok) _skipws(r, str.end()); if(r != str.end() || ! ok) ConversionError::doThrow(typeto, "String", str.narrow().c_str()); } template <typename T> void convertFloat(T& n, const std::string& str, const char* typeto) { bool ok = false; std::string::const_iterator r = getFloat(str.begin(), str.end(), ok, n); if (ok) _skipws(r, str.end()); if(r != str.end() || ! ok) ConversionError::doThrow(typeto, "string", str.c_str()); } template <typename T> void convertFloat(T& n, const char* str, const char* typeto) { bool ok = false; nullterm_array_iterator<char> it(str); nullterm_array_iterator<char> end; it = getFloat( it, end, ok, n ); if (ok) _skipws(it, end); if( it != end || ! ok ) ConversionError::doThrow(typeto, "char*", str); } // // Conversions to cxxtools::String // void convert(String& s, const std::string& value) { s = String::widen(value); } void convert(String& str, bool value) { static const wchar_t* trueValue = L"true"; static const wchar_t* falseValue = L"false"; str = value ? trueValue : falseValue; } void convert(String& str, char value) { str = String(1, Char(value)); } void convert(String& str, wchar_t value) { str = String(1, Char(value)); } void convert(String& str, Char value) { str = String(1, value); } void convert(String& str, unsigned char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, signed char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, unsigned short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, unsigned int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, long value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, unsigned long value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(String& str, float value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(String& str, double value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(String& str, long double value) { str.clear(); putFloat(std::back_inserter(str), value); } // // Conversions from cxxtools::String // void convert(bool& n, const String& str) { if (str == L"true" || str == L"1") n = true; else if (str == L"false" || str == L"0") n = false; else ConversionError::doThrow("bool", "String", str.narrow().c_str()); } void convert(char& c, const String& str) { if ( str.empty() ) ConversionError::doThrow("char", "String"); c = str[0].narrow(); } void convert(wchar_t& c, const String& str) { if ( str.empty() ) ConversionError::doThrow("wchar_t", "String"); c = str[0].toWchar(); } void convert(Char& c, const String& str) { if ( str.empty() ) ConversionError::doThrow("char", "Char"); c = str[0]; } void convert(unsigned char& n, const String& str) { convertInt(n, str, "unsigned char"); } void convert(signed char& n, const String& str) { convertInt(n, str, "signed char"); } void convert(short& n, const String& str) { convertInt(n, str, "short"); } void convert(unsigned short& n, const String& str) { convertInt(n, str, "unsigned short"); } void convert(int& n, const String& str) { convertInt(n, str, "int"); } void convert(unsigned int& n, const String& str) { convertInt(n, str, "unsigned int"); } void convert(long& n, const String& str) { convertInt(n, str, "long"); } void convert(unsigned long& n, const String& str) { convertInt(n, str, "unsigned long"); } #ifdef HAVE_LONG_LONG void convert(long long& n, const String& str) { convertInt(n, str, "long long"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const String& str) { convertInt(n, str, "unsigned long long"); } #endif void convert(float& n, const String& str) { convertFloat(n, str, "float"); } void convert(double& n, const String& str) { convertFloat(n, str, "double"); } void convert(long double& n, const String& str) { convertFloat(n, str, "long double"); } // // Conversions to std::string // void convert(std::string& s, const String& str) { s = str.narrow(); } void convert(std::string& str, bool value) { static const char* trueValue = "true"; static const char* falseValue = "false"; str = value ? trueValue : falseValue; } void convert(std::string& str, char value) { str.clear(); str += value; } void convert(std::string& str, signed char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned char value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned short value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned int value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, long value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, unsigned long value) { str.clear(); putInt(std::back_inserter(str), value); } void convert(std::string& str, float value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(std::string& str, double value) { str.clear(); putFloat(std::back_inserter(str), value); } void convert(std::string& str, long double value) { str.clear(); putFloat(std::back_inserter(str), value); } // // Conversions from std::string // void convert(bool& n, const std::string& str) { if (str == "true" || str == "1") n = true; else if (str == "false" || str == "0") n = false; else ConversionError::doThrow("bool", "string", str.c_str()); } void convert(char& c, const std::string& str) { if ( str.empty() ) ConversionError::doThrow("char", "string"); int n = str[0]; c = n; } void convert(signed char& n, const std::string& str) { convertInt(n, str, "signed char"); } void convert(unsigned char& n, const std::string& str) { convertInt(n, str, "unsigned char"); } void convert(short& n, const std::string& str) { convertInt(n, str, "short"); } void convert(unsigned short& n, const std::string& str) { convertInt(n, str, "unsigned short"); } void convert(int& n, const std::string& str) { convertInt(n, str, "int"); } void convert(unsigned int& n, const std::string& str) { convertInt(n, str, "unsigned int"); } void convert(long& n, const std::string& str) { convertInt(n, str, "long"); } void convert(unsigned long& n, const std::string& str) { convertInt(n, str, "unsigned long"); } #ifdef HAVE_LONG_LONG void convert(long long& n, const std::string& str) { convertInt(n, str, "long long"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const std::string& str) { convertInt(n, str, "unsigned long long"); } #endif void convert(float& n, const std::string& str) { convertFloat(n, str, "float"); } void convert(double& n, const std::string& str) { convertFloat(n, str, "double"); } void convert(long double& n, const std::string& str) { convertFloat(n, str, "long double"); } // // Conversions from const char* // void convert(bool& n, const char* str) { if (std::strcmp(str, "true") == 0 || std::strcmp(str, "1") == 0) n = true; else if (std::strcmp(str, "false") || std::strcmp(str, "0")) n = false; else ConversionError::doThrow("bool", "char*", str); } void convert(char& c, const char* str) { if ( *str == '\0' ) ConversionError::doThrow("char", "char*"); c = str[0]; } void convert(signed char& n, const char* str) { convertInt(n, str, "signed char"); } void convert(unsigned char& n, const char* str) { convertInt(n, str, "unsigned char"); } void convert(short& n, const char* str) { convertInt(n, str, "short"); } void convert(unsigned short& n, const char* str) { convertInt(n, str, "unsigned short"); } void convert(int& n, const char* str) { convertInt(n, str, "int"); } void convert(unsigned int& n, const char* str) { convertInt(n, str, "unsigned int"); } void convert(long& n, const char* str) { convertInt(n, str, "long"); } void convert(unsigned long& n, const char* str) { convertInt(n, str, "unsigned long"); } #ifdef HAVE_LONG_LONG void convert(long long& n, const char* str) { convertInt(n, str, "long long"); } #endif #ifdef HAVE_UNSIGNED_LONG_LONG void convert(unsigned long long& n, const char* str) { convertInt(n, str, "unsigned long long"); } #endif void convert(float& n, const char* str) { convertFloat(n, str, "float"); } void convert(double& n, const char* str) { convertFloat(n, str, "double"); } void convert(long double& n, const char* str) { convertFloat(n, str, "long double"); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/remoteclient.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000002676�12256773774�014346� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/remoteclient.h> namespace cxxtools { const std::size_t RemoteClient::WaitInfinite; } ������������������������������������������������������������������cxxtools-2.2.1/src/Makefile.am����������������������������������������������������������������������0000664�0001750�0001750�00000007557�12266277345�013201� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools.la libcxxtools_la_SOURCES = \ addrinfo.cpp \ addrinfoimpl.cpp \ application.cpp \ applicationimpl.cpp \ base64codec.cpp \ csvdeserializer.cpp \ csvformatter.cpp \ csvparser.cpp \ char.cpp \ clock.cpp \ clockimpl.cpp \ condition.cpp \ conditionimpl.cpp \ connectable.cpp \ connection.cpp \ cgi.cpp \ conversionerror.cpp \ convert.cpp \ date.cpp \ datetime.cpp \ decomposer.cpp \ deserializer.cpp \ directory.cpp \ directoryimpl.cpp \ error.cpp \ eventloop.cpp \ eventsink.cpp \ eventsource.cpp \ fdstream.cpp \ file.cpp \ filedevice.cpp \ filedeviceimpl.cpp \ fileimpl.cpp \ fileinfo.cpp \ formatter.cpp \ hdstream.cpp \ inifile.cpp \ iniparser.cpp \ iodevice.cpp \ iodeviceimpl.cpp \ ioerror.cpp \ iostream.cpp \ jsondeserializer.cpp \ jsonformatter.cpp \ jsonparser.cpp \ jsonserializer.cpp \ library.cpp \ libraryimpl.cpp \ log.cpp \ md5.c \ md5stream.cpp \ mime.cpp \ multifstream.cpp \ mutex.cpp \ muteximpl.cpp \ pipe.cpp \ pipeimpl.cpp \ posix/commandinput.cpp \ posix/commandoutput.cpp \ posix/pipestream.cpp \ posix/posixpipe.cpp \ properties.cpp \ propertiesdeserializer.cpp \ query_params.cpp \ quotedprintablestream.cpp \ regex.cpp \ remoteclient.cpp \ selectable.cpp \ selector.cpp \ selectorimpl.cpp \ semaphore.cpp \ semaphoreimpl.cpp \ serviceregistry.cpp \ settings.cpp \ settingsreader.cpp \ settingswriter.cpp \ serializationerror.cpp \ serializationinfo.cpp \ signal.cpp \ streambuffer.cpp \ string.cpp \ stringstream.cpp \ systemerror.cpp \ tee.cpp \ textbuffer.cpp \ textcodec.cpp \ textstream.cpp \ thread.cpp \ threadimpl.cpp \ threadpool.cpp \ threadpoolimpl.cpp \ time.cpp \ timer.cpp \ timespan.cpp \ uri.cpp \ utf8codec.cpp \ uuencode.cpp \ xmltag.cpp \ net.cpp \ tcpserverimpl.cpp \ tcpserver.cpp \ tcpsocket.cpp \ tcpsocketimpl.cpp \ tcpstream.cpp \ udp.cpp \ udpstream.cpp \ xml/characters.cpp \ xml/endelement.cpp \ xml/entityresolver.cpp \ xml/namespacecontext.cpp \ xml/startelement.cpp \ xml/xmldeserializer.cpp \ xml/xmlerror.cpp \ xml/xmlformatter.cpp \ xml/xmlreader.cpp \ xml/xmlserializer.cpp \ xml/xmlwriter.cpp noinst_HEADERS = \ addrinfoimpl.h \ applicationimpl.h \ clockimpl.h \ conditionimpl.h \ directoryimpl.h \ error.h \ facets.cpp \ fileimpl.h \ filedeviceimpl.h \ fileinfoimpl.h \ iodeviceimpl.h \ libraryimpl.h \ md5.h \ muteximpl.h \ pipeimpl.h \ selectableimpl.h \ selectorimpl.h \ semaphoreimpl.h \ settingsreader.h \ settingswriter.h \ threadimpl.h \ threadpoolimpl.h \ unicode.h \ tcpserverimpl.h \ tcpsocketimpl.h if MAKE_ICONVSTREAM libcxxtools_la_SOURCES += \ iconvwrap.cpp \ iconvstream.cpp endif if MAKE_ATOMICITY_SUN libcxxtools_la_SOURCES += \ atomicity.sun.cpp endif if MAKE_ATOMICITY_WINDOWS libcxxtools_la_SOURCES += \ atomicity.windows.cpp endif if MAKE_ATOMICITY_GCC_ARM libcxxtools_la_SOURCES += \ atomicity.gcc.arm.cpp endif if MAKE_ATOMICITY_GCC_MIPS libcxxtools_la_SOURCES += \ atomicity.gcc.mips.cpp endif if MAKE_ATOMICITY_GCC_PPC libcxxtools_la_SOURCES += \ atomicity.gcc.ppc.cpp endif if MAKE_ATOMICITY_GCC_X86_64 libcxxtools_la_SOURCES += \ atomicity.gcc.x86_64.cpp endif if MAKE_ATOMICITY_GCC_X86 libcxxtools_la_SOURCES += \ atomicity.gcc.x86.cpp endif if MAKE_ATOMICITY_GCC_SPARC32 libcxxtools_la_SOURCES += \ atomicity.gcc.sparc32.cpp endif if MAKE_ATOMICITY_GCC_SPARC64 libcxxtools_la_SOURCES += \ atomicity.gcc.sparc64.cpp endif if MAKE_ATOMICITY_GCC_AVR32 libcxxtools_la_SOURCES += \ atomicity.gcc.avr32.cpp endif if MAKE_ATOMICITY_PTHREAD libcxxtools_la_SOURCES += \ atomicity.pthread.cpp endif if MAKE_ATOMICITY_GENERIC libcxxtools_la_SOURCES += \ atomicity.generic.cpp endif libcxxtools_la_LIBADD = $(LIBICONV) libcxxtools_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ �������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/libraryimpl.h��������������������������������������������������������������������0000664�0001750�0001750�00000004743�12256773774�013644� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_LIBRARYIMPL_H #define CXXTOOLS_LIBRARYIMPL_H #include "cxxtools/systemerror.h" #include <string> #include <dlfcn.h> namespace cxxtools { class LibraryImpl { public: LibraryImpl() : _refs(1) , _handle(0) { } LibraryImpl(const std::string& path) : _refs(1) , _handle(0) { this->open(path); } ~LibraryImpl() { if(_handle) ::dlclose(_handle); } unsigned refs() const { return _refs; } unsigned ref() { return ++_refs; } unsigned unref() { return --_refs; } void open(const std::string& path); void close(); void* resolve(const char* symbol) const; bool failed() { return _handle == 0; } static std::string suffix() { return ".so"; } static std::string prefix() { return "lib"; } private: unsigned _refs; void* _handle; }; } // namespace cxxtools #endif �����������������������������cxxtools-2.2.1/src/threadpoolimpl.h�����������������������������������������������������������������0000664�0001750�0001750�00000004564�12256773774�014342� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_THREADPOOLIMPL_H #define CXXTOOLS_THREADPOOLIMPL_H #include <cxxtools/queue.h> #include <cxxtools/thread.h> #include <vector> namespace cxxtools { class ThreadPoolImpl { public: explicit ThreadPoolImpl(unsigned size) : _state(Stopped), _size(size) { } ~ThreadPoolImpl(); void start(); void stop(bool cancel); void schedule(const Callable<void>& cb); bool running() const { return _state == Running; } bool stopped() const { return _state == Stopped; } private: void threadFunc(); enum { Stopped, Starting, Running, Stopping } _state; Queue<Callable<void>*> _queue; typedef std::vector<AttachedThread*> ThreadsType; ThreadsType _threads; unsigned _size; }; } #endif // CXXTOOLS_THREADPOOLIMPL_H ��������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/serviceregistry.cpp��������������������������������������������������������������0000664�0001750�0001750�00000005034�12256773774�015074� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/serviceregistry.h> namespace cxxtools { ServiceRegistry::~ServiceRegistry() { ProcedureMap::iterator it; for(it = _procedures.begin(); it != _procedures.end(); ++it) { delete it->second; } } ServiceProcedure* ServiceRegistry::getProcedure(const std::string& name) const { ProcedureMap::const_iterator it = _procedures.find( name ); if( it == _procedures.end() ) { return 0; } return it->second->clone(); } void ServiceRegistry::releaseProcedure(ServiceProcedure* proc) const { delete proc; } std::vector<std::string> ServiceRegistry::getProcedureNames() const { std::vector<std::string> procs; for (ProcedureMap::const_iterator it = _procedures.begin(); it != _procedures.end(); ++it) { procs.push_back(it->first); } return procs; } void ServiceRegistry::registerProcedure(const std::string& name, ServiceProcedure* proc) { ProcedureMap::iterator it = _procedures.find(name); if (it == _procedures.end()) { std::pair<const std::string, ServiceProcedure*> p( name, proc ); _procedures.insert( p ); } else { delete it->second; it->second = proc; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/connection.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000006016�12256773774�014003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/connectable.h" #include <memory> namespace cxxtools { Connection::Connection() { _data = new ConnectionData(); } Connection::Connection(Connectable& sender, Slot* slot) { std::auto_ptr<ConnectionData> data( new ConnectionData(sender, slot) ); _data = data.get(); _data->setValid(false); sender.onConnectionOpen(*this); slot->onConnect(*this); _data->setValid(true); data.release(); } Connection::Connection(const Connection& connection) { _data = connection._data; _data->ref(); } Connection::~Connection() { if( _data->unref() > 0) { return; } // close the connection if its still valid if( this->valid() ) { this->close(); } // delete the shared data delete _data; _data = 0; } void Connection::close() { if( !this->valid() ) return; _data->slot().onDisconnect( *this ); // We set the valid flag here to false since the call above may // fail for any reason. If setting the valid flag before, a // connection may pretend to be closed but it is not and it // may reside e.g. in the list of connections of the // Connectable class and then provoke an infinite loop. _data->setValid(false); _data->sender().onConnectionClose( *this ); } Connection& Connection::operator=(const Connection& connection) { if( 0 == _data->unref()) { this->close(); delete _data; } _data = connection._data; _data->ref(); return (*this); } bool Connection::operator==(const Connection& connection) const { // compare pointers or callable? return _data == connection._data; } } //namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/iodeviceimpl.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000024333�12260037210�014264� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "iodeviceimpl.h" #include "cxxtools/ioerror.h" #include "error.h" #include <cerrno> #include <cassert> #include <unistd.h> #include <string.h> #include <fcntl.h> #include <sys/poll.h> #include <cxxtools/log.h> #include <cxxtools/hdstream.h> log_define("cxxtools.iodevice.impl") namespace cxxtools { const short IODeviceImpl::POLLERR_MASK= POLLERR | POLLHUP | POLLNVAL; const short IODeviceImpl::POLLIN_MASK= POLLIN; const short IODeviceImpl::POLLOUT_MASK= POLLOUT; IODeviceImpl::IODeviceImpl(IODevice& device) : _device(device) , _fd(-1) , _timeout(Selectable::WaitInfinite) , _pfd(0) , _sentry(0) , _errorPending(false) { } IODeviceImpl::~IODeviceImpl() { assert(_pfd == 0); if(_sentry) _sentry->detach(); } void IODeviceImpl::open(const std::string& path, IODevice::OpenMode mode, bool inherit) { int flags = O_RDONLY; if( (mode & IODevice::Read ) && (mode & IODevice::Write) ) { flags |= O_RDWR; } else if(mode & IODevice::Write) { flags |= O_WRONLY; } else if(mode & IODevice::Read ) { flags |= O_RDONLY; } if(mode & IODevice::Async) flags |= O_NONBLOCK; if(mode & IODevice::Trunc) flags |= O_TRUNC; flags |= O_NOCTTY; _fd = ::open( path.c_str(), flags ); if(_fd == -1) throw AccessFailed(getErrnoString("open failed")); if (!inherit) { int flags = fcntl(_fd, F_GETFD); flags |= FD_CLOEXEC ; int ret = fcntl(_fd, F_SETFD, flags); if(-1 == ret) throw IOError(getErrnoString("Could not set FD_CLOEXEC")); } } void IODeviceImpl::open(int fd, bool isAsync, bool inherit) { _fd = fd; if (isAsync) { int flags = fcntl(_fd, F_GETFL); flags |= O_NONBLOCK ; int ret = fcntl(_fd, F_SETFL, flags); if(-1 == ret) throw IOError(getErrnoString("Could not set fd to non-blocking")); } if (!inherit) { int flags = fcntl(_fd, F_GETFD); flags |= FD_CLOEXEC ; int ret = fcntl(_fd, F_SETFD, flags); if(-1 == ret) throw IOError(getErrnoString("Could not set FD_CLOEXEC")); } } void IODeviceImpl::close() { log_debug("close device; fd=" << _fd << " pfd=" << _pfd); if(_fd != -1) { int fd = _fd; _fd = -1; _pfd = 0; while ( ::close(fd) != 0 ) { if( errno != EINTR ) { log_error("close of iodevice failed; errno=" << errno); throw IOError(getErrnoString("Could not close file handle")); } } } } size_t IODeviceImpl::beginRead(char* buffer, size_t n, bool& eof) { if(_pfd) { _pfd->events |= POLLIN; } return 0; } size_t IODeviceImpl::endRead(bool& eof) { if(_pfd) { _pfd->events &= ~POLLIN; } if (_errorPending) { _errorPending = false; throw IOError("read error"); } return this->read( _device.rbuf(), _device.rbuflen(), eof ); } size_t IODeviceImpl::read( char* buffer, size_t count, bool& eof ) { ssize_t ret = 0; while(true) { ret = ::read( _fd, (void*)buffer, count); if(ret > 0) { log_debug("::read(" << _fd << ", " << count << ") returned " << ret << " => \"" << hexDump(buffer, ret) << '"'); break; } log_debug("::read(" << _fd << ", " << count << ") returned " << ret << " errno=" << errno); if(ret == 0 || errno == ECONNRESET) { eof = true; return 0; } if(errno == EINTR) continue; if(errno != EAGAIN) throw IOError(getErrnoString("read failed")); pollfd pfd; pfd.fd = this->fd(); pfd.revents = 0; pfd.events = POLLIN; bool ret = this->wait(_timeout, pfd); if(false == ret) { log_debug("timeout"); throw IOTimeout(); } } return ret; } size_t IODeviceImpl::beginWrite(const char* buffer, size_t n) { log_debug("::write(" << _fd << ", buffer, " << n << ')'); ssize_t ret = ::write(_fd, (const void*)buffer, n); log_debug("write returned " << ret); if (ret > 0) return static_cast<size_t>(ret); if (ret == 0 || errno == ECONNRESET || errno == EPIPE) throw IOError("lost connection to peer"); if(_pfd) { _pfd->events |= POLLOUT; } return 0; } size_t IODeviceImpl::endWrite() { if(_pfd) { _pfd->events &= ~POLLOUT; } if (_errorPending) { _errorPending = false; throw IOError("write error"); } if (_device.wavail() > 0) { log_debug("write pending " << _device.wavail()); size_t n = _device.wavail(); return n; } return this->write( _device.wbuf(), _device.wbuflen() ); } size_t IODeviceImpl::write( const char* buffer, size_t count ) { ssize_t ret = 0; while(true) { log_debug("::write(" << _fd << ", buffer, " << count << ')'); ret = ::write(_fd, (const void*)buffer, count); log_debug("write returned " << ret); if(ret > 0) break; if(ret == 0 || errno == ECONNRESET || errno == EPIPE) throw IOError("lost connection to peer"); if(errno == EINTR) continue; if(errno != EAGAIN) throw IOError(getErrnoString("Could not write to file handle")); pollfd pfd; pfd.fd = this->fd(); pfd.revents = 0; pfd.events = POLLOUT; if (!this->wait(_timeout, pfd)) { throw IOTimeout(); } } return static_cast<size_t>(ret); } void IODeviceImpl::sigwrite(int sig) { ::write(_fd, (const void*)&sig, sizeof(sig)); } void IODeviceImpl::cancel() { if(_pfd) { _pfd->events &= ~(POLLIN|POLLOUT); } } void IODeviceImpl::sync() const { int ret = fsync(_fd); if(ret != 0) throw IOError(getErrnoString("Could not sync handle")); } void IODeviceImpl::attach(SelectorBase& s) { } void IODeviceImpl::detach(SelectorBase& s) { _pfd = 0; } bool IODeviceImpl::wait(std::size_t msecs) { if (_device.wavail() > 0) { _device.outputReady(_device); return true; } pollfd pfd; this->initWait(pfd); this->wait(msecs, pfd); return this->checkPollEvent(pfd); } bool IODeviceImpl::wait(std::size_t umsecs, pollfd& pfd) { int msecs = static_cast<int>(umsecs); if( umsecs > static_cast<std::size_t>(std::numeric_limits<int>::max()) ) { if(umsecs == SelectorBase::WaitInfinite) msecs = -1; else msecs = std::numeric_limits<int>::max(); } int ret = -1; do { ret = ::poll(&pfd, 1, msecs); } while (ret == -1 && errno == EINTR); if (ret == -1) throw IOError(getErrnoString("poll failed")); return ret > 0; } void IODeviceImpl::initWait(pollfd& pfd) { pfd.fd = this->fd(); pfd.revents = 0; pfd.events = 0; if( _device.reading() ) pfd.events |= POLLIN; if( _device.writing() ) pfd.events |= POLLOUT; } size_t IODeviceImpl::initializePoll(pollfd* pfd, size_t pollSize) { assert(pfd != 0); assert(pollSize >= 1); this->initWait(*pfd); _pfd = pfd; return 1; } bool IODeviceImpl::checkPollEvent() { // _pfd can be 0 if the device is just added during wait iteration if (_pfd == 0) return false; return this->checkPollEvent(*_pfd); } bool IODeviceImpl::checkPollEvent(pollfd& pfd) { log_trace("checkPollEvent"); bool avail = false; DestructionSentry sentry(_sentry); if (pfd.revents & POLLERR_MASK) { _errorPending = true; try { bool reading = _device.reading(); bool writing = _device.writing(); if (reading) { avail = true; _device.inputReady(_device); } if( ! _sentry ) return avail; if (writing) { avail = true; _device.outputReady(_device); } if( ! _sentry ) return avail; if (!reading && !writing) { avail = true; _device.close(); } } catch (...) { _errorPending = false; throw; } _errorPending = false; return avail; } if( _device.wavail() > 0 || (pfd.revents & POLLOUT_MASK) ) { log_debug("send signal outputReady"); _device.outputReady(_device); avail = true; } if( ! _sentry ) return avail; if( pfd.revents & POLLIN_MASK ) { log_debug("send signal inputReady"); _device.inputReady(_device); avail = true; } return avail; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/mime.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000013310�12256773774�012566� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/mime.h> #include <cxxtools/base64stream.h> #include <cxxtools/quotedprintablestream.h> #include <cxxtools/log.h> #include <stdlib.h> #include <vector> #include <sstream> #include <fstream> #include <stdexcept> log_define("cxxtools.mime") namespace cxxtools { Mimepart::Mimepart(const std::string& contentType_, ContentTransferEncoding contentTransferEncoding_) : contentTransferEncoding(contentTransferEncoding_) { setHeader("Content-Type", contentType_); } void Mimepart::addData(std::istream& in) { std::ostringstream data; data << in.rdbuf(); body += data.str(); } Mimepart& Mime::addPart(const std::string& data, const std::string& contentType, ContentTransferEncoding contentTransferEncoding) { log_debug("add part " << data.size() << " bytes, contentType \"" << contentType << "\" content transfer encoding " << contentTransferEncoding); parts.push_back(Mimepart(contentType, contentTransferEncoding)); parts.back().setData(data); return parts.back(); } Mimepart& Mime::addPart(std::istream& in, const std::string& contentType, ContentTransferEncoding contentTransferEncoding) { log_debug("add part from stream, contentType \"" << contentType << "\" content transfer encoding " << contentTransferEncoding); parts.push_back(Mimepart(contentType, contentTransferEncoding)); std::ostringstream body; body << in.rdbuf(); log_debug("part has " << body.str().size() << " bytes"); parts.back().setData(body.str()); return parts.back(); } Mimepart& Mime::addTextFile(const std::string& contentType, const std::string& filename) { std::ifstream in(filename.c_str()); if (!in) throw std::runtime_error("cannot open file \"" + filename + '"'); return addTextFile(contentType, filename, in); } Mimepart& Mime::addBinaryFile(const std::string& contentType, const std::string& filename) { std::ifstream in(filename.c_str()); if (!in) throw std::runtime_error("cannot open file \"" + filename + '"'); return addBinaryFile(contentType, filename, in); } std::ostream& operator<< (std::ostream& out, const Mimepart& mimePart) { // print headers for (Mimepart::HeadersType::const_iterator it = mimePart.headers.begin(); it != mimePart.headers.end(); ++it) out << it->first << ": " << it->second << '\n'; // encode data if (mimePart.contentTransferEncoding == Mimepart::quotedPrintable) { out << "Content-Transfer-Encoding: quoted-printable\n\n"; QuotedPrintable_ostream enc(out); enc << mimePart.getBody(); out << '\n'; } else if (mimePart.contentTransferEncoding == Mimepart::base64) { out << "Content-Transfer-Encoding: base64\n\n"; Base64ostream enc(out); enc << mimePart.getBody(); enc.terminate(); out << "\n\n"; } else { std::ostringstream msg; msg << "unknown Content-Transfer-Encoding " << mimePart.contentTransferEncoding; log_error(msg.str()); throw std::runtime_error(msg.str()); } return out; } std::ostream& operator<< (std::ostream& out, const Mime& mime) { // build string parts typedef std::vector<std::string> SpartsType; SpartsType sparts; for (Mime::PartsType::const_iterator pit = mime.parts.begin(); pit != mime.parts.end(); ++pit) { std::ostringstream out; out << *pit; sparts.push_back(out.str()); } // choose suitable boundary std::string boundary; time_t t; time(&t); while (true) { std::ostringstream h; h << std::hex << t; boundary = "=Boundary=" + h.str() + "="; for (SpartsType::const_iterator it = sparts.begin(); it != sparts.end(); ++it) if (it->find(boundary) != std::string::npos) continue; t += rand(); break; } // print headers out << "MIME-Version: 1.0\n" "Content-Type: multipart/mixed; boundary=\"" << boundary << "\"\n"; for (Mime::HeadersType::const_iterator it = mime.headers.begin(); it != mime.headers.end(); ++it) out << it->first << ": " << it->second << '\n'; out << '\n'; // print parts for (SpartsType::const_iterator it = sparts.begin(); it != sparts.end(); ++it) out << "--" << boundary << '\n' << *it; out << "--" << boundary << "--\n"; return out; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.pthread.cpp������������������������������������������������������������0000664�0001750�0001750�00000011621�12256773774�015272� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.pthread.h> #include <cassert> #include <pthread.h> namespace cxxtools { static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; atomic_t atomicGet(volatile atomic_t& val) { atomic_t ret = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert(thr_ret == 0); ret = val; thr_ret = pthread_mutex_unlock(&mtx); assert(thr_ret == 0); pthread_cleanup_pop (0); return ret; } void atomicSet(volatile atomic_t& val, atomic_t n) { pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert(thr_ret == 0); val = n; thr_ret = pthread_mutex_unlock(&mtx); assert(thr_ret == 0); pthread_cleanup_pop (0); } atomic_t atomicIncrement(volatile atomic_t& dest) { atomic_t ret = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert(thr_ret == 0); ++dest; ret = dest; thr_ret = pthread_mutex_unlock(&mtx); assert(thr_ret == 0); pthread_cleanup_pop (0); return (ret); } atomic_t atomicDecrement(volatile atomic_t& dest) { atomic_t ret = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert(thr_ret == 0); --dest; ret = dest; thr_ret = pthread_mutex_unlock(&mtx); assert(thr_ret == 0); pthread_cleanup_pop (0); return (ret); } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { atomic_t old = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int ret = pthread_mutex_lock(&mtx); assert (ret == 0); old = dest; if(old == comp) { dest = exch; } ret = pthread_mutex_unlock(&mtx); assert (ret == 0); pthread_cleanup_pop (0); return old; } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { void* old = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int ret = pthread_mutex_lock(&mtx); assert(ret == 0); old = dest; if(old == comp) { dest = exch; } ret = pthread_mutex_unlock(&mtx); assert(ret == 0); pthread_cleanup_pop (0); return old; } atomic_t atomicExchange(volatile atomic_t& dest, atomic_t exch) { atomic_t ret = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert(thr_ret == 0); ret = dest; dest = exch; thr_ret = pthread_mutex_unlock(&mtx); assert(thr_ret == 0); pthread_cleanup_pop (0); return ret; } void* atomicExchange(void* volatile& dest, void* exch) { void* ret = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert(thr_ret == 0); ret = dest; dest = exch; thr_ret = pthread_mutex_unlock(&mtx); assert(thr_ret == 0); pthread_cleanup_pop (0); return ret; } atomic_t atomicExchangeAdd(volatile atomic_t& dest, atomic_t add) { atomic_t ret = 0; pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&mtx); int thr_ret = pthread_mutex_lock(&mtx); assert (thr_ret == 0); ret = dest; dest += add; thr_ret = pthread_mutex_unlock(&mtx); assert (thr_ret == 0); pthread_cleanup_pop (0); return (ret); } } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/error.h��������������������������������������������������������������������������0000664�0001750�0001750�00000003344�12256773774�012443� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef ERROR_H #define ERROR_H #include <string> #include <errno.h> namespace cxxtools { std::string getErrnoString(int err, const char* fn); std::string getErrnoString(int err); inline std::string getErrnoString(const char* fn) { return getErrnoString(errno, fn); } inline std::string getErrnoString() { return getErrnoString(errno); } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/selectable.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000006153�12266277345�013743� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/selectable.h" namespace cxxtools { Selectable::~Selectable() { } void Selectable::setSelector(SelectorBase* parent) { if(_parent) { this->onDetach(*_parent); if( this->enabled() ) _parent->onRemove(*this); _parent = 0; } if(parent) { this->onAttach(*parent); if( this->enabled() ) parent->onAdd(*this); } _parent = parent; } SelectorBase* Selectable::selector() { return _parent; } const SelectorBase* Selectable::selector() const { return _parent; } void Selectable::close() { if( this->enabled() ) { this->onClose(); this->setEnabled(false); } } bool Selectable::wait(std::size_t msecs) { return this->onWait(msecs); } bool Selectable::enabled() const { return _state != Disabled; } bool Selectable::idle() const { return _state == Idle; } bool Selectable::busy() const { return _state == Busy; } bool Selectable::avail() const { return _state == Avail; } Selectable::Selectable() : _parent(0) , _state(Disabled) { } void Selectable::setEnabled(bool isEnabled) { if(isEnabled) { if(_state == Disabled) this->setState(Idle); else { this->setState(_state); if(_parent) _parent->onReinit(*this); } } else { this->setState(Disabled); } } void Selectable::setState(State state) { if(state == Disabled) { if(_parent) _parent->onRemove(*this); } else if(_state == Disabled) { if(_parent) _parent->onAdd(*this); } //State prev = _state; _state = state; if(_parent) { _parent->onChanged(*this /*, prev */); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/filedevice.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000006257�12260037210�013717� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Marc Boris Duerner * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/filedevice.h> #include "filedeviceimpl.h" namespace cxxtools { FileDevice::FileDevice() { _impl = new FileDeviceImpl(*this); } FileDevice::FileDevice(const std::string& path, IODevice::OpenMode mode, bool inherit) { _impl = new FileDeviceImpl(*this); open(path, mode, inherit); } FileDevice::~FileDevice() { try { close(); } catch(...) { } delete _impl; } void FileDevice::open( const std::string& path, IODevice::OpenMode mode, bool inherit) { close(); _impl->open(path, mode, inherit); _path = path; } void FileDevice::onClose() { _impl->close(); } void FileDevice::onSetTimeout(size_t timeout) { _impl->setTimeout(timeout); } size_t FileDevice::onBeginRead(char* buffer, size_t n, bool& eof) { return _impl->beginRead(buffer, n, eof); } size_t FileDevice::onEndRead(bool& eof) { return _impl->endRead(eof); } size_t FileDevice::onBeginWrite(const char* buffer, size_t n) { return _impl->beginWrite(buffer, n); } size_t FileDevice::onEndWrite() { return _impl->endWrite(); } size_t FileDevice::size() const { return _impl->size(); } FileDevice::pos_type FileDevice::onSeek(off_type offset, std::ios::seekdir sd) { return _impl->seek(offset, sd); } size_t FileDevice::onRead( char* buffer, size_t count, bool& eof ) { //if(count > SSIZE_MAX) // count = SSIZE_MAX; size_t ret = _impl->read( buffer, count, eof ); return ret; } size_t FileDevice::onWrite(const char* buffer, size_t count) { return _impl->write(buffer, count); } void FileDevice::onCancel() { _impl->cancel(); } size_t FileDevice::onPeek(char* buffer, size_t count) { return _impl->peek(buffer, count); } void FileDevice::onSync() const { _impl->sync(); } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/selectableimpl.h�����������������������������������������������������������������0000664�0001750�0001750�00000003714�12260020530�014242� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_SELECTABLEIMPL_H #define CXXTOOLS_SYSTEM_SELECTABLEIMPL_H #include <cstddef> struct pollfd; namespace cxxtools { class SelectorImpl; class SelectableImpl { public: virtual ~SelectableImpl() {}; virtual void close() = 0; virtual bool wait(std::size_t msecs)= 0; virtual std::size_t pollSize() const = 0; virtual std::size_t initializePoll(pollfd* pfd, std::size_t pollSize) = 0; virtual bool checkPollEvent() = 0; }; } //namespace cxxtools #endif ����������������������������������������������������cxxtools-2.2.1/src/eventloop.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000007731�12260020530�013626� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Marc Boris Duerner * Copyright (C) 2007 Laurentiu-Gheorghe Crisan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "selectorimpl.h" #include "cxxtools/eventloop.h" namespace cxxtools { EventLoop::EventLoop() : _exitLoop(false) , _allocator(/*255, 64*/) { _selector = new SelectorImpl(); } EventLoop::~EventLoop() { try { while ( ! _eventQueue.empty() ) { Event* ev = _eventQueue.front(); _eventQueue.pop_front(); ev->destroy(_allocator); } } catch(...) {} delete _selector; } void EventLoop::onAdd( Selectable& s ) { return _selector->add( s ); } void EventLoop::onRemove( Selectable& s ) { _selector->remove( s ); } void EventLoop::onReinit(Selectable& s) { } void EventLoop::onChanged(Selectable& s) { _selector->changed(s); } void EventLoop::onRun() { while( true ) { RecursiveLock lock(_queueMutex); if(_exitLoop) { _exitLoop = false; break; } if( !_eventQueue.empty() ) { lock.unlock(); this->processEvents(); } lock.unlock(); bool active = this->wait( this->idleTimeout() ); if( ! active ) timeout.send(); } exited(); } bool EventLoop::onWait(std::size_t msecs) { if( _selector->wait(msecs) ) { RecursiveLock lock(_queueMutex); if( !_eventQueue.empty() ) { lock.unlock(); this->processEvents(); } return true; } return false; } void EventLoop::onWake() { _selector->wake(); } void EventLoop::onExit() { RecursiveLock lock(_queueMutex); _exitLoop = true; lock.unlock(); this->wake(); } void EventLoop::onCommitEvent(const Event& ev) { { RecursiveLock lock( _queueMutex ); // TODO: use a continuous block of memory to store events // this avoids new/delete Event& clonedEvent = ev.clone(_allocator); try { _eventQueue.push_back(&clonedEvent); } catch(...) { clonedEvent.destroy(_allocator); throw; } } this->wake(); } void EventLoop::onProcessEvents() { while( false == _exitLoop ) { RecursiveLock lock(_queueMutex); if ( _eventQueue.empty() || _exitLoop ) break; Event* ev = _eventQueue.front(); _eventQueue.pop_front(); try { lock.unlock(); event.send(*ev); } catch(...) { ev->destroy(_allocator); throw; } ev->destroy(_allocator); } } } // namespace cxxtools ���������������������������������������cxxtools-2.2.1/src/query_params.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000017640�12256775511�014350� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003,2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/query_params.h" #include <iterator> #include <iostream> #include <stdlib.h> namespace cxxtools { namespace { class UrlParser { QueryParams& _q; enum { state_0, state_key, state_value, state_keyesc, state_valueesc } _state; std::string _key; std::string _value; unsigned _cnt; unsigned _v; public: explicit UrlParser(QueryParams& q) : _q(q), _state(state_0), _cnt(0), _v(0) { } void parse(char ch); void finish(); }; void UrlParser::parse(char ch) { switch(_state) { case state_0: if (ch == '=') _state = state_value; else if (ch == '&') ; else if (ch == '%') _state = state_keyesc; else { _key = ch; _state = state_key; } break; case state_key: if (ch == '=') _state = state_value; else if (ch == '&') { _q.add(_key); _key.clear(); _state = state_0; } else if (ch == '%') _state = state_keyesc; else _key += ch; break; case state_value: if (ch == '%') _state = state_valueesc; else if (ch == '&') { _q.add(_key, _value); _key.clear(); _value.clear(); _state = state_0; } else if (ch == '+') _value += ' '; else _value += ch; break; case state_keyesc: case state_valueesc: if (ch >= '0' && ch <= '9') { ++_cnt; _v = (_v << 4) + (ch - '0'); } else if (ch >= 'a' && ch <= 'f') { ++_cnt; _v = (_v << 4) + (ch - 'a' + 10); } else if (ch >= 'A' && ch <= 'F') { ++_cnt; _v = (_v << 4) + (ch - 'A' + 10); } else { if (_cnt == 0) { if (_state == state_keyesc) { _key += '%'; _state = state_key; } else { _value += '%'; _state = state_value; } } else { if (_state == state_keyesc) { _key += static_cast<char>(_v); _state = state_key; } else { _value += static_cast<char>(_v); _state = state_value; } _cnt = 0; _v = 0; } parse(ch); break; } if (_cnt >= 2) { if (_state == state_keyesc) { _key += static_cast<char>(_v); _state = state_key; } else { _value += static_cast<char>(_v); _state = state_value; } _cnt = 0; _v = 0; } break; } } void UrlParser::finish() { switch(_state) { case state_0: break; case state_key: if (!_key.empty()) { _q.add(_key); _key.clear(); } break; case state_value: _q.add(_key, _value); _key.clear(); _value.clear(); break; case state_keyesc: case state_valueesc: if (_cnt == 0) { if (_state == state_keyesc) { _key += '%'; _q.add(_key); } else { _value += '%'; _q.add(_key, _value); } } else { if (_state == state_keyesc) { _key += static_cast<char>(_v); _q.add(_key); } else { _value += static_cast<char>(_v); _q.add(_key, _value); } } _value.clear(); _key.clear(); _cnt = 0; _v = 0; break; } } void appendUrl(std::string& url, char ch) { static const char hex[] = "0123456789ABCDEF"; if (ch > 32 && ch < 127 && ch != '%' && ch != '+' && ch != '=' && ch != '&') url += ch; else if (ch == ' ') url += '+'; else { url += '%'; char hi = (ch >> 4) & 0x0f; char lo = ch & 0x0f; url += hex[static_cast<int>(hi)]; url += hex[static_cast<int>(lo)]; } } void appendUrl(std::string& url, const std::string& str) { for (std::string::const_iterator i = str.begin(); i != str.end(); ++i) appendUrl(url, *i); } } void QueryParams::parse_url(const std::string& url) { UrlParser p(*this); for (std::string::const_iterator it = url.begin(); it != url.end(); ++it) p.parse(*it); p.finish(); } void QueryParams::parse_url(const char* url) { UrlParser p(*this); while (*url) { p.parse(*url); ++url; } p.finish(); } void QueryParams::parse_url(std::istream& url_stream) { UrlParser p(*this); char ch; while (url_stream.get(ch)) p.parse(ch); p.finish(); } /// get nth named parameter. const std::string& QueryParams::param(const std::string& name, size_type n) const { for (size_type nn = 0; nn < _values.size(); ++nn) { if (_values[nn].name == name) { if (n == 0) return _values[nn].value; --n; } } static std::string emptyValue; return emptyValue; } /// get nth named parameter with default value. std::string QueryParams::param(const std::string& name, size_type n, const std::string& def) const { for (size_type nn = 0; nn < _values.size(); ++nn) { if (_values[nn].name == name) { if (n == 0) return _values[nn].value; --n; } } return def; } /// get number of parameters with the given name QueryParams::size_type QueryParams::paramcount(const std::string& name) const { size_type count = 0; for (size_type nn = 0; nn < _values.size(); ++nn) if (_values[nn].name == name) ++count; return count; } /// checks if the named parameter exists bool QueryParams::has(const std::string& name) const { for (size_type nn = 0; nn < _values.size(); ++nn) if (_values[nn].name == name) return true; return false; } /// get parameters as url std::string QueryParams::getUrl() const { std::string url; for (size_type nn = 0; nn < _values.size(); ++nn) { if (nn > 0) url += '&'; if (!_values[nn].name.empty()) { appendUrl(url, _values[nn].name); url += '='; } appendUrl(url, _values[nn].value); } return url; } } ������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/condition.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000003547�12266277345�013632� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr Marc Boris Duerner * Copyright (C) 2005-2006 by Sebastian Pieck * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "conditionimpl.h" #include "cxxtools/condition.h" namespace cxxtools { Condition::Condition() { _impl = new ConditionImpl(); } Condition::~Condition() { delete _impl; } void Condition::wait(Mutex& mtx) { _impl->wait(mtx); } bool Condition::wait(Mutex& mtx, unsigned int ms) { return _impl->wait(mtx, ms); } void Condition::signal() { _impl->signal(); } void Condition::broadcast() { _impl->broadcast(); } } // !namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/�����������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�011761� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/responder.cpp����������������������������������������������������������������0000664�0001750�0001750�00000014711�12256773774�014416� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "responder.h" #include "rpcserverimpl.h" #include <cxxtools/bin/valueparser.h> #include <cxxtools/serviceprocedure.h> #include <cxxtools/remoteexception.h> #include <cxxtools/log.h> log_define("cxxtools.bin.responder") namespace cxxtools { namespace bin { Responder::~Responder() { if (_proc) _serviceRegistry.releaseProcedure(_proc); } void Responder::reply(IOStream& out) { log_info("send reply"); out << '\xc1'; _formatter.begin(out); _result->format(_formatter); out << '\xff'; } void Responder::replyError(IOStream& out, const char* msg, int rc) { log_info("send error \"" << msg << '"'); out << '\xc2' << static_cast<char>(static_cast<uint32_t>(rc) >> 24) << static_cast<char>(static_cast<uint32_t>(rc) >> 16) << static_cast<char>(static_cast<uint32_t>(rc) >> 8) << static_cast<char>(static_cast<uint32_t>(rc)) << msg << '\0' << '\xff'; } bool Responder::onInput(IOStream& ios) { while (ios.buffer().in_avail() > 0) { if (advance(ios.buffer().sbumpc())) { if (_failed) { replyError(ios, _errorMessage.c_str(), 0); } else { try { _result = _proc->endCall(); reply(ios); } catch (const RemoteException& e) { ios.buffer().discard(); replyError(ios, e.what(), e.rc()); } catch (const std::exception& e) { ios.buffer().discard(); replyError(ios, e.what(), 0); } } _serviceRegistry.releaseProcedure(_proc); _proc = 0; _args = 0; _result = 0; _state = state_0; _failed = false; _errorMessage.clear(); return true; } } return false; } bool Responder::advance(char ch) { switch (_state) { case state_0: if (ch == '\xc0') _state = state_method; else if (ch == '\xc3') _state = state_domain; else throw std::runtime_error("domain or method name expected"); break; case state_domain: if (ch == '\0') { log_info("rpc method domain \"" << _domain << '"'); _state = state_method; } else _domain += ch; break; case state_method: if (ch == '\0') { log_info("rpc method \"" << _methodName << '"'); _proc = _serviceRegistry.getProcedure(_domain.empty() ? _methodName : _domain + '\0' + _methodName); if (_proc) { _args = _proc->beginCall(); _state = state_params; } else { _failed = true; _errorMessage = "unknown method \"" + _methodName + '"'; _state = state_params_skip; } _methodName.clear(); _domain.clear(); } else _methodName += ch; break; case state_params: if (ch == '\xff') { if (_args && *_args) { _failed = true; _errorMessage = "argument expected"; } return true; } else { if (_args == 0 || *_args == 0) { _failed = true; _errorMessage = "too many arguments"; _state = state_params_skip; } else { _deserializer.begin(); _valueParser.begin(_deserializer); _valueParser.advance(ch); _state = state_param; } } break; case state_params_skip: if (ch == '\xff') return true; else { _valueParser.beginSkip(); _valueParser.advance(ch); _state = state_param_skip; } break; case state_param: if (_valueParser.advance(ch)) { try { (*_args)->fixup(*_deserializer.si()); _deserializer.si()->clear(); ++_args; _state = state_params; } catch (const std::exception& e) { _failed = true; _errorMessage = e.what(); _state = state_params_skip; } } break; case state_param_skip: if (_valueParser.advance(ch)) _state = state_params_skip; break; } return false; } } } �������������������������������������������������������cxxtools-2.2.1/src/bin/formatter.cpp����������������������������������������������������������������0000664�0001750�0001750�00000050733�12256773774�014424� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/bin/formatter.h> #include <cxxtools/bin/serializer.h> #include <cxxtools/utf8codec.h> #include <cxxtools/convert.h> #include <cxxtools/log.h> #include <limits> #include <stdint.h> #include <math.h> log_define("cxxtools.bin.formatter") namespace cxxtools { namespace bin { namespace { void printTypeCode(std::ostream& out, const std::string& type, bool plain) { if (type.empty()) out << static_cast<char>(plain ? Serializer::TypePlainEmpty : Serializer::TypeEmpty); else if (type == "bool") out << static_cast<char>(plain ? Serializer::TypePlainBool : Serializer::TypeBool); else if (type == "char") out << static_cast<char>(plain ? Serializer::TypePlainChar : Serializer::TypeChar); else if (type == "string") out << static_cast<char>(plain ? Serializer::TypePlainString : Serializer::TypeString); else if (type == "int") out << static_cast<char>(plain ? Serializer::TypePlainInt : Serializer::TypeInt); else if (type == "double") out << static_cast<char>(plain ? Serializer::TypePlainBcdFloat : Serializer::TypeBcdFloat); else if (type == "pair") out << static_cast<char>(plain ? Serializer::TypePlainPair : Serializer::TypePair); else if (type == "array") out << static_cast<char>(plain ? Serializer::TypePlainArray : Serializer::TypeArray); else if (type == "list") out << static_cast<char>(plain ? Serializer::TypePlainList : Serializer::TypeList); else if (type == "deque") out << static_cast<char>(plain ? Serializer::TypePlainDeque : Serializer::TypeDeque); else if (type == "set") out << static_cast<char>(plain ? Serializer::TypePlainSet : Serializer::TypeSet); else if (type == "multiset") out << static_cast<char>(plain ? Serializer::TypePlainMultiset : Serializer::TypeMultiset); else if (type == "map") out << static_cast<char>(plain ? Serializer::TypePlainMap : Serializer::TypeMap); else if (type == "multimap") out << static_cast<char>(plain ? Serializer::TypePlainMultimap : Serializer::TypeMultimap); else out << static_cast<char>(plain ? Serializer::TypePlainOther : Serializer::TypeOther) << type << '\0'; } void printUInt(std::ostream& out, uint64_t v, const std::string& name) { if (v <= std::numeric_limits<uint8_t>::max()) { out << static_cast<char>(name.empty() ? Serializer::TypePlainUInt8 : Serializer::TypeUInt8); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v); } else if (v <= std::numeric_limits<uint16_t>::max()) { out << static_cast<char>(name.empty() ? Serializer::TypePlainUInt16 : Serializer::TypeUInt16); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v >> 8) << static_cast<char>(v); } else if (v <= std::numeric_limits<uint32_t>::max()) { out << static_cast<char>(name.empty() ? Serializer::TypePlainUInt32 : Serializer::TypeUInt32); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v >> 24) << static_cast<char>(v >> 16) << static_cast<char>(v >> 8) << static_cast<char>(v); } else { out << static_cast<char>(name.empty() ? Serializer::TypePlainUInt64 : Serializer::TypeUInt64); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v >> 56) << static_cast<char>(v >> 48) << static_cast<char>(v >> 40) << static_cast<char>(v >> 32) << static_cast<char>(v >> 24) << static_cast<char>(v >> 16) << static_cast<char>(v >> 8) << static_cast<char>(v); } } void printInt(std::ostream& out, int64_t v, const std::string& name) { if (v >= 0) { printUInt(out, v, name); } else if (v >= std::numeric_limits<int8_t>::min() && v <= std::numeric_limits<int8_t>::max()) { out << static_cast<char>(name.empty() ? Serializer::TypePlainInt8 : Serializer::TypeInt8); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v); } else if (v >= std::numeric_limits<int16_t>::min() && v <= std::numeric_limits<int16_t>::max()) { out << static_cast<char>(name.empty() ? Serializer::TypePlainInt16 : Serializer::TypeInt16); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v >> 8) << static_cast<char>(v); } else if (v >= std::numeric_limits<int32_t>::min() && v <= std::numeric_limits<int32_t>::max()) { out << static_cast<char>(name.empty() ? Serializer::TypePlainInt32 : Serializer::TypeInt32); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v >> 24) << static_cast<char>(v >> 16) << static_cast<char>(v >> 8) << static_cast<char>(v); } else { out << static_cast<char>(name.empty() ? Serializer::TypePlainInt64 : Serializer::TypeInt64); if (!name.empty()) out << name << '\0'; out << static_cast<char>(v >> 56) << static_cast<char>(v >> 48) << static_cast<char>(v >> 40) << static_cast<char>(v >> 32) << static_cast<char>(v >> 24) << static_cast<char>(v >> 16) << static_cast<char>(v >> 8) << static_cast<char>(v); } } template <typename StringT> bool isTrue(const StringT& s) { return !s.empty() && (s[0] == '1' || s[0] == 't' || s[0] == 'T' || s[0] == 'y' || s[0] == 'Y'); } template <typename T> bool areLowerBitsSet(T v, unsigned bits) { return v >> bits << bits != v; } } Formatter::Formatter() : _out(0), _ts(new Utf8Codec()) { } Formatter::Formatter(std::ostream& out) : _out(0), _ts(new Utf8Codec()) { begin(out); } void Formatter::begin(std::ostream& out) { _out = &out; _ts.attach(out); } void Formatter::finish() { } void Formatter::addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) { log_trace("addValueString(\"" << name << "\", \"" << type << "\", \"" << value << "\")"); bool plain = name.empty(); if (type == "int") { if (value.size() > 0 && (value[0] == L'-' || value[0] == L'+')) { int64_t v = convert<int64_t>(value); printInt(*_out, v, name); } else { uint64_t v = convert<uint64_t>(value); printUInt(*_out, v, name); } } else if (type == "double") { static const char d[257] = " " // 00-0f " " // 10-1f " \xa \xb\xc " // 20-2f "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9 " // 30-3f " " // 40-4f " " // 50-5f " \xe " // 60-6f " " // 70-7f " " // 80-8f " " // 90-9f " " // a0-af " " // b0-bf " " // c0-cf " " // d0-df " " // e0-ef " "; // f0-ff *_out << static_cast<char>(plain ? Serializer::TypePlainBcdFloat : Serializer::TypeBcdFloat); if (!plain) *_out << name << '\0'; if (value == L"nan") { *_out << '\xf0'; } else if (value == L"inf") { *_out << '\xf1'; } else if (value == L"-inf") { *_out << '\xf2'; } else { bool high = true; char ch; for (String::const_iterator it = value.begin(); it != value.end(); ++it) { int v = it->value(); if (high) ch = d[v] << 4; else { ch |= d[v]; *_out << ch; } high = !high; } if (!high) *_out << static_cast<char>(ch | '\xd'); } *_out << '\xff'; } else if (type == "bool") { *_out << static_cast<char>(plain ? Serializer::TypePlainBool : Serializer::TypeBool); if (!plain) *_out << name << '\0'; *_out << (isTrue(value) ? '\1' : '\0'); } else { printTypeCode(*_out, type, plain); if (!plain) *_out << name << '\0'; _ts << value; _ts.flush(); *_out << '\0' << '\xff'; } } void Formatter::addValueStdString(const std::string& name, const std::string& type, const std::string& value) { log_trace("addValueStdString(\"" << name << "\", \"" << type << "\", \"" << value << "\")"); bool plain = name.empty(); if (type == "int") { if (value.size() > 0 && (value[0] == L'-' || value[0] == L'+')) { int64_t v = convert<int64_t>(value); printInt(*_out, v, name); } else { uint64_t v = convert<uint64_t>(value); printUInt(*_out, v, name); } } else if (type == "double") { static const char d[257] = " " // 00-0f " " // 10-1f " \xa \xb\xc " // 20-2f "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9 " // 30-3f " " // 40-4f " " // 50-5f " \xe " // 60-6f " " // 70-7f " " // 80-8f " " // 90-9f " " // a0-af " " // b0-bf " " // c0-cf " " // d0-df " " // e0-ef " "; // f0-ff *_out << static_cast<char>(plain ? Serializer::TypePlainBcdFloat : Serializer::TypeBcdFloat); if (!plain) *_out << name << '\0'; if (value == "nan") { *_out << '\xf0'; } else if (value == "inf") { *_out << '\xf1'; } else if (value == "-inf") { *_out << '\xf2'; } else { bool high = true; char ch; for (std::string::const_iterator it = value.begin(); it != value.end(); ++it) { int v = (*it); if (high) ch = d[v] << 4; else { ch |= d[v]; *_out << ch; } high = !high; } if (!high) *_out << static_cast<char>(ch | '\xd'); } *_out << '\xff'; } else if (type == "bool") { *_out << static_cast<char>(plain ? Serializer::TypePlainBool : Serializer::TypeBool); if (!plain) *_out << name << '\0'; *_out << (isTrue(value) ? '\1' : '\0'); } else if (value.find('\0') != std::string::npos) { uint32_t v = value.size(); if (v <= 0xffff) { *_out << static_cast<char>(plain ? Serializer::TypePlainBinary2 : Serializer::TypeBinary2); if (!plain) *_out << name << '\0'; } else { *_out << static_cast<char>(plain ? Serializer::TypePlainBinary4 : Serializer::TypeBinary4); if (!plain) *_out << name << '\0'; *_out << static_cast<char>(v >> 24) << static_cast<char>(v >> 16); } *_out << static_cast<char>(v >> 8) << static_cast<char>(v) << value; } else { printTypeCode(*_out, type, plain); if (!plain) *_out << name << '\0'; *_out << value << '\0' << '\xff'; } } void Formatter::addValueBool(const std::string& name, const std::string& type, bool value) { log_trace("addValueBool(\"" << name << "\", \"" << type << "\", " << value << ')'); bool plain = name.empty(); *_out << static_cast<char>(plain ? Serializer::TypePlainBool : Serializer::TypeBool); if (!plain) *_out << name << '\0'; *_out << (value ? '\1' : '\0'); } void Formatter::addValueInt(const std::string& name, const std::string& type, int_type value) { log_trace("addValueInt(\"" << name << "\", \"" << type << "\", " << value << ')'); printInt(*_out, value, name); } void Formatter::addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value) { log_trace("addValueUnsigned(\"" << name << "\", \"" << type << "\", " << value << ')'); printUInt(*_out, value, name); } void Formatter::addValueFloat(const std::string& name, const std::string& type, long double value) { log_trace("addValueFloat(\"" << name << "\", \"" << type << "\", " << value << ')'); if (value != value) { // NaN *_out << static_cast<char>(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat); if (!name.empty()) *_out << name << '\0'; *_out << '\x7f' << '\x1' << '\0'; } else if (value == std::numeric_limits<long double>::infinity()) { *_out << static_cast<char>(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat); if (!name.empty()) *_out << name << '\0'; *_out << '\x7f' << '\x0' << '\0'; } else if (value == -std::numeric_limits<long double>::infinity()) { *_out << static_cast<char>(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat); if (!name.empty()) *_out << name << '\0'; *_out << '\xff' << '\x0' << '\0'; } else if (value == 0.0) { log_debug("value is zero"); *_out << static_cast<char>(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat); if (!name.empty()) *_out << name << '\0'; *_out << '\0' << '\0' << '\0'; } else { bool isNeg = value < 0; int exp; long double s = frexp(isNeg ? -value : value, &exp); uint64_t m = static_cast<uint64_t>((std::numeric_limits<uint64_t>::max() + 1.0l) * (s * 2.0l - 1.0l)); if (m < 5 && s > .9) { // this must be an overflow, which may happen when long double has a very high resolution m = std::numeric_limits<uint64_t>::max(); } log_debug("value=" << value << " s=" << s << " man=" << std::hex << m << std::dec << " exp=" << exp << " neg=" << isNeg); if (areLowerBitsSet(m, 32) || exp > 63 || exp < -63) { log_debug("output long float"); uint16_t e = exp + 16383; if (isNeg) e |= 0x8000; *_out << static_cast<char>(name.empty() ? Serializer::TypePlainLongFloat : Serializer::TypeLongFloat); if (!name.empty()) *_out << name << '\0'; *_out << static_cast<char>(e >> 8) << static_cast<char>(e) << static_cast<char>(m >> 56) << static_cast<char>(m >> 48) << static_cast<char>(m >> 40) << static_cast<char>(m >> 32) << static_cast<char>(m >> 24) << static_cast<char>(m >> 16) << static_cast<char>(m >> 8) << static_cast<char>(m); } else if (areLowerBitsSet(m, 48)) { log_debug("output medium float"); uint16_t e = exp + 63; if (isNeg) e |= 0x80; *_out << static_cast<char>(name.empty() ? Serializer::TypePlainMediumFloat : Serializer::TypeMediumFloat); if (!name.empty()) *_out << name << '\0'; *_out << static_cast<char>(e) << static_cast<char>(m >> 56) << static_cast<char>(m >> 48) << static_cast<char>(m >> 40) << static_cast<char>(m >> 32); } else { log_debug("output short float"); uint8_t e = exp + 63; if (isNeg) e |= 0x80; *_out << static_cast<char>(name.empty() ? Serializer::TypePlainShortFloat : Serializer::TypeShortFloat); if (!name.empty()) *_out << name << '\0'; *_out << static_cast<char>(e) << static_cast<char>(m >> 56) << static_cast<char>(m >> 48); } } } void Formatter::addNull(const std::string& name, const std::string& type) { log_trace("addNull(\"" << name << "\", \"" << type << "\")"); *_out << static_cast<char>(name.empty() ? Serializer::TypePlainEmpty : Serializer::TypeEmpty); if (!name.empty()) *_out << name << '\0'; *_out << '\xff'; } void Formatter::beginArray(const std::string& name, const std::string& type) { log_trace("beginArray(\"" << name << "\", \"" << type << ')'); *_out << static_cast<char>(Serializer::CategoryArray) << name << '\0'; printTypeCode(*_out, type, name.empty()); } void Formatter::finishArray() { log_trace("finishArray()"); *_out << '\xff'; } void Formatter::beginObject(const std::string& name, const std::string& type) { log_trace("beginObject(\"" << name << "\", \"" << type << ')'); *_out << static_cast<char>(Serializer::CategoryObject) << name << '\0'; printTypeCode(*_out, type, false); } void Formatter::beginMember(const std::string& name) { log_trace("beginMember(\"" << name << ')'); *_out << '\1'; } void Formatter::finishMember() { log_trace("finishMember()"); } void Formatter::finishObject() { log_trace("finishObject()"); *_out << '\xff'; } } } �������������������������������������cxxtools-2.2.1/src/bin/worker.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000010240�12256773774�013717� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "worker.h" #include "rpcserverimpl.h" #include <cxxtools/log.h> #include "socket.h" log_define("cxxtools.bin.worker") namespace cxxtools { namespace bin { void Worker::run() { log_info("new thread running"); while (!_server.isTerminating() && _server._queue.numWaiting() < _server.minThreads()) { Socket* socket = _server._queue.get(); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } if (_server._queue.numWaiting() == 0) _server.noWaitingThreads(); try { if (!socket->hasAccepted()) { // do blocking accept socket->accept(); log_debug("connection accepted from " << socket->getPeerAddr()); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } // new connection arrived - create new accept socket log_info("new connection accepted from " << socket->getPeerAddr()); _server._queue.put(new Socket(*socket)); } else if (socket->isConnected()) { log_debug("process available input from " << socket->getPeerAddr()); socket->onInput(socket->buffer()); } else { log_debug("socket is not connected any more; delete " << static_cast<void*>(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; continue; } Connection inputConnection = connect(socket->buffer().inputReady, socket->inputSlot); while (socket->wait(10) && socket->isConnected()) ; if (socket->isConnected()) { log_debug("timeout processing socket"); inputConnection.close(); _server.addIdleSocket(socket); } else if (_server.isTerminating()) { _server._queue.put(socket); } else { log_debug("socket is not connected any more; delete " << static_cast<void*>(socket)); log_info("client " << socket->getPeerAddr() << " closed connection"); delete socket; } } catch (const std::exception& e) { log_debug("error occured in device: " << e.what() << "; delete " << static_cast<void*>(socket)); delete socket; } } log_info("thread terminated"); _server.threadTerminated(this); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/valueparser.cpp��������������������������������������������������������������0000664�0001750�0001750�00000065655�12256773774�014763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/bin/valueparser.h> #include <cxxtools/deserializer.h> #include <cxxtools/bin/serializer.h> #include <cxxtools/serializationerror.h> #include <cxxtools/log.h> #include <math.h> log_define("cxxtools.bin.valueparser") namespace cxxtools { namespace bin { namespace { const char* typeName(unsigned char typeCode) { switch (typeCode) { case Serializer::TypeEmpty: case Serializer::TypePlainEmpty: return ""; case Serializer::TypeBool: case Serializer::TypePlainBool: return "bool"; case Serializer::TypeChar: case Serializer::TypePlainChar: return "char"; case Serializer::TypeString: case Serializer::TypePlainString: return "string"; case Serializer::TypeInt: case Serializer::TypePlainInt: case Serializer::TypeInt8: case Serializer::TypePlainInt8: case Serializer::TypeInt16: case Serializer::TypePlainInt16: case Serializer::TypeInt32: case Serializer::TypePlainInt32: case Serializer::TypeInt64: case Serializer::TypePlainInt64: case Serializer::TypeUInt8: case Serializer::TypePlainUInt8: case Serializer::TypeUInt16: case Serializer::TypePlainUInt16: case Serializer::TypeUInt32: case Serializer::TypePlainUInt32: case Serializer::TypeUInt64: case Serializer::TypePlainUInt64: return "int"; case Serializer::TypeBinary2: case Serializer::TypePlainBinary2: case Serializer::TypeBinary4: case Serializer::TypePlainBinary4: return "binary"; case Serializer::TypeShortFloat: case Serializer::TypePlainShortFloat: case Serializer::TypeMediumFloat: case Serializer::TypePlainMediumFloat: case Serializer::TypeLongFloat: case Serializer::TypePlainLongFloat: case Serializer::TypeBcdFloat: case Serializer::TypePlainBcdFloat: return "double"; case Serializer::TypePair: case Serializer::TypePlainPair: return "pair"; case Serializer::TypeArray: case Serializer::TypePlainArray: return "array"; case Serializer::TypeList: case Serializer::TypePlainList: return "list"; case Serializer::TypeDeque: case Serializer::TypePlainDeque: return "deque"; case Serializer::TypeSet: case Serializer::TypePlainSet: return "set"; case Serializer::TypeMultiset: case Serializer::TypePlainMultiset: return "multiset"; case Serializer::TypeMap: case Serializer::TypePlainMap: return "map"; case Serializer::TypeMultimap: case Serializer::TypePlainMultimap: return "multimap"; default: { std::ostringstream msg; msg << "unknown serialization type code <" << std::hex << static_cast<unsigned>(static_cast<unsigned char>(typeCode)) << '>'; SerializationError::doThrow(msg.str()); } } return 0; // never reached } static const char bcdDigits[16] = "0123456789+-. e"; } void ValueParser::begin(DeserializerBase& handler) { log_debug(static_cast<void*>(this) << " begin"); _state = state_type; _nextstate = state_type; _deserializer = &handler; _int = 0; _exp = 0; _token.clear(); } void ValueParser::beginSkip() { _state = state_type; _deserializer = 0; _int = 0; _exp = 0; _token.clear(); } bool ValueParser::advance(char ch) { //log_debug(static_cast<void*>(this) << " advance " << std::hex << static_cast<unsigned>(static_cast<unsigned char>(ch)) << std::dec << " state " << _state << " nextstate " << _nextstate); switch (_state) { case state_type: { Serializer::TypeCode tc = static_cast<Serializer::TypeCode>(static_cast<unsigned char>(ch)); if (tc == Serializer::CategoryObject) { _nextstate = state_object_type; _state = state_name; if (_deserializer) _deserializer->setCategory(SerializationInfo::Object); } else if (tc == Serializer::CategoryArray) { _nextstate = state_array_type; _state = state_name; if (_deserializer) _deserializer->setCategory(SerializationInfo::Array); } else if (tc == Serializer::TypeOther) { log_debug("type other"); _nextstate = state_name; _state = state_value_type_other; } else if (tc == Serializer::TypePlainOther) { log_debug("type plain other"); _nextstate = state_value_value; _state = state_value_type_other; } else { log_debug("type code " << std::hex << tc << " => type " << typeName(ch)); if (_deserializer) { _deserializer->setTypeName(typeName(ch)); _deserializer->setCategory(SerializationInfo::Value); } switch (tc) { case Serializer::TypeEmpty: if (_deserializer) _deserializer->setNull(); _nextstate = state_end; _state = state_name; break; case Serializer::TypeChar: case Serializer::TypeString: case Serializer::TypeInt: _nextstate = state_value_value; _state = state_name; break; case Serializer::TypeBool: _nextstate = state_value_bool; _state = state_name; break; case Serializer::TypeBinary2: _count = 2; _nextstate = state_value_binary_length; _state = state_name; break; case Serializer::TypeBinary4: _count = 4; _nextstate = state_value_binary_length; _state = state_name; break; case Serializer::TypeInt8: _count = 1; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeInt16: _count = 2; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeInt32: _count = 4; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeInt64: _count = 8; _nextstate = state_value_intsign; _state = state_name; break; case Serializer::TypeUInt8: _count = 1; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeUInt16: _count = 2; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeUInt32: _count = 4; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeUInt64: _count = 8; _nextstate = state_value_uint; _state = state_name; break; case Serializer::TypeShortFloat: _nextstate = state_sfloat_exp; _count = 1; _state = state_name; break; case Serializer::TypeMediumFloat: _nextstate = state_mfloat_exp; _count = 1; _state = state_name; break; case Serializer::TypeLongFloat: _nextstate = state_lfloat_exp; _count = 2; _state = state_name; break; case Serializer::TypeBcdFloat: _nextstate = state_value_bcd0; _state = state_name; break; case Serializer::TypeArray: case Serializer::TypeVector: case Serializer::TypeList: case Serializer::TypeDeque: case Serializer::TypeSet: case Serializer::TypeMultiset: _state = state_name; _nextstate = state_array_member; if (_deserializer) _deserializer->setCategory(SerializationInfo::Array); break; case Serializer::TypePair: case Serializer::TypeMap: case Serializer::TypeMultimap: _nextstate = state_object_member; _state = state_name; if (_deserializer) _deserializer->setCategory(SerializationInfo::Object); break; case Serializer::TypePlainEmpty: if (_deserializer) _deserializer->setNull(); _state = state_end; break; case Serializer::TypePlainChar: case Serializer::TypePlainString: case Serializer::TypePlainInt: _state = state_value_value; break; case Serializer::TypePlainBool: _state = state_value_bool; break; case Serializer::TypePlainBcdFloat: _state = state_value_bcd0; break; case Serializer::TypePlainBinary2: _count = 2; _state = state_value_binary_length; break; case Serializer::TypePlainBinary4: _count = 4; _state = state_value_binary_length; break; case Serializer::TypePlainInt8: _count = 1; _state = state_value_intsign; break; case Serializer::TypePlainInt16: _count = 2; _state = state_value_intsign; break; case Serializer::TypePlainInt32: _count = 4; _state = state_value_intsign; break; case Serializer::TypePlainInt64: _count = 8; _state = state_value_intsign; break; case Serializer::TypePlainUInt8: _count = 1; _state = state_value_uint; break; case Serializer::TypePlainUInt16: _count = 2; _state = state_value_uint; break; case Serializer::TypePlainUInt32: _count = 4; _state = state_value_uint; break; case Serializer::TypePlainUInt64: _count = 8; _state = state_value_uint; break; case Serializer::TypePlainShortFloat: _state = state_sfloat_exp; _count = 1; break; case Serializer::TypePlainMediumFloat: _state = state_mfloat_exp; _count = 1; break; case Serializer::TypePlainLongFloat: _state = state_lfloat_exp; _count = 2; break; case Serializer::TypePlainArray: case Serializer::TypePlainVector: case Serializer::TypePlainList: case Serializer::TypePlainDeque: case Serializer::TypePlainSet: case Serializer::TypePlainMultiset: _state = state_array_type; if (_deserializer) _deserializer->setCategory(SerializationInfo::Array); break; case Serializer::TypePlainPair: case Serializer::TypePlainMap: case Serializer::TypePlainMultimap: _state = state_object_type; if (_deserializer) _deserializer->setCategory(SerializationInfo::Object); break; default: { std::ostringstream msg; msg << "invalid type code <h" << std::hex << tc << '>'; SerializationError::doThrow(msg.str()); } } } } break; case state_name: if (ch == '\0') { log_debug("name=" << _token); if (_deserializer) _deserializer->setName(_token); _token.clear(); _state = _nextstate; } else _token += ch; break; case state_value_type_other: if (ch == '\0') { log_debug("typename=" << _token); if (_deserializer) _deserializer->setTypeName(_token); _token.clear(); _state = _nextstate; _nextstate = state_value_value; } else _token += ch; break; case state_value_intsign: if (static_cast<signed char>(ch) < 0) _int = static_cast<uint64_t>(-1); // set all bits else _int = 0; _state = state_value_int; // no break case state_value_int: case state_value_uint: _int = (_int << 8) | static_cast<unsigned char>(ch); if (--_count == 0) { if (_deserializer) { if (_state == state_value_int) { DeserializerBase::int_type value = DeserializerBase::int_type(_int); _deserializer->setValue(value); } else { DeserializerBase::unsigned_type value = DeserializerBase::unsigned_type(_int); _deserializer->setValue(value); } } _int = 0; return true; } break; case state_value_bool: if (_deserializer) _deserializer->setValue(ch != '\0'); return true; case state_value_bcd0: if (ch == '\xf0') { if (_deserializer) _deserializer->setValue("nan"); _state = state_end; break; } else if (ch == '\xf1') { if (_deserializer) _deserializer->setValue("inf"); _state = state_end; break; } else if (ch == '\xf2') { if (_deserializer) _deserializer->setValue("-inf"); _state = state_end; break; } _state = state_value_bcd; // no break case state_value_bcd: if (ch == '\xff') { if (_deserializer) _deserializer->setValue(_token); _token.clear(); return true; } else { _token += bcdDigits[static_cast<uint8_t>(ch) >> 4]; if ((ch & '\xf') == '\xd') { if (_deserializer) _deserializer->setValue(_token); _token.clear(); _state = state_end; } else { _token += bcdDigits[static_cast<uint8_t>(ch) & '\xf']; } } break; case state_value_binary_length: _int = (_int << 8) | static_cast<unsigned char>(ch); if (--_count == 0) { _count = static_cast<unsigned>(_int); _int = 0; if (_count == 0) { if (_deserializer) _deserializer->setValue(std::string()); _state = state_end; } else { _state = state_value_binary; } } break; case state_value_binary: if (_deserializer) _token += ch; if (--_count == 0) { if (_deserializer) _deserializer->setValue(_token); return true; } break; case state_value_value: if (ch == '\0') { if (_deserializer) _deserializer->setValue(_token); _token.clear(); _state = state_end; } else _token += ch; break; case state_sfloat_exp: _isNeg = (ch & '\x80') != 0; _exp = ch & '\x7f'; _state = state_sfloat_base; _count = 2; break; case state_mfloat_exp: _isNeg = (ch & '\x80') != 0; _exp = ch & '\x7f'; _state = state_mfloat_base; _count = 4; break; case state_lfloat_exp: if (--_count == 1) { _isNeg = (ch & '\x80') != 0; _exp = ch & '\x7f'; } else { _exp = (_exp << 8) | static_cast<unsigned char>(ch); _count = 8; _state = state_lfloat_base; } break; case state_sfloat_base: return processFloatBase(ch, 48, 63); case state_mfloat_base: return processFloatBase(ch, 32, 63); case state_lfloat_base: return processFloatBase(ch, 0, 16383); case state_object_type: if (static_cast<Serializer::TypeCode>(ch) == Serializer::TypePlainOther || static_cast<Serializer::TypeCode>(ch) == Serializer::TypeOther) _state = state_object_type_other; else { if (_deserializer) _deserializer->setTypeName(typeName(ch)); _state = state_object_member; } break; case state_object_type_other: if (ch == '\0') { if (_deserializer) _deserializer->setTypeName(_token); _token.clear(); _state = state_object_member; } else _token += ch; break; case state_object_member: if (ch == '\xff') return true; if (ch != '\1') SerializationError::doThrow("member expected"); if (_next == 0) _next = new ValueParser(); if (_deserializer) { _deserializer->beginMember(_token, "", SerializationInfo::Void); _next->begin(*_deserializer); } else _next->beginSkip(); _state = state_object_member_value; break; case state_object_member_value: if (_next->advance(ch)) { if (_deserializer) _deserializer->leaveMember(); _state = state_object_member; } break; case state_array_type: if (ch == '\xff') _state = state_array_type_other; else { if (_deserializer) _deserializer->setTypeName(typeName(ch)); _state = state_array_member; } break; case state_array_type_other: if (ch == '\0') { if (_deserializer) _deserializer->setTypeName(_token); _token.clear(); _state = state_array_member; } else _token += ch; break; case state_array_member: if (ch == '\xff') return true; if (_next == 0) _next = new ValueParser(); if (_deserializer) { _deserializer->beginMember("", "", SerializationInfo::Void); _next->begin(*_deserializer); } else { _next->beginSkip(); } _next->advance(ch); _state = state_array_member_value; break; case state_array_member_value: if (_next->advance(ch)) { if (_deserializer) _deserializer->leaveMember(); _state = state_array_member_value_next; } break; case state_array_member_value_next: if (ch == '\xff') { return true; } else { if (_deserializer) { _deserializer->beginMember("", "", SerializationInfo::Void); _next->begin(*_deserializer); } else { _next->beginSkip(); } _next->advance(ch); _state = state_array_member_value; } break; case state_end: if (ch != '\xff') SerializationError::doThrow("end of value marker expected"); log_debug("end of value"); return true; } return false; } bool ValueParser::processFloatBase(char ch, unsigned shift, unsigned expOffset) { _int = (_int << 8) | static_cast<unsigned char>(ch); if (--_count == 0) { _int <<= shift; long double v; if (expOffset == 63 && _exp == 0x7f) { log_debug("float: value is special"); v = (_int == 0 ? _isNeg ? -std::numeric_limits<long double>::infinity() : std::numeric_limits<long double>::infinity() : std::numeric_limits<long double>::quiet_NaN()); } else if (_exp == 0 && _int == 0) { log_debug("float: value is zero"); v = 0.0; } else { long double ss = static_cast<long double>(_int) / (static_cast<long double>(std::numeric_limits<uint64_t>::max()) + 1.0l) / 2.0l + .5l; v = ldexp(ss, _exp - expOffset); if (_isNeg) v = -v; log_debug("float: s=" << ss << " man=" << std::hex << _int << std::dec << " exp=" << _exp << " isNeg=" << _isNeg << " value=" << v); } if (_deserializer) _deserializer->setValue(v); _int = 0; return true; } return false; } } } �����������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/worker.h���������������������������������������������������������������������0000664�0001750�0001750�00000003445�12256773774�013375� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_WORKER_H #define CXXTOOLS_BIN_WORKER_H #include <cxxtools/thread.h> namespace cxxtools { namespace bin { class RpcServerImpl; class Worker : public AttachedThread { public: explicit Worker(RpcServerImpl& server) : AttachedThread(callable(*this, &Worker::run)), _server(server) { } private: void run(); RpcServerImpl& _server; }; } } #endif // CXXTOOLS_BIN_WORKER_H ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/scanner.h��������������������������������������������������������������������0000664�0001750�0001750�00000004640�12256773774�013513� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_SCANNER_H #define CXXTOOLS_BIN_SCANNER_H #include <cxxtools/composer.h> #include <cxxtools/bin/valueparser.h> #include <string> namespace cxxtools { namespace bin { class Scanner { public: Scanner() : _state(state_0), _failed(false) { } void begin(DeserializerBase& handler, IComposer& composer); bool advance(char ch); void checkException(); private: enum { state_0, state_value, state_errorcode, state_errormessage, state_end } _state; ValueParser _vp; DeserializerBase* _deserializer; IComposer* _composer; unsigned short _count; bool _failed; int _errorCode; std::string _errorMessage; }; } } #endif // CXXTOOLS_BIN_SCANNER_H ������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/rpcclientimpl.cpp������������������������������������������������������������0000664�0001750�0001750�00000017351�12266277345�015257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcclientimpl.h" #include <cxxtools/log.h> #include <cxxtools/remoteprocedure.h> #include <cxxtools/bin/rpcclient.h> #include <cxxtools/selector.h> #include <cxxtools/clock.h> #include <stdexcept> log_define("cxxtools.bin.rpcclient.impl") namespace cxxtools { namespace bin { RpcClientImpl::RpcClientImpl(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& domain) : _proc(0), _stream(_socket, 8192, true), _formatter(_stream), _exceptionPending(false), _domain(domain) { setSelector(selector); connect(addr, port, domain); cxxtools::connect(_socket.connected, *this, &RpcClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &RpcClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &RpcClientImpl::onInput); } RpcClientImpl::RpcClientImpl(const std::string& addr, unsigned short port, const std::string& domain) : _proc(0), _stream(_socket, 8192, true), _formatter(_stream), _exceptionPending(false), _domain(domain) { connect(addr, port, domain); cxxtools::connect(_socket.connected, *this, &RpcClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &RpcClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &RpcClientImpl::onInput); } RpcClientImpl::~RpcClientImpl() { } void RpcClientImpl::connect(const std::string& addr, unsigned short port, const std::string& domain) { if (_addr != addr || _port != port) { _socket.close(); _addr = addr; _port = port; } _domain = domain; } void RpcClientImpl::close() { _socket.close(); } void RpcClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_socket.selector() == 0) throw std::logic_error("cannot run async rpc request without a selector"); if (_proc) throw std::logic_error("asyncronous request already running"); _proc = &method; prepareRequest(method.name(), argv, argc); if (_socket.isConnected()) { try { _stream.buffer().beginWrite(); } catch (const IOError&) { log_debug("write failed, connection is not active any more"); _socket.beginConnect(_addr, _port); } } else { log_debug("not yet connected - do it now"); _socket.beginConnect(_addr, _port); } _scanner.begin(_deserializer, r); } void RpcClientImpl::endCall() { _proc = 0; if (_exceptionPending) { _exceptionPending = false; throw; } } void RpcClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _proc = &method; prepareRequest(_proc->name(), argv, argc); if (!_socket.isConnected()) _socket.connect(_addr, _port); try { _stream.flush(); _scanner.begin(_deserializer, r); char ch; while (_stream.get(ch)) { if (_scanner.advance(ch)) { _proc = 0; _scanner.checkException(); break; } } } catch (const RemoteException&) { throw; } catch (const std::exception& e) { cancel(); throw; } _proc = 0; if (!_stream) { cancel(); throw std::runtime_error("reading result failed"); } } void RpcClientImpl::wait(std::size_t msecs) { if (!_socket.selector()) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (msecs != RemoteClient::WaitInfinite) clock.start(); std::size_t remaining = msecs; while (activeProcedure() != 0) { if (_socket.selector()->wait(remaining) == false) throw IOTimeout(); if (msecs != RemoteClient::WaitInfinite) { std::size_t diff = static_cast<std::size_t>(clock.stop().totalMSecs()); remaining = diff >= msecs ? 0 : msecs - diff; } } } void RpcClientImpl::cancel() { _socket.close(); _stream.clear(); _stream.buffer().discard(); _proc = 0; } void RpcClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { if (_domain.empty()) _stream << '\xc0' << name << '\0'; else _stream << '\xc3' << _domain << '\0' << name << '\0'; for(unsigned n = 0; n < argc; ++n) { argv[n]->format(_formatter); } _stream << '\xff'; } void RpcClientImpl::onConnect(net::TcpSocket& socket) { try { log_trace("onConnect"); _exceptionPending = false; socket.endConnect(); _stream.buffer().beginWrite(); } catch (const std::exception& ) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onOutput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endWrite(); if (sb.out_avail() > 0) sb.beginWrite(); else sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } void RpcClientImpl::onInput(StreamBuffer& sb) { try { _exceptionPending = false; sb.endRead(); if (sb.device()->eof()) throw IOError("end of input"); char ch; while (_stream.buffer().in_avail() && _stream.get(ch)) { if (_scanner.advance(ch)) { _scanner.checkException(); IRemoteProcedure* proc = _proc; _proc = 0; proc->onFinished(); return; } } if (!_stream) { close(); throw std::runtime_error("reading result failed"); } sb.beginRead(); } catch (const std::exception&) { IRemoteProcedure* proc = _proc; cancel(); if (!proc) throw; _exceptionPending = true; proc->onFinished(); if (_exceptionPending) throw; } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/Makefile.am������������������������������������������������������������������0000664�0001750�0001750�00000001116�12256773774�013740� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-bin.la noinst_HEADERS = \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_bin_la_SOURCES = \ deserializer.cpp \ formatter.cpp \ responder.cpp \ socket.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ valueparser.cpp \ worker.cpp libcxxtools_bin_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_bin_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/socket.h���������������������������������������������������������������������0000664�0001750�0001750�00000005117�12256773774�013352� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_SOCKET_H #define CXXTOOLS_BIN_SOCKET_H #include <cxxtools/net/tcpsocket.h> #include <cxxtools/iostream.h> #include <cxxtools/timer.h> #include <cxxtools/connectable.h> #include <cxxtools/signal.h> #include <cxxtools/method.h> #include "responder.h" namespace cxxtools { namespace bin { class RpcServerImpl; class Socket : public net::TcpSocket, public Connectable { public: Socket(RpcServerImpl& server, ServiceRegistry& _serviceRegistry, net::TcpServer& tcpServer); explicit Socket(Socket& socket); void accept(); bool hasAccepted() const { return _accepted; } void setSelector(SelectorBase* s); void removeSelector(); void onIODeviceInput(IODevice& iodevice); void onInput(StreamBuffer& sb); bool onOutput(StreamBuffer& sb); Signal<Socket&> inputReady; StreamBuffer& buffer() { return _stream.buffer(); } MethodSlot<void, Socket, StreamBuffer&> inputSlot; Connection inputConnection; Connection timeoutConnection; private: net::TcpServer& _tcpServer; RpcServerImpl& _server; Responder _responder; IOStream _stream; bool _accepted; }; } } #endif // CXXTOOLS_BIN_SOCKET_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/rpcclientimpl.h��������������������������������������������������������������0000664�0001750�0001750�00000006616�12266277345�014726� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_CLIENTIMPL_H #define CXXTOOLS_BIN_CLIENTIMPL_H #include <cxxtools/remoteclient.h> #include <cxxtools/bin/formatter.h> #include <cxxtools/net/tcpsocket.h> #include <cxxtools/iostream.h> #include <cxxtools/string.h> #include <cxxtools/connectable.h> #include <cxxtools/deserializerbase.h> #include <string> #include "scanner.h" namespace cxxtools { class SelectorBase; namespace bin { class RpcClient; class RpcClientImpl : public Connectable { RpcClientImpl(RpcClientImpl&) { } void operator= (const RpcClientImpl&) { } public: RpcClientImpl(const std::string& addr, unsigned short port, const std::string& domain); RpcClientImpl(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& domain); ~RpcClientImpl(); void setSelector(SelectorBase& selector) { selector.add(_socket); } void connect(const std::string& addr, unsigned short port, const std::string& domain); void close(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); const IRemoteProcedure* activeProcedure() const { return _proc; } void wait(std::size_t msecs); void cancel(); const std::string& domain() const { return _domain; } void domain(const std::string& p) { _domain = p; } private: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void onConnect(net::TcpSocket& socket); void onOutput(StreamBuffer& sb); void onInput(StreamBuffer& sb); IRemoteProcedure* _proc; net::TcpSocket _socket; IOStream _stream; Scanner _scanner; DeserializerBase _deserializer; Formatter _formatter; bool _exceptionPending; std::string _addr; unsigned short _port; std::string _domain; }; } } #endif // CXXTOOLS_BIN_CLIENTIMPL_H ������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/rpcserver.cpp����������������������������������������������������������������0000664�0001750�0001750�00000006170�12256773774�014430� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/bin/rpcserver.h> #include "rpcserverimpl.h" namespace cxxtools { namespace bin { RpcServer::RpcServer(EventLoopBase& eventLoop) : _impl(new RpcServerImpl(eventLoop, runmodeChanged, *this)) { } RpcServer::RpcServer(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, int backlog) : _impl(new RpcServerImpl(eventLoop, runmodeChanged, *this)) { listen(ip, port, backlog); } RpcServer::RpcServer(EventLoopBase& eventLoop, unsigned short int port, int backlog) : _impl(new RpcServerImpl(eventLoop, runmodeChanged, *this)) { listen(port, backlog); } RpcServer::~RpcServer() { delete _impl; } void RpcServer::addService(const ServiceRegistry& service) { std::vector<std::string> procs = service.getProcedureNames(); for (std::vector<std::string>::const_iterator it = procs.begin(); it != procs.end(); ++it) { registerProcedure(*it, service.getProcedure(*it)); } } void RpcServer::addService(const std::string& domain, const ServiceRegistry& service) { std::vector<std::string> procs = service.getProcedureNames(); for (std::vector<std::string>::const_iterator it = procs.begin(); it != procs.end(); ++it) { registerProcedure(domain + '\0' + *it, service.getProcedure(*it)); } } void RpcServer::listen(const std::string& ip, unsigned short int port, int backlog) { _impl->listen(ip, port, backlog); } void RpcServer::listen(unsigned short int port, int backlog) { _impl->listen(std::string(), port, backlog); } unsigned RpcServer::minThreads() const { return _impl->minThreads(); } void RpcServer::minThreads(unsigned m) { _impl->minThreads(m); } unsigned RpcServer::maxThreads() const { return _impl->maxThreads(); } void RpcServer::maxThreads(unsigned m) { _impl->maxThreads(m); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/socket.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000007136�12256773774�013710� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "socket.h" #include "rpcserverimpl.h" #include <cxxtools/log.h> log_define("cxxtools.bin.socket") namespace cxxtools { namespace bin { Socket::Socket(RpcServerImpl& server, ServiceRegistry& serviceRegistry, net::TcpServer& tcpServer) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(tcpServer), _server(server), _responder(serviceRegistry), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); } Socket::Socket(Socket& socket) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(socket._tcpServer), _server(socket._server), _responder(socket._responder._serviceRegistry), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); } void Socket::accept() { net::TcpSocket::accept(_tcpServer, net::TcpSocket::DEFER_ACCEPT); _accepted = true; _stream.buffer().beginRead(); } void Socket::setSelector(SelectorBase* s) { s->add(*this); } void Socket::removeSelector() { TcpSocket::setSelector(0); } void Socket::onIODeviceInput(IODevice& iodevice) { log_debug("onIODeviceInput"); inputReady(*this); } void Socket::onInput(StreamBuffer& sb) { log_debug("onInput"); sb.endRead(); if (sb.in_avail() == 0 || sb.device()->eof()) { close(); return; } if (_responder.onInput(_stream)) { sb.beginWrite(); onOutput(sb); } else { sb.beginRead(); } } bool Socket::onOutput(StreamBuffer& sb) { log_trace("onOutput"); log_debug("send data to " << getPeerAddr()); try { sb.endWrite(); if ( sb.out_avail() ) { sb.beginWrite(); } else { if (sb.in_avail()) onInput(sb); else sb.beginRead(); } } catch (const std::exception& e) { log_warn("exception occured when processing request: " << e.what()); close(); return false; } return true; } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/Makefile.in������������������������������������������������������������������0000664�0001750�0001750�00000047714�12266277545�013763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/bin DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_bin_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_libcxxtools_bin_la_OBJECTS = deserializer.lo formatter.lo \ responder.lo socket.lo rpcclient.lo rpcclientimpl.lo \ rpcserver.lo rpcserverimpl.lo scanner.lo valueparser.lo \ worker.lo libcxxtools_bin_la_OBJECTS = $(am_libcxxtools_bin_la_OBJECTS) libcxxtools_bin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libcxxtools_bin_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcxxtools_bin_la_SOURCES) DIST_SOURCES = $(libcxxtools_bin_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-bin.la noinst_HEADERS = \ responder.h \ rpcclientimpl.h \ rpcserverimpl.h \ scanner.h \ socket.h \ worker.h libcxxtools_bin_la_SOURCES = \ deserializer.cpp \ formatter.cpp \ responder.cpp \ socket.cpp \ rpcclient.cpp \ rpcclientimpl.cpp \ rpcserver.cpp \ rpcserverimpl.cpp \ scanner.cpp \ valueparser.cpp \ worker.cpp libcxxtools_bin_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_bin_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/bin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-bin.la: $(libcxxtools_bin_la_OBJECTS) $(libcxxtools_bin_la_DEPENDENCIES) $(EXTRA_libcxxtools_bin_la_DEPENDENCIES) $(libcxxtools_bin_la_LINK) -rpath $(libdir) $(libcxxtools_bin_la_OBJECTS) $(libcxxtools_bin_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcclientimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserverimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/valueparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������cxxtools-2.2.1/src/bin/rpcclient.cpp����������������������������������������������������������������0000664�0001750�0001750�00000005733�12266277345�014376� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/bin/rpcclient.h> #include "rpcclientimpl.h" namespace cxxtools { namespace bin { RpcClient::RpcClient(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& domain) : _impl(new RpcClientImpl(selector, addr, port, domain)) { } RpcClient::RpcClient(const std::string& addr, unsigned short port, const std::string& domain) : _impl(new RpcClientImpl(addr, port, domain)) { } RpcClient::~RpcClient() { delete _impl; } void RpcClient::setSelector(SelectorBase& selector) { if (!_impl) _impl = new RpcClientImpl(std::string(), 0, std::string()); _impl->setSelector(selector); } void RpcClient::connect(const std::string& addr, unsigned short port, const std::string& domain) { if (!_impl) _impl = new RpcClientImpl(addr, port, domain); else _impl->connect(addr, port, domain); } void RpcClient::close() { if (_impl) _impl->close(); } void RpcClient::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void RpcClient::endCall() { _impl->endCall(); } void RpcClient::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } const IRemoteProcedure* RpcClient::activeProcedure() const { return _impl->activeProcedure(); } void RpcClient::wait(std::size_t msecs) { _impl->wait(msecs); } void RpcClient::cancel() { _impl->cancel(); } const std::string& RpcClient::domain() const { return _impl->domain(); } void RpcClient::domain(const std::string& p) { _impl->domain(p); } } } �������������������������������������cxxtools-2.2.1/src/bin/deserializer.cpp�������������������������������������������������������������0000664�0001750�0001750�00000003365�12256773774�015102� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/bin/deserializer.h> #include <cxxtools/bin/valueparser.h> #include <cxxtools/serializationerror.h> namespace cxxtools { namespace bin { void Deserializer::doDeserialize() { ValueParser vp; vp.begin(*this); char ch; while (_in.get(ch) && !vp.advance(ch)) ; if (_in.rdstate() & std::ios::badbit) SerializationError::doThrow("binary deserialization failed"); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/rpcserverimpl.h��������������������������������������������������������������0000664�0001750�0001750�00000011230�12256773774�014750� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RPCSERVERIMPL_H #define CXXTOOLS_BIN_RPCSERVERIMPL_H #include <map> #include <set> #include <vector> #include <cxxtools/noncopyable.h> #include <cxxtools/event.h> #include <cxxtools/mutex.h> #include <cxxtools/condition.h> #include <cxxtools/queue.h> #include <cxxtools/signal.h> #include <cxxtools/connectable.h> #include <cxxtools/bin/rpcserver.h> namespace cxxtools { class EventLoopBase; class ServiceProcedure; namespace net { class TcpServer; } namespace bin { class RpcServerImpl; class Worker; class Socket; class IdleSocketEvent; class ServerStartEvent; class NoWaitingThreadsEvent; class ThreadTerminatedEvent; class ActiveSocketEvent; class RpcServerImpl : private NonCopyable, public Connectable { public: RpcServerImpl(EventLoopBase& eventLoop, Signal<RpcServer::Runmode>& runmodeChanged, ServiceRegistry& serviceRegistry); ~RpcServerImpl(); void listen(const std::string& ip, unsigned short int port, int backlog); unsigned minThreads() const { return _minThreads; } void minThreads(unsigned m) { _minThreads = m; } unsigned maxThreads() const { return _maxThreads; } void maxThreads(unsigned m) { _maxThreads = m; } void terminate(); RpcServer::Runmode runmode() const { return _runmode; } private: void runmode(RpcServer::Runmode runmode) { _runmode = runmode; _runmodeChanged(runmode); } RpcServer::Runmode _runmode; Signal<RpcServer::Runmode>& _runmodeChanged; EventLoopBase& _eventLoop; void noWaitingThreads(); void onInput(Socket& _socket); void addIdleSocket(Socket* socket); void onIdleSocket(const IdleSocketEvent& event); void onActiveSocket(const ActiveSocketEvent& event); void onNoWaitingThreads(const NoWaitingThreadsEvent& event); void onThreadTerminated(const ThreadTerminatedEvent& event); void onServerStart(const ServerStartEvent& event); void start(); friend class Worker; //////////////////////////////////////////////////// MethodSlot<void, RpcServerImpl, Socket&> inputSlot; ServiceRegistry& _serviceRegistry; unsigned _minThreads; unsigned _maxThreads; std::vector<net::TcpServer*> _listener; Queue<Socket*> _queue; typedef std::set<Socket*> IdleSocket; IdleSocket _idleSocket; Mutex _threadMutex; Condition _threadTerminated; typedef std::set<Worker*> Threads; Threads _threads; Threads _terminatedThreads; void threadTerminated(Worker* worker); bool isTerminating() const { return runmode() == RpcServer::Terminating; } }; } } #endif // CXXTOOLS_BIN_RPCSERVERIMPL_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/rpcserverimpl.cpp������������������������������������������������������������0000664�0001750�0001750�00000021345�12256773774�015313� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpcserverimpl.h" #include "socket.h" #include "worker.h" #include <cxxtools/eventloop.h> #include <cxxtools/net/tcpserver.h> #include <cxxtools/log.h> #include <signal.h> log_define("cxxtools.bin.rpcserver.impl") namespace cxxtools { namespace bin { // Sent from the worker thread when a socket is idle. // The server will take that socket to the event loop. class IdleSocketEvent : public BasicEvent<IdleSocketEvent> { Socket* _socket; public: explicit IdleSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; // Sent from the server when constructed, so that the server // knows, when the event loop is running. class ServerStartEvent : public BasicEvent<ServerStartEvent> { const RpcServerImpl* _server; public: explicit ServerStartEvent(const RpcServerImpl* server) : _server(server) { } const RpcServerImpl* server() const { return _server; } }; // Sent from a worker, when a job was fetched from the queue and // no further threads are left for subsequent jobs. class NoWaitingThreadsEvent : public BasicEvent<NoWaitingThreadsEvent> { }; // Sent from the worker, when he decidid to stop, because there are // enough idle threads waiting on the queue already. class ThreadTerminatedEvent : public BasicEvent<ThreadTerminatedEvent> { Worker* _worker; public: explicit ThreadTerminatedEvent(Worker* worker) : _worker(worker) { } Worker* worker() const { return _worker; } }; RpcServerImpl::RpcServerImpl(EventLoopBase& eventLoop, Signal<RpcServer::Runmode>& runmodeChanged, ServiceRegistry& serviceRegistry) : _runmode(RpcServer::Stopped), _runmodeChanged(runmodeChanged), _eventLoop(eventLoop), inputSlot(slot(*this, &RpcServerImpl::onInput)), _serviceRegistry(serviceRegistry), _minThreads(5), _maxThreads(200) { _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onIdleSocket)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onNoWaitingThreads)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onThreadTerminated)); _eventLoop.event.subscribe(slot(*this, &RpcServerImpl::onServerStart)); connect(_eventLoop.exited, *this, &RpcServerImpl::terminate); _eventLoop.commitEvent(ServerStartEvent(this)); } RpcServerImpl::~RpcServerImpl() { if (runmode() == RpcServer::Running) { try { terminate(); } catch (const std::exception& e) { log_fatal("failed to terminate rpc server: " << e.what()); } } } void RpcServerImpl::listen(const std::string& ip, unsigned short int port, int backlog) { log_info("listen on " << ip << " port " << port); net::TcpServer* listener = new net::TcpServer(ip, port, backlog, net::TcpServer::DEFER_ACCEPT); try { _listener.push_back(listener); _queue.put(new Socket(*this, _serviceRegistry, *listener)); } catch (...) { delete listener; throw; } } void RpcServerImpl::start() { log_trace("start server"); runmode(RpcServer::Starting); MutexLock lock(_threadMutex); while (_threads.size() < minThreads()) { Worker* worker = new Worker(*this); _threads.insert(worker); worker->start(); } runmode(RpcServer::Running); } void RpcServerImpl::terminate() { MutexLock lock(_threadMutex); runmode(RpcServer::Terminating); try { for (unsigned n = 0; n < _listener.size(); ++n) _listener[n]->terminateAccept(); _queue.put(0); while (!_threads.empty() || !_terminatedThreads.empty()) { if (!_threads.empty()) { _threadTerminated.wait(lock); } for (Threads::iterator it = _terminatedThreads.begin(); it != _terminatedThreads.end(); ++it) delete *it; _terminatedThreads.clear(); } for (unsigned n = 0; n < _listener.size(); ++n) delete _listener[n]; _listener.clear(); while (!_queue.empty()) delete _queue.get(); for (IdleSocket::iterator it = _idleSocket.begin(); it != _idleSocket.end(); ++it) delete *it; _idleSocket.clear(); runmode(RpcServer::Stopped); } catch (const std::exception& e) { runmode(RpcServer::Failed); } } void RpcServerImpl::noWaitingThreads() { if (runmode() == RpcServer::Running) _eventLoop.commitEvent(NoWaitingThreadsEvent()); } void RpcServerImpl::threadTerminated(Worker* worker) { MutexLock lock(_threadMutex); _threads.erase(worker); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(ThreadTerminatedEvent(worker)); } else { _terminatedThreads.insert(worker); _threadTerminated.signal(); } } void RpcServerImpl::addIdleSocket(Socket* socket) { log_debug("add idle socket " << static_cast<void*>(socket)); if (runmode() == RpcServer::Running) { _eventLoop.commitEvent(IdleSocketEvent(socket)); } else { log_debug("server not running; delete " << static_cast<void*>(socket)); delete socket; } } void RpcServerImpl::onIdleSocket(const IdleSocketEvent& event) { Socket* socket = event.socket(); log_debug("add idle socket " << static_cast<void*>(socket) << " to selector"); _idleSocket.insert(socket); socket->setSelector(&_eventLoop); socket->inputConnection = connect(socket->inputReady, inputSlot); } void RpcServerImpl::onNoWaitingThreads(const NoWaitingThreadsEvent& event) { MutexLock lock(_threadMutex); if (_threads.size() >= maxThreads()) { log_warn("thread limit " << maxThreads() << " reached"); return; } try { Worker* worker = new Worker(*this); try { log_debug("create thread " << static_cast<void*>(worker) << "; running threads=" << _threads.size()); worker->start(); _threads.insert(worker); log_debug(_threads.size() << " threads running"); } catch (const std::exception&) { delete worker; throw; } } catch (const std::exception& e) { log_warn("failed to create thread: " << e.what()); } } void RpcServerImpl::onThreadTerminated(const ThreadTerminatedEvent& event) { MutexLock lock(_threadMutex); log_debug("thread terminated (" << static_cast<void*>(event.worker()) << ") " << _threads.size() << " threads left"); try { event.worker()->join(); } catch (const std::exception& e) { log_error("failed to join thread: " << e.what()); } delete event.worker(); } void RpcServerImpl::onServerStart(const ServerStartEvent& event) { if (event.server() == this) { start(); } } void RpcServerImpl::onInput(Socket& socket) { socket.removeSelector(); log_debug("search socket " << static_cast<void*>(&socket) << " in idle socket"); _idleSocket.erase(&socket); if (socket.isConnected()) { socket.inputConnection.close(); _queue.put(&socket); } else { log_debug("onInput; delete " << static_cast<void*>(&socket)); log_info("client " << socket.getPeerAddr() << " closed connection"); delete &socket; } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/responder.h������������������������������������������������������������������0000664�0001750�0001750�00000005650�12256773774�014065� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_BIN_RESPONDER_H #define CXXTOOLS_BIN_RESPONDER_H #include <cxxtools/bin/valueparser.h> #include <cxxtools/deserializer.h> #include <cxxtools/decomposer.h> #include <cxxtools/iostream.h> #include <cxxtools/bin/formatter.h> #include <cxxtools/serviceregistry.h> namespace cxxtools { class ServiceProcedure; namespace bin { class RpcServerImpl; class Socket; class Responder { friend class Socket; enum State { state_0, state_domain, state_method, state_params, state_params_skip, state_param, state_param_skip }; public: explicit Responder(ServiceRegistry& serviceRegistry) : _serviceRegistry(serviceRegistry), _state(state_0), _proc(0), _args(0), _result(0), _failed(false) { } ~Responder(); // returns true, if request is ready and reply is put to the socket bool onInput(IOStream& ios); bool advance(char ch); void reply(IOStream& out); void replyError(IOStream& out, const char* msg, int rc); private: ServiceRegistry& _serviceRegistry; State _state; std::string _domain; std::string _methodName; ValueParser _valueParser; DeserializerBase _deserializer; ServiceProcedure* _proc; IComposer** _args; IDecomposer* _result; Formatter _formatter; bool _failed; std::string _errorMessage; }; } } #endif // CXXTOOLS_BIN_RESPONDER_H ����������������������������������������������������������������������������������������cxxtools-2.2.1/src/bin/scanner.cpp������������������������������������������������������������������0000664�0001750�0001750�00000006356�12256773774�014054� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "scanner.h" #include <cxxtools/log.h> #include <cxxtools/remoteexception.h> #include <cxxtools/deserializerbase.h> log_define("cxxtools.bin.scanner") namespace cxxtools { namespace bin { void Scanner::begin(DeserializerBase& handler, IComposer& composer) { _vp.begin(handler); _deserializer = &handler; _composer = &composer; _deserializer->begin(); _state = state_0; _failed = false; _errorCode = 0; _errorMessage.clear(); } bool Scanner::advance(char ch) { switch (_state) { case state_0: if (ch == '\xc1') { _failed = false; _state = state_value; } else if (ch == '\xc2') { _failed = true; _state = state_errorcode; _count = 4; } else throw std::runtime_error("response expected"); break; case state_value: if (_vp.advance(ch)) { _composer->fixup(*_deserializer->si()); _deserializer->si()->clear(); _state = state_end; } break; case state_errorcode: _errorCode = (_errorCode << 8) | ch; if (--_count == 0) _state = state_errormessage; break; case state_errormessage: if (ch == '\0') _state = state_end; else _errorMessage += ch; break; case state_end: if (ch == '\xff') { log_debug("reply finished"); return true; } else throw std::runtime_error("end of response marker expected"); break; } return false; } void Scanner::checkException() { if (_failed) throw RemoteException(_errorMessage, _errorCode); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/fdstream.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000010070�12256773774�013444� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/fdstream.h> #include <cxxtools/systemerror.h> #include <cxxtools/log.h> #include <algorithm> #include <unistd.h> #include <errno.h> log_define("cxxtools.fdstream") namespace cxxtools { Fdstreambuf::Fdstreambuf(int fd_, unsigned bufsize_, bool doClose_) : fd(fd_), doClose(doClose_), bufsize(bufsize_), buffer(0) { } Fdstreambuf::~Fdstreambuf() { delete [] buffer; if (doClose) ::close(fd); } void Fdstreambuf::close() { ::close(fd); doClose = false; } std::streambuf::int_type Fdstreambuf::overflow(std::streambuf::int_type ch) { log_debug("overflow(" << ch << ')'); setg(0, 0, 0); if (pptr() > buffer) { log_debug("write " << (pptr() - buffer) << " bytes to fd " << fd); ssize_t ret; do { ret = ::write(fd, buffer, pptr() - buffer); } while (ret == -1 && errno == EINTR); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes written to fd " << fd); ssize_t rest = pptr() - buffer - ret; std::copy(buffer + ret, buffer + ret + rest, buffer); setp(buffer + rest, buffer + bufsize); } else { log_debug("initialize outputbuffer"); if (buffer == 0) { log_debug("allocate " << bufsize << " bytes output buffer"); buffer = new char[bufsize]; } setp(buffer, buffer + bufsize); } if (ch != traits_type::eof()) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type Fdstreambuf::underflow() { if (sync() != 0) return traits_type::eof(); if (buffer == 0) { log_debug("allocate " << bufsize << " bytes input buffer"); buffer = new char[bufsize]; } log_debug("read from fd " << fd); ssize_t ret; do { ret = ::read(fd, buffer, bufsize); } while (ret == -1 && errno == EINTR); if(ret < 0) throw SystemError(errno, "read"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes read"); setg(buffer, buffer, buffer + ret); return traits_type::to_int_type(*gptr()); } int Fdstreambuf::sync() { log_debug("sync()"); if (pptr() != pbase()) { char* p = pbase(); while (p < pptr()) { log_debug("write " << (pptr() - p) << " bytes to fd " << fd); ssize_t ret = ::write(fd, p, pptr() - p); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes written to fd " << fd); p += ret; } } setp(0, 0); setg(0, 0, 0); return 0; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/csvparser.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000027616�12256773774�013665� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/csvparser.h> #include <cxxtools/deserializerbase.h> #include <cxxtools/serializationerror.h> #include <cxxtools/log.h> #include <stdexcept> log_define("cxxtools.csv.parser") namespace cxxtools { namespace { const unsigned unknownNoColumns = std::numeric_limits<unsigned>::max(); void checkNoColumns(unsigned column, unsigned& noColumns, unsigned lineNo) { if (noColumns == unknownNoColumns) { column = noColumns; } else if (column + 1 != noColumns) { std::ostringstream msg; msg << "number of columns " << (column + 1) << " in line " << lineNo << " does not match expected number of columns " << noColumns; SerializationError::doThrow(msg.str()); } } } const Char CsvParser::autoDelimiter = L'\0'; void CsvParser::begin(DeserializerBase& handler) { if (_delimiter == autoDelimiter && !_readTitle) throw std::logic_error("can't read csv data with auto delimiter but without title"); _state = (_readTitle ? _delimiter == autoDelimiter ? state_detectDelim : state_title : state_rowstart); _deserializer = &handler; _titles.clear(); _titles.push_back(std::string()); _noColumns = unknownNoColumns; _lineNo = 0; } void CsvParser::advance(Char ch) { if (ch == L'\n') ++_lineNo; switch (_state) { case state_detectDelim: if (isalnum(ch) || ch == L'_' || ch == L' ') { _titles.back() += ch.narrow(); } else if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _noColumns = 1; _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == L'\'' || ch == L'"') { _quote = ch; _state = state_detectDelim_q; } else { _delimiter = ch; log_debug("delimiter=" << _delimiter.narrow()); log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); _state = state_title; } break; case state_detectDelim_q: if (ch == _quote) { _state = state_detectDelim_postq; } else { _titles.back() += ch.narrow(); } break; case state_detectDelim_postq: if (isalnum(ch) || ch == L'_' || ch == L'\'' || ch == L'"' || ch == L' ') { std::ostringstream msg; msg << "invalid character '" << ch.narrow() << "' within csv title of column " << _titles.size(); SerializationError::doThrow(msg.str()); } else if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _noColumns = 1; _state = (ch == L'\r' ? state_cr : state_rowstart); } else { _delimiter = ch; log_debug("delimiter=" << _delimiter.narrow()); log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); _state = state_title; } break; case state_title: if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _state = (ch == L'\r' ? state_cr : state_rowstart); _noColumns = _titles.size(); } else if (ch == _delimiter) { log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); } else if (ch == L'\'' || ch == L'\"') { if (_titles.back().empty()) { _quote = ch; _state = state_qtitle; } else { std::ostringstream msg; msg << "unexpected quote character within csv title of column " << _titles.size(); SerializationError::doThrow(msg.str()); } } else { _titles.back() += ch.narrow(); } break; case state_qtitle: if (ch == _quote) { _state = state_qtitlep; } else { _titles.back() += ch.narrow(); } break; case state_qtitlep: if (ch == L'\n' || ch == L'\r') { log_debug("title=\"" << _titles.back() << '"'); _state = (ch == L'\r' ? state_cr : state_rowstart); _noColumns = _titles.size(); } else if (ch == _delimiter) { log_debug("title=\"" << _titles.back() << '"'); _titles.push_back(std::string()); _state = state_title; } else { std::ostringstream msg; msg << "invalid character '" << ch.narrow() << "' within csv title of column " << _titles.size(); SerializationError::doThrow(msg.str()); } break; case state_cr: _state = state_rowstart; if (ch == L'\n') { break; } // fallthrough case state_rowstart: _column = 0; log_debug("new row"); _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Array); _state = state_datastart; // no break case state_datastart: log_debug("member \"" << (_column < _titles.size() ? _titles[_column] : std::string()) << '"'); _deserializer->beginMember( _column < _titles.size() ? _titles[_column] : std::string(), std::string(), SerializationInfo::Value); if (ch == L'\n' || ch == L'\r') { _deserializer->leaveMember(); checkNoColumns(_column, _noColumns, _lineNo); _deserializer->leaveMember(); _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == L'"' || ch == L'\'') { _quote = ch; _state = state_qdata; } else if (ch == _delimiter) { ++_column; _deserializer->leaveMember(); } else { _value += ch; _state = state_data; } break; case state_data0: if (ch == L'"' || ch == L'\'') { _quote = ch; _state = state_qdata; break; } case state_data: if (ch == L'\n' || ch == L'\r') { log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); checkNoColumns(_column, _noColumns, _lineNo); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == _delimiter) { log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); _deserializer->leaveMember(); // leave data item ++_column; log_debug("member \"" << (_column < _titles.size() ? _titles[_column] : std::string()) << '"'); _deserializer->beginMember( _column < _titles.size() ? _titles[_column] : std::string(), std::string(), SerializationInfo::Value); _state = state_data0; } else { _value += ch; } break; case state_qdata: if (ch == _quote) { log_debug("value \"" << _value << '"'); _deserializer->setValue(_value); _value.clear(); _deserializer->leaveMember(); // leave data item _state = state_qdata_end; } else { _value += ch; } break; case state_qdata_end: if (ch == L'\n' || ch == L'\r') { checkNoColumns(_column, _noColumns, _lineNo); _deserializer->leaveMember(); // leave row _state = (ch == L'\r' ? state_cr : state_rowstart); } else if (ch == _delimiter) { ++_column; log_debug("member \"" << (_column < _titles.size() ? _titles[_column] : std::string()) << '"'); _deserializer->beginMember( _column < _titles.size() ? _titles[_column] : std::string(), std::string(), SerializationInfo::Value); _state = state_data0; } else { _value = _quote + _value + ch; _state = state_data; } break; } //log_debug("ch=" << ch.narrow() << " _state=" << _state); } void CsvParser::finish() { switch (_state) { case state_datastart: _deserializer->leaveMember(); // leave row break; case state_data0: case state_data: checkNoColumns(_column, _noColumns, _lineNo); _deserializer->setValue(_value); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row break; case state_qdata: checkNoColumns(_column, _noColumns, _lineNo); log_debug("value \"" << _quote.narrow() << _value << '"'); _deserializer->setValue(_quote + _value); _deserializer->leaveMember(); // leave data item _deserializer->leaveMember(); // leave row break; case state_qdata_end: _deserializer->leaveMember(); // leave row break; default: ; } } } ������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/semaphoreimpl.h������������������������������������������������������������������0000664�0001750�0001750�00000003412�12256773774�014153� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_SemaphoreImpl_h #define cxxtools_SemaphoreImpl_h #include <cxxtools/api.h> #include <semaphore.h> namespace cxxtools { class SemaphoreImpl { public: SemaphoreImpl(unsigned int initial = 0); ~SemaphoreImpl(); void wait(); bool tryWait(); void post(); private: sem_t _handle; }; } // !namespace cxxtools #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/stringstream.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000004714�12256773774�014371� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/stringstream.h" namespace cxxtools { StringStreamBuffer::StringStreamBuffer(std::ios::openmode mode) : std::basic_stringbuf<cxxtools::Char>(mode) { } StringStreamBuffer::StringStreamBuffer(const cxxtools::String& str, std::ios::openmode mode) : std::basic_stringbuf<cxxtools::Char>(str, mode) { } } // namespace cxxtools namespace std { basic_stringstream<cxxtools::Char>::basic_stringstream(ios_base::openmode mode) : basic_iostream<cxxtools::Char>(0) , _buffer(mode) { init(&_buffer); } basic_stringstream<cxxtools::Char>::basic_stringstream(const cxxtools::String& str, std::ios_base::openmode mode) : basic_iostream<cxxtools::Char>(0) , _buffer(str, mode) { init(&_buffer); } basic_stringstream<cxxtools::Char>::~basic_stringstream() { } basic_stringbuf<cxxtools::Char>* basic_stringstream<cxxtools::Char>::rdbuf() const { return (basic_stringbuf<cxxtools::Char>*)(&_buffer); } cxxtools::String basic_stringstream<cxxtools::Char>::str() const { return _buffer.str(); } void basic_stringstream<cxxtools::Char>::str(const cxxtools::String& str) { _buffer.str(str); } } // namespace std ����������������������������������������������������cxxtools-2.2.1/src/textbuffer.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000003021�12256773774�014013� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/textbuffer.h" namespace cxxtools { TextBuffer::TextBuffer(std::ios* s, Codec* codec) : BasicTextBuffer<cxxtools::Char, char>(s, codec) { } } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/����������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�012170� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/responder.cpp���������������������������������������������������������������0000664�0001750�0001750�00000004261�12256773774�014624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/responder.h> #include <cxxtools/http/reply.h> #include <cxxtools/http/request.h> namespace cxxtools { namespace http { void Responder::beginRequest(std::istream& in, Request& request) { _request = &request; } std::size_t Responder::readBody(std::istream& in) { std::streambuf* sb = in.rdbuf(); std::size_t ret = 0; while (sb->in_avail() > 0) { _request->body() << std::streambuf::traits_type::to_char_type(sb->sbumpc()); ++ret; } return ret; } void Responder::replyError(std::ostream& out, Request& request, Reply& reply, const std::exception& ex) { reply.httpReturn(500, "internal server error"); reply.setHeader("Content-Type", "text/plain"); reply.setHeader("Connection", "close"); out << ex.what(); } } // namespace http } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/serverimpl.h����������������������������������������������������������������0000664�0001750�0001750�00000007156�12256773774�014466� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_SERVERIMPL_H #define CXXTOOLS_HTTP_SERVERIMPL_H #include "serverimplbase.h" #include <set> #include <vector> #include <cxxtools/queue.h> #include <cxxtools/event.h> #include <cxxtools/http/server.h> namespace cxxtools { class EventLoopBase; namespace net { class TcpServer; } namespace http { class Worker; class ServerImpl; class Socket; class IdleSocketEvent; class KeepAliveTimeoutEvent; class ServerStartEvent; class NoWaitingThreadsEvent; class ThreadTerminatedEvent; class ActiveSocketEvent; class ServerImpl : public ServerImplBase, public Connectable { public: ServerImpl(EventLoopBase& eventLoop, Signal<Server::Runmode>& runmodeChanged); ~ServerImpl(); // override from ServerImplBase void listen(const std::string& ip, unsigned short int port, int backlog); bool isTerminating() const { return runmode() == Server::Terminating; } // override from ServerImplBase void terminate(); private: void noWaitingThreads(); void onInput(Socket& _socket); void onTimeout(Socket& _socket); void addIdleSocket(Socket* socket); void onIdleSocket(const IdleSocketEvent& event); void onActiveSocket(const ActiveSocketEvent& event); void onKeepAliveTimeout(const KeepAliveTimeoutEvent& event); void onNoWaitingThreads(const NoWaitingThreadsEvent& event); void onThreadTerminated(const ThreadTerminatedEvent& event); void onServerStart(const ServerStartEvent& event); void start(); friend class Worker; //////////////////////////////////////////////////// MethodSlot<void, ServerImpl, Socket&> inputSlot; MethodSlot<void, ServerImpl, Socket&> timeoutSlot; Queue<Socket*> _queue; std::set<Socket*> _idleSockets; //////////////////////////////////////////////////// typedef std::vector<net::TcpServer*> ListenerType; ListenerType _listener; //////////////////////////////////////////////////// typedef std::set<Worker*> Threads; Threads _threads; Threads _terminatedThreads; Mutex _threadMutex; Condition _threadTerminated; void threadTerminated(Worker* worker); }; } } #endif // CXXTOOLS_HTTP_SERVERIMPL_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notauthenticatedresponder.cpp�����������������������������������������������0000664�0001750�0001750�00000003447�12256773774�020115� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notauthenticatedresponder.h" #include <cxxtools/http/reply.h> namespace cxxtools { namespace http { void NotAuthenticatedResponder::reply(std::ostream& out, Request& request, Reply& reply) { reply.setHeader("WWW-Authenticate", ("Basic realm=\"" + _realm + '"').c_str()); reply.httpReturn(401, "not authorized"); if (_content.empty()) out << "<html><body><h1>not authorized</h1></body></html>"; else out << _content; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notfoundresponder.cpp�������������������������������������������������������0000664�0001750�0001750�00000003073�12256773774�016401� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notfoundresponder.h" #include <cxxtools/http/reply.h> namespace cxxtools { namespace http { void NotFoundResponder::reply(std::ostream& out, Request& request, Reply& reply) { reply.httpReturn(404, "Not found"); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/worker.cpp������������������������������������������������������������������0000664�0001750�0001750�00000007601�12256773774�014135� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "worker.h" #include "serverimpl.h" #include <cxxtools/log.h> #include "socket.h" log_define("cxxtools.http.worker") namespace cxxtools { namespace http { void Worker::run() { log_info("new thread running"); while (!_server.isTerminating() && _server._queue.numWaiting() < _server.minThreads()) { Socket* socket = _server._queue.get(); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } if (_server._queue.numWaiting() == 0) _server.noWaitingThreads(); try { if (!socket->hasAccepted()) { // do blocking accept socket->accept(); log_debug("connection accepted from " << socket->getPeerAddr()); if (_server.isTerminating()) { log_debug("server is terminating - quit thread"); _server._queue.put(socket); break; } // new connection arrived - create new accept socket _server._queue.put(new Socket(*socket)); } else if (socket->isConnected()) { log_debug("process available input"); socket->onInput(socket->buffer()); } else { log_debug("socket is not connected any more; delete " << static_cast<void*>(socket)); delete socket; continue; } Connection inputConnection = connect(socket->buffer().inputReady, socket->inputSlot); while (socket->wait(10) && socket->isConnected()) ; if (socket->isConnected()) { log_debug("timeout processing socket"); inputConnection.close(); _server.addIdleSocket(socket); } else if (_server.isTerminating()) { _server._queue.put(socket); } else { log_debug("socket is not connected any more; delete " << static_cast<void*>(socket)); delete socket; } } catch (const std::exception& e) { log_debug("error occured in device: " << e.what() << "; delete " << static_cast<void*>(socket)); delete socket; } } log_info("thread terminated"); _server.threadTerminated(this); } } } �������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notauthenticatedservice.h���������������������������������������������������0000664�0001750�0001750�00000003603�12256773774�017213� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTAUTHENTICATEDSERVICE_H #define CXXTOOLS_HTTP_NOTAUTHENTICATEDSERVICE_H #include <cxxtools/http/service.h> namespace cxxtools { namespace http { class NotAuthenticatedService : public Service { public: NotAuthenticatedService() { } Responder* createResponder(const Request&); Responder* createResponder(const Request&, const std::string& realm, const std::string& authContent); void releaseResponder(Responder* responder); }; } } #endif // CXXTOOLS_HTTP_NOTAUTHENTICATEDSERVICE_H �����������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/serverimplbase.h������������������������������������������������������������0000664�0001750�0001750�00000007762�12256773774�015324� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_SERVERIMPLBASE_H #define CXXTOOLS_HTTP_SERVERIMPLBASE_H #include <cxxtools/noncopyable.h> #include <cxxtools/http/server.h> #include "mapper.h" namespace cxxtools { class EventLoopBase; namespace http { class ServerImplBase : private NonCopyable { public: ServerImplBase(EventLoopBase& eventLoop, Signal<Server::Runmode>& runmodeChanged) : _eventLoop(eventLoop), _readTimeout(20000), _writeTimeout(20000), _keepAliveTimeout(30000), _minThreads(5), _maxThreads(200), _runmodeChanged(runmodeChanged), _runmode(Server::Stopped) { } virtual ~ServerImplBase() { } virtual void listen(const std::string& ip, unsigned short int port, int backlog) = 0; void addService(const std::string& url, Service& service) { _mapper.addService(url, service); } void addService(const Regex& url, Service& service) { _mapper.addService(url, service); } void removeService(Service& service) { _mapper.removeService(service); } Responder* getResponder(const Request& request) { return _mapper.getResponder(request); } Responder* getDefaultResponder(const Request& request) { return _mapper.getDefaultResponder(request); } std::size_t readTimeout() const { return _readTimeout; } std::size_t writeTimeout() const { return _writeTimeout; } std::size_t keepAliveTimeout() const { return _keepAliveTimeout; } void readTimeout(std::size_t ms) { _readTimeout = ms; } void writeTimeout(std::size_t ms) { _writeTimeout = ms; } void keepAliveTimeout(std::size_t ms) { _keepAliveTimeout = ms; } unsigned minThreads() const { return _minThreads; } void minThreads(unsigned m) { _minThreads = m; } unsigned maxThreads() const { return _maxThreads; } void maxThreads(unsigned m) { _maxThreads = m; } virtual void terminate() { } Server::Runmode runmode() const { return _runmode; } protected: void runmode(Server::Runmode runmode) { _runmode = runmode; _runmodeChanged(runmode); } EventLoopBase& _eventLoop; private: std::size_t _readTimeout; std::size_t _writeTimeout; std::size_t _keepAliveTimeout; unsigned _minThreads; unsigned _maxThreads; Signal<Server::Runmode>& _runmodeChanged; Server::Runmode _runmode; Mapper _mapper; }; } } #endif // CXXTOOLS_HTTP_SERVERIMPL_H ��������������cxxtools-2.2.1/src/http/mapper.cpp������������������������������������������������������������������0000664�0001750�0001750�00000006170�12256773774�014110� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/service.h> #include <cxxtools/http/request.h> #include <cxxtools/log.h> #include "mapper.h" log_define("cxxtools.http.mapper") namespace cxxtools { namespace http { void Mapper::addService(const std::string& url, Service& service) { log_debug("add service for url <" << url << '>'); WriteLock serviceLock(_serviceMutex); _services.push_back(ServicesType::value_type(url, &service)); } void Mapper::addService(const Regex& url, Service& service) { log_debug("add service for regex"); WriteLock serviceLock(_serviceMutex); _services.push_back(ServicesType::value_type(url, &service)); } void Mapper::removeService(Service& service) { WriteLock serviceLock(_serviceMutex); service.waitIdle(); ServicesType::size_type n = 0; while (n < _services.size()) { if (_services[n].second == &service) { _services.erase(_services.begin() + n); } else { ++n; } } } Responder* Mapper::getResponder(const Request& request) { log_debug("get responder for url <" << request.url() << '>'); ReadLock serviceLock(_serviceMutex); for (ServicesType::const_iterator it = _services.begin(); it != _services.end(); ++it) { if (it->first.match(request.url())) { if (!it->second->checkAuth(request)) { return _noAuthService.createResponder(request, it->second->realm(), it->second->authContent()); } Responder* resp = it->second->doCreateResponder(request); if (resp) { log_debug("got responder"); return resp; } } } log_debug("use default responder"); return _defaultService.createResponder(request); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/client.cpp������������������������������������������������������������������0000664�0001750�0001750�00000007343�12266277345�014077� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/client.h> #include <cxxtools/net/addrinfo.h> #include "clientimpl.h" namespace cxxtools { namespace http { Client::Client() : _impl(new ClientImpl(this)) { } Client::Client(const net::AddrInfo& addrinfo) : _impl(new ClientImpl(this, addrinfo)) { } Client::Client(const net::Uri& uri) : _impl(new ClientImpl(this, uri)) { } Client::Client(const std::string& host, unsigned short int port) : _impl(new ClientImpl(this, net::AddrInfo(host, port))) { } Client::Client(SelectorBase& selector, const std::string& host, unsigned short int port) : _impl(new ClientImpl(this, selector, net::AddrInfo(host, port))) { } Client::Client(SelectorBase& selector, const net::AddrInfo& addrinfo) : _impl(new ClientImpl(this, selector, addrinfo)) { } Client::Client(SelectorBase& selector, const net::Uri& uri) : _impl(new ClientImpl(this, selector, uri)) { } Client::~Client() { delete _impl; } void Client::connect(const net::AddrInfo& addrinfo) { _impl->connect(addrinfo); } void Client::connect(const std::string& host, unsigned short int port) { _impl->connect(net::AddrInfo(host, port)); } const ReplyHeader& Client::execute(const Request& request, std::size_t timeout) { try { return _impl->execute(request, timeout); } catch (...) { cancel(); throw; } } const ReplyHeader& Client::header() { return _impl->header(); } void Client::readBody(std::string& s) { _impl->readBody(s); } std::string Client::get(const std::string& url, std::size_t timeout) { return _impl->get(url, timeout); } void Client::beginExecute(const Request& request) { _impl->beginExecute(request); } void Client::endExecute() { _impl->endExecute(); } void Client::setSelector(SelectorBase& selector) { _impl->setSelector(selector); } SelectorBase* Client::selector() { return _impl->selector(); } bool Client::wait(std::size_t msecs) { return _impl->wait(msecs); } std::istream& Client::in() { return _impl->in(); } const std::string& Client::host() const { return _impl->host(); } unsigned short int Client::port() const { return _impl->port(); } void Client::auth(const std::string& username, const std::string& password) { _impl->auth(username, password); } void Client::clearAuth() { _impl->clearAuth(); } void Client::cancel() { _impl->cancel(); } } // namespace http } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/chunkedreader.h�������������������������������������������������������������0000664�0001750�0001750�00000005324�12256773774�015075� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef HTTP_CHUNKEDHREADER_H #define HTTP_CHUNKEDHREADER_H #include <streambuf> #include <iostream> namespace cxxtools { namespace http { class ChunkedReader : public std::streambuf { std::streambuf* _ib; char* _buffer; unsigned _bufsize; unsigned _chunkSize; void (ChunkedReader::*_state)(); void onBegin(); void onSize(); void onEndl(); void onExtension(); void onData(); void onDataEnd0(); void onDataEnd(); void onTrailer(); void onTrailerData(); public: explicit ChunkedReader(std::streambuf* ib, unsigned bufsize = 8192); ~ChunkedReader() { delete[] _buffer; } void reset() { _state = &ChunkedReader::onBegin; setg(0, 0, 0); } bool eod() const { return _state == 0; } std::streamsize showmanyc(); virtual int sync(); virtual int_type overflow(int_type ch); virtual int_type underflow(); }; class ChunkedIStream : public std::istream { ChunkedReader _streambuf; public: explicit ChunkedIStream(std::streambuf* ib) : std::istream(&_streambuf), _streambuf(ib) { } void reset() { _streambuf.reset(); clear(); } bool eod() const { return _streambuf.eod(); } }; } } #endif // HTTP_CHUNKEDHREADER_H ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notauthenticatedresponder.h�������������������������������������������������0000664�0001750�0001750�00000003764�12256773774�017564� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTAUTHENTICATEDRESPONDER_H #define CXXTOOLS_HTTP_NOTAUTHENTICATEDRESPONDER_H #include <cxxtools/http/responder.h> #include <string> namespace cxxtools { namespace http { class NotAuthenticatedResponder : public Responder { std::string _realm; std::string _content; public: explicit NotAuthenticatedResponder(Service& service, const std::string& realm, const std::string& content) : Responder(service), _realm(realm), _content(content) { } void reply(std::ostream&, Request& request, Reply& reply); }; } } #endif // CXXTOOLS_HTTP_NOTAUTHENTICATEDRESPONDER_H ������������cxxtools-2.2.1/src/http/messageheader.cpp�����������������������������������������������������������0000664�0001750�0001750�00000012630�12266277345�015411� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/messageheader.h> #include <cxxtools/clock.h> #include <cxxtools/log.h> #include <cctype> #include <sstream> #include <stdio.h> #include <string.h> log_define("cxxtools.http.messageheader") namespace cxxtools { namespace http { namespace { int compareIgnoreCase(const char* s1, const char* s2) { const char* it1 = s1; const char* it2 = s2; while (*it1 && *it2) { if (*it1 != *it2) { char c1 = std::toupper(*it1); char c2 = std::toupper(*it2); if (c1 < c2) return -1; else if (c2 < c1) return 1; } ++it1; ++it2; } return *it1 ? 1 : *it2 ? -1 : 0; } } const char* MessageHeader::getHeader(const char* key) const { for (const_iterator it = begin(); it != end(); ++it) { if (compareIgnoreCase(key, it->first) == 0) return it->second; } return 0; } bool MessageHeader::isHeaderValue(const char* key, const char* value) const { const char* h = getHeader(key); if (h == 0) return false; return compareIgnoreCase(h, value) == 0; } void MessageHeader::clear() { _rawdata[0] = _rawdata[1] = '\0'; _endOffset = 0; _httpVersionMajor = 1; _httpVersionMinor = 1; } void MessageHeader::setHeader(const char* key, const char* value, bool replace) { log_debug("setHeader(\"" << key << "\", \"" << value << "\", " << replace << ')'); if (!*key) throw std::runtime_error("empty key not allowed in messageheader"); if (replace) removeHeader(key); char* p = eptr(); size_t lk = strlen(key); // length of key size_t lv = strlen(value); // length of value if (p - _rawdata + lk + lv + 2 > MAXHEADERSIZE) throw std::runtime_error("message header too big"); std::strcpy(p, key); // copy key p += lk + 1; std::strcpy(p, value); // copy value p[lv + 1] = '\0'; // put new message end marker in place _endOffset = (p + lv + 1) - _rawdata; } void MessageHeader::removeHeader(const char* key) { if (!*key) throw std::runtime_error("empty key not allowed in messageheader"); char* p = eptr(); const_iterator it = begin(); while (it != end()) { if (compareIgnoreCase(key, it->first) == 0) { unsigned slen = it->second - it->first + std::strlen(it->second) + 1; std::memcpy( const_cast<char*>(it->first), it->first + slen, p - it->first + slen); p -= slen; it.fixup(); } else ++it; } _endOffset = p - _rawdata; } bool MessageHeader::chunkedTransferEncoding() const { return isHeaderValue("Transfer-Encoding", "chunked"); } std::size_t MessageHeader::contentLength() const { const char* s = getHeader("Content-Length"); if (s == 0) return 0; std::size_t size = 0; while (*s >= '0' && *s <= '9') size = size * 10 + (*s++ - '0'); return size; } bool MessageHeader::keepAlive() const { const char* ch = getHeader("Connection"); if (ch == 0) return httpVersionMajor() == 1 && httpVersionMinor() >= 1; else return compareIgnoreCase(ch, "keep-alive") == 0; } char* MessageHeader::htdateCurrent(char* buffer) { int year = 0; unsigned month = 0; unsigned day = 0; unsigned hour = 0; unsigned min = 0; unsigned sec = 0; unsigned msec = 0; DateTime dt = Clock::getSystemTime(); dt.get(year, month, day, hour, min, sec, msec); unsigned dayOfWeek = dt.date().dayOfWeek(); static const char* wday[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static const char* monthn[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; sprintf(buffer, "%s, %02d %s %d %02d:%02d:%02d GMT", wday[dayOfWeek], day, monthn[month-1], year, hour, min, sec); return buffer; } } // namespace http } // namespace cxxtools ��������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notauthenticatedservice.cpp�������������������������������������������������0000664�0001750�0001750�00000003615�12256773774�017551� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notauthenticatedservice.h" #include "notauthenticatedresponder.h" namespace cxxtools { namespace http { Responder* NotAuthenticatedService::createResponder(const Request& request) { return createResponder(request, std::string(), std::string()); } Responder* NotAuthenticatedService::createResponder(const Request& request, const std::string& realm, const std::string& authContent) { return new NotAuthenticatedResponder(*this, realm, authContent); } void NotAuthenticatedService::releaseResponder(Responder* responder) { delete responder; } } } �������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/worker.h��������������������������������������������������������������������0000664�0001750�0001750�00000003441�12256773774�013600� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_WORKER_H #define CXXTOOLS_HTTP_WORKER_H #include <cxxtools/thread.h> namespace cxxtools { namespace http { class ServerImpl; class Worker : public AttachedThread { public: explicit Worker(ServerImpl& server) : AttachedThread(callable(*this, &Worker::run)), _server(server) { } void run(); private: ServerImpl& _server; }; } } #endif // CXXTOOLS_HTTP_WORKER_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/serverimpl.cpp��������������������������������������������������������������0000664�0001750�0001750�00000023464�12256773774�015021� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "serverimpl.h" #include "worker.h" #include "socket.h" #include <cxxtools/eventloop.h> #include <cxxtools/log.h> #include <cxxtools/net/tcpserver.h> #include <signal.h> log_define("cxxtools.http.server.impl") namespace cxxtools { namespace http { class IdleSocketEvent : public BasicEvent<IdleSocketEvent> { Socket* _socket; public: explicit IdleSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; class KeepAliveTimeoutEvent : public BasicEvent<KeepAliveTimeoutEvent> { Socket* _socket; public: explicit KeepAliveTimeoutEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; class ServerStartEvent : public BasicEvent<ServerStartEvent> { const ServerImpl* _server; public: explicit ServerStartEvent(const ServerImpl* server) : _server(server) { } const ServerImpl* server() const { return _server; } }; class NoWaitingThreadsEvent : public BasicEvent<NoWaitingThreadsEvent> { }; class ThreadTerminatedEvent : public BasicEvent<ThreadTerminatedEvent> { Worker* _worker; public: explicit ThreadTerminatedEvent(Worker* worker) : _worker(worker) { } Worker* worker() const { return _worker; } }; class ActiveSocketEvent : public BasicEvent<ActiveSocketEvent> { Socket* _socket; public: explicit ActiveSocketEvent(Socket* socket) : _socket(socket) { } Socket* socket() const { return _socket; } }; ServerImpl::ServerImpl(EventLoopBase& eventLoop, Signal<Server::Runmode>& runmodeChanged) : ServerImplBase(eventLoop, runmodeChanged), inputSlot(slot(*this, &ServerImpl::onInput)), timeoutSlot(slot(*this, &ServerImpl::onTimeout)) { _eventLoop.event.subscribe(slot(*this, &ServerImpl::onIdleSocket)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onActiveSocket)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onKeepAliveTimeout)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onNoWaitingThreads)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onThreadTerminated)); _eventLoop.event.subscribe(slot(*this, &ServerImpl::onServerStart)); connect(_eventLoop.exited, *this, &ServerImpl::terminate); _eventLoop.commitEvent(ServerStartEvent(this)); } ServerImpl::~ServerImpl() { if (runmode() == Server::Running) { try { terminate(); } catch (const std::exception& e) { log_fatal("exception in http-server termination occured: " << e.what()); } } } void ServerImpl::listen(const std::string& ip, unsigned short int port, int backlog) { log_debug("listen on " << ip << " port " << port); net::TcpServer* listener = new net::TcpServer(ip, port, backlog, net::TcpServer::DEFER_ACCEPT); try { _listener.push_back(listener); _queue.put(new Socket(*this, *listener)); } catch (...) { delete listener; throw; } } void ServerImpl::start() { log_trace("start server"); runmode(Server::Starting); MutexLock lock(_threadMutex); while (_threads.size() < minThreads()) { Worker* worker = new Worker(*this); _threads.insert(worker); worker->start(); } runmode(Server::Running); } void ServerImpl::terminate() { log_trace("terminate"); MutexLock lock(_threadMutex); runmode(Server::Terminating); try { log_debug("wake " << _listener.size() << " listeners"); for (ServerImpl::ListenerType::iterator it = _listener.begin(); it != _listener.end(); ++it) (*it)->terminateAccept(); _queue.put(0); log_debug("terminate " << _threads.size() << " threads"); while (!_threads.empty() || !_terminatedThreads.empty()) { if (!_threads.empty()) { log_debug("wait for terminated thread"); _threadTerminated.wait(lock); } for (Threads::iterator it = _terminatedThreads.begin(); it != _terminatedThreads.end(); ++it) { log_debug("join thread"); (*it)->join(); delete *it; } _terminatedThreads.clear(); } log_debug("delete " << _listener.size() << " listeners"); for (ServerImpl::ListenerType::iterator it = _listener.begin(); it != _listener.end(); ++it) delete *it; _listener.clear(); while (!_queue.empty()) delete _queue.get(); for (std::set<Socket*>::iterator it = _idleSockets.begin(); it != _idleSockets.end(); ++it) delete *it; _idleSockets.clear(); runmode(Server::Stopped); } catch (const std::exception& e) { runmode(Server::Failed); } } void ServerImpl::noWaitingThreads() { MutexLock lock(_threadMutex); if (runmode() == Server::Running) _eventLoop.commitEvent(NoWaitingThreadsEvent()); } void ServerImpl::threadTerminated(Worker* worker) { MutexLock lock(_threadMutex); _threads.erase(worker); if (runmode() == Server::Running) { _eventLoop.commitEvent(ThreadTerminatedEvent(worker)); } else { _terminatedThreads.insert(worker); _threadTerminated.signal(); } } void ServerImpl::addIdleSocket(Socket* socket) { log_debug("add idle socket " << static_cast<void*>(socket)); if (runmode() == Server::Running) { _eventLoop.commitEvent(IdleSocketEvent(socket)); } else { log_debug("server not running; delete " << static_cast<void*>(socket)); delete socket; } } void ServerImpl::onIdleSocket(const IdleSocketEvent& event) { Socket* socket = event.socket(); log_debug("add idle socket " << static_cast<void*>(socket) << " to selector"); _idleSockets.insert(socket); socket->setSelector(&_eventLoop); socket->inputConnection = connect(socket->inputReady, inputSlot); socket->timeoutConnection = connect(socket->timeout, timeoutSlot); } void ServerImpl::onActiveSocket(const ActiveSocketEvent& event) { _queue.put(event.socket()); } void ServerImpl::onNoWaitingThreads(const NoWaitingThreadsEvent& event) { MutexLock lock(_threadMutex); if (_threads.size() >= maxThreads()) { log_warn("thread limit " << maxThreads() << " reached"); return; } try { Worker* worker = new Worker(*this); try { log_debug("create thread " << static_cast<void*>(worker) << "; running threads=" << _threads.size()); worker->start(); _threads.insert(worker); log_debug(_threads.size() << " threads running"); } catch (const std::exception&) { delete worker; throw; } } catch (const std::exception& e) { log_warn("failed to create thread: " << e.what()); } } void ServerImpl::onThreadTerminated(const ThreadTerminatedEvent& event) { MutexLock lock(_threadMutex); log_debug("thread terminated (" << static_cast<void*>(event.worker()) << ") " << _threads.size() << " threads left"); try { event.worker()->join(); } catch (const std::exception& e) { log_error("failed to join thread: " << e.what()); } delete event.worker(); } void ServerImpl::onServerStart(const ServerStartEvent& event) { if (event.server() == this) { start(); } } void ServerImpl::onInput(Socket& socket) { socket.removeSelector(); log_debug("search socket " << static_cast<void*>(&socket) << " in idle sockets"); _idleSockets.erase(&socket); if (socket.isConnected()) { socket.inputConnection.close(); socket.timeoutConnection.close(); _eventLoop.commitEvent(ActiveSocketEvent(&socket)); } else { log_debug("onInput; delete " << static_cast<void*>(&socket)); delete &socket; } } void ServerImpl::onTimeout(Socket& socket) { log_debug("timeout; socket " << static_cast<void*>(&socket)); _eventLoop.commitEvent(KeepAliveTimeoutEvent(&socket)); } void ServerImpl::onKeepAliveTimeout(const KeepAliveTimeoutEvent& event) { Socket* socket = event.socket(); _idleSockets.erase(socket); log_debug("onKeepAliveTimeout; delete " << static_cast<void*>(&socket)); delete socket; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notfoundservice.cpp���������������������������������������������������������0000664�0001750�0001750�00000003054�12256773774�016037� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "notfoundservice.h" namespace cxxtools { namespace http { Responder* NotFoundService::createResponder(const Request&) { return &_responder; } void NotFoundService::releaseResponder(Responder*) { } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/Makefile.am�����������������������������������������������������������������0000664�0001750�0001750�00000001657�12256773774�014161� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-http.la libcxxtools_http_la_SOURCES = \ chunkedreader.cpp \ client.cpp \ clientimpl.cpp \ mapper.cpp \ messageheader.cpp \ notauthenticatedresponder.cpp \ notauthenticatedservice.cpp \ notfoundresponder.cpp \ notfoundservice.cpp \ parser.cpp \ server.cpp \ serverimpl.cpp \ service.cpp \ socket.cpp \ request.cpp \ responder.cpp \ worker.cpp noinst_HEADERS = \ chunkedreader.h \ clientimpl.h \ mapper.h \ notauthenticatedresponder.h \ notauthenticatedservice.h \ notfoundresponder.h \ notfoundservice.h \ parser.h \ serverimpl.h \ serverimplbase.h \ socket.h \ worker.h libcxxtools_http_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_http_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ ���������������������������������������������������������������������������������cxxtools-2.2.1/src/http/socket.h��������������������������������������������������������������������0000664�0001750�0001750�00000007237�12256773774�013566� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Socket_h #define cxxtools_Http_Socket_h #include <cxxtools/net/tcpsocket.h> #include <cxxtools/http/request.h> #include <cxxtools/http/reply.h> #include <cxxtools/iostream.h> #include <cxxtools/timer.h> #include <cxxtools/connectable.h> #include <cxxtools/signal.h> #include <cxxtools/method.h> #include "parser.h" namespace cxxtools { namespace http { class ServerImpl; class Responder; class Socket : public net::TcpSocket, public Connectable { class ParseEvent : public HeaderParser::MessageHeaderEvent { Request& _request; public: explicit ParseEvent(Request& request) : HeaderParser::MessageHeaderEvent(request.header()), _request(request) { } virtual void onMethod(const std::string& method); virtual void onUrl(const std::string& url); virtual void onUrlParam(const std::string& q); }; public: Socket(ServerImpl& server, net::TcpServer& tcpServer); explicit Socket(Socket& socket); ~Socket(); void accept(); bool hasAccepted() const { return _accepted; } void setSelector(SelectorBase* s); void removeSelector(); void onIODeviceInput(IODevice& iodevice); void onInput(StreamBuffer& sb); bool onOutput(StreamBuffer& sb); void onTimeout(); bool doReply(); void sendReply(); bool isReady() const { return _parser.end() && _contentLength == 0; } const Request& request() const { return _request; } const Reply& reply() const { return _reply; } Signal<Socket&> inputReady; Signal<Socket&> timeout; StreamBuffer& buffer() { return _stream.buffer(); } MethodSlot<void, Socket, StreamBuffer&> inputSlot; Connection inputConnection; Connection timeoutConnection; private: net::TcpServer& _tcpServer; ServerImpl& _server; ParseEvent _parseEvent; HeaderParser _parser; Request _request; Reply _reply; Timer _timer; int _contentLength; Responder* _responder; IOStream _stream; bool _accepted; }; } // namespace http } // namespace cxxtools #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notfoundresponder.h���������������������������������������������������������0000664�0001750�0001750�00000003435�12256773774�016050� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTFOUNDRESPONDER_H #define CXXTOOLS_HTTP_NOTFOUNDRESPONDER_H #include <cxxtools/http/responder.h> namespace cxxtools { namespace http { class CXXTOOLS_HTTP_API NotFoundResponder : public Responder { public: explicit NotFoundResponder(Service& service) : Responder(service) { } void reply(std::ostream&, Request& request, Reply& reply); }; } } #endif // CXXTOOLS_HTTP_NOTFOUNDRESPONDER_H �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/clientimpl.cpp��������������������������������������������������������������0000664�0001750�0001750�00000045730�12266277345�014763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "clientimpl.h" #include <cxxtools/http/client.h> #include <cxxtools/net/uri.h> #include "parser.h" #include <cxxtools/ioerror.h> #include <cxxtools/textstream.h> #include <cxxtools/base64codec.h> #include <sstream> #include "config.h" #include <cxxtools/log.h> log_define("cxxtools.http.client.impl") namespace cxxtools { namespace http { void ClientImpl::ParseEvent::onHttpReturn(unsigned ret, const std::string& text) { _replyHeader.httpReturn(ret, text); } ClientImpl::ClientImpl(Client* client) : _client(client) , _parseEvent(_replyHeader) , _parser(_parseEvent, true) , _request(0) , _stream(8192, true) , _chunkedIStream(_stream.rdbuf()) , _contentLength(0) , _readHeader(true) , _chunkedEncoding(false) , _reconnectOnError(false) , _errorPending(false) { _stream.attachDevice(_socket); cxxtools::connect(_socket.connected, *this, &ClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &ClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &ClientImpl::onInput); } ClientImpl::ClientImpl(Client* client, const net::AddrInfo& addrinfo) : _client(client) , _parseEvent(_replyHeader) , _parser(_parseEvent, true) , _request(0) , _addrInfo(addrinfo) , _stream(8192, true) , _chunkedIStream(_stream.rdbuf()) , _contentLength(0) , _readHeader(true) , _chunkedEncoding(false) , _reconnectOnError(false) , _errorPending(false) { _stream.attachDevice(_socket); cxxtools::connect(_socket.connected, *this, &ClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &ClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &ClientImpl::onInput); } ClientImpl::ClientImpl(Client* client, const net::Uri& uri) : _client(client) , _parseEvent(_replyHeader) , _parser(_parseEvent, true) , _request(0) , _addrInfo(uri.host(), uri.port()) , _stream(8192, true) , _chunkedIStream(_stream.rdbuf()) , _username(uri.user()) , _password(uri.password()) , _contentLength(0) , _readHeader(true) , _chunkedEncoding(false) , _reconnectOnError(false) , _errorPending(false) { if (uri.protocol() != "http") throw std::runtime_error("only http is supported by http client"); _stream.attachDevice(_socket); cxxtools::connect(_socket.connected, *this, &ClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &ClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &ClientImpl::onInput); } ClientImpl::ClientImpl(Client* client, SelectorBase& selector, const net::AddrInfo& addrinfo) : _client(client) , _parseEvent(_replyHeader) , _parser(_parseEvent, true) , _request(0) , _addrInfo(addrinfo) , _stream(8192, true) , _chunkedIStream(_stream.rdbuf()) , _contentLength(0) , _readHeader(true) , _chunkedEncoding(false) , _reconnectOnError(false) , _errorPending(false) { _stream.attachDevice(_socket); cxxtools::connect(_socket.connected, *this, &ClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &ClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &ClientImpl::onInput); setSelector(selector); } ClientImpl::ClientImpl(Client* client, SelectorBase& selector, const net::Uri& uri) : _client(client) , _parseEvent(_replyHeader) , _parser(_parseEvent, true) , _request(0) , _addrInfo(uri.host(), uri.port()) , _stream(8192, true) , _chunkedIStream(_stream.rdbuf()) , _contentLength(0) , _readHeader(true) , _chunkedEncoding(false) , _reconnectOnError(false) , _errorPending(false) { if (uri.protocol() != "http") throw std::runtime_error("only http is supported by http client"); _stream.attachDevice(_socket); cxxtools::connect(_socket.connected, *this, &ClientImpl::onConnect); cxxtools::connect(_stream.buffer().outputReady, *this, &ClientImpl::onOutput); cxxtools::connect(_stream.buffer().inputReady, *this, &ClientImpl::onInput); setSelector(selector); } void ClientImpl::setSelector(SelectorBase& selector) { selector.add(_socket); } void ClientImpl::reexecute(const Request& request) { log_debug("reexecute"); _stream.clear(); _stream.buffer().discard(); _socket.connect(_addrInfo); sendRequest(request); _stream.flush(); } void ClientImpl::reexecuteBegin(const Request& request) { log_debug("reexecuteBegin"); _stream.clear(); _stream.buffer().discard(); _socket.beginConnect(_addrInfo); _reconnectOnError = false; } void ClientImpl::doparse() { char ch; while (!_parser.end() && _stream.get(ch)) _parser.parse(ch); } const ReplyHeader& ClientImpl::execute(const Request& request, std::size_t timeout) { log_trace("execute request " << request.url()); _replyHeader.clear(); _socket.setTimeout(timeout); bool shouldReconnect = _socket.isConnected(); if (!shouldReconnect) { log_debug("connect"); _socket.connect(_addrInfo); } log_debug("send request"); sendRequest(request); _stream.flush(); if (!_stream && shouldReconnect) { // sending failed and we were not connected before, so try again reexecute(request); shouldReconnect = false; } if (!_stream) throw IOError("error sending HTTP request"); log_debug("read reply"); _parser.reset(true); _readHeader = true; doparse(); if (_parser.begin() && shouldReconnect) { // reading failed and we were not connected before, so try again reexecute(request); if (!_stream) throw IOError("error sending HTTP request"); doparse(); } log_debug("reply ready"); if (_stream.fail()) throw IOError("failed to read HTTP reply"); if (_parser.fail()) throw IOError("invalid HTTP reply"); if (!_parser.end()) throw IOError("incomplete HTTP reply header"); return _replyHeader; } void ClientImpl::readBody(std::string& s) { s.clear(); _chunkedEncoding = _replyHeader.chunkedTransferEncoding(); _chunkedIStream.reset(); if (_chunkedEncoding) { log_debug("read body with chunked encoding"); char ch; while (_chunkedIStream.get(ch)) s += ch; log_debug("eod=" << _chunkedIStream.eod()); if (!_chunkedIStream.eod()) throw IOError("error reading HTTP reply body: incomplete chunked data stream"); } else { unsigned n = _replyHeader.contentLength(); log_debug("read body; content-size: " << n); s.reserve(n); char ch; while (n-- && _stream.get(ch)) s += ch; if (_stream.fail()) throw IOError("error reading HTTP reply body"); //log_debug("body read: \"" << s << '"'); } if (!_replyHeader.keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } else { log_debug("do not close socket - keep alive"); } } std::string ClientImpl::get(const std::string& url, std::size_t timeout) { Request request(url); execute(request, timeout); return readBody(); } void ClientImpl::beginExecute(const Request& request) { if (_socket.selector() == 0) throw std::logic_error("cannot run async http request without a selector"); log_trace("beginExecute"); _errorPending = false; _request = &request; _replyHeader.clear(); if (_socket.isConnected()) { log_debug("we are connected already"); sendRequest(*_request); try { _stream.buffer().beginWrite(); _reconnectOnError = true; } catch (const IOError&) { log_debug("first write failed, so connection is not active any more"); _stream.clear(); _stream.buffer().discard(); _socket.beginConnect(_addrInfo); _reconnectOnError = false; } } else { log_debug("not yet connected - do it now"); _socket.beginConnect(_addrInfo); _reconnectOnError = false; } } void ClientImpl::endExecute() { if (_errorPending) { _errorPending = false; throw; } } bool ClientImpl::wait(std::size_t msecs) { return _socket.wait(msecs); } SelectorBase* ClientImpl::selector() { return _socket.selector(); } void ClientImpl::sendRequest(const Request& request) { log_debug("send request " << request.url()); static const char* contentLength = "Content-Length"; static const char* connection = "Connection"; static const char* date = "Date"; static const char* host = "Host"; static const char* authorization = "Authorization"; static const char* userAgent = "User-Agent"; _stream << request.method() << ' ' << request.url() << " HTTP/" << request.header().httpVersionMajor() << '.' << request.header().httpVersionMinor() << "\r\n"; for (RequestHeader::const_iterator it = request.header().begin(); it != request.header().end(); ++it) { _stream << it->first << ": " << it->second << "\r\n"; } if (!request.header().hasHeader(contentLength)) { _stream << "Content-Length: " << request.bodySize() << "\r\n"; } if (!request.header().hasHeader(connection)) { _stream << "Connection: keep-alive\r\n"; } if (!request.header().hasHeader(date)) { char buffer[50]; _stream << "Date: " << MessageHeader::htdateCurrent(buffer) << "\r\n"; } if (!request.header().hasHeader(host)) { _stream << "Host: " << _addrInfo.host(); unsigned short port = _addrInfo.port(); if (port != 80) _stream << ':' << port; _stream << "\r\n"; } if (!request.header().hasHeader(userAgent)) { _stream << "User-Agent: " PACKAGE_STRING " http client\r\n"; } if (!_username.empty() && !request.header().hasHeader(authorization)) { std::ostringstream d; BasicTextOStream<char, char> b(d, new Base64Codec()); b << _username << ':' << _password; b.terminate(); log_debug("set Authorization to " << d.str()); _stream << "Authorization: Basic " << d.str() << "\r\n"; } _stream << "\r\n"; log_debug("send body; " << request.bodySize() << " bytes"); request.sendBody(_stream); } void ClientImpl::onConnect(net::TcpSocket& socket) { try { log_trace("onConnect"); _errorPending = false; socket.endConnect(); sendRequest(*_request); log_debug("request sent - begin write"); _stream.buffer().beginWrite(); } catch (const std::exception& ) { _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } void ClientImpl::onOutput(StreamBuffer& sb) { log_trace("ClientImpl::onOutput; out_avail=" << sb.out_avail()); try { try { _errorPending = false; sb.endWrite(); if( sb.out_avail() > 0 ) { sb.beginWrite(); } else { sb.beginRead(); _client->requestSent(*_client); _parser.reset(true); _readHeader = true; } } catch (const IOError& e) { if (_reconnectOnError && _request != 0) { log_debug("reconnect on error"); _socket.close(); _reconnectOnError = false; reexecuteBegin(*_request); return; } throw; } } catch (const std::exception& e) { log_warn("error of type " << typeid(e).name() << " occured: " << e.what()); _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } void ClientImpl::onInput(StreamBuffer& sb) { try { try { log_trace("ClientImpl::onInput; readHeader=" << _readHeader); _errorPending = false; sb.endRead(); if (sb.device()->eof()) throw IOError("end of input"); _reconnectOnError = false; if (_readHeader) { processHeaderAvailable(sb); } else { processBodyAvailable(sb); } } catch (const IOError& e) { // after writing the request, the first read request may // detect, that the server has already closed the connection, // so check it here if (_readHeader && _reconnectOnError && _request != 0) { log_debug("reconnect on error"); _socket.close(); _reconnectOnError = false; reexecuteBegin(*_request); return; } throw; } } catch (const std::exception& e) { _errorPending = true; _client->replyFinished(*_client); if (_errorPending) throw; } } void ClientImpl::processHeaderAvailable(StreamBuffer& sb) { _parser.advance(sb); if (_parser.fail()) throw std::runtime_error("http parser failed"); // TODO define exception class if( _parser.end() ) { _chunkedEncoding = _replyHeader.chunkedTransferEncoding(); _client->headerReceived(*_client); _readHeader = false; if (_chunkedEncoding) { log_debug("chunked transfer encoding used"); _chunkedIStream.reset(); if( sb.in_avail() > 0 ) { processBodyAvailable(sb); } else { sb.beginRead(); } } else { _contentLength = _replyHeader.contentLength(); log_debug("header received - content-length=" << _contentLength); if (_contentLength > 0) { if( sb.in_avail() > 0 ) { processBodyAvailable(sb); } else { sb.beginRead(); } } else { if (!_replyHeader.keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } _client->replyFinished(*_client); } } } else { sb.beginRead(); } } void ClientImpl::processBodyAvailable(StreamBuffer& sb) { log_trace("processBodyAvailable"); if (_chunkedEncoding) { if (_chunkedIStream.rdbuf()->in_avail() > 0) { if (!_chunkedIStream.eod()) { log_debug("read chunked encoding body"); while (_chunkedIStream.good() && _chunkedIStream.rdbuf()->in_avail() > 0 && !_chunkedIStream.eod()) { log_debug("bodyAvailable"); _client->bodyAvailable(*_client); } log_debug("in_avail=" << _chunkedIStream.rdbuf()->in_avail() << " eod=" << _chunkedIStream.eod()); if (_chunkedIStream.eod()) { _parser.readHeader(); } } if (_chunkedIStream.eod() && sb.in_avail() > 0) { log_debug("read chunked encoding post headers"); _parser.advance(sb); if (_parser.fail()) throw std::runtime_error("http parser failed"); // TODO define exception class if( _parser.end() ) { log_debug("reply finished"); if (!_replyHeader.keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } _client->replyFinished(*_client); } } if (_chunkedIStream.fail()) throw IOError("error reading HTTP reply body"); } else if( _chunkedIStream.eod() ) { if( _replyHeader.hasHeader("Trailer") ) _parser.readHeader(); else _client->replyFinished(*_client); } if (_socket.enabled()) { if ((!_chunkedIStream.eod() || !_parser.end())) { log_debug("call beginRead"); sb.beginRead(); } } else { cancel(); } } else { log_debug("content-length(pre)=" << _contentLength); while (_stream.good() && _contentLength > 0 && sb.in_avail() > 0) { _contentLength -= _client->bodyAvailable(*_client); // TODO: may throw exception log_debug("content-length(post)=" << _contentLength); } if (_stream.fail()) throw IOError("error reading HTTP reply body"); if( _contentLength <= 0 ) { log_debug("reply finished"); if (!_replyHeader.keepAlive()) { log_debug("close socket - no keep alive"); _socket.close(); } _client->replyFinished(*_client); } else if (_socket.enabled() && _stream.good()) { sb.beginRead(); } else { cancel(); } } } void ClientImpl::cancel() { _socket.close(); _stream.clear(); _stream.buffer().discard(); _chunkedIStream.reset(); } } // namespace http } // namespace cxxtools ����������������������������������������cxxtools-2.2.1/src/http/parser.cpp������������������������������������������������������������������0000664�0001750�0001750�00000055025�12266277345�014115� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "parser.h" #include <cxxtools/http/messageheader.h> #include <cxxtools/log.h> #include <cctype> #include <algorithm> #include <string.h> log_define("cxxtools.http.parser") namespace cxxtools { namespace http { namespace { std::string chartoprint(char ch) { const static char hex[] = "0123456789abcdef"; if (std::isprint(ch)) return std::string(1, '\'') + ch + '\''; else return std::string("'\\x") + hex[(ch >> 4) & 0xf] + hex[ch & 0xf] + '\''; } inline bool istokenchar(char ch) { static const char s[] = "\"(),/:;<=>?@[\\]{}"; return std::isalpha(ch) || std::binary_search(s, s + sizeof(s) - 1, ch); } inline bool isHexDigit(char ch) { return (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } inline unsigned valueOfHexDigit(char ch) { return ch >= '0' && ch <= '9' ? ch - '0' : ch >= 'a' && ch <= 'z' ? ch - 'a' + 10 : ch >= 'A' && ch <= 'Z' ? ch - 'A' + 10 : 0; } } void HeaderParser::Event::onMethod(const std::string& method) { } void HeaderParser::Event::onUrl(const std::string& url) { } void HeaderParser::Event::onUrlParam(const std::string& q) { } void HeaderParser::Event::onHttpVersion(unsigned major, unsigned minor) { } void HeaderParser::Event::onKey(const std::string& key) { } void HeaderParser::Event::onValue(const std::string& value) { } void HeaderParser::Event::onHttpReturn(unsigned ret, const std::string& text) { } void HeaderParser::Event::onEnd() { } void HeaderParser::MessageHeaderEvent::onHttpVersion(unsigned major, unsigned minor) { _header.httpVersion(major, minor); } void HeaderParser::MessageHeaderEvent::onKey(const std::string& key) { strncpy(_key, key.c_str(), MessageHeader::MAXHEADERSIZE); } void HeaderParser::MessageHeaderEvent::onValue(const std::string& value) { _header.addHeader(_key, value.c_str()); } std::size_t HeaderParser::advance(std::streambuf& sb) { std::size_t ret = 0; while (sb.in_avail() > 0) { ++ret; if (parse(sb.sbumpc())) return ret; } return ret; } void HeaderParser::state_cmd0(char ch) { if (istokenchar(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_cmd; return; } else if (ch != ' ' && ch != '\t') { log_warn("invalid character " << chartoprint(ch) << " in method"); state = &HeaderParser::state_error; return; } else { state = &HeaderParser::state_cmd; return; } } void HeaderParser::state_cmd(char ch) { if (istokenchar(ch)) { token += ch; return; } else if (ch == ' ') { log_debug("method=" << token); ev.onMethod(token); state = &HeaderParser::state_url0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in method"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_url0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '/' || ch == '*') { token.reserve(32); token = ch; state = &HeaderParser::state_url; return; } else if (std::isalpha(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_uri_protocol; return; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_uri_protocol(char ch) { if (std::isalpha(ch)) { } else if (ch == ':') { token.clear(); state = &HeaderParser::state_uri_protocol_e; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; } } void HeaderParser::state_uri_protocol_e(char ch) { if (token.size() < 2 && ch == '/') { token += ch; } else if (token.size() == 2 && std::isalpha(ch)) { token = ch; state = &HeaderParser::state_uri_host; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; } } void HeaderParser::state_uri_host(char ch) { if (std::isalnum(ch) || ch == '.' || ch == ':' || ch == '[' || ch == ']') { } else if (ch == '/') { token = ch; state = &HeaderParser::state_url; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; } } void HeaderParser::state_url(char ch) { if (ch == '?') { log_debug("url=" << token); ev.onUrl(token); token.clear(); token.reserve(32); state = &HeaderParser::state_qparam; return; } else if (ch == ' ' || ch == '\t') { log_debug("url=" << token); ev.onUrl(token); token.clear(); token.reserve(32); state = &HeaderParser::state_protocol0; return; } else if (ch == '+') { token += ' '; return; } else if (ch == '%') { token += ch; state = &HeaderParser::state_urlesc; return; } else if (ch > ' ') { token += ch; return; } else { log_warn("invalid character " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_urlesc(char ch) { if (isHexDigit(ch)) { if (token.size() >= 2 && token[token.size() - 2] == '%') { unsigned v = (valueOfHexDigit(token[token.size() - 1]) << 4) | valueOfHexDigit(ch); token[token.size() - 2] = static_cast<char>(v); token.resize(token.size() - 1); state = &HeaderParser::state_url; return; } else { token += ch; return; } } else { log_warn("invalid hex digit " << chartoprint(ch) << " in url"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_qparam(char ch) { if (ch == ' ' || ch == '\t') { log_debug("queryString=" << token); ev.onUrlParam(token); token.clear(); token.reserve(32); state = &HeaderParser::state_protocol0; return; } else { token += ch; return; } } void HeaderParser::state_protocol0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isalpha(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_protocol; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_protocol(char ch) { if (ch == ' ' || ch == '\t' || ch == '/') { if (token != "HTTP") { log_warn("invalid protocol " << token << " in http protocol field"); state = &HeaderParser::state_error; return; } else { state = (ch == '/' ? &HeaderParser::state_version_major : &HeaderParser::state_version0); return; } } else if (std::isalpha(ch)) { token += std::toupper(ch); return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '/') { state = &HeaderParser::state_version_major; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version_major(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '1') { state = &HeaderParser::state_version_major_e; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version_major_e(char ch) { if (ch == ' ' || ch == '\t') { state = &HeaderParser::state_version_major_e; return; } else if (ch == '.') { state = &HeaderParser::state_version_minor; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_version_minor(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '0' || ch == '1') { ev.onHttpVersion(1, ch - '0'); state = &HeaderParser::state_end0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_end0(char ch) { if (ch == '\n') { state = &HeaderParser::state_h0; return; } else if (ch == ' ' || ch == '\t' || ch == '\r') { return; } else { log_warn("invalid character " << chartoprint(ch) << " in http request line"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_h0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch > 32 && ch < 127) { token.reserve(32); token = ch; state = &HeaderParser::state_hfieldname; return; } else if (ch == '\r') { state = &HeaderParser::state_hcr; return; } else if (ch == '\n') { ev.onEnd(); state = &HeaderParser::state_end; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http header"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hcr(char ch) { if (ch == '\n') { ev.onEnd(); state = &HeaderParser::state_end; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http header"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldname(char ch) { if (ch == ':') { ev.onKey(token); state = &HeaderParser::state_hfieldbody0; return; } else if (ch == ' ' || ch == '\t') { ev.onKey(token); state = &HeaderParser::state_hfieldnamespace; return; } else if (ch > 32 && ch < 127) { token += ch; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldname"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldnamespace(char ch) { if (ch == ':') { state = &HeaderParser::state_hfieldbody0; return; } else if (ch == ' ' || ch == '\t') { return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldname"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldbody0(char ch) { if (ch == '\r') { state = &HeaderParser::state_hfieldbody_cr; return; } else if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; return; } else if (std::isspace(ch)) { return; } else if (!std::isspace(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_hfieldbody; return; } } void HeaderParser::state_hfieldbody(char ch) { if (ch == '\r') { state = &HeaderParser::state_hfieldbody_cr; return; } else if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; return; } else { token += ch; return; } } void HeaderParser::state_hfieldbody_cr(char ch) { if (ch == '\n') { state = &HeaderParser::state_hfieldbody_crlf; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldbody"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hfieldbody_crlf(char ch) { if (ch == '\r') { ev.onValue(token); state = &HeaderParser::state_hend_cr; return; } else if (ch == '\n') { ev.onValue(token); ev.onEnd(); state = &HeaderParser::state_end; return; } else if (ch == ' ' || ch == '\t') { token += ch; state = &HeaderParser::state_hfieldbody; return; } else if (ch > 32 && ch < 127) { ev.onValue(token); token.reserve(32); token = ch; state = &HeaderParser::state_hfieldname; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldbody"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_hend_cr(char ch) { if (ch == '\n') { ev.onEnd(); state = &HeaderParser::state_end; return; } else { log_warn("invalid character " << chartoprint(ch) << " in fieldbody"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_protocol0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isalpha(ch)) { token.reserve(32); token = ch; state = &HeaderParser::state_cl_protocol; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_protocol(char ch) { if (ch == ' ' || ch == '\t' || ch == '/') { if (token != "HTTP") { log_warn("invalid protocol " << token << " in http protocol field"); state = &HeaderParser::state_error; return; } else { state = (ch == '/' ? &HeaderParser::state_cl_version_major : &HeaderParser::state_cl_version0); return; } } else if (std::isalpha(ch)) { token += std::toupper(ch); return; } else { log_warn("invalid character " << chartoprint(ch) << " in http protocol field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '/') { state = &HeaderParser::state_cl_version_major; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version_major(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '1') { state = &HeaderParser::state_cl_version_major_e; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version_major_e(char ch) { if (ch == ' ' || ch == '\t') { state = &HeaderParser::state_cl_version_major_e; return; } else if (ch == '.') { state = &HeaderParser::state_cl_version_minor; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http version field"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_version_minor(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (ch == '0' || ch == '1') { ev.onHttpVersion(1, ch - '0'); state = &HeaderParser::state_cl_httpresult0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http result"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_httpresult0(char ch) { if (ch == ' ' || ch == '\t') { return; } else if (std::isdigit(ch)) { value = (ch - '0'); state = &HeaderParser::state_cl_httpresult; return; } else { log_warn("invalid character " << chartoprint(ch) << " in http result"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_cl_httpresult(char ch) { if (std::isdigit(ch)) { value = value * 10 + (ch - '0'); return; } else if (ch == ' ' || ch == '\t') { token.clear(); token.reserve(32); state = &HeaderParser::state_cl_httpresulttext; } } void HeaderParser::state_cl_httpresulttext(char ch) { if (ch == '\r') { ev.onHttpReturn(value, token); state = &HeaderParser::state_cl_httpresult_cr; return; } else if (ch == '\n') { ev.onHttpReturn(value, token); state = &HeaderParser::state_h0; return; } else if (token.empty() && (ch == ' ' || ch == '\t')) { return; } else { token += ch; return; } } void HeaderParser::state_cl_httpresult_cr(char ch) { if (ch == '\n') { state = &HeaderParser::state_h0; return; } else { log_warn("invalid character " << chartoprint(ch) << " in requestheader"); state = &HeaderParser::state_error; return; } } void HeaderParser::state_end(char ch) { return; } void HeaderParser::state_error(char ch) { return; } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/socket.cpp������������������������������������������������������������������0000664�0001750�0001750�00000021776�12256773774�014125� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "socket.h" #include "serverimpl.h" #include <cxxtools/log.h> #include <cassert> #include "config.h" log_define("cxxtools.http.socket") namespace cxxtools { namespace http { void Socket::ParseEvent::onMethod(const std::string& method) { _request.method(method); } void Socket::ParseEvent::onUrl(const std::string& url) { _request.url(url); } void Socket::ParseEvent::onUrlParam(const std::string& q) { _request.qparams(q); } Socket::Socket(ServerImpl& server, net::TcpServer& tcpServer) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(tcpServer), _server(server), _parseEvent(_request), _parser(_parseEvent, false), _responder(0), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(_timer.timeout, *this, &Socket::onTimeout); } Socket::Socket(Socket& socket) : inputSlot(slot(*this, &Socket::onInput)), _tcpServer(socket._tcpServer), _server(socket._server), _parseEvent(_request), _parser(_parseEvent, false), _responder(0), _accepted(false) { _stream.attachDevice(*this); cxxtools::connect(IODevice::inputReady, *this, &Socket::onIODeviceInput); cxxtools::connect(_stream.buffer().outputReady, *this, &Socket::onOutput); cxxtools::connect(_timer.timeout, *this, &Socket::onTimeout); } Socket::~Socket() { if (_responder) _responder->release(); } void Socket::accept() { net::TcpSocket::accept(_tcpServer, net::TcpSocket::DEFER_ACCEPT); _accepted = true; _stream.buffer().beginRead(); _timer.start(_server.readTimeout()); } void Socket::setSelector(SelectorBase* s) { s->add(*this); s->add(_timer); } void Socket::removeSelector() { TcpSocket::setSelector(0); _timer.setSelector(0); } void Socket::onIODeviceInput(IODevice& iodevice) { log_debug("onIODeviceInput"); inputReady(*this); } void Socket::onInput(StreamBuffer& sb) { log_debug("onInput"); sb.endRead(); if (sb.in_avail() == 0 || sb.device()->eof()) { close(); return; } _timer.start(_server.readTimeout()); if ( _responder == 0 ) { _parser.advance(sb); if (_parser.fail()) { _responder = _server.getDefaultResponder(_request); _responder->replyError(_reply.body(), _request, _reply, std::runtime_error("invalid http header")); _responder->release(); _responder = 0; sendReply(); onOutput(sb); return; } if (_parser.end()) { log_info("request " << _request.method() << ' ' << _request.header().query() << " from client " << getPeerAddr()); _responder = _server.getResponder(_request); try { _responder->beginRequest(_stream, _request); } catch (const std::exception& e) { _reply.setHeader("Connection", "close"); _responder->replyError(_reply.body(), _request, _reply, e); _responder->release(); _responder = 0; sendReply(); onOutput(sb); return; } _contentLength = _request.header().contentLength(); log_debug("content length of request is " << _contentLength); if (_contentLength == 0) { _timer.stop(); doReply(); return; } } else { sb.beginRead(); } } if (_responder) { if (sb.in_avail() > 0) { try { std::size_t s = _responder->readBody(_stream); assert(s > 0); _contentLength -= s; } catch (const std::exception& e) { _reply.setHeader("Connection", "close"); _responder->replyError(_reply.body(), _request, _reply, e); _responder->release(); _responder = 0; sendReply(); onOutput(sb); return; } } if (_contentLength <= 0) { _timer.stop(); doReply(); } else { sb.beginRead(); } } } bool Socket::doReply() { log_trace("http::Socket::doReply"); try { _responder->reply(_reply.body(), _request, _reply); } catch (const std::exception& e) { log_warn("responder reported error: " << e.what()); _reply.clear(); _responder->replyError(_reply.body(), _request, _reply, e); } _responder->release(); _responder = 0; sendReply(); return onOutput(_stream.buffer()); } bool Socket::onOutput(StreamBuffer& sb) { log_trace("onOutput"); log_debug("send data to " << getPeerAddr()); try { sb.endWrite(); if ( sb.out_avail() ) { sb.beginWrite(); _timer.start(_server.writeTimeout()); } else { bool keepAlive = _request.header().keepAlive() && _reply.header().keepAlive(); if (keepAlive) { log_debug("do keep alive"); _timer.start(_server.keepAliveTimeout()); _request.clear(); _reply.clear(); _parser.reset(false); if (sb.in_avail()) onInput(sb); else _stream.buffer().beginRead(); } else { log_debug("don't do keep alive"); close(); return false; } } } catch (const std::exception& e) { log_warn("exception occured when processing request: " << e.what()); close(); timeout(*this); return false; } return true; } void Socket::onTimeout() { log_debug("timeout"); timeout(*this); } void Socket::sendReply() { const char* contentLength = "Content-Length"; const char* server = "Server"; const char* connection = "Connection"; const char* date = "Date"; log_info("request " << _request.method() << ' ' << _request.header().query() << " ready, returncode " << _reply.httpReturnCode() << ' ' << _reply.httpReturnText()); _stream << "HTTP/" << _reply.header().httpVersionMajor() << '.' << _reply.header().httpVersionMinor() << ' ' << _reply.header().httpReturnCode() << ' ' << _reply.header().httpReturnText() << "\r\n"; for (ReplyHeader::const_iterator it = _reply.header().begin(); it != _reply.header().end(); ++it) { _stream << it->first << ": " << it->second << "\r\n"; } if (!_reply.header().hasHeader(contentLength)) { _stream << "Content-Length: " << _reply.bodySize() << "\r\n"; } if (!_reply.header().hasHeader(server)) { _stream << "Server: cxxtools-Http-Server " PACKAGE_VERSION "\r\n"; } if (!_reply.header().hasHeader(connection)) { _stream << "Connection: " << (_request.header().keepAlive() ? "keep-alive" : "close") << "\r\n"; } if (!_reply.header().hasHeader(date)) { char buffer[50]; _stream << "Date: " << MessageHeader::htdateCurrent(buffer) << "\r\n"; } _stream << "\r\n"; _reply.sendBody(_stream); } } // namespace http } // namespace cxxtools ��cxxtools-2.2.1/src/http/parser.h��������������������������������������������������������������������0000664�0001750�0001750�00000013315�12256773774�013564� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_Parser_h #define cxxtools_Http_Parser_h #include <cxxtools/http/api.h> #include <cxxtools/http/messageheader.h> #include <string> #include <iostream> namespace cxxtools { namespace http { class CXXTOOLS_HTTP_API HeaderParser { public: class CXXTOOLS_HTTP_API Event { public: virtual ~Event() {} virtual void onMethod(const std::string& method); virtual void onUrl(const std::string& url); virtual void onUrlParam(const std::string& q); virtual void onHttpVersion(unsigned major, unsigned minor); virtual void onKey(const std::string& key); virtual void onValue(const std::string& value); virtual void onHttpReturn(unsigned ret, const std::string& text); virtual void onEnd(); }; class CXXTOOLS_HTTP_API MessageHeaderEvent : public Event { MessageHeader& _header; char _key[MessageHeader::MAXHEADERSIZE]; public: explicit MessageHeaderEvent(MessageHeader& header) : _header(header) { } virtual void onHttpVersion(unsigned major, unsigned minor); virtual void onKey(const std::string& key); virtual void onValue(const std::string& value); }; private: typedef void (HeaderParser::*state_type)(char); void state_cmd0(char ch); void state_cmd(char ch); void state_url0(char ch); void state_uri_protocol(char ch); void state_uri_protocol_e(char ch); void state_uri_host(char ch); void state_url(char ch); void state_urlesc(char ch); void state_qparam(char ch); void state_protocol0(char ch); void state_protocol(char ch); void state_version0(char ch); void state_version_major(char ch); void state_version_major_e(char ch); void state_version_minor(char ch); void state_end0(char ch); void state_h0(char ch); void state_hcr(char ch); void state_hfieldname(char ch); void state_hfieldnamespace(char ch); void state_hfieldbody0(char ch); void state_hfieldbody(char ch); void state_hfieldbody_cr(char ch); void state_hfieldbody_crlf(char ch); void state_hend_cr(char ch); void state_cl_protocol0(char ch); void state_cl_protocol(char ch); void state_cl_version0(char ch); void state_cl_version_major(char ch); void state_cl_version_major_e(char ch); void state_cl_version_minor(char ch); void state_cl_httpresult0(char ch); void state_cl_httpresult(char ch); void state_cl_httpresulttext(char ch); void state_cl_httpresult_cr(char ch); void state_end(char ch); void state_error(char ch); state_type state; Event& ev; std::string token; unsigned value; public: HeaderParser(Event& ev_, bool client) : state(client ? &HeaderParser::state_cl_protocol0 : &HeaderParser::state_cmd0), ev(ev_) { } /// parse as many characters as available in buffer without blocking std::size_t advance(std::streambuf& sb); std::size_t advance(std::istream& is) { return advance(*is.rdbuf()); } /// parses a single character and returns true, if message is finished bool parse(char ch) { (this->*state)(ch); return state == &HeaderParser::state_end || state == &HeaderParser::state_error; } bool begin() const { return state == &HeaderParser::state_cl_protocol0 || state == &HeaderParser::state_cmd0; } bool end() const { return state == &HeaderParser::state_end || state == &HeaderParser::state_error; } bool fail() const { return state == &HeaderParser::state_error; } void reset(bool client) { state = (client ? &HeaderParser::state_cl_protocol0 : &HeaderParser::state_cmd0); } /// returns parser to header reading state void readHeader() { state = &HeaderParser::state_h0; } }; } // namespace http } // namespace cxxtools #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/server.cpp������������������������������������������������������������������0000664�0001750�0001750�00000007025�12256773774�014132� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/server.h> #include <cxxtools/eventloop.h> #include <cxxtools/log.h> #include "serverimpl.h" log_define("cxxtools.http.server") namespace cxxtools { namespace http { Server::Server(EventLoopBase& eventLoop) : _impl(new ServerImpl(eventLoop, runmodeChanged)) { } Server::Server(EventLoopBase& eventLoop, const std::string& ip, unsigned short int port, int backlog) : _impl(new ServerImpl(eventLoop, runmodeChanged)) { listen(ip, port, backlog); } Server::Server(EventLoopBase& eventLoop, unsigned short int port, int backlog) : _impl(new ServerImpl(eventLoop, runmodeChanged)) { listen(port, backlog); } Server::~Server() { if (!_impl) return; if (_impl->runmode() == Running) _impl->terminate(); delete _impl; } void Server::listen(const std::string& ip, unsigned short int port, int backlog) { log_info("listen ip=" << ip << " port=" << port); _impl->listen(ip, port, backlog); } void Server::listen(unsigned short int port, int backlog) { log_info("listen port=" << port); _impl->listen(std::string(), port, backlog); } void Server::addService(const std::string& url, Service& service) { _impl->addService(url, service); } void Server::addService(const Regex& url, Service& service) { _impl->addService(url, service); } void Server::removeService(Service& service) { _impl->removeService(service); } std::size_t Server::readTimeout() const { return _impl->readTimeout(); } std::size_t Server::writeTimeout() const { return _impl->writeTimeout(); } std::size_t Server::keepAliveTimeout() const { return _impl->keepAliveTimeout(); } void Server::readTimeout(std::size_t ms) { _impl->readTimeout(ms); } void Server::writeTimeout(std::size_t ms) { _impl->writeTimeout(ms); } void Server::keepAliveTimeout(std::size_t ms) { _impl->keepAliveTimeout(ms); } unsigned Server::minThreads() const { return _impl->minThreads(); } void Server::minThreads(unsigned m) { _impl->minThreads(m); } unsigned Server::maxThreads() const { return _impl->maxThreads(); } void Server::maxThreads(unsigned m) { _impl->maxThreads(m); } } // namespace http } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/mapper.h��������������������������������������������������������������������0000664�0001750�0001750�00000005135�12256773774�013555� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_MAPPER_H #define CXXTOOLS_HTTP_MAPPER_H #include "notfoundservice.h" #include "notauthenticatedservice.h" #include <map> #include <cxxtools/regex.h> namespace cxxtools { namespace http { class Mapper { public: void addService(const std::string& url, Service& service); void addService(const Regex& url, Service& service); void removeService(Service& service); Responder* getResponder(const Request& request); Responder* getDefaultResponder(const Request& request) { return _defaultService.createResponder(request); } private: struct Key { Regex regex; std::string url; Key() { } Key(const Regex& regex_) : regex(regex_) { } Key(const std::string& url_) : url(url_) { } bool match(const std::string& u) const { return regex.empty() ? url == u : regex.match(u); } }; typedef std::vector<std::pair<Key, Service*> > ServicesType; ReadWriteMutex _serviceMutex; ServicesType _services; NotFoundService _defaultService; NotAuthenticatedService _noAuthService; }; } } #endif // CXXTOOLS_HTTP_MAPPER_H �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/Makefile.in�����������������������������������������������������������������0000664�0001750�0001750�00000051605�12266277545�014164� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/http DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_http_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_libcxxtools_http_la_OBJECTS = chunkedreader.lo client.lo \ clientimpl.lo mapper.lo messageheader.lo \ notauthenticatedresponder.lo notauthenticatedservice.lo \ notfoundresponder.lo notfoundservice.lo parser.lo server.lo \ serverimpl.lo service.lo socket.lo request.lo responder.lo \ worker.lo libcxxtools_http_la_OBJECTS = $(am_libcxxtools_http_la_OBJECTS) libcxxtools_http_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libcxxtools_http_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcxxtools_http_la_SOURCES) DIST_SOURCES = $(libcxxtools_http_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-http.la libcxxtools_http_la_SOURCES = \ chunkedreader.cpp \ client.cpp \ clientimpl.cpp \ mapper.cpp \ messageheader.cpp \ notauthenticatedresponder.cpp \ notauthenticatedservice.cpp \ notfoundresponder.cpp \ notfoundservice.cpp \ parser.cpp \ server.cpp \ serverimpl.cpp \ service.cpp \ socket.cpp \ request.cpp \ responder.cpp \ worker.cpp noinst_HEADERS = \ chunkedreader.h \ clientimpl.h \ mapper.h \ notauthenticatedresponder.h \ notauthenticatedservice.h \ notfoundresponder.h \ notfoundservice.h \ parser.h \ serverimpl.h \ serverimplbase.h \ socket.h \ worker.h libcxxtools_http_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_http_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/http/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/http/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-http.la: $(libcxxtools_http_la_OBJECTS) $(libcxxtools_http_la_DEPENDENCIES) $(EXTRA_libcxxtools_http_la_DEPENDENCIES) $(libcxxtools_http_la_LINK) -rpath $(libdir) $(libcxxtools_http_la_OBJECTS) $(libcxxtools_http_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunkedreader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/messageheader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notauthenticatedresponder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notauthenticatedservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notfoundresponder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notfoundservice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serverimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/service.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000005236�12256773774�014266� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/service.h> #include <cxxtools/http/responder.h> namespace cxxtools { namespace http { Responder* Service::doCreateResponder(const Request& request) { MutexLock lock(_mutex); ++_responderCount; return createResponder(request); } void Service::doReleaseResponder(Responder* responder) { MutexLock lock(_mutex); releaseResponder(responder); if (--_responderCount <= 0) _isIdle.signal(); } void Service::waitIdle() { MutexLock lock(_mutex); while (_responderCount > 0) _isIdle.wait(lock); } bool Service::checkAuth(const Request& request) { for (std::vector<const Authenticator*>::const_iterator it = _authenticators.begin(); it != _authenticators.end(); ++it) { if (!(*it)->checkAuth(request)) return false; } return true; } CachedServiceBase::~CachedServiceBase() { for (Responders::iterator it = responders.begin(); it != responders.end(); ++it) delete *it; } Responder* CachedServiceBase::createResponder(const Request& request) { if (responders.empty()) { return newResponder(); } else { Responder* ret = responders.back(); responders.pop_back(); return ret; } } void CachedServiceBase::releaseResponder(Responder* resp) { responders.push_back(resp); } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/chunkedreader.cpp�����������������������������������������������������������0000664�0001750�0001750�00000016140�12256773774�015426� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "chunkedreader.h" #include <stdexcept> #include <sstream> #include <cxxtools/log.h> log_define("cxxtools.http.chunkedreader") namespace cxxtools { namespace http { namespace { std::string charToPrint(char ch) { std::ostringstream s; if (ch >= 32 && ch < 127) s << '<' << ch << '>'; s << '(' << static_cast<unsigned>(static_cast<unsigned char>(ch)) << ')'; return s.str(); } void throwInvalidCharacter(char ch) { std::ostringstream s; s << "invalid character "; if (ch >= 32 && ch < 127) s << '<' << ch << '>'; s << '(' << static_cast<unsigned>(static_cast<unsigned char>(ch)) << ") in chunked encoding"; throw std::runtime_error(s.str()); } } //////////////////////////////////////////////////////////////////// // ChunkedReader ChunkedReader::ChunkedReader(std::streambuf* ib, unsigned bufsize) : _ib(ib), _buffer(0), _bufsize(bufsize), _state(&ChunkedReader::onBegin) { } std::streamsize ChunkedReader::showmanyc() { log_trace("showmanyc"); while (_state != 0 && gptr() == egptr() && _ib->in_avail()) { (this->*_state)(); } log_debug("showmanyc=" << egptr() - gptr()); return egptr() - gptr(); } int ChunkedReader::sync() { return 0; } ChunkedReader::int_type ChunkedReader::overflow(int_type ch) { return traits_type::eof(); } ChunkedReader::int_type ChunkedReader::underflow() { log_trace("ChunkedReader::underflow"); while (_state != 0 && gptr() == egptr() && _ib->sgetc() != traits_type::eof()) { (this->*_state)(); } if (_state == 0) { log_debug("end of chunked data reached"); return traits_type::eof(); } if (_ib->sgetc() == traits_type::eof()) { log_debug("end of input stream"); _state = 0; return traits_type::eof(); } log_debug("not at eof - return " << charToPrint(*gptr())); return *gptr(); } void ChunkedReader::onBegin() { char ch = _ib->sbumpc(); log_trace("onBegin, ch=" << charToPrint(ch)); if (ch >= '0' && ch <= '9') { _chunkSize = ch - '0'; _state = &ChunkedReader::onSize; } else if (ch >= 'a' && ch <= 'f') { _chunkSize = ch - 'a' + 10; _state = &ChunkedReader::onSize; } else if (ch >= 'A' && ch <= 'F') { _chunkSize = ch - 'A' + 10; _state = &ChunkedReader::onSize; } else throwInvalidCharacter(ch); } void ChunkedReader::onSize() { char ch = _ib->sbumpc(); log_trace("onSize, ch=" << charToPrint(ch)); if (ch >= '0' && ch <= '9') { _chunkSize = _chunkSize * 16 + (ch - '0'); } else if (ch >= 'a' && ch <= 'f') { _chunkSize = _chunkSize * 16 + (ch - 'a' + 10); } else if (ch >= 'A' && ch <= 'F') { _chunkSize = _chunkSize * 16 + (ch - 'A' + 10); } else { log_debug("chunk size=" << _chunkSize); if (ch == '\r') { _state = &ChunkedReader::onEndl; } else if (ch == '\n') { if (_chunkSize > 0) _state = &ChunkedReader::onData; else _state = 0; } else { _state = &ChunkedReader::onExtension; } } } void ChunkedReader::onEndl() { char ch = _ib->sbumpc(); log_trace("onEndl, ch=" << charToPrint(ch)); if (ch == '\n') { if (_chunkSize > 0) _state = &ChunkedReader::onData; else _state = &ChunkedReader::onTrailer; } else throwInvalidCharacter(ch); } void ChunkedReader::onExtension() { log_trace("onExtension"); char ch = _ib->sbumpc(); if (ch == '\r') { _state = &ChunkedReader::onEndl; } else if (ch == '\n') { if (_chunkSize > 0) _state = &ChunkedReader::onData; else _state = 0; } } void ChunkedReader::onData() { log_trace("onData"); unsigned n = static_cast<unsigned>(_ib->in_avail()); if (n > _bufsize) n = _bufsize; if (n > _chunkSize) n = _chunkSize; if (!_buffer) _buffer = new char[_bufsize]; n = _ib->sgetn(_buffer, n); setg(_buffer, _buffer, _buffer + n); _chunkSize -= n; if (_chunkSize <= 0) _state = &ChunkedReader::onDataEnd0; } void ChunkedReader::onDataEnd0() { char ch = _ib->sbumpc(); log_trace("onDataEnd0, ch=" << charToPrint(ch)); if (ch == '\r') { log_debug("=> onDataEnd"); _state = &ChunkedReader::onDataEnd; } else if (ch == '\n') { log_debug("=> onBegin"); _state = &ChunkedReader::onBegin; } else throwInvalidCharacter(ch); } void ChunkedReader::onDataEnd() { char ch = _ib->sbumpc(); log_trace("onDataEnd, ch=" << charToPrint(ch)); if (ch == '\n') { log_debug("=> onBegin"); _state = &ChunkedReader::onBegin; } else throwInvalidCharacter(ch); } void ChunkedReader::onTrailer() { char ch = _ib->sbumpc(); if (ch == '\n') _state = 0; else if (ch == '\r') ; else _state = &ChunkedReader::onTrailerData; } void ChunkedReader::onTrailerData() { // the trailer is actually ignored char ch = _ib->sbumpc(); if (ch == '\n') _state = &ChunkedReader::onTrailer; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/clientimpl.h����������������������������������������������������������������0000664�0001750�0001750�00000014504�12266277345�014423� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_Http_ClientImpl_h #define cxxtools_Http_ClientImpl_h #include <cxxtools/net/tcpserver.h> #include <cxxtools/net/tcpsocket.h> #include "parser.h" #include <cxxtools/http/request.h> #include <cxxtools/http/reply.h> #include <cxxtools/selectable.h> #include <cxxtools/iostream.h> #include <cxxtools/timer.h> #include <cxxtools/connectable.h> #include <cxxtools/delegate.h> #include <string> #include <sstream> #include <cstddef> #include "chunkedreader.h" namespace cxxtools { namespace net { class Uri; } namespace http { class Client; class ClientImpl : public Connectable { friend class ParseEvent; Client* _client; class CXXTOOLS_HTTP_API ParseEvent : public HeaderParser::MessageHeaderEvent { ReplyHeader& _replyHeader; public: explicit ParseEvent(ReplyHeader& replyHeader) : HeaderParser::MessageHeaderEvent(replyHeader), _replyHeader(replyHeader) { } void onHttpReturn(unsigned ret, const std::string& text); }; ParseEvent _parseEvent; HeaderParser _parser; const Request* _request; ReplyHeader _replyHeader; net::AddrInfo _addrInfo; net::TcpSocket _socket; IOStream _stream; ChunkedIStream _chunkedIStream; std::string _username; std::string _password; long _contentLength; bool _readHeader; bool _chunkedEncoding; bool _reconnectOnError; bool _errorPending; void sendRequest(const Request& request); void processHeaderAvailable(StreamBuffer& sb); void processBodyAvailable(StreamBuffer& sb); void reexecute(const Request& request); void reexecuteBegin(const Request& request); void doparse(); protected: void onConnect(net::TcpSocket& socket); void onOutput(StreamBuffer& sb); void onInput(StreamBuffer& sb); public: ClientImpl(Client* client); ClientImpl(Client* client, const net::AddrInfo& addrinfo); ClientImpl(Client* client, const net::Uri& uri); ClientImpl(Client* client, SelectorBase& selector, const net::AddrInfo& addrinfo); ClientImpl(Client* client, SelectorBase& selector, const net::Uri& uri); // Sets the server and port. No actual network connect is done. void connect(const net::AddrInfo& addrinfo) { _addrInfo = addrinfo; _socket.close(); } // Sends the passed request to the server and parses the headers. // The body must be read with readBody. // This method blocks or times out until the body is parsed. const ReplyHeader& execute(const Request& request, std::size_t timeout = Selectable::WaitInfinite); const ReplyHeader& header() { return _replyHeader; } // Reads the http body after header read with execute. // This method blocks until the body is received. void readBody(std::string& s); // Reads the http body after header read with execute. // This method blocks until the body is received. std::string readBody() { std::string ret; readBody(ret); return ret; } // Combines the execute and readBody methods in one call. // This method blocks until the reply is recieved. std::string get(const std::string& url, std::size_t timeout = Selectable::WaitInfinite); // Starts a new request. // This method does not block. To actually process the request, the // event loop must be executed. The state of the request is signaled // with the corresponding signals and delegates. // The delegate "bodyAvailable" must be connected, if a body is // received. void beginExecute(const Request& request); void endExecute(); void setSelector(SelectorBase& selector); SelectorBase* selector(); // Executes the underlying selector until a event occures or the // specified timeout is reached. bool wait(std::size_t msecs); // Returns the underlying stream, where the reply may be read from. std::istream& in() { return _chunkedEncoding ? static_cast<std::istream&>(_chunkedIStream) : static_cast<std::istream&>(_stream); } const std::string& host() const { return _addrInfo.host(); } unsigned short port() const { return _addrInfo.port(); } // Sets the username and password for all subsequent requests. void auth(const std::string& username, const std::string& password) { _username = username; _password = password; } void clearAuth() { _username.clear(); _password.clear(); } void cancel(); }; } // namespace http } // namespace cxxtools #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/notfoundservice.h�����������������������������������������������������������0000664�0001750�0001750�00000003523�12256773774�015505� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_HTTP_NOTFOUNDSERVICE_H #define CXXTOOLS_HTTP_NOTFOUNDSERVICE_H #include <cxxtools/http/service.h> #include "notfoundresponder.h" namespace cxxtools { namespace http { class NotFoundService : public Service { public: NotFoundService() : _responder(*this) { } Responder* createResponder(const Request&); void releaseResponder(Responder*); private: NotFoundResponder _responder; }; } } #endif // CXXTOOLS_HTTP_NOTFOUNDSERVICE_H �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/http/request.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000003732�12256773774�014315� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/request.h> #include <cxxtools/textstream.h> #include <cxxtools/base64codec.h> #include <string> namespace cxxtools { namespace http { Request::Auth Request::auth() const { Auth ret; const char* sp = getHeader("Authorization"); if (!sp) return ret; std::string s = sp; std::string::size_type p = s.find(' '); if (p == std::string::npos) return ret; std::istringstream in(s); in.ignore(p + 1); cxxtools::BasicTextIStream<char, char> b(in, new cxxtools::Base64Codec()); std::getline(b, ret.user, ':'); std::getline(b, ret.password); return ret; } } } ��������������������������������������cxxtools-2.2.1/src/decomposer.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000006742�12256773774�014012� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/decomposer.h" #include "cxxtools/formatter.h" namespace cxxtools { void IDecomposer::formatEach(const SerializationInfo& si, Formatter& formatter) { if (si.category() == SerializationInfo::Void) { formatter.addNull( si.name(), si.typeName() ); } else if (si.category() == SerializationInfo::Value) { if (si.isInt()) { int_type value; si.getValue(value); formatter.addValueInt( si.name(), si.typeName(), value ); } else if (si.isUInt()) { unsigned_type value; si.getValue(value); formatter.addValueUnsigned( si.name(), si.typeName(), value ); } else if (si.isBool()) { bool value; si.getValue(value); formatter.addValueBool( si.name(), si.typeName(), value ); } else if (si.isFloat()) { long double value; si.getValue(value); formatter.addValueFloat( si.name(), si.typeName(), value ); } else if (si.isString8()) { std::string value; si.getValue(value); formatter.addValueStdString( si.name(), si.typeName(), value ); } else { String value; si.getValue(value); formatter.addValueString( si.name(), si.typeName(), value ); } } else if(si.category() == SerializationInfo::Object) { formatter.beginObject( si.name(), si.typeName() ); SerializationInfo::ConstIterator it; for(it = si.begin(); it != si.end(); ++it) { formatter.beginMember( it->name() ); formatEach(*it, formatter); formatter.finishMember(); } formatter.finishObject(); } else if(si.category() == SerializationInfo::Array) { formatter.beginArray( si.name(), si.typeName() ); SerializationInfo::ConstIterator it; for(it = si.begin(); it != si.end(); ++it) { formatEach(*it, formatter); } formatter.finishArray(); } } } // namespace cxxtools ������������������������������cxxtools-2.2.1/src/conditionimpl.cpp����������������������������������������������������������������0000664�0001750�0001750�00000005553�12266277345�014513� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 - 2007 by Marc Boris Durrner * Copyright (C) 2005 - 2007 by Sebastian Pieck * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "conditionimpl.h" #include "muteximpl.h" #include "cxxtools/systemerror.h" #include <sys/time.h> #include <unistd.h> #include <errno.h> namespace cxxtools { ConditionImpl::ConditionImpl() { int rc = pthread_cond_init( &_cond, NULL ); if ( rc != 0) throw SystemError( rc, "pthread_cond_init failed"); } ConditionImpl::~ConditionImpl() { pthread_cond_destroy(&_cond); } void ConditionImpl::wait(Mutex& mtx) { int rc = pthread_cond_wait(&_cond, mtx.impl().handle() ); if ( rc != 0) throw SystemError( rc, "pthread_cond_wait failed"); } bool ConditionImpl::wait(Mutex& mtx, unsigned int ms) { int result; struct timeval tv; ::gettimeofday(&tv, NULL); struct timespec ts; ts.tv_nsec = ((ms%1000) * 1000 + tv.tv_usec) * 1000; ts.tv_sec = (ms/1000) + (ts.tv_nsec/1000000000) + tv.tv_sec; ts.tv_nsec = ts.tv_nsec % 1000000000; do { result = pthread_cond_timedwait(&_cond, mtx.impl().handle(), &ts); } while(result == EINTR); if(result != 0 && result != ETIMEDOUT) throw SystemError( result, "pthread_cond_timedwait failed"); return result != ETIMEDOUT; } void ConditionImpl::signal() { int rc = pthread_cond_signal( &_cond ); if( rc != 0 ) throw SystemError( rc, "pthread_cond_signal failed"); } void ConditionImpl::broadcast() { int rc = pthread_cond_broadcast( &_cond ); if( rc != 0 ) throw SystemError( rc, "pthread_cond_broadcast failed"); } } �����������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/tcpserverimpl.h������������������������������������������������������������������0000664�0001750�0001750�00000005722�12256773774�014213� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_NET_TCPSERVERIMPL_H #define CXXTOOLS_NET_TCPSERVERIMPL_H #include "selectableimpl.h" #include <cxxtools/signal.h> #include <string> #include <vector> #include <sys/types.h> #include <sys/socket.h> #include "config.h" namespace cxxtools { class SelectorBase; namespace net { class TcpServer; class TcpServerImpl : public SelectableImpl { private: TcpServer& _server; struct Listener { int _fd; struct sockaddr_storage _servaddr; }; typedef std::vector<Listener> Listeners; Listeners _listeners; int _pendingAccept; pollfd* _pfd; int _wakePipe[2]; #ifdef HAVE_TCP_DEFER_ACCEPT bool _deferAccept; #endif int create(int domain, int type, int protocol); public: TcpServerImpl(TcpServer& server); ~TcpServerImpl(); void close(); void listen(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags); void terminateAccept(); #ifdef HAVE_TCP_DEFER_ACCEPT void deferAccept(bool sw); #endif bool wait(std::size_t msecs); void attach(SelectorBase& s); void detach(SelectorBase& s); // implementation using poll std::size_t pollSize() const; // implementation using poll std::size_t initializePoll(pollfd* pfd, std::size_t pollSize); // implementation using poll bool checkPollEvent(); int accept(int flags, struct sockaddr* sa, socklen_t& sa_len); }; } // namespace net } // namespace cxxtools #endif // CXXTOOLS_NET_TCPSERVERIMPL_H ����������������������������������������������cxxtools-2.2.1/src/inifile.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000006410�12256773774�013261� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/inifile.h> #include <cxxtools/iniparser.h> #include <cxxtools/log.h> #include <fstream> #include <stdexcept> log_define("cxxtools.inifile") namespace cxxtools { namespace { class IniFileEvent : public IniParser::Event { IniFile& iniFile; std::string section; std::string key; public: IniFileEvent(IniFile& iniFile_) : iniFile(iniFile_) { } bool onSection(const std::string& section); bool onKey(const std::string& key); bool onValue(const std::string& value); }; bool IniFileEvent::onSection(const std::string& section_) { log_debug("section \"" << section_ << '"'); section = section_; return false; } bool IniFileEvent::onKey(const std::string& key_) { log_debug("key \"" << key_ << '"'); key = key_; return false; } bool IniFileEvent::onValue(const std::string& value) { log_debug("value(" << section << ", " << key << ")=" << value); iniFile.setValue(section, key, value); return false; } } IniFile::IniFile(const std::string& filename) { log_debug("read ini-file \"" << filename << '"'); std::ifstream in(filename.c_str()); if (!in) throw std::runtime_error("could not open file \"" + filename + '"'); IniFileEvent ev(*this); IniParser(ev).parse(in); } IniFile::IniFile(std::istream& in) { IniFileEvent ev(*this); IniParser(ev).parse(in); } std::ostream& operator << (std::ostream& out, const IniFile& ini) { for (IniFile::MapType::const_iterator si = ini.data.begin(); si != ini.data.end(); ++si) { out << '[' << si->first << "]\n"; for (IniFile::MapType::mapped_type::const_iterator it = si->second.begin(); it != si->second.end(); ++it) out << it->first << '=' << it->second << '\n'; } return out; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/addrinfo.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000005037�12256773774�013434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/addrinfo.h> #include <cxxtools/log.h> #include <string.h> #include "addrinfoimpl.h" log_define("cxxtools.net.addrinfo") namespace cxxtools { namespace net { AddrInfo::AddrInfo(AddrInfoImpl* impl) : _impl(impl) { if (_impl) _impl->addRef(); } AddrInfo::AddrInfo(const std::string& host, unsigned short port, bool listen) : _impl(0) { log_debug("host=" << host << " port=" << port); struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; if (listen) hints.ai_flags |= AI_PASSIVE; _impl = new AddrInfoImpl(host, port, hints); _impl->addRef(); } AddrInfo::AddrInfo(const AddrInfo& src) : _impl(src._impl) { _impl->addRef(); } AddrInfo::~AddrInfo() { if (_impl && _impl->release() == 0) delete _impl; } AddrInfo& AddrInfo::operator= (const AddrInfo& src) { if (src._impl != _impl) { if (_impl) _impl->release(); _impl = src._impl; if (_impl) _impl->addRef(); } return *this; } const std::string& AddrInfo::host() const { return _impl->host(); } unsigned short AddrInfo::port() const { return _impl->port(); } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/threadimpl.h���������������������������������������������������������������������0000664�0001750�0001750�00000004141�12266277345�013431� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/thread.h" #include <pthread.h> #include <sched.h> namespace cxxtools { class ThreadImpl { public: ThreadImpl() : _cb(0), _id(0), _detached(false) { } ~ThreadImpl() { delete _cb; } void init(const Callable<void>& cb); void detach(); void start(); void join(); void terminate(); static void exit() { ::pthread_exit( NULL ); } static void yield() { ::sched_yield(); } static void sleep(unsigned int ms); const Callable<void>* cb() { return _cb; } private: const Callable<void>* _cb; pthread_t _id; bool _detached; }; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/char.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000140724�12256773774�012566� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/char.h" #include "cxxtools/string.h" #include "cxxtools/utf8codec.h" #include <sstream> #include <iostream> #ifdef CXXTOOLS_WITH_STD_LOCALE #include "facets.cpp" namespace std { std::locale::id ctype<cxxtools::Char>::id; #if (defined _MSC_VER || defined __QNX__ || defined __xlC__) ctype<cxxtools::Char>::ctype(size_t refs) : ctype_base(refs) { } #else ctype<cxxtools::Char>::ctype(size_t refs) : locale::facet(refs) { } #endif ctype<cxxtools::Char>::~ctype() { } bool ctype<cxxtools::Char>::do_is(mask m, cxxtools::Char c) const { return (m & ctypeMask(c)) != 0; } const cxxtools::Char* ctype<cxxtools::Char>::do_is(const cxxtools::Char* begin, const cxxtools::Char* end, mask* vec) const { for( ; begin < end; ++begin) { *vec = ctypeMask(*begin); ++vec; } return end; } const cxxtools::Char* ctype<cxxtools::Char>::do_scan_is(mask m, const cxxtools::Char* begin, const cxxtools::Char* end) const { while( begin != end && !is(m,*begin)) { ++begin; } return begin; } const cxxtools::Char* ctype<cxxtools::Char>::do_scan_not(mask m, const cxxtools::Char* begin, const cxxtools::Char* end) const { while( begin != end && is(m,*begin)) { ++begin; } return begin; } cxxtools::Char ctype<cxxtools::Char>::do_toupper(cxxtools::Char ch) const { return toupper(ch); } const cxxtools::Char* ctype<cxxtools::Char>::do_toupper(cxxtools::Char* begin, const cxxtools::Char* end) const { for(; begin < end; ++begin) { *begin = do_toupper(*begin); } return end; } cxxtools::Char ctype<cxxtools::Char>::do_tolower(cxxtools::Char ch) const { return tolower(ch); } const cxxtools::Char* ctype<cxxtools::Char>::do_tolower(cxxtools::Char* begin, const cxxtools::Char* end) const { for(; begin < end; ++begin) { *begin = do_tolower(*begin); } return end; } cxxtools::Char ctype<cxxtools::Char>::do_widen(char ch) const { return cxxtools::Char(ch); } const char* ctype<cxxtools::Char>::do_widen(const char* begin, const char* end, cxxtools::Char* dest) const { for(const char* cur = begin; cur < end; ++cur) { *dest = do_widen(*cur); ++dest; } return end; } char ctype<cxxtools::Char>::do_narrow(cxxtools::Char ch, char dfault) const { return ch.narrow(dfault); } const cxxtools::Char* ctype<cxxtools::Char>::do_narrow(const cxxtools::Char* begin, const cxxtools::Char* end, char dfault, char* dest) const { for(const cxxtools::Char* cur = begin; cur < end; ++cur) { *dest = do_narrow(*cur, dfault); ++dest; } return end; } } // namespace std #endif namespace cxxtools { std::ostream& operator<< (std::ostream& out, Char ch) { Utf8Codec codec; char to[16]; MBState state; Utf8Codec::result r; const Char* from_next; char* to_next = to; r = codec.out(state, &ch, &ch + 1, from_next, to, to + sizeof(to), to_next); if (r == Utf8Codec::error) { out.setstate(std::ios::failbit); } else { out.write(to, to_next - to); } return out; } const unsigned short ctype_lookup1[69] = { 0, 104, 169, 257, 385, 402, 402, 498, 626, 626, 677, 755, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 883, 402, 402, 402, 1011, 1011, 1011, 1012, 1011, 1011, 1011, 1012, 0 }; const unsigned short ctype_lookup2[1141] = { 0, 127, 255, 382, 502, 582, 710, 837, 965, 1091, 1219, 1339, 1467, 1580, 1708, 1836, 1886, 1886, 2013, 2140, 2267, 2394, 2521, 2647, 2774, 2900, 3026, 3152, 3279, 3406, 3534, 3662, 3790, 3886, 4014, 4069, 4197, 4318, 4431, 4556, 4683, 4684, 4684, 4684, 4703, 4831, 4959, 5087, 5215, 5343, 5471, 5588, 1886, 1886, 1886, 1886, 1886, 1886, 5716, 1886, 5844, 5950, 6078, 6206, 6334, 6462, 6590, 6714, 6830, 6830, 6958, 7083, 7211, 7311, 7439, 7512, 7640, 7768, 7895, 8013, 7439, 7439, 6830, 8138, 6830, 6830, 8266, 1886, 1886, 1886, 1886, 1886, 1886, 8394, 7439, 8424, 8552, 8657, 8785, 8898, 9026, 9154, 7439, 7439, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9282, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9410, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9538, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 9666, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9794, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 4684, 4684, 10050, 1886, 10178, 10256, 4684, 4684, 10339, 10451, 10579, 10697, 10825, 10938, 11066, 11194, 11322, 1886, 1886, 1886, 11450, 11578, 11706, 11804, 1886, 1886, 1886, 1886, 1886, 1886, 11932, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 7439, 12060, 12188, 12313, 1886, 1886, 12441, 1886, 12569, 12695, 12819, 12941, 12965, 13083, 13153, 13223, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 4684, 13351, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 4684, 4684, 4684, 4684, 13408, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 13535, 1886, 13663, 13679, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 9922, 13807, 0 }; #include "unicode.h" const unsigned short upper_lookup1[69]= { 0, 74, 74, 76, 203, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 0 }; const unsigned short upper_lookup2[332]= { 0, 123, 251, 379, 499, 627, 686, 770, 894, 1020, 1147, 1268, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1402, 1508, 1636, 1764, 1275, 1275, 1880, 1275, 1275, 1275, 1275, 1275, 1275, 2008, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 32, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 2114, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275,0 }; const short upper_data[2243]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 0, -32, -32, -32, -32, -32, -32, -32, 121, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -232, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, -300, 0, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 97, 0, 0, 0, -1, 0, 0, 0, 0, 130, 0, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 56, 0, 0, 0, 0, 0, -1, -2, 0, -1, -2, 0, -1, -2, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -79, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, -2, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, -206, 0, -205, -205, 0, -202, 0, -203, 0, 0, 0, 0, -205, 0, 0, -207, 0, 0, 0, 0, -209, -211, 0, 0, 0, 0, 0, -211, 0, 0, -213, 0, 0, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -218, 0, 0, -218, 0, 0, 0, 0, -218, 0, -217, -217, 0, 0, 0, 0, 0, 0, -219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -38, -37, -37, -37, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -31, -32, -32, -32, -32, -32, -32, -32, -32, -32, -64, -63, -63, 0, -62, -57, 0, 0, 0, -47, -54, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, -86, -80, 7, 0, 0, -96, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 8, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 74, 74, 86, 86, 86, 86, 100, 100, 128, 128, 112, 112, 126, 126, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7205, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; const unsigned short lower_lookup1[69]= { 0, 74, 74, 76, 203, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 7, 0 }; const unsigned short lower_lookup2[332]= { 0, 91, 219, 346, 466, 517, 517, 639, 767, 893, 1021, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 1149, 1255, 1376, 1496, 517, 517, 1621, 517, 517, 517, 517, 517, 517, 1733, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 1828, 517, 517, 517, 517, 517, 517, 517, 517, 1956, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517, 0 }; const short lower_data[2085]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -199, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -121, 1, 0, 1, 0, 1, 0, 0, 210, 1, 0, 1, 0, 206, 1, 0, 205, 205, 1, 0, 0, 79, 202, 203, 1, 0, 205, 207, 0, 211, 209, 1, 0, 0, 0, 211, 213, 0, 214, 1, 0, 1, 0, 1, 0, 218, 1, 0, 218, 0, 0, 1, 0, 218, 1, 0, 217, 217, 1, 0, 1, 0, 219, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 2, 1, 0, 1, 0, -97, -56, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, -130, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 37, 37, 37, 0, 64, 0, 63, 63, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -60, 0, 0, 1, 0, -7, 1, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, -8, 0, -8, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -8, -8, -8, -8, -8, -8, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -74, -74, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -86, -86, -86, -86, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -100, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -8, -112, -112, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, -128, -126, -126, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7517, 0, 0, 0, -8383, -8262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Char tolower(const cxxtools::Char& ch) { const cxxtools::Char::value_type ucs = ch.value(); return Char(ucs + lower_data[lower_lookup2[lower_lookup1[ucs>>14]+((ucs>>7)&127)]+(ucs&127)]); } Char toupper(const Char& ch) { const cxxtools::Char::value_type ucs = ch.value(); return Char(ucs + upper_data[upper_lookup2[upper_lookup1[ucs>>14]+((ucs>>7)&127)]+(ucs&127)]); } std::ctype_base::mask ctypeMask(const Char& ch) { const cxxtools::Char::value_type c = ch.value(); return ctype_data[ ctype_lookup2[ ctype_lookup1[c>>14]+((c>>7)&127) ]+(c&127) ]; } } // namespace cxxtools ��������������������������������������������cxxtools-2.2.1/src/tcpstream.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000004051�12256773774�013643� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/tcpstream.h> namespace cxxtools { namespace net { void TcpStream::init(std::size_t timeout) { _socket.setTimeout(timeout); attachDevice(_socket); cxxtools::connect(_socket.inputReady, *this, &TcpStream::onInput); cxxtools::connect(_socket.outputReady, *this, &TcpStream::onOutput); cxxtools::connect(_socket.connected, *this, &TcpStream::onConnected); cxxtools::connect(_socket.closed, *this, &TcpStream::onClosed); } void TcpStream::onInput(IODevice&) { inputReady(*this); } void TcpStream::onOutput(IODevice&) { outputReady(*this); } void TcpStream::onConnected(TcpSocket&) { connected(*this); } void TcpStream::onClosed(TcpSocket&) { closed(*this); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/settingsreader.cpp���������������������������������������������������������������0000664�0001750�0001750�00000011040�12256773774�014660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "settingsreader.h" namespace cxxtools { void SettingsReader::State::syntaxError(unsigned line) { throw SettingsError("syntax error", line); } void SettingsReader::parse(cxxtools::SerializationInfo& si) { _current = &si; state = BeginStatement::instance(); _line = 1; _isDotted = false; Char ch = Char(0); while ( _is->get(ch) ) { state = state->onChar(ch, *this); if(ch == '\n') { ++_line; } } // if exceptions are deactivated caller must check // istream for failure if( _is->bad() ) return; state->onEof(*this); } void SettingsReader::enterMember() { // // Consider namespace at top-level. For example a.b.c means c // as a child of a.b. both are only added when not present. // If we are not top-level, always add a node. // if( _depth == 0 ) { std::string name; if( _section.size() ) { name += _section.narrow(); name += '.'; name += _token.narrow(); } else { name = _token.narrow(); } // // Add a serialization node for the parent if not present. // In this example the parent is a.b // size_t pos = name.rfind('.'); if(pos != std::string::npos) { std::string root = name.substr( 0, pos ); cxxtools::SerializationInfo* current = _current->findMember( root ); if(current == 0) current = &( _current->addMember( root ) ); _current = current; ++_depth; _isDotted = true; // remember that we have to leave twice later name = name.substr( ++pos ); // TODO: use remove or erase } // // Add a node for the actual value if not present. In this // example c is a parent of a.b // cxxtools::SerializationInfo* current = _current->findMember( name ); if(current == 0) current = &( _current->addMember( name ) ); _current = current; } else { _current = &( _current->addMember( _token.narrow() ) ); } ++_depth; _token.clear(); } void SettingsReader::leaveMember() { //std::cerr << "@" << std::endl; if(0 == _current->parent() ) throw SettingsError("too many closing braces", _line); _current = _current->parent(); --_depth; if(_depth == 1 && _isDotted) { // leaving a dotted entry _current = _current->parent(); _isDotted = false; --_depth; } } void SettingsReader::pushValue() { _current->setValue(_token); _token.clear(); } void SettingsReader::pushTypeName() { _current->setTypeName( _token.narrow() ); _token.clear(); } void SettingsReader::pushName() { _current->setName( _token.narrow() ); _token.clear(); } cxxtools::Char SettingsReader::getEscaped() { cxxtools::Char ch; if( ! _is->get(ch) ) throw SettingsError("unexpected EOF", _line); switch( ch.value() ) { case 'n': return cxxtools::Char(L'\n'); case 'r': return cxxtools::Char(L'\r'); } return ch; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/log.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000060671�12266277345�012426� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/log/cxxtools.h> #include <cxxtools/refcounted.h> #include <cxxtools/smartptr.h> #include <cxxtools/convert.h> #include <cxxtools/mutex.h> #include <cxxtools/atomicity.h> #include <cxxtools/serializationinfo.h> #include <cxxtools/xml/xmldeserializer.h> #include <cxxtools/propertiesdeserializer.h> #include <cxxtools/net/udp.h> #include <cxxtools/fileinfo.h> #include <vector> #include <map> #include <fstream> #include <sstream> #include <unistd.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <sys/time.h> #include <pthread.h> namespace cxxtools { namespace { Mutex loggersMutex; Mutex logMutex; Mutex poolMutex; atomic_t mutexWaitCount = 0; template <typename T, unsigned MaxPoolSize = 8> class LPool { std::vector<T*> pool; Mutex mutex; public: ~LPool() { for (unsigned n = 0; n < pool.size(); ++n) delete pool[n]; } T* getInstance() { if (pool.empty()) { // we don't care about locking here since it is not dangerous to get a false answer return new T(); } T* impl; { MutexLock lock(poolMutex); if (pool.empty()) return new T(); impl = pool.back(); pool.pop_back(); } return impl; } void releaseInstance(T* inst) { MutexLock lock(poolMutex); if (pool.size() < MaxPoolSize) pool.push_back(inst); else delete inst; } }; class ScopedAtomicIncrementer { atomic_t& count; public: explicit ScopedAtomicIncrementer(atomic_t& count_) : count(count_) { atomicIncrement(count); } ~ScopedAtomicIncrementer() { atomicDecrement(count); } }; void logentry(std::string& entry, const char* level, const std::string& category) { struct timeval t; gettimeofday(&t, 0); // format date only once per second: static char date[20]; static time_t psec = 0; time_t sec = static_cast<time_t>(t.tv_sec); if (sec != psec) { struct tm tt; localtime_r(&sec, &tt); int year = 1900 + tt.tm_year; int mon = tt.tm_mon + 1; date[0] = static_cast<char>('0' + year / 1000 % 10); date[1] = static_cast<char>('0' + year / 100 % 10); date[2] = static_cast<char>('0' + year / 10 % 10); date[3] = static_cast<char>('0' + year % 10); date[4] = '-'; date[5] = static_cast<char>('0' + mon / 10); date[6] = static_cast<char>('0' + mon % 10); date[7] = '-'; date[8] = static_cast<char>('0' + tt.tm_mday / 10); date[9] = static_cast<char>('0' + tt.tm_mday % 10); date[10] = ' '; date[11] = static_cast<char>('0' + tt.tm_hour / 10); date[12] = static_cast<char>('0' + tt.tm_hour % 10); date[13] = ':'; date[14] = static_cast<char>('0' + tt.tm_min / 10); date[15] = static_cast<char>('0' + tt.tm_min % 10); date[16] = ':'; date[17] = static_cast<char>('0' + tt.tm_sec / 10); date[18] = static_cast<char>('0' + tt.tm_sec % 10); date[19] = '.'; psec = sec; } entry.append(date, 20); entry += static_cast<char>('0' + t.tv_usec / 100000 % 10); entry += static_cast<char>('0' + t.tv_usec / 10000 % 10); entry += static_cast<char>('0' + t.tv_usec / 1000 % 10); entry += static_cast<char>('0' + t.tv_usec / 100 % 10); entry += static_cast<char>('0' + t.tv_usec / 10 % 10); entry += ' '; entry += '['; char str[64]; char* p = putInt(str, getpid()); entry.append(str, p - str); entry += '.'; p = putInt(str, (unsigned long)pthread_self()); entry.append(str, p - str); entry += "] "; entry += level; entry += ' '; entry += category; entry += " - "; } class LogAppender : public RefCounted { public: virtual ~LogAppender() { } virtual void putMessage(const std::string& msg) = 0; virtual void finish(bool flush) = 0; }; ////////////////////////////////////////////////////////////////////// // FdAppender - writes log to a file descriptor // class FdAppender : public LogAppender { protected: int _fd; std::string _msg; public: explicit FdAppender(int fd) : _fd(fd) { } virtual void putMessage(const std::string& msg); virtual void finish(bool flush); }; void FdAppender::putMessage(const std::string& msg) { _msg += msg; _msg += '\n'; } void FdAppender::finish(bool flush) { if (!flush && _msg.size() < 8192) return; ::write(_fd, _msg.data(), _msg.size()); _msg.clear(); } ////////////////////////////////////////////////////////////////////// // FileAppender // class FileAppender : public LogAppender { protected: std::string _fname; std::ofstream _ofile; public: explicit FileAppender(const std::string& fname); virtual void putMessage(const std::string& msg); virtual void finish(bool flush); }; FileAppender::FileAppender(const std::string& fname) : _fname(fname), _ofile(fname.c_str(), std::ios::out | std::ios::app) { } void FileAppender::putMessage(const std::string& msg) { if (!_ofile.is_open()) { _ofile.clear(); _ofile.open(_fname.c_str(), std::ios::out | std::ios::app); } _ofile << msg << '\n'; } void FileAppender::finish(bool flush) { if (flush) _ofile.flush(); } ////////////////////////////////////////////////////////////////////// // RollingFileAppender // class RollingFileAppender : public FileAppender { unsigned _maxfilesize; unsigned _maxbackupindex; unsigned _fsize; void doRotate(); std::string mkfilename(unsigned idx) const; public: RollingFileAppender(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex); virtual void putMessage(const std::string& msg); }; RollingFileAppender::RollingFileAppender(const std::string& fname, unsigned maxfilesize, unsigned maxbackupindex) : FileAppender(fname), _maxfilesize(maxfilesize), _maxbackupindex(maxbackupindex), _fsize(_ofile.tellp()) { } void RollingFileAppender::doRotate() { _ofile.clear(); _ofile.close(); // ignore unlink- and rename-errors. In case of failure the // original file is reopened std::string newfilename = mkfilename(_maxbackupindex); ::unlink(newfilename.c_str()); for (unsigned idx = _maxbackupindex; idx > 0; --idx) { std::string oldfilename = mkfilename(idx - 1); ::rename(oldfilename.c_str(), newfilename.c_str()); newfilename = oldfilename; } ::rename(_fname.c_str(), newfilename.c_str()); _ofile.open(_fname.c_str(), std::ios::out | std::ios::app); _fsize = 0; } std::string RollingFileAppender::mkfilename(unsigned idx) const { std::string fname(_fname); fname += '.'; fname += convert<std::string>(idx); return fname; } void RollingFileAppender::putMessage(const std::string& msg) { if (_fsize >= _maxfilesize) doRotate(); FileAppender::putMessage(msg); _fsize += msg.size() + 1; // FileAppender adds line feed to the message } ////////////////////////////////////////////////////////////////////// // UdpAppender // class UdpAppender : public LogAppender { net::UdpSender _loghost; std::string _msg; public: UdpAppender(const std::string& host, unsigned short int port, bool broadcast = true) : _loghost(host, port, broadcast) { } virtual void putMessage(const std::string& msg); virtual void finish(bool flush); }; void UdpAppender::putMessage(const std::string& msg) { _msg = msg; } void UdpAppender::finish(bool flush) { try { _loghost.send(_msg); } catch (const std::exception&) { } _msg.clear(); } ////////////////////////////////////////////////////////////////////// Logger::log_level_type str2loglevel(const std::string& level, const std::string& category = std::string()) { char l = level.empty() ? '\0' : level[0]; switch (l) { case 'f': case 'F': return Logger::LOG_LEVEL_FATAL; case 'e': case 'E': return Logger::LOG_LEVEL_ERROR; case 'w': case 'W': return Logger::LOG_LEVEL_WARN; case 'i': case 'I': return Logger::LOG_LEVEL_INFO; case 'd': case 'D': return Logger::LOG_LEVEL_DEBUG; case 't': case 'T': return Logger::LOG_LEVEL_TRACE; default: { std::string msg = "unknown log level \"" + level + '\"'; if (!category.empty()) msg += " for category \"" + category + '"'; throw std::runtime_error(msg); } } } } ////////////////////////////////////////////////////////////////////// // Logger // ////////////////////////////////////////////////////////////////////// // LoggerManagerConfiguration // class LoggerManagerConfiguration::Impl { public: typedef std::map<std::string, Logger::log_level_type> LogLevels; private: friend void operator>>= (const SerializationInfo& si, LoggerManagerConfiguration::Impl& loggerManagerConfigurationImpl); std::string _fname; unsigned _maxfilesize; unsigned _maxbackupindex; std::string _loghost; unsigned short _logport; bool _broadcast; bool _tostdout; // flag for console output: true=stdout, false=stderr Logger::log_level_type _rootLevel; LogLevels _logLevels; public: Impl() : _maxfilesize(0), _maxbackupindex(0), _logport(0), _broadcast(true), _rootLevel(Logger::LOG_LEVEL_FATAL) { } const std::string& fname() const { return _fname; } unsigned maxfilesize() const { return _maxfilesize; } unsigned maxbackupindex() const { return _maxbackupindex; } const std::string& loghost() const { return _loghost; } unsigned short logport() const { return _logport; } bool broadcast() const { return _broadcast; } bool tostdout() const { return _tostdout; } Logger::log_level_type rootLevel() const { return _rootLevel; } Logger::log_level_type logLevel(const std::string& category) const; const LogLevels& logLevels() const { return _logLevels; } }; LoggerManagerConfiguration::LoggerManagerConfiguration() : _impl(new LoggerManagerConfiguration::Impl()) { } LoggerManagerConfiguration::LoggerManagerConfiguration(const LoggerManagerConfiguration& c) : _impl(new Impl(*c._impl)) { } LoggerManagerConfiguration& LoggerManagerConfiguration::operator=(const LoggerManagerConfiguration& c) { delete _impl; _impl = 0; _impl = new Impl(*c._impl); return *this; } LoggerManagerConfiguration::~LoggerManagerConfiguration() { delete _impl; } Logger::log_level_type LoggerManagerConfiguration::rootLevel() const { return _impl->rootLevel(); } Logger::log_level_type LoggerManagerConfiguration::logLevel(const std::string& category) const { return _impl->logLevel(category); } Logger::log_level_type LoggerManagerConfiguration::Impl::logLevel(const std::string& category) const { // check for exact match of category in log level settings LogLevels::const_iterator lit = _logLevels.find(category); if (lit != _logLevels.end()) return lit->second; // find best match of category in log level settings std::string::size_type best_len = 0; Logger::log_level_type best_level = _rootLevel; for (LogLevels::const_iterator it = _logLevels.begin(); it != _logLevels.end(); ++it) { if (it->first.size() > best_len && it->first.size() < category.size() && category.at(it->first.size()) == '.' && category.compare(0, it->first.size(), it->first) == 0) { best_len = it->first.size(); best_level = it->second; } } return best_level; } void operator>>= (const SerializationInfo& si, LoggerManagerConfiguration::Impl& impl) { if (si.getMember("file", impl._fname)) { std::string s; if (si.getMember("maxfilesize", s)) { bool ok = true; std::string::iterator it = getInt(s.begin(), s.end(), ok, impl._maxfilesize); if (!ok) throw std::runtime_error("failed to read maxfilesize (\"" + s + "\")"); if (it != s.end()) { switch (*it) { case 'k': case 'K': impl._maxfilesize *= 1024; break; case 'm': case 'M': impl._maxfilesize *= 1024 * 1024; break; case 'g': case 'G': impl._maxfilesize *= 1024 * 1024 * 1024; break; } } si.getMember("maxbackupindex") >>= impl._maxbackupindex; } } else if (si.getMember("logport", impl._logport)) { si.getMember("loghost", impl._loghost); si.getMember("broadcast", impl._broadcast); } else { if (!si.getMember("stdout", impl._tostdout)) impl._tostdout = false; } std::string rootLevel; if (!si.getMember("rootlogger", rootLevel)) impl._rootLevel = Logger::LOG_LEVEL_FATAL; else impl._rootLevel = str2loglevel(rootLevel); const SerializationInfo* psi = si.findMember("loggers"); if (psi) { std::string category; std::string levelstr; Logger::log_level_type level; for( SerializationInfo::ConstIterator it = psi->begin(); it != psi->end(); ++it) { it->getMember("category") >>= category; if (impl._logLevels.find(category) != impl._logLevels.end()) throw std::runtime_error("level already set for category \"" + category + '"'); it->getMember("level") >>= levelstr; if (levelstr.empty()) level = Logger::LOG_LEVEL_FATAL; else level = str2loglevel(levelstr, category); impl._logLevels[category] = level; } } else if ((psi = si.findMember("logger")) != 0) { for( SerializationInfo::ConstIterator it = psi->begin(); it != psi->end(); ++it) { std::string category = it->name(); std::string levelstr; Logger::log_level_type level; it->getValue(levelstr); if (levelstr.empty()) level = Logger::LOG_LEVEL_FATAL; else level = str2loglevel(levelstr, category); impl._logLevels[category] = level; } } } void operator>>= (const SerializationInfo& si, LoggerManagerConfiguration& loggerManagerConfiguration) { si >>= *loggerManagerConfiguration.impl(); } ////////////////////////////////////////////////////////////////////// // LoggerManager // class LoggerManager::Impl { SmartPtr<LogAppender> _appender; LoggerManagerConfiguration _config; typedef std::map<std::string, Logger*> Loggers; // map category => logger Loggers _loggers; Impl(const Impl&); Impl& operator=(const Impl&); public: explicit Impl(const LoggerManagerConfiguration& config); ~Impl(); Logger* getLogger(const std::string& category); LogAppender& appender() { return *_appender; } Logger::log_level_type rootLevel() const { return _config.rootLevel(); } Logger::log_level_type logLevel(const std::string& category) const { return _config.logLevel(category); } }; LoggerManager::Impl::Impl(const LoggerManagerConfiguration& config) { if (config.impl()->fname().empty()) { if (config.impl()->logport() != 0) { _appender = new UdpAppender(config.impl()->loghost(), config.impl()->logport(), config.impl()->broadcast()); } else { _appender = new FdAppender(config.impl()->tostdout() ? STDOUT_FILENO : STDERR_FILENO); } } else if (config.impl()->maxfilesize() == 0) { _appender = new FileAppender(config.impl()->fname()); } else { _appender = new RollingFileAppender(config.impl()->fname(), config.impl()->maxfilesize(), config.impl()->maxbackupindex()); } _config = config; } LoggerManager::Impl::~Impl() { for (Loggers::iterator it = _loggers.begin(); it != _loggers.end(); ++it) delete it->second; } bool LoggerManager::_enabled = false; LoggerManager::LoggerManager() { } LoggerManager::~LoggerManager() { MutexLock lock(logMutex); delete _impl; _enabled = false; } LoggerManager& LoggerManager::getInstance() { static LoggerManager loggerManager; return loggerManager; } void LoggerManager::logInit() { std::string logXml = "log.xml"; if (FileInfo::exists(logXml)) { logInit(logXml); } else { std::string logProperties = "log.properties"; if (FileInfo::exists(logProperties)) logInit(logProperties); } } void LoggerManager::logInit(const std::string& fname) { std::ifstream in(fname.c_str()); if (in) { try { if (fname.size() >= 11 && fname.compare(fname.size() - 11, 11, ".properties") == 0) { PropertiesDeserializer d(in); LoggerManagerConfiguration config; d.deserialize(config); getInstance().configure(config); } else { xml::XmlDeserializer d(in); LoggerManagerConfiguration config; d.deserialize(config); getInstance().configure(config); } } catch (const std::exception& e) { std::cerr << "failed to initialize logging: " << e.what() << std::endl; } } } void LoggerManager::logInit(const cxxtools::SerializationInfo& si) { LoggerManagerConfiguration config; si >>= config; getInstance().configure(config); } void LoggerManager::configure(const LoggerManagerConfiguration& config) { Impl* p = new Impl(config); delete _impl; _impl = p; _enabled = true; } Logger::log_level_type LoggerManager::rootLevel() const { return _impl->rootLevel(); } Logger::log_level_type LoggerManager::logLevel(const std::string& category) const { return _impl->logLevel(category); } Logger* LoggerManager::getLogger(const std::string& category) { if (_impl == 0) return 0; return _impl->getLogger(category); } Logger* LoggerManager::Impl::getLogger(const std::string& category) { MutexLock lock(loggersMutex); // check for existing loggers Loggers::iterator it = _loggers.find(category); if (it != _loggers.end()) return it->second; Logger* ret = new Logger(category, logLevel(category)); _loggers[category] = ret; return ret; } ////////////////////////////////////////////////////////////////////// // LogMessage // class LogMessage::Impl { Logger* _logger; const char* _level; std::ostringstream _msg; public: void setLogger(Logger* logger) { _logger = logger; } void setLevel(const char* level) { _level = level; } void finish(); std::ostringstream& out() { return _msg; } std::string str() { return _msg.str(); } void clear() { _msg.clear(); _msg.str(std::string()); } }; namespace { LPool<LogMessage::Impl> logMessageImplPool; } LogMessage::LogMessage(Logger* logger, const char* level) : _impl(logMessageImplPool.getInstance()) { _impl->setLogger(logger); _impl->setLevel(level); } LogMessage::LogMessage(Logger* logger, Logger::log_level_type level) : _impl(logMessageImplPool.getInstance()) { _impl->setLogger(logger); _impl->setLevel(level >= Logger::LOG_LEVEL_TRACE ? "TRACE" : level >= Logger::LOG_LEVEL_DEBUG ? "DEBUG" : level >= Logger::LOG_LEVEL_INFO ? "INFO" : level >= Logger::LOG_LEVEL_WARN ? "WARN" : level >= Logger::LOG_LEVEL_ERROR ? "ERROR" : "FATAL"); } LogMessage::~LogMessage() { if (_impl) { _impl->finish(); logMessageImplPool.releaseInstance(_impl); } } void LogMessage::finish() { _impl->finish(); logMessageImplPool.releaseInstance(_impl); _impl = 0; } void LogMessage::Impl::finish() { try { ScopedAtomicIncrementer inc(mutexWaitCount); MutexLock lock(logMutex); if (!LoggerManager::isEnabled()) return; std::string msg; logentry(msg, _level, _logger->getCategory()); msg += _msg.str(); LogAppender& appender = LoggerManager::getInstance().impl()->appender(); appender.putMessage(msg); appender.finish((atomicGet(mutexWaitCount) <= 1)); } catch (const std::exception&) { } clear(); } std::ostream& LogMessage::out() { return _impl->out(); } std::string LogMessage::str() const { return _impl->str(); } ////////////////////////////////////////////////////////////////////// // LogTracer // class LogTracer::Impl { std::ostringstream _msg; Logger* _logger; void putmessage(const char* state) const; public: explicit Impl(Logger* logger) : _logger(logger) { } void setLogger(Logger* logger) { _logger = logger; } std::ostream& out() { return _msg; } void enter() const { putmessage("ENTER "); } void exit() const { putmessage("EXIT "); } }; LogTracer::LogTracer() : _impl(0) { } LogTracer::~LogTracer() { if (_impl) { _impl->exit(); delete _impl; } } void LogTracer::setLogger(Logger* l) { if (_impl) _impl->setLogger(l); else _impl = new Impl(l); } std::ostream& LogTracer::out() { return _impl->out(); } void LogTracer::enter() { if (_impl) _impl->enter(); } void LogTracer::exit() { if (_impl) { _impl->exit(); delete _impl; _impl = 0; } } void LogTracer::Impl::putmessage(const char* state) const { try { ScopedAtomicIncrementer inc(mutexWaitCount); MutexLock lock(logMutex); if (!LoggerManager::isEnabled()) return; std::string msg; logentry(msg, "TRACE", _logger->getCategory()); msg += state; msg += _msg.str(); LogAppender& appender = LoggerManager::getInstance().impl()->appender(); appender.putMessage(msg); appender.finish((atomicGet(mutexWaitCount) <= 1)); } catch (const std::exception&) { } } } �����������������������������������������������������������������������cxxtools-2.2.1/src/csvdeserializer.cpp��������������������������������������������������������������0000775�0001750�0001750�00000004232�12266277345�015035� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/csvdeserializer.h> #include <cxxtools/serializationerror.h> #include <stdexcept> namespace cxxtools { const Char CsvDeserializer::autoDelimiter = CsvParser::autoDelimiter; CsvDeserializer::CsvDeserializer(std::istream& in, TextCodec<Char, char>* codec) : _ts(new TextIStream(in, codec)), _in(*_ts) { } CsvDeserializer::CsvDeserializer(TextIStream& in) : _ts(0), _in(in) { } CsvDeserializer::~CsvDeserializer() { delete _ts; } void CsvDeserializer::doDeserialize() { Char ch; _parser.begin(*this); while (_in.get(ch)) _parser.advance(ch); if (_in.rdstate() & std::ios::badbit) SerializationError::doThrow("csv deserialization failed"); _parser.finish(); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/propertiesdeserializer.cpp�������������������������������������������������������0000664�0001750�0001750�00000010336�12266277345�016435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/propertiesdeserializer.h> #include <cxxtools/utf8codec.h> #include <cxxtools/properties.h> #include <cxxtools/log.h> log_define("cxxtools.propertiesdeserializer") namespace cxxtools { PropertiesDeserializer::PropertiesDeserializer(std::istream& in, TextCodec<Char, char>* codec) : _ts(new TextIStream(in, codec ? codec : new Utf8Codec())), _in(*_ts) { } PropertiesDeserializer::PropertiesDeserializer(TextIStream& in) : _ts(0), _in(in) { } PropertiesDeserializer::~PropertiesDeserializer() { delete _ts; } class PropertiesDeserializer::Ev : public PropertiesParser::Event { PropertiesDeserializer& _deserializer; std::vector<std::string> _keys; std::string _longkey; public: Ev(PropertiesDeserializer& deserializer) : _deserializer(deserializer) { } virtual bool onKeyPart(const String& key); virtual bool onKey(const String& key); virtual bool onValue(const String& value); }; bool PropertiesDeserializer::Ev::onKeyPart(const String& key) { _keys.push_back(Utf8Codec::encode(key)); return false; } bool PropertiesDeserializer::Ev::onKey(const String& key) { _longkey = Utf8Codec::encode(key); return false; } bool PropertiesDeserializer::Ev::onValue(const String& value) { SerializationInfo* p = _deserializer.current()->findMember(_longkey); if (p == 0) p = &_deserializer.current()->addMember(_longkey); *p <<= value; p->addMember(std::string()) <<= value; if (_keys.size() > 1) { std::string key = _keys[0]; // foo.bar.baz => foo std::string member = _longkey.substr(key.size() + 1); // foo.bar.baz => bar.baz for (unsigned n = 1; n < _keys.size(); ++n ) { log_debug("add key " << key << " member " << member << " value " << value); SerializationInfo* p = _deserializer.current()->findMember(key); if (p == 0) p = &_deserializer.current()->addMember(key); p->addMember(member) <<= value; key += '.'; // foo => foo.bar; foo.bar => foo.bar.baz key += _keys[n]; member.erase(0, _keys[n].size() + 1); // bar.baz => baz } } _keys.clear(); _longkey.clear(); return false; } void PropertiesDeserializer::doDeserialize() { Ev ev(*this); PropertiesParser parser(ev); Char ch; while (_in.get(ch)) parser.parse(ch); if (_in.rdstate() & std::ios::badbit) SerializationError::doThrow("propertiesdeserialization failed"); parser.end(); log_debug(*current()); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/clockimpl.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000006006�12266277345�013612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "clockimpl.h" #include <sys/time.h> #include <time.h> namespace cxxtools { ClockImpl::ClockImpl() {} ClockImpl::~ClockImpl() {} void ClockImpl::start() { #ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_MONOTONIC, &_startTime); #else gettimeofday( &_startTime, 0 ); #endif } Timespan ClockImpl::stop() { #ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_MONOTONIC, &_stopTime); time_t secs = _stopTime.tv_sec - _startTime.tv_sec; suseconds_t usecs = (_stopTime.tv_nsec - _startTime.tv_nsec) / 1000; #else gettimeofday( &_stopTime, 0 ); time_t secs = _stopTime.tv_sec - _startTime.tv_sec; suseconds_t usecs = _stopTime.tv_usec - _startTime.tv_usec; #endif return Timespan(secs, usecs); } DateTime ClockImpl::getSystemTime() { struct ::tm tim; struct timeval tod; gettimeofday(&tod, NULL); time_t sec = tod.tv_sec; gmtime_r(&sec, &tim); return DateTime( tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, tod.tv_usec / 1000 ); } DateTime ClockImpl::getLocalTime() { struct timeval tod; gettimeofday(&tod, NULL); struct tm tim; time_t sec = tod.tv_sec; localtime_r(&sec, &tim); return DateTime( tim.tm_year + 1900, tim.tm_mon + 1, tim.tm_mday, tim.tm_hour, tim.tm_min, tim.tm_sec, tod.tv_usec / 1000 ); } Timespan ClockImpl::getSystemTicks() { struct timeval tv; gettimeofday( &tv, 0 ); return Timespan(tv.tv_sec, tv.tv_usec); } } // namespace System ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/iniparser.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000011123�12266277345�013625� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/iniparser.h> #include <cxxtools/log.h> #include <cctype> #include <iostream> #include <stdexcept> log_define("cxxtools.iniparser") namespace cxxtools { bool IniParser::Event::onSection(const std::string& section) { return false; } bool IniParser::Event::onKey(const std::string& key) { return false; } bool IniParser::Event::onValue(const std::string& key) { return false; } bool IniParser::Event::onComment(const std::string& comment) { return false; } bool IniParser::Event::onError() { throw std::runtime_error("parse error in ini-file"); return true; } void IniParser::parse(std::istream& in) { char ch; while (in.get(ch) && !parse(ch)) ; end(); } bool IniParser::parse(char ch) { bool ret = false; switch (state) { case state_0: if (ch == '[') state = state_section; else if (std::isalnum(ch)) { data = ch; state = state_key; } else if (ch == '#' || ch == ';') { state = state_comment; } else if (std::isspace(ch)) ; else { log_debug("onError"); ret = event.onError(); } break; case state_section: if (ch == ']') { log_debug("onSection(" << data << ')'); ret = event.onSection(data); data.clear(); state = state_0; } else data += ch; break; case state_key: if (ch == '=') { log_debug("onKey(" << data << ')'); ret = event.onKey(data); state = state_value0; } else if (std::isspace(ch)) { log_debug("onKey(" << data << ')'); ret = event.onKey(data); state = state_key_sp; } else data += ch; break; case state_key_sp: if (ch == '=') state = state_value0; else if (!std::isspace(ch)) { log_debug("onError"); ret = event.onError(); } break; case state_value0: if (ch == '\n') { log_debug("onValue(\"\")"); ret = event.onValue(std::string()); state = state_0; } else if (!std::isspace(ch)) { data = ch; state = state_value; } break; case state_value: if (ch == '\n') { log_debug("onValue(" << data << ')'); ret = event.onValue(data); data.clear(); state = state_0; } else data += ch; break; case state_comment: if (ch == '\n') state = state_0; break; } return ret; } void IniParser::end() { switch (state) { case state_0: case state_comment: break; case state_section: case state_key: case state_key_sp: log_debug("onError"); event.onError(); break; case state_value0: log_debug("onValue(\"\")"); event.onValue(std::string()); break; case state_value: log_debug("onValue" << data << ')'); event.onValue(data); break; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/conversionerror.cpp��������������������������������������������������������������0000664�0001750�0001750�00000004037�12256773774�015104� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/conversionerror.h" namespace cxxtools { ConversionError::ConversionError(const std::string& msg) : std::runtime_error(msg) { } void ConversionError::doThrow(const char* typeto, const char* typefrom) { std::string msg = "conversion from type "; msg += typefrom; msg += " to type "; msg += typeto; msg += " failed"; throw ConversionError(msg); } void ConversionError::doThrow(const char* typeto, const char* typefrom, const char* valuefrom) { std::string msg = "conversion from type "; msg += typefrom; msg += " (\""; msg += valuefrom; msg += "\") to type "; msg += typeto; msg += " failed"; throw ConversionError(msg); } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/muteximpl.h����������������������������������������������������������������������0000664�0001750�0001750�00000004304�12256773774�013333� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 - 2007 by Marc Boris Duerner * Copyright (C) 2005 - 2007 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_MUTEXIMPL_H #define CXXTOOLS_MUTEXIMPL_H #include <pthread.h> namespace cxxtools { class MutexImpl { public: explicit MutexImpl(); MutexImpl(int n); ~MutexImpl(); void lock(); bool tryLock(); void unlock(); pthread_mutex_t* handle() { return &_handle; } const pthread_mutex_t* handle() const { return &_handle; } private: pthread_mutex_t _handle; }; class ReadWriteMutexImpl { public: ReadWriteMutexImpl(); ~ReadWriteMutexImpl(); void readLock(); bool tryReadLock(); void writeLock(); bool tryWriteLock(); void unlock(); private: pthread_rwlock_t _rwl; }; } // !namespace cxxtools #endif // CXXTOOLS_MUTEXIMPL_H ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/�����������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�012011� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/xmldeserializer.cpp����������������������������������������������������������0000664�0001750�0001750�00000022564�12256773774�015655� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmldeserializer.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/string.h" #include <stdexcept> namespace cxxtools { namespace xml { XmlDeserializer::XmlDeserializer(cxxtools::xml::XmlReader& reader) : _reader(&reader) { } XmlDeserializer::XmlDeserializer(std::istream& is) : _reader( 0 ) , _deleter( new cxxtools::xml::XmlReader(is) ) { _reader = _deleter.get(); } void XmlDeserializer::doDeserialize() { if(_reader->get().type() != cxxtools::xml::Node::StartElement) _reader->nextElement(); _processNode = &XmlDeserializer::beginDocument; _startDepth = _reader->depth(); for(cxxtools::xml::XmlReader::Iterator it = _reader->current(); it != _reader->end(); ++it) { (this->*_processNode)(*it); if( (it->type() == cxxtools::xml::Node::EndElement) && (_reader->depth() < _startDepth) ) { break; } } } void XmlDeserializer::beginDocument(const cxxtools::xml::Node& node) { switch( node.type() ) { case cxxtools::xml::Node::StartElement: { _nodeName = static_cast<const cxxtools::xml::StartElement&>(node).name(); _nodeType = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"type"); _nodeCategory = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"category"); setName( _nodeName.narrow() ); _processNode = &XmlDeserializer::onRootElement; break; } default: throw std::logic_error("Expected start element"); }; } void XmlDeserializer::onRootElement(const cxxtools::xml::Node& node) { switch( node.type() ) { case cxxtools::xml::Node::Characters: { const cxxtools::xml::Characters& chars = static_cast<const cxxtools::xml::Characters&>(node); if(cxxtools::String::npos != chars.content().find_first_not_of(L" \t\n\r") ) { setValue( chars.content() ); _processNode = &XmlDeserializer::onContent; } else { _processNode = &XmlDeserializer::onWhitespace; } break; } case cxxtools::xml::Node::StartElement: { _nodeName = static_cast<const cxxtools::xml::StartElement&>(node).name(); _nodeType = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"type"); _nodeCategory = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"category"); _processNode = &XmlDeserializer::onStartElement; break; } default: throw std::logic_error("Invalid element"); }; } void XmlDeserializer::onStartElement(const cxxtools::xml::Node& node) { switch( node.type() ) { case cxxtools::xml::Node::Characters: { const cxxtools::xml::Characters& chars = static_cast<const cxxtools::xml::Characters&>(node); if(cxxtools::String::npos != chars.content().find_first_not_of(L" \t\n\r") ) { std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); setValue( chars.content() ); leaveMember(); //_current->addValue( _nodeName.narrow(), chars.content() ); _processNode = &XmlDeserializer::onContent; } else { std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); _processNode = &XmlDeserializer::onWhitespace; } break; } case cxxtools::xml::Node::StartElement: { std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); //SerializationInfo& added = _current->addMember( _nodeName.narrow() ); //_current = &added; _nodeName = static_cast<const cxxtools::xml::StartElement&>(node).name(); _nodeType = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"type"); _nodeCategory = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"category"); break; } case cxxtools::xml::Node::EndElement: { if( _nodeName != static_cast<const cxxtools::xml::EndElement&>(node).name() ) throw std::logic_error("Invalid element"); std::string nodeName = _nodeName.narrow(); std::string nodeType = _nodeType.empty() ? nodeName : _nodeType.narrow(); beginMember(nodeName, nodeType, nodeCategory()); setValue( cxxtools::String() ); leaveMember(); //_current->addValue( _nodeName.narrow(), cxxtools::String() ); _processNode = &XmlDeserializer::onEndElement; break; } default: throw std::logic_error("Invalid element"); }; } void XmlDeserializer::onWhitespace(const cxxtools::xml::Node& node) { switch( node.type() ) { case cxxtools::xml::Node::StartElement: { _nodeName = static_cast<const cxxtools::xml::StartElement&>(node).name(); _nodeType = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"type"); _nodeCategory = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"category"); _processNode = &XmlDeserializer::onStartElement; break; } case cxxtools::xml::Node::EndElement: { _nodeName = static_cast<const cxxtools::xml::EndElement&>(node).name(); if(_reader->depth() >= _startDepth) leaveMember(); _processNode = &XmlDeserializer::onEndElement; break; } default: throw std::logic_error("Expected start element"); }; } void XmlDeserializer::onContent(const cxxtools::xml::Node& node) { switch( node.type() ) { case cxxtools::xml::Node::EndElement: { _processNode = &XmlDeserializer::onEndElement; break; } default: throw std::logic_error("Expected end element"); }; } void XmlDeserializer::onEndElement(const cxxtools::xml::Node& node) { switch( node.type() ) { case cxxtools::xml::Node::Characters: { _processNode = &XmlDeserializer::onWhitespace; break; } case cxxtools::xml::Node::StartElement: { _nodeName = static_cast<const cxxtools::xml::StartElement&>(node).name(); _nodeType = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"type"); _nodeCategory = static_cast<const cxxtools::xml::StartElement&>(node).attribute(L"category"); _processNode = &XmlDeserializer::onStartElement; break; } case cxxtools::xml::Node::EndElement: { _nodeName = static_cast<const cxxtools::xml::EndElement&>(node).name(); if(_reader->depth() >= _startDepth) leaveMember(); break; } case cxxtools::xml::Node::EndDocument: { break; } default: { throw std::logic_error("Expected start element"); } } } SerializationInfo::Category XmlDeserializer::nodeCategory() const { return _nodeCategory == L"array" ? SerializationInfo::Array : _nodeCategory == L"struct" || _nodeCategory == L"object" ? SerializationInfo::Object : _nodeCategory == L"scalar" || _nodeCategory == L"value" ? SerializationInfo::Value : SerializationInfo::Void; } } // namespace xml } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/startelement.cpp�������������������������������������������������������������0000664�0001750�0001750�00000004317�12256773774�015155� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/startelement.h" namespace cxxtools { namespace xml { const String& StartElement::attribute(const String& attributeName) const { static const String null; for(std::list<Attribute>::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it) { if(it->name() == attributeName) { return it->value(); } } return null; } bool StartElement::hasAttribute(const String& attributeName) const { for(std::list<Attribute>::const_iterator it = _attributes.begin(); it != _attributes.end(); ++it) { if(it->name() == attributeName) { return true; } } return false; } bool StartElement::operator==(const Node& node) const { const StartElement* se = dynamic_cast<const StartElement*>(&node); if(!se) return false; return ( se->name() == this->name() ); } } // namespace xml } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/entityresolver.cpp�����������������������������������������������������������0000664�0001750�0001750�00000026207�12256773774�015546� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/xml/entityresolver.h> #include <cxxtools/stringstream.h> #include <stdexcept> #include <stdint.h> namespace cxxtools { namespace xml { namespace { struct Ent { const wchar_t* entity; Char::value_type charValue; }; static const Ent ent[] = { { L"AElig", 0x00C6 }, { L"Acirc", 0x00C2 }, { L"Agrave", 0x00C0 }, { L"Alpha", 0x0391 }, { L"Aring", 0x00C5 }, { L"Atilde", 0x00C3 }, { L"Auml", 0x00C4 }, { L"Beta", 0x0392 }, { L"Ccedil", 0x00C7 }, { L"Chi", 0x03A7 }, { L"Dagger", 0x2021 }, { L"Delta", 0x0394 }, { L"ETH", 0x00D0 }, { L"Eacute", 0x00C9 }, { L"Ecirc", 0x00CA }, { L"Egrave", 0x00C8 }, { L"Epsilon", 0x0395 }, { L"Eta", 0x0397 }, { L"Euml", 0x00CB }, { L"Gamma", 0x0393 }, { L"Iacute", 0x00CD }, { L"Icirc", 0x00CE }, { L"Igrave", 0x00CC }, { L"Iota", 0x0399 }, { L"Iuml", 0x00CF }, { L"Kappa", 0x039A }, { L"Lambda", 0x039B }, { L"Mu", 0x039C }, { L"Ntilde", 0x00D1 }, { L"Nu", 0x039D }, { L"OElig", 0x0152 }, { L"Oacute", 0x00D3 }, { L"Ocirc", 0x00D4 }, { L"Ograve", 0x00D2 }, { L"Omega", 0x03A9 }, { L"Omicron", 0x039F }, { L"Oslash", 0x00D8 }, { L"Otilde", 0x00D5 }, { L"Ouml", 0x00D6 }, { L"Phi", 0x03A6 }, { L"Pi", 0x03A0 }, { L"Prime", 0x2033 }, { L"Psi", 0x03A8 }, { L"Rho", 0x03A1 }, { L"Scaron", 0x0160 }, { L"Sigma", 0x03A3 }, { L"THORN", 0x00DE }, { L"Tau", 0x03A4 }, { L"Theta", 0x0398 }, { L"Uacute", 0x00DA }, { L"Ucirc", 0x00DB }, { L"Ugrave", 0x00D9 }, { L"Upsilon", 0x03A5 }, { L"Uuml", 0x00DC }, { L"Xi", 0x039E }, { L"Yacute", 0x00DD }, { L"Yuml", 0x0178 }, { L"Zeta", 0x0396 }, { L"acirc", 0x00E2 }, { L"acute", 0x00B4 }, { L"aelig", 0x00E6 }, { L"agrave", 0x00E0 }, { L"alefsym", 0x2135 }, { L"alpha", 0x03B1 }, { L"amp", 0x0026 }, { L"and", 0x2227 }, { L"ang", 0x2220 }, { L"apos", 0x0027 }, { L"aring", 0x00E5 }, { L"asymp", 0x2248 }, { L"atilde", 0x00E3 }, { L"auml", 0x00E4 }, { L"bdquo", 0x201E }, { L"beta", 0x03B2 }, { L"brvbar", 0x00A6 }, { L"bull", 0x2022 }, { L"cap", 0x2229 }, { L"ccedil", 0x00E7 }, { L"cedil", 0x00B8 }, { L"cent", 0x00A2 }, { L"chi", 0x03C7 }, { L"circ", 0x02C6 }, { L"clubs", 0x2663 }, { L"cong", 0x2245 }, { L"copy", 0x00A9 }, { L"crarr", 0x21B5 }, { L"cup", 0x222A }, { L"curren", 0x00A4 }, { L"dArr", 0x21D3 }, { L"dagger", 0x2020 }, { L"darr", 0x2193 }, { L"deg", 0x00B0 }, { L"delta", 0x03B4 }, { L"diams", 0x2666 }, { L"divide", 0x00F7 }, { L"eacute", 0x00E9 }, { L"ecirc", 0x00EA }, { L"egrave", 0x00E8 }, { L"empty", 0x2205 }, { L"emsp", 0x2003 }, { L"ensp", 0x2002 }, { L"epsilon", 0x03B5 }, { L"equiv", 0x2261 }, { L"eta", 0x03B7 }, { L"eth", 0x00F0 }, { L"euml", 0x00EB }, { L"euro", 0x20AC }, { L"exist", 0x2203 }, { L"fnof", 0x0192 }, { L"forall", 0x2200 }, { L"frac12", 0x00BD }, { L"frac14", 0x00BC }, { L"frac34", 0x00BE }, { L"frasl", 0x2044 }, { L"gamma", 0x03B3 }, { L"ge", 0x2265 }, { L"gt", 0x003E }, { L"hArr", 0x21D4 }, { L"harr", 0x2194 }, { L"hearts", 0x2665 }, { L"hellip", 0x2026 }, { L"iacute", 0x00ED }, { L"icirc", 0x00EE }, { L"iexcl", 0x00A1 }, { L"igrave", 0x00EC }, { L"image", 0x2111 }, { L"infin", 0x221E }, { L"int", 0x222B }, { L"iota", 0x03B9 }, { L"iquest", 0x00BF }, { L"isin", 0x2208 }, { L"iuml", 0x00EF }, { L"kappa", 0x03BA }, { L"lArr", 0x21D0 }, { L"lambda", 0x03BB }, { L"lang", 0x2329 }, { L"laquo", 0x00AB }, { L"larr", 0x2190 }, { L"lceil", 0x2308 }, { L"ldquo", 0x201C }, { L"le", 0x2264 }, { L"lfloor", 0x230A }, { L"lowast", 0x2217 }, { L"loz", 0x25CA }, { L"lrm", 0x200E }, { L"lsaquo", 0x2039 }, { L"lsquo", 0x2018 }, { L"lt", 0x003C }, { L"macr", 0x00AF }, { L"mdash", 0x2014 }, { L"micro", 0x00B5 }, { L"middot", 0x00B7 }, { L"minus", 0x2212 }, { L"mu", 0x03BC }, { L"nabla", 0x2207 }, { L"nbsp", 0x00A0 }, { L"ndash", 0x2013 }, { L"ne", 0x2260 }, { L"ni", 0x220B }, { L"not", 0x00AC }, { L"notin", 0x2209 }, { L"nsub", 0x2284 }, { L"ntilde", 0x00F1 }, { L"nu", 0x03BD }, { L"oacute", 0x00F3 }, { L"ocirc", 0x00F4 }, { L"oelig", 0x0153 }, { L"ograve", 0x00F2 }, { L"oline", 0x203E }, { L"omega", 0x03C9 }, { L"omicron", 0x03BF }, { L"oplus", 0x2295 }, { L"or", 0x2228 }, { L"ordf", 0x00AA }, { L"ordm", 0x00BA }, { L"oslash", 0x00F8 }, { L"otilde", 0x00F5 }, { L"otimes", 0x2297 }, { L"ouml", 0x00F6 }, { L"para", 0x00B6 }, { L"part", 0x2202 }, { L"permil", 0x2030 }, { L"perp", 0x22A5 }, { L"phi", 0x03C6 }, { L"pi", 0x03C0 }, { L"piv", 0x03D6 }, { L"plusmn", 0x00B1 }, { L"pound", 0x00A3 }, { L"prime", 0x2032 }, { L"prod", 0x220F }, { L"prop", 0x221D }, { L"psi", 0x03C8 }, { L"quot", 0x0022 }, { L"rArr", 0x21D2 }, { L"radic", 0x221A }, { L"rang", 0x232A }, { L"raquo", 0x00BB }, { L"rarr", 0x2192 }, { L"rceil", 0x2309 }, { L"rdquo", 0x201D }, { L"real", 0x211C }, { L"reg", 0x00AE }, { L"rfloor", 0x230B }, { L"rho", 0x03C1 }, { L"rlm", 0x200F }, { L"rsaquo", 0x203A }, { L"rsquo", 0x2019 }, { L"sbquo", 0x201A }, { L"scaron", 0x0161 }, { L"sdot", 0x22C5 }, { L"sect", 0x00A7 }, { L"shy", 0x00AD }, { L"sigma", 0x03C3 }, { L"sigmaf", 0x03C2 }, { L"sim", 0x223C }, { L"spades", 0x2660 }, { L"sub", 0x2282 }, { L"sube", 0x2286 }, { L"sum", 0x2211 }, { L"sup", 0x2283 }, { L"sup1", 0x00B9 }, { L"sup2", 0x00B2 }, { L"sup3", 0x00B3 }, { L"supe", 0x2287 }, { L"szlig", 0x00DF }, { L"tau", 0x03C4 }, { L"there4", 0x2234 }, { L"theta", 0x03B8 }, { L"thetasym", 0x03D1 }, { L"thinsp", 0x2009 }, { L"thorn", 0x00FE }, { L"tilde", 0x02DC }, { L"times", 0x00D7 }, { L"trade", 0x2122 }, { L"uArr", 0x21D1 }, { L"uacute", 0x00FA }, { L"uarr", 0x2191 }, { L"ucirc", 0x00FB }, { L"ugrave", 0x00F9 }, { L"uml", 0x00A8 }, { L"upsih", 0x03D2 }, { L"upsilon", 0x03C5 }, { L"uuml", 0x00FC }, { L"weierp", 0x2118 }, { L"xi", 0x03BE }, { L"yacute", 0x00FD }, { L"yen", 0x00A5 }, { L"yuml", 0x00FF }, { L"zeta", 0x03B6 }, { L"zwj", 0x200D }, { L"zwnj", 0x200C } }; static const Ent rent[] = { { L"quot", 0x0022 }, { L"amp", 0x0026 }, { L"apos", 0x0027 }, { L"lt", 0x003C }, { L"gt", 0x003E } }; void printEntity(std::basic_ostream<Char>& os, const wchar_t* p) { os << Char('&'); while (*p) os << Char(*p++); os << Char(';'); } } String EntityResolver::resolveEntity(const String& entity) const { if (!entity.empty() && entity[0] == L'#') { int code = 0; if (entity.size() > 2 && entity[1] == L'x') { // hex notation: ꯍ for (String::const_iterator it = entity.begin() + 2; it != entity.end(); ++it) { if (*it >= L'0' && *it <= L'9') code = code * 16 + (it->value() - L'0'); else if (*it >= L'A' && *it <= L'F') code = code * 16 + (it->value() - L'A' + 10); else if (*it >= L'a' && *it <= L'f') code = code * 16 + (it->value() - L'a' + 10); else throw std::runtime_error(std::string("invalid entity ") + entity.narrow()); } } else { // dec notation: ✏ for (String::const_iterator it = entity.begin() + 1; it != entity.end(); ++it) { if (*it >= L'0' && *it <= L'9') code = code * 10 + (it->value() - '0'); else throw std::runtime_error(std::string("invalid entity ") + entity.narrow()); } } return String( 1, Char(code) ); } unsigned u = 0; unsigned o = sizeof(ent)/sizeof(Ent) - 1; while (o - u > 1) { unsigned m = (o + u) / 2; int c = entity.compare(ent[m].entity); if (c == 0) return String(1, Char(ent[m].charValue)); else if (c < 0) o = m; else u = m; } if (entity.compare(ent[u].entity) == 0) return String(1, Char(ent[u].charValue)); if (entity.compare(ent[o].entity) == 0) return String(1, Char(ent[o].charValue)); EntityMap::const_iterator it = _entityMap.find(entity); if( it == _entityMap.end() ) { it = _entityMap.find(entity); if( it == _entityMap.end() ) throw std::runtime_error("invalid entity " + entity.narrow()); } return it->second; } String EntityResolver::getEntity(Char ch) const { OStringStream s; getEntity(s, ch); return s.str(); } void EntityResolver::getEntity(std::basic_ostream<Char>& os, Char ch) const { unsigned u = 0; unsigned o = sizeof(rent)/sizeof(Ent) - 1; while (o - u > 1) { unsigned m = (o + u) / 2; if (rent[m].charValue == ch.value()) { printEntity(os, rent[m].entity); return; } if (ch.value() < rent[m].charValue) o = m; else u = m; } if (rent[u].charValue == ch.value()) printEntity(os, rent[u].entity); else if (rent[o].charValue == ch.value()) printEntity(os, rent[o].entity); else if (ch.value() >= ' ' && ch.value() <= 0x7F) os << ch; else os << Char('&') << Char('#') << static_cast<uint32_t>(ch.value()) << Char(';'); } } // namespace xml } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/endelement.cpp���������������������������������������������������������������0000664�0001750�0001750�00000003140�12256773774�014557� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/endelement.h" namespace cxxtools { namespace xml { bool EndElement::operator==(const Node& node) const { const EndElement* e = dynamic_cast<const EndElement*>(&node); if(!e) return false; return ( e->name() == this->name() ); } } // namespace xml } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/xmlerror.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000003006�12256773774�014312� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlerror.h" namespace cxxtools { namespace xml { XmlError::XmlError(const std::string& what, unsigned line) : std::runtime_error(what) , _line(line) { } } // namespace Xml } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/xmlserializer.cpp������������������������������������������������������������0000664�0001750�0001750�00000003632�12256773774�015337� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlserializer.h" namespace cxxtools { namespace xml { XmlSerializer::XmlSerializer() { } XmlSerializer::XmlSerializer(std::ostream& os) : _formatter(os) { } XmlSerializer::XmlSerializer(XmlWriter* writer) : _formatter(writer) { } XmlSerializer::~XmlSerializer() { finish(); } void XmlSerializer::attach(std::ostream& os) { _formatter.attach(os); } void XmlSerializer::attach(XmlWriter& writer) { _formatter.attach(writer); } void XmlSerializer::detach() { _formatter.detach(); } } // namespace xml } // namespace cxxtools ������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/characters.cpp���������������������������������������������������������������0000664�0001750�0001750�00000003115�12256773774�014560� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/characters.h" namespace cxxtools { namespace xml { bool Characters::operator==(const Node& node) const { const Characters* chars = dynamic_cast<const Characters*>(&node); if (!chars) return false; return ( chars->content() == content() ); } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/xmlformatter.cpp�������������������������������������������������������������0000664�0001750�0001750�00000010544�12256773774�015171� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlformatter.h" #include "cxxtools/xml/startelement.h" #include <stdexcept> namespace cxxtools { namespace xml { XmlFormatter::XmlFormatter() : _writer(0) , _deleter(0) , _useAttributes(true) { } XmlFormatter::XmlFormatter(std::ostream& os) : _writer( 0 ) , _deleter( new XmlWriter(os) ) , _useAttributes(true) { _writer = _deleter.get(); } XmlFormatter::XmlFormatter(XmlWriter* writer) : _writer(writer) , _deleter(0) { } XmlFormatter::~XmlFormatter() { this->detach(); } void XmlFormatter::attach(std::ostream& os) { if (_writer) throw std::logic_error("XmlSerizalizer is already open"); _deleter.reset(new XmlWriter(os)); _writer = _deleter.get(); } void XmlFormatter::attach(XmlWriter& writer) { if (_writer) throw std::logic_error("XmlSerizalizer is already open"); _deleter.reset(0); _writer = &writer; } void XmlFormatter::detach() { if (_writer) { this->flush(); _deleter.reset(0); _writer = 0; } } void XmlFormatter::flush() { if (_writer) _writer->flush(); } void XmlFormatter::addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) { cxxtools::String tag(name.empty() ? type : name); Attribute attrs[1]; size_t countAttrs = 0; if (_useAttributes) { if ( ! name.empty() && ! type.empty() ) { attrs[countAttrs].name() = L"type"; attrs[countAttrs].value() = type; ++countAttrs; } } _writer->writeElement( tag, attrs, countAttrs, value ); } void XmlFormatter::beginComplexElement(const std::string& name, const std::string& type, const String& category) { cxxtools::String tag(name.empty() ? type : name); if (tag.empty()) throw std::logic_error("type name or element name must be set in xml formatter"); Attribute attrs[2]; size_t countAttrs = 0; if (_useAttributes) { if ( ! name.empty() && ! type.empty() ) { attrs[countAttrs].name() = L"type"; attrs[countAttrs].value() = type; ++countAttrs; } if ( ! category.empty() ) { attrs[countAttrs].name().assign(L"category"); attrs[countAttrs].value().assign(category); ++countAttrs; } } _writer->writeStartElement( tag, attrs, countAttrs ); } void XmlFormatter::beginArray(const std::string& name, const std::string& type) { beginComplexElement(name, type, L"array"); } void XmlFormatter::finishArray() { _writer->writeEndElement(); } void XmlFormatter::beginObject(const std::string& name, const std::string& type) { beginComplexElement(name, type, L"struct"); } void XmlFormatter::beginMember(const std::string& name) { } void XmlFormatter::finishMember() { } void XmlFormatter::finishObject() { _writer->writeEndElement(); } void XmlFormatter::finish() { } } // namespace xml } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/xmlwriter.cpp����������������������������������������������������������������0000664�0001750�0001750�00000010714�12256773774�014501� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlwriter.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/entityresolver.h" #include "cxxtools/utf8codec.h" #include <stdexcept> #include <iostream> namespace cxxtools { namespace xml { namespace { static const String xmlPraefix(L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); } XmlWriter::XmlWriter() : _tos(new Utf8Codec) , _flags(UseXmlDeclaration | UseIndent | UseEndl) { } XmlWriter::XmlWriter(std::ostream& os, int flags) : _tos(os, new Utf8Codec) , _flags(flags) { if (useXmlDeclaration()) { _tos << xmlPraefix; if (useEndl()) endl(); } } XmlWriter::~XmlWriter() { } void XmlWriter::begin(std::ostream& os) { _tos.attach(os); if (useXmlDeclaration()) _tos << xmlPraefix; if (useEndl()) endl(); } void XmlWriter::writeStartElement(const String& prefix, const String& localName, const String& ns) { } void XmlWriter::writeStartElement(const String& localName) { writeStartElement(localName, 0, 0); } void XmlWriter::writeStartElement(const String& localName, const Attribute* attr, size_t attrCount) { if (localName.empty()) throw std::runtime_error("local name must not be empty in xml writer"); if (useIndent()) { for(size_t n = 0; n < _elements.size(); ++n) { _tos << Char(' ') << Char(' '); } } _tos << Char('<') << localName; for(size_t n = 0; n < attrCount; ++n) { _tos << Char(' ') << attr[n].name() << Char('=') << Char('"'); writeCharacters(attr[n].value()); _tos << Char('"'); } _tos << Char('>'); if (useEndl()) endl(); _elements.push(localName); } void XmlWriter::writeEndElement() { if( _elements.empty() ) return; if (useIndent()) { for(size_t n = 1; n < _elements.size(); ++n) { _tos << Char(' ') << Char(' '); } } _tos << Char(L'<') << Char(L'/') << _elements.top() << Char(L'>'); if (useEndl()) endl(); _elements.pop(); } void XmlWriter::writeElement(const String& localName, const String& content) { writeElement(localName, 0, 0, content); } void XmlWriter::writeElement(const String& localName, const Attribute* attr, size_t attrCount, const String& content) { if (useIndent()) { for(size_t n = 0; n < _elements.size(); ++n) { _tos << Char(' ') << Char(' '); } } _tos << Char(L'<') << localName; for(size_t n = 0; n < attrCount; ++n) { _tos << Char(' ') << attr[n].name() << Char('=') << Char('"'); writeCharacters(attr[n].value()); _tos << Char('"'); } _tos << Char('>'); writeCharacters(content); _tos << Char('<') << Char('/') << localName << Char('>'); if (useEndl()) endl(); } void XmlWriter::writeCharacters(const String& text) { static EntityResolver resolver; String::const_iterator it; for(it = text.begin(); it != text.end(); ++it) resolver.getEntity(_tos, *it); } void XmlWriter::flush() { _tos.flush(); } void XmlWriter::endl() { _tos << Char('\n'); } } // namespace xml } // namespace cxxtools ����������������������������������������������������cxxtools-2.2.1/src/xml/namespacecontext.cpp���������������������������������������������������������0000664�0001750�0001750�00000004507�12256773774�016010� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/namespacecontext.h" #include "cxxtools/string.h" namespace cxxtools { namespace xml { namespace { static const String null; } const String& NamespaceContext::namespaceUri(const String& prefix) const { std::multimap<String, Namespace>::const_iterator it; for( it = _namespaceScopes.begin(); it != _namespaceScopes.end(); ++it) { if(it->second.prefix() == prefix) { return it->second.namespaceUri(); } } return null; } const String& NamespaceContext::prefix(const String& namespaceUri) const { std::multimap<String, Namespace>::const_iterator it; for( it = _namespaceScopes.begin(); it != _namespaceScopes.end(); ++it) { if(it->second.namespaceUri() == namespaceUri) { return it->second.prefix(); } } return null; } void NamespaceContext::addNamespace(const String& elementName, const Namespace& ns) { ScopeMap::value_type elem(elementName, ns); _namespaceScopes.insert(elem); } } // namespace xml } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xml/xmlreader.cpp����������������������������������������������������������������0000664�0001750�0001750�00000126176�12256773774�014441� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xml/xmlreader.h" #include <cxxtools/xml/enddocument.h> #include "cxxtools/xml/entityresolver.h" #include <cxxtools/xml/doctypedeclaration.h> #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/xml/processinginstruction.h" #include "cxxtools/xml/comment.h" #include "cxxtools/xml/xmlerror.h" #include "cxxtools/textstream.h" #include "cxxtools/utf8codec.h" #include "cxxtools/log.h" #include <stdexcept> #include <iostream> #include <sstream> log_define("cxxtools.xml.reader") namespace cxxtools { namespace xml { class XmlReaderImpl { struct State { virtual ~State() {} State* onChar(cxxtools::Char c, XmlReaderImpl& reader) { switch( c.value() ) { case '\n': case ' ': case '\t': case '\r': return this->onSpace(c, reader); case '<': return this->onOpenBracket(c, reader); case '>': return this->onCloseBracket(c, reader); case ':': return this->onColon(c, reader); case '/': return this->onSlash(c, reader); case '=': return this->onEqual(c, reader); case '"': case '\'': return this->onQuote(c, reader); case '!': return this->onExclam(c, reader); case '?': return this->onQuest(c, reader); default: return this->onAlpha(c, reader); } std::ostringstream msg; msg << "unexpected char '" << c.narrow() << '\''; syntaxError(msg.str().c_str(), reader.line()); return 0; } virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected space", reader.line() ); return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected open bracket", reader.line()); return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected close bracket", reader.line()); return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected colon", reader.line()); return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected slash", reader.line()); return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected equal", reader.line()); return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected quote", reader.line()); return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected exclamation mark", reader.line()); return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { syntaxError("unexpected questionmark", reader.line()); return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { std::ostringstream msg; msg << "unexpected alpha '" << c.narrow() << '\''; syntaxError(msg.str().c_str(), reader.line()); return this; } virtual State* onEof(XmlReaderImpl& reader) { syntaxError("unexpected end of file", reader.line()); return this; } static void syntaxError(const char* msg, unsigned line); }; struct OnCData : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { const String& content = reader._chars.content(); unsigned len = content.length(); if( len > 2 && content[len-2] == ']' && content[len-2] == ']') { reader._chars.content().resize(len-2); return AfterTag::instance(); } reader.appendContent(c); return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } static State* instance() { static OnCData _state; return &_state; } }; struct BeforeCData : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { String& token = reader._token; token += c; if(token.length() < 7) return this; if(token == L"[CDATA[") { token.clear(); return OnCData::instance(); } syntaxError("CDATA expected", reader.line()); return this; } static State* instance() { static BeforeCData _state; return &_state; } }; struct OnEntityReference : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == ';') { try { reader.resolveEntity(reader._token); } catch (const std::exception&) { throw XmlError("invalid entity " + reader._token.narrow(), reader.line()); } reader._chars.content() += reader._token; reader._token.clear(); return OnCharacters::instance(); } reader._token += c; return this; } static State* instance() { static OnEntityReference _state; return &_state; } }; struct OnAttributeEntityReference : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == ';') { reader.resolveEntity(reader._token); reader._attr.value() += reader._token; reader._token.clear(); return OnAttributeValue::instance(); } reader._token += c; return this; } static State* instance() { static OnAttributeEntityReference _state; return &_state; } }; struct OnCharacters : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnTag::instance(); } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader.appendContent(c); return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '&') { reader._token.clear(); return OnEntityReference::instance(); } reader.appendContent(c); return this; } static State* instance() { static OnCharacters _state; return &_state; } }; struct AfterEndElementName : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._endElem); reader._depth--; if(reader.depth() == 0) return OnEpilog::instance(); return AfterTag::instance(); } static State* instance() { static AfterEndElementName _state; return &_state; } }; struct OnEndElementName : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return AfterEndElementName::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._endElem.name() += c; return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._endElem); reader._depth--; if(reader.depth() == 0) return OnEpilog::instance(); return AfterTag::instance(); } static State* instance() { static OnEndElementName _state; return &_state; } }; struct OnEndElement : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._endElem.name() += c; return OnEndElementName::instance(); } static State* instance() { static OnEndElement _state; return &_state; } }; struct OnEmptyElement : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._endElem.name() = reader._startElem.name(); reader._current = &(reader._endElem); reader._depth--; if(reader.depth() == 0) return OnEpilog::instance(); return AfterTag::instance(); } static State* instance() { static OnEmptyElement _state; return &_state; } }; struct OnAttributeValue : public State { virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader._startElem.addAttribute(reader._attr); return BeforeAttribute::instance(); } virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if (c == '&') { reader._token.clear(); return OnAttributeEntityReference::instance(); } reader._attr.value() += c; return this; } static State* instance() { static OnAttributeValue _state; return &_state; } }; struct BeforeAttributeValue : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { return OnAttributeValue::instance(); } static State* instance() { static BeforeAttributeValue _state; return &_state; } }; struct AfterAttributeName : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { return BeforeAttributeValue::instance(); } static State* instance() { static AfterAttributeName _state; return &_state; } }; struct OnAttributeName : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return AfterAttributeName::instance(); } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { return BeforeAttributeValue::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.name() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.name() += c; return this; } static State* instance() { static OnAttributeName _state; return &_state; } }; struct BeforeAttribute : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._current = &(reader._startElem); reader._depth++; return OnEmptyElement::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.clear(); reader._attr.name() += c; return OnAttributeName::instance(); } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._startElem); reader._depth++; return AfterTag::instance(); } static State* instance() { static BeforeAttribute _state; return &_state; } }; struct OnStartElement : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return BeforeAttribute::instance(); } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._startElem); reader._depth++; return OnEmptyElement::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._startElem.name() += c; return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._chars.clear(); reader._current = &(reader._startElem); reader._depth++; return AfterTag::instance(); } static State* instance() { static OnStartElement _state; return &_state; } }; struct OnCommentEnd : public State { virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { if(reader.depth() == 0) return OnProlog::instance(); return AfterTag::instance(); } static State* instance() { static OnCommentEnd _state; return &_state; } }; struct AfterComment : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { return OnComment::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '-') return OnCommentEnd::instance(); return OnComment::instance(); } static State* instance() { static AfterComment _state; return &_state; } }; struct OnComment : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '-') return AfterComment::instance(); return this; } static State* instance() { static OnComment _state; return &_state; } }; struct BeforeComment: public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '-') return OnComment::instance(); State::onAlpha(c, reader); // throws syntax error // TODO DOCTYPE return this; } static State* instance() { static BeforeComment _state; return &_state; } }; struct AfterTag : public OnCharacters { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { if(reader.depth() == 0) return OnProlog::instance(); reader.appendContent(c); return OnCharacters::instance(); } virtual State* onEof(XmlReaderImpl& reader) { if(reader.depth() > 0) return State::onEof(reader); // throws exception reader._current = &( reader._endDoc ); return this; } static State* instance() { static AfterTag _state; return &_state; } }; struct OnDocType : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._current = &(reader._docType); return OnProlog::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._docType.content() += c; return this; } static State* instance() { static OnDocType _state; return &_state; } }; struct BeforeDocType : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { String& token = reader._docType.content(); token += c; if(token.length() < 7) return this; if(token == L"DOCTYPE") { return OnDocType::instance(); } token.clear(); syntaxError("DOCTYPE expected", reader.line()); return this; } static State* instance() { static BeforeDocType _state; return &_state; } }; struct OnTagExclam : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if(c == '-') return BeforeComment::instance(); if(c == '[' && reader.depth() > 0) { reader._token.clear(); reader._token += c; return BeforeCData::instance(); } if(c == 'D' && reader.depth() == 0) { reader._docType.clear(); reader._docType.content() += c; return BeforeDocType::instance(); } return State::onAlpha(c, reader); // throws syntax error } static State* instance() { static OnTagExclam _state; return &_state; } }; struct OnTag : public State { virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.clear(); return OnProcessingInstruction::instance(); } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { return OnTagExclam::instance(); } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { if( reader._chars.content().length() ) { reader._current = &(reader._chars); } reader._endElem.clear(); return OnEndElement::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { if( reader._chars.content().length() ) { reader._current = &(reader._chars); } reader._startElem.clear(); reader._startElem.name() += c; return OnStartElement::instance(); } static State* instance() { static OnTag _state; return &_state; } }; struct OnEpilog : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnTag::instance(); } virtual State* onEof(XmlReaderImpl& reader) { reader._current = &( reader._endDoc ); return this; } static State* instance() { static OnEpilog _state; return &_state; } }; struct OnProlog : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnTag::instance(); } virtual State* onEof(XmlReaderImpl& reader) { reader._current = &( reader._endDoc ); return this; } static State* instance() { static OnProlog _state; return &_state; } }; struct OnProcessingInstructionEnd : public State { virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { reader._current = &(reader._procInstr); return AfterTag::instance(); } static State* instance() { static OnProcessingInstructionEnd _state; return &_state; } }; struct OnProcessingInstructionData : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onSlash(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { return OnProcessingInstructionEnd::instance(); } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.data() += c; return this; } static State* instance() { static OnProcessingInstructionData _state; return &_state; } }; struct OnProcessingInstruction : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return OnProcessingInstructionData::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.target() += c; return this; } static State* instance() { static OnProcessingInstruction _state; return &_state; } }; struct OnXmlDeclValue : public State { virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { if(reader._attr.name() == L"version") { reader._version = reader._attr.value(); } else if(reader._attr.name() == L"encoding") { reader._encoding = reader._attr.value(); } else if(reader._attr.name() == L"standalone") { if(reader._attr.value() == L"true") reader._standalone = true; } return OnXmlDeclBeforeAttr::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.value() += c; return this; } static State* instance() { static OnXmlDeclValue _state; return &_state; } }; struct OnXmlDeclBeforeValue : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onQuote(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDeclValue::instance(); } static State* instance() { static OnXmlDeclBeforeValue _state; return &_state; } }; struct OnXmlDeclAfterName : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDeclBeforeValue::instance(); } static State* instance() { static OnXmlDeclAfterName _state; return &_state; } }; struct OnXmlDeclAttr : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDeclAfterName::instance(); } virtual State* onEqual(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDeclBeforeValue::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.name() += c; return this; } static State* instance() { static OnXmlDeclAttr _state; return &_state; } }; struct OnXmlDeclEnd : public State { virtual State* onCloseBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnProlog::instance(); } static State* instance() { static OnXmlDeclEnd _state; return &_state; } }; struct OnXmlDeclBeforeAttr : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._attr.clear(); reader._attr.name() += c; return OnXmlDeclAttr::instance(); } virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDeclEnd::instance(); } static State* instance() { static OnXmlDeclBeforeAttr _state; return &_state; } }; struct OnXmlDeclName : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { if( reader._procInstr.target() == L"xml" ) return OnXmlDeclBeforeAttr::instance(); return OnProcessingInstructionData::instance(); } virtual State* onColon(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.target() += c; return this; } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.target() += c; return this; } static State* instance() { static OnXmlDeclName _state; return &_state; } }; struct OnXmlDeclQMark : public State { virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._procInstr.clear(); reader._procInstr.target() += c; return OnXmlDeclName::instance(); } static State* instance() { static OnXmlDeclQMark _state; return &_state; } }; struct OnXmlDecl : public State { virtual State* onQuest(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDeclQMark::instance(); } virtual State* onExclam(cxxtools::Char c, XmlReaderImpl& reader) { return OnTagExclam::instance(); } virtual State* onAlpha(cxxtools::Char c, XmlReaderImpl& reader) { reader._startElem.clear(); reader._startElem.name() += c; return OnStartElement::instance(); } static State* instance() { static OnXmlDecl _state; return &_state; } }; struct OnDocumentBegin : public State { virtual State* onSpace(cxxtools::Char c, XmlReaderImpl& reader) { return OnProlog::instance(); } virtual State* onOpenBracket(cxxtools::Char c, XmlReaderImpl& reader) { return OnXmlDecl::instance(); } static State* instance() { static OnDocumentBegin _state; return &_state; } }; public: XmlReaderImpl(std::basic_istream<Char>& is, int flags) : _textBuffer( is.rdbuf() ) , _buffer(0) , _flags(flags) , _standalone(true) , _depth(0) , _line(1) , _state(0) , _current(0) { _state = XmlReaderImpl::OnDocumentBegin::instance(); } XmlReaderImpl(std::istream& is, int flags) : _textBuffer(0) , _buffer(0) , _flags(flags) , _standalone(true) , _depth(0) , _line(1) , _state(0) , _current(0) { _state = XmlReaderImpl::OnDocumentBegin::instance(); _buffer = new TextBuffer( &is, new cxxtools::Utf8Codec() ); _textBuffer = _buffer; } ~XmlReaderImpl() { delete _buffer; } void reset(std::basic_istream<Char>& is, int flags) { delete _buffer; _buffer = 0; _textBuffer = is.rdbuf(); _state = XmlReaderImpl::OnDocumentBegin::instance(); _flags = flags; _version.clear(); _encoding.clear(); _standalone = true; _depth = 0; _line = 1; _current = 0; } void reset(std::istream& is, int flags) { delete _buffer; _buffer = new TextBuffer( &is, new cxxtools::Utf8Codec() ); _textBuffer = _buffer; _state = XmlReaderImpl::OnDocumentBegin::instance(); _flags = flags; _version.clear(); _encoding.clear(); _standalone = true; _depth = 0; _line = 1; _current = 0; } const cxxtools::String& version() const { return _version; } const cxxtools::String& encoding() const { return _encoding; } bool standalone() const { return _standalone; } EntityResolver& entityResolver() { return _resolver; } const EntityResolver& entityResolver() const { return _resolver; } size_t depth() const { return _depth; } std::size_t line() const { return _line; } const Node& get() { if( ! _current ) { this->next(); } return *_current; } const Node& next() { _current = 0; do { std::basic_streambuf<Char>::int_type c = _textBuffer->sbumpc(); if (c == std::char_traits<Char>::eof()) { _state = _state->onEof(*this); break; } Char ch = std::char_traits<Char>::to_char_type(c); _state = _state->onChar(ch, *this); if (ch == L'\n') { ++_line; } } while (!_current); return *_current; } bool advance() { _current = 0; while( ! _current && _textBuffer->in_avail() > 0 ) { Char ch = std::char_traits<Char>::to_char_type(_textBuffer->sbumpc()); _state = _state->onChar(ch, *this); if (ch == '\n') { ++_line; } } return _current != 0; } void resolveEntity(String& str) { str = entityResolver().resolveEntity( str ); } void appendContent(cxxtools::Char c) { String& content = _chars.content(); if (content.capacity() <= content.size() + 20) { if (content.capacity() < 16) content.reserve(16); else content.reserve(content.capacity() + content.capacity() / 2); } content += c; } private: std::basic_streambuf<Char>* _textBuffer; std::basic_streambuf<Char>* _buffer; int _flags; EntityResolver _resolver; cxxtools::String _version; cxxtools::String _encoding; bool _standalone; size_t _depth; std::size_t _line; State* _state; Node* _current; String _token; DocTypeDeclaration _docType; ProcessingInstruction _procInstr; StartElement _startElem; EndElement _endElem; Characters _chars; Attribute _attr; EndDocument _endDoc; }; void XmlReaderImpl::State::syntaxError(const char* msg, unsigned line) { std::ostringstream s; s << msg << " while parsing xml in line " << line; log_warn(s.str()); throw XmlError(s.str(), line); } XmlReader::XmlReader(std::istream& is, int flags) : _impl(0) { _impl = new XmlReaderImpl(is, flags); } XmlReader::XmlReader(std::basic_istream<Char>& is, int flags) : _impl(0) { _impl = new XmlReaderImpl(is, flags); } XmlReader::~XmlReader() { delete _impl; } void XmlReader::reset(std::basic_istream<Char>& is, int flags) { _impl->reset(is, flags); } void XmlReader::reset(std::istream& is, int flags) { _impl->reset(is, flags); } const cxxtools::String& XmlReader::documentVersion() const { return _impl->version(); } const cxxtools::String& XmlReader::documentEncoding() const { return _impl->encoding(); } bool XmlReader::standaloneDocument() const { return _impl->standalone(); } EntityResolver& XmlReader::entityResolver() { return _impl->entityResolver(); } const EntityResolver& XmlReader::entityResolver() const { return _impl->entityResolver(); } size_t XmlReader::depth() const { return _impl->depth(); } std::size_t XmlReader::line() const { return _impl->line(); } const Node& XmlReader::get() { return _impl->get(); } const Node& XmlReader::next() { return _impl->next(); } bool XmlReader::advance() { return _impl->advance(); } const StartElement& XmlReader::nextElement() { bool found = false; while( !found ) { const Node& node = this->next(); switch( node.type() ) { case Node::EndDocument: { throw std::logic_error("End of document"); } case Node::StartElement: found = true; break; default: break; } } return static_cast<const StartElement&>( this->get() ); } const Node& XmlReader::nextTag() { bool found = false; while( !found ) { const Node& node = this->next(); switch( node.type() ) { case Node::EndDocument: { throw std::logic_error("End of document"); } case Node::StartElement: case Node::EndElement: found = true; break; default: break; } } return this->get(); } } // namespace xml } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/settingswriter.cpp���������������������������������������������������������������0000664�0001750�0001750�00000012744�12256773774�014746� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "settingswriter.h" namespace cxxtools { void SettingsWriter::write(const cxxtools::SerializationInfo& si) { cxxtools::SerializationInfo::ConstIterator it; for(it = si.begin(); it != si.end(); ++it) { if( it->category() == cxxtools::SerializationInfo::Value ) { String value; it->getValue(value); this->writeEntry( it->name(), value, it->typeName() ); *_os << std::endl; } else if( it->category() == cxxtools::SerializationInfo::Object) { // Array types may have no instance-names if( it->findMember("") ) { *_os << cxxtools::String::widen( it->name() ) << cxxtools::String(L" = "); *_os << cxxtools::String::widen( it->typeName() ) << cxxtools::String(L"{ "); this->writeParent( *it, ""); *_os << cxxtools::String(L" }") << std::endl; continue; } //this->writeSection( subdata->name() ); this->writeParent( *it, it->name() ); } } } void SettingsWriter::writeParent(const cxxtools::SerializationInfo& sd, const std::string& prefix) { cxxtools::SerializationInfo::ConstIterator it; for(it = sd.begin(); it != sd.end(); ++it) { if( it->category() == cxxtools::SerializationInfo::Value ) { *_os << cxxtools::String::widen( prefix ) << '.'; String value; it->getValue(value); this->writeEntry( it->name(), value, it->typeName() ); *_os << std::endl; } else if( it->category() == cxxtools::SerializationInfo::Object ) { *_os << cxxtools::String::widen( prefix ) << '.' << cxxtools::String::widen( it->name() ) << cxxtools::String(L" = "); *_os<< cxxtools::String::widen( it->typeName() ) << cxxtools::String(L"{ "); this->writeChild(*it); *_os << cxxtools::String(L" }") << std::endl; } } } void SettingsWriter::writeChild(const cxxtools::SerializationInfo& sd) { bool separate = false; cxxtools::SerializationInfo::ConstIterator it; for(it = sd.begin(); it != sd.end(); ++it) { if(separate) *_os << cxxtools::String(L", "); if( it->category() == cxxtools::SerializationInfo::Value ) { String value; it->getValue(value); writeEntry( it->name(), value, it->typeName() ); } else if( it->category() == cxxtools::SerializationInfo::Object || it->category() == cxxtools::SerializationInfo::Array) { if(it->name().empty() == false && sd.category() != cxxtools::SerializationInfo::Array) *_os << cxxtools::String::widen( it->name() ) << cxxtools::String(L" = "); *_os << cxxtools::String::widen( it->typeName() ) << cxxtools::String(L"{ "); this->writeChild(*it); *_os << cxxtools::String(L" }"); } separate = true; } } void writeEscapedValue(std::basic_ostream<cxxtools::Char>& os, const cxxtools::String& value) { for(size_t n = 0; n < value.size(); ++n) { switch( value[n].value() ) { case '\\': os << cxxtools::Char('\\'); default: os << value[n]; } } } void SettingsWriter::writeEntry(const std::string& name, const cxxtools::String& value, const std::string& type) { if( type.empty() ) { if( name.empty() == false) *_os << cxxtools::String::widen(name) << cxxtools::String(L"="); *_os << cxxtools::String(L"\""); writeEscapedValue(*_os, value); *_os << cxxtools::String(L"\""); return; } if( name.empty() == false) *_os << cxxtools::String::widen(name) << cxxtools::String(L" = "); *_os << cxxtools::String::widen(type) << cxxtools::String(L"(\""); writeEscapedValue(*_os, value); *_os << cxxtools::String(L"\")"); } void SettingsWriter::writeSection(const cxxtools::String& prefix) { *_os << cxxtools::String(L"[") << prefix << cxxtools::String(L"]") << std::endl; } } ����������������������������cxxtools-2.2.1/src/tcpsocketimpl.cpp����������������������������������������������������������������0000664�0001750�0001750�00000031106�12266277345�014515� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #if defined(HAVE_ACCEPT4) || defined(HAVE_SO_NOSIGPIPE) || defined(MSG_NOSIGNAL) #include <sys/types.h> #include <sys/socket.h> #endif #if !defined(MSG_MSG_NOSIGNAL) #include <signal.h> #endif #include "tcpsocketimpl.h" #include "tcpserverimpl.h" #include "cxxtools/net/tcpserver.h" #include "cxxtools/net/tcpsocket.h" #include "cxxtools/systemerror.h" #include "cxxtools/ioerror.h" #include "cxxtools/log.h" #include "config.h" #include "error.h" #include <cerrno> #include <cstring> #include <cassert> #include <fcntl.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sstream> log_define("cxxtools.net.tcpsocket.impl") namespace cxxtools { namespace net { namespace { std::string connectFailedMessage(const AddrInfo& ai, int err) { std::ostringstream msg; msg << "failed to connect to host \"" << ai.host() << "\" port " << ai.port() << ": " << getErrnoString(err); return msg.str(); } } void formatIp(const sockaddr_in& sa, std::string& str) { #ifdef HAVE_INET_NTOP char strbuf[INET6_ADDRSTRLEN + 1]; const char* p = inet_ntop(sa.sin_family, &sa.sin_addr, strbuf, sizeof(strbuf)); str = (p == 0 ? "-" : strbuf); #else static cxxtools::Mutex monitor; cxxtools::MutexLock lock(monitor); const char* p = inet_ntoa(sa.sin_addr); if (p) str = p; else str.clear(); #endif } std::string getSockAddr(int fd) { union { struct sockaddr_storage storage; struct sockaddr sa; struct sockaddr_in sa_in; struct sockaddr_in6 sa_in6; struct in_addr addr; } addr; socklen_t slen = sizeof(addr); if (::getsockname(fd, &addr.sa, &slen) < 0) throw SystemError("getsockname"); std::string ret; formatIp(addr.sa_in, ret); return ret; } TcpSocketImpl::TcpSocketImpl(TcpSocket& socket) : IODeviceImpl(socket) , _socket(socket) , _isConnected(false) { } TcpSocketImpl::~TcpSocketImpl() { assert(_pfd == 0); } void TcpSocketImpl::close() { log_debug("close socket " << _fd); IODeviceImpl::close(); _isConnected = false; } std::string TcpSocketImpl::getSockAddr() const { return net::getSockAddr(fd()); } std::string TcpSocketImpl::getPeerAddr() const { union { struct sockaddr_storage storage; struct sockaddr sa; struct sockaddr_in sa_in; struct sockaddr_in6 sa_in6; struct in_addr addr; } addr; addr.storage = _peeraddr; std::string ret; formatIp(addr.sa_in, ret); return ret; } void TcpSocketImpl::connect(const AddrInfo& addrInfo) { log_debug("connect"); this->beginConnect(addrInfo); this->endConnect(); } int TcpSocketImpl::checkConnect() { log_trace("checkConnect"); int sockerr; socklen_t optlen = sizeof(sockerr); // check for socket error if( ::getsockopt(this->fd(), SOL_SOCKET, SO_ERROR, &sockerr, &optlen) != 0 ) { // getsockopt failed int e = errno; close(); throw SystemError(e, "getsockopt"); } if (sockerr == 0) { log_debug("connected successfully to " << getPeerAddr()); _isConnected = true; } return sockerr; } void TcpSocketImpl::checkPendingError() { if (!_connectResult.empty()) { std::string p = _connectResult; _connectResult.clear(); throw IOError(p); } } std::string TcpSocketImpl::tryConnect() { log_trace("tryConnect"); assert(_fd == -1); if (_addrInfoPtr == _addrInfo.impl()->end()) { log_debug("no more address informations"); std::ostringstream msg; msg << "invalid address information; host \"" << _addrInfo.host() << "\" port " << _addrInfo.port(); return msg.str(); } while (true) { int fd; while (true) { log_debug("create socket"); fd = ::socket(_addrInfoPtr->ai_family, SOCK_STREAM, 0); if (fd >= 0) break; if (++_addrInfoPtr == _addrInfo.impl()->end()) { std::ostringstream msg; msg << "failed to create socket for host \"" << _addrInfo.host() << "\" port " << _addrInfo.port() << ": " << getErrnoString(); return msg.str(); } } #ifdef HAVE_SO_NOSIGPIPE static const int on = 1; if (::setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)) < 0) throw cxxtools::SystemError("setsockopt(SO_NOSIGPIPE)"); #endif IODeviceImpl::open(fd, true, false); std::memmove(&_peeraddr, _addrInfoPtr->ai_addr, _addrInfoPtr->ai_addrlen); log_debug("created socket " << _fd << " max: " << FD_SETSIZE); if( ::connect(this->fd(), _addrInfoPtr->ai_addr, _addrInfoPtr->ai_addrlen) == 0 ) { _isConnected = true; log_debug("connected successfully to " << getPeerAddr()); break; } if (errno == EINPROGRESS) { log_debug("connect in progress"); break; } close(); if (++_addrInfoPtr == _addrInfo.impl()->end()) return connectFailedMessage(_addrInfo, errno); } return std::string(); } bool TcpSocketImpl::beginConnect(const AddrInfo& addrInfo) { log_trace("begin connect"); assert(!_isConnected); _addrInfo = addrInfo; _addrInfoPtr = _addrInfo.impl()->begin(); _connectResult = tryConnect(); checkPendingError(); return _isConnected; } void TcpSocketImpl::endConnect() { log_trace("ending connect"); if(_pfd && ! _socket.wbuf()) { _pfd->events &= ~POLLOUT; } checkPendingError(); if( _isConnected ) return; try { while (true) { pollfd pfd; pfd.fd = this->fd(); pfd.revents = 0; pfd.events = POLLOUT; log_debug("wait " << timeout() << " ms"); bool avail = this->wait(this->timeout(), pfd); if (avail) { // something has happened int sockerr = checkConnect(); if (_isConnected) return; if (++_addrInfoPtr == _addrInfo.impl()->end()) { // no more addrInfo - propagate error throw IOError(connectFailedMessage(_addrInfo, sockerr)); } } else if (++_addrInfoPtr == _addrInfo.impl()->end()) { log_debug("timeout"); throw IOTimeout(); } close(); _connectResult = tryConnect(); if (_isConnected) return; checkPendingError(); } } catch(...) { close(); throw; } } void TcpSocketImpl::accept(const TcpServer& server, unsigned flags) { socklen_t peeraddr_len = sizeof(_peeraddr); _fd = server.impl().accept(flags, reinterpret_cast <struct sockaddr*>(&_peeraddr), peeraddr_len); if( _fd < 0 ) throw SystemError("accept"); #ifdef HAVE_ACCEPT4 IODeviceImpl::open(_fd, false, false); #else bool inherit = (flags & TcpSocket::INHERIT) != 0; IODeviceImpl::open(_fd, true, inherit); #endif //TODO ECONNABORTED EINTR EPERM _isConnected = true; log_debug( "accepted from " << getPeerAddr()); } void TcpSocketImpl::initWait(pollfd& pfd) { IODeviceImpl::initWait(pfd); if( ! _isConnected ) { log_debug("not connected, setting POLLOUT "); pfd.events = POLLOUT; } } bool TcpSocketImpl::checkPollEvent(pollfd& pfd) { log_debug("checkPollEvent " << pfd.revents); if( _isConnected ) { // check for error while neither reading nor writing // // if reading or writing, IODeviceImpl::checkPollEvent will emit // inputReady or outputReady signal and the user gets an exception in // endRead or endWrite. if ( !_device.reading() && !_device.writing() && (pfd.revents & POLLERR) ) { _device.close(); _socket.closed(_socket); return true; } return IODeviceImpl::checkPollEvent(pfd); } if ( pfd.revents & POLLERR ) { AddrInfoImpl::const_iterator ptr = _addrInfoPtr; if (++ptr == _addrInfo.impl()->end()) { // not really connected but error // end of addrinfo list means that no working addrinfo was found log_debug("no more addrinfos found"); _socket.connected(_socket); return true; } else { _addrInfoPtr = ptr; close(); _connectResult = tryConnect(); if (_isConnected || !_connectResult.empty()) { // immediate success or error log_debug("connected successfully"); _socket.connected(_socket); } else { // by closing the previous file handle _pfd is set to 0. // creating a new socket in tryConnect may also change the value of fd. initializePoll(&pfd, 1); } return true; } } else if( pfd.revents & POLLOUT ) { int sockerr = checkConnect(); if (_isConnected) { _socket.connected(_socket); return true; } // something went wrong - look for next addrInfo log_debug("sockerr is " << sockerr << " try next"); if (++_addrInfoPtr == _addrInfo.impl()->end()) { // no more addrInfo - propagate error _connectResult = connectFailedMessage(_addrInfo, sockerr); _socket.connected(_socket); return true; } _connectResult = tryConnect(); if (_isConnected) { _socket.connected(_socket); return true; } } return false; } size_t TcpSocketImpl::beginWrite(const char* buffer, size_t n) { log_debug("::send(" << _fd << ", buffer, " << n << ')'); #if defined(HAVE_MSG_NOSIGNAL) ssize_t ret = ::send(_fd, (const void*)buffer, n, MSG_NOSIGNAL); #elif defined(HAVE_SO_NOSIGPIPE) ssize_t ret = ::send(_fd, (const void*)buffer, n, 0); #else // block SIGPIPE sigset_t sigpipeMask, oldSigmask; sigemptyset(&sigpipeMask); sigaddset(&sigpipeMask, SIGPIPE); pthread_sigmask(SIG_BLOCK, &sigpipeMask, &oldSigmask); // execute send ssize_t ret = ::send(_fd, (const void*)buffer, n, 0); // clear possible SIGPIPE sigset_t pending; sigemptyset(&pending); sigpending(&pending); if (sigismember(&pending, SIGPIPE)) { static const struct timespec nowait = { 0, 0 }; while (sigtimedwait(&sigpipeMask, 0, &nowait) == -1 && errno == EINTR) ; } // unblock SIGPIPE pthread_sigmask(SIG_SETMASK, &oldSigmask, 0); #endif log_debug("send returned " << ret); if (ret > 0) return static_cast<size_t>(ret); if (ret == 0 || errno == ECONNRESET || errno == EPIPE) throw IOError("lost connection to peer"); if(_pfd) { _pfd->events |= POLLOUT; } return 0; } } // namespace net } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/iconvwrap.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000003634�12256773774�013657� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. */ #include "cxxtools/iconvwrap.h" namespace cxxtools { iconvwrap::iconvwrap() : cd(iconv_t(-1)) { } iconvwrap::iconvwrap(const char *tocode, const char *fromcode) { open(tocode, fromcode); } bool iconvwrap::close() { if (cd != iconv_t(-1)) { int ret; ret = ::iconv_close(cd); cd = iconv_t(-1); return (ret != -1); } return true; } bool iconvwrap::convert(char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { return (iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft) != size_t(-1)); } bool iconvwrap::is_open() { return (cd != iconv_t(-1)); } bool iconvwrap::open(const char *tocode, const char *fromcode) { close(); cd = ::iconv_open(tocode, fromcode); return (cd != iconv_t(-1)); } iconvwrap::~iconvwrap() { close(); } } ����������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/directoryimpl.cpp����������������������������������������������������������������0000664�0001750�0001750�00000013155�12256773774�014534� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "directoryimpl.h" #include "cxxtools/systemerror.h" #include <sys/stat.h> #include <sys/types.h> #include <dirent.h> #include <unistd.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <vector> namespace cxxtools { DirectoryIteratorImpl::DirectoryIteratorImpl() : _refs(1), _handle(0), _current(0), _dirty(true) { } DirectoryIteratorImpl::DirectoryIteratorImpl(const char* path, bool skipHidden) : _refs(1), _path(path), _handle(0), _current(0), _dirty(true), _skipHidden(skipHidden) { _handle = ::opendir( path ); // EACCES Permission denied. // EMFILE Too many file descriptors in use by process. // ENFILE Too many files are currently open in the system. // ENOENT Directory does not exist, or name is an empty string. // ENOMEM Insufficient memory to complete the operation. // ENOTDIR name is not a directory. if( !_handle ) { throw SystemError("opendir", "Could not open directory '" + std::string(path) + '\''); } // append a trailing slash if not empty, so we can add the // directory entry name easily if( ! _path.empty() && _path[_path.size()-1] != '/') _path += '/'; this->advance(); } DirectoryIteratorImpl::~DirectoryIteratorImpl() { if(_handle) ::closedir(_handle); } const std::string& DirectoryIteratorImpl::name() const { return _name; } const std::string& DirectoryIteratorImpl::path() const { if(_dirty) { // replace substring after last slash with the new file-name or // append the file-name if we have a trailing slash. Ctor makes // sure we have a trailing slash. std::string::size_type idx = _path.rfind('/'); if(idx != std::string::npos && ++idx < _path.size() ) { _path.replace(idx, _path.size(), _current->d_name); } else { _path += _current->d_name; } } return _path; } int DirectoryIteratorImpl::ref() { return ++_refs; } int DirectoryIteratorImpl::deref() { return --_refs; } bool DirectoryIteratorImpl::advance() { _dirty = true; // _current == 0 means end do { _current = ::readdir( _handle ); if(_current) _name = _current->d_name; } while (_skipHidden && _current && _current->d_name[0] == '.'); return _current != 0; } void DirectoryImpl::create(const std::string& path) { if( -1 == ::mkdir(path.c_str(), 0777) ) { throw SystemError("mkdir", "Could not create directory '" + path + "'"); } } bool DirectoryImpl::exists(const std::string& path) { struct stat buff; int err = stat(path.c_str(), &buff); if (err == -1 ) { if (errno == ENOENT || errno == ENOTDIR) { return false; } throw SystemError("stat", "Could not stat file '" + path + "'"); } return true; } void DirectoryImpl::remove(const std::string& path) { if( -1 == ::rmdir(path.c_str()) ) { throw SystemError("rmdir", "Could not remove directory '" + path + "'"); } } void DirectoryImpl::move(const std::string& oldName, const std::string& newName) { if (0 != ::rename(oldName.c_str(), newName.c_str())) { throw SystemError("rename", "Could not move directory '" + oldName + "' to '" + newName + "'"); } } void DirectoryImpl::chdir(const std::string& path) { if( -1 == ::chdir(path.c_str()) ) { throw SystemError("chdir", "Could not change working directory to '" + path + "'"); } } std::string DirectoryImpl::cwd() { std::vector<char> cwd(1024); while ( getcwd(&cwd[0], cwd.size()) == 0 ) { if (errno != ERANGE) throw SystemError("getcwd"); cwd.resize(cwd.size() * 2); } return std::string(&cwd[0]); } std::string DirectoryImpl::curdir() { return "."; } std::string DirectoryImpl::updir() {; return ".."; } std::string DirectoryImpl::rootdir() { return "/"; } std::string DirectoryImpl::tmpdir() { const char* tmpdir = getenv("TEMP"); if(tmpdir) { return tmpdir; } tmpdir = getenv("TMP"); if(tmpdir) { return tmpdir; } return DirectoryImpl::exists("/tmp") ? "/tmp" : curdir(); } std::string DirectoryImpl::sep() { return "/"; } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/serializationerror.cpp�����������������������������������������������������������0000664�0001750�0001750�00000003444�12256773774�015575� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/serializationerror.h> namespace cxxtools { SerializationError::SerializationError(const std::string& msg) : std::runtime_error(msg) { } void SerializationError::doThrow(const std::string& msg) { throw SerializationError(msg); } SerializationMemberNotFound::SerializationMemberNotFound(const std::string& member) : SerializationError("Missing info for '" + member + "'"), _member(member) { } } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/tcpserver.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000005725�12256773774�013667� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "tcpserverimpl.h" #include <cxxtools/net/tcpserver.h> #include <memory> #include <sstream> namespace cxxtools { namespace net { namespace { std::string AddressInUseMsg(const std::string& ipaddr, unsigned short int port) { std::ostringstream msg; msg << "address " << ipaddr << ':' << port << " in use"; return msg.str(); } } AddressInUse::AddressInUse(const std::string& ipaddr, unsigned short int port) : IOError(AddressInUseMsg(ipaddr, port)) { } TcpServer::TcpServer() : _impl(0) { _impl = new TcpServerImpl(*this); } TcpServer::TcpServer(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags) : _impl(0) { _impl = new TcpServerImpl(*this); std::auto_ptr<TcpServerImpl> impl(_impl); this->listen(ipaddr, port, backlog, flags); impl.release(); } TcpServer::~TcpServer() { try { this->close(); } catch(...) {} delete _impl; } void TcpServer::listen(const std::string& ipaddr, unsigned short int port, int backlog, unsigned flags) { this->close(); _impl->listen(ipaddr, port, backlog, flags); this->setEnabled(true); } void TcpServer::terminateAccept() { _impl->terminateAccept(); } SelectableImpl& TcpServer::simpl() { return *_impl; } TcpServerImpl& TcpServer::impl() const { return *_impl; } void TcpServer::onClose() { _impl->close(); } bool TcpServer::onWait(std::size_t msecs) { return _impl->wait(msecs); } void TcpServer::onAttach(SelectorBase& sb) { _impl->attach(sb); } void TcpServer::onDetach(SelectorBase& sb) { _impl->detach(sb); } } // namespace net } // namespace cxxtools �������������������������������������������cxxtools-2.2.1/src/fileimpl.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000011451�12266277345�013436� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fileimpl.h" #include "error.h" #include "cxxtools/ioerror.h" #include "cxxtools/systemerror.h" #include <string> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <stdio.h> namespace cxxtools { namespace { // EACCES Permission denied. // EMFILE Too many file descriptors in use by process. // ENOENT Directory does not exist, or name is an empty string. // ENOTDIR name is not a directory. // EBUSY pathname is currently in use by the system or some process that prevents its removal. // EFAULT pathname points outside your accessible address space. // EINVAL pathname has . as last component. // ELOOP Too many symbolic links were encountered in resolving pathname. // ENAMETOOLONG pathname was too long. // ENOMEM Insufficient kernel memory was available. // ENOTEMPTY pathname contains entries other than . and .. ; or, pathname has .. as its final component. // EPERM The directory containing pathname has the sticky bit (S_ISVTX) set // EPERM The filesystem containing pathname does not support the removal of directories. // EROFS pathname refers to a file on a read-only filesystem. void throwErrno(const char* fn, const std::string& path) { if(errno == EEXIST) throw AccessFailed(path); switch(errno) { case EIO: case EBADF: case EBUSY: case ENOSPC: case EMLINK: case ENOTEMPTY: case EXDEV: throw IOError(getErrnoString(errno)); case EACCES: case EPERM: case EROFS: case ENXIO: throw PermissionDenied(path); case ELOOP: case ENAMETOOLONG: case ENOENT: case ENOTDIR: case EISDIR: throw FileNotFound(path); case ENODEV: throw DeviceNotFound(path); case ENOMEM: throw std::bad_alloc(); default: // EFAULT EMFILE EOVERFLOW throw SystemError(fn); } } void throwFileErrno(const char* fn, const std::string& path) { switch(errno) { case ELOOP: case ENAMETOOLONG: case ENOENT: case ENOTDIR: case EISDIR: throw FileNotFound(path); default: throwErrno(fn, path); } } } std::size_t FileImpl::size(const std::string& path) { struct stat buff; if( 0 != stat(path.c_str(), &buff) ) { throwFileErrno("stat", path); } return buff.st_size; } void FileImpl::resize(const std::string& path, std::size_t newSize) { int ret = 0; do { ret = truncate(path.c_str(), newSize); } while ( ret == EINTR ); if(ret != 0) throwFileErrno("truncate", path); } void FileImpl::remove(const std::string& path) { if(0 != ::remove(path.c_str())) throwFileErrno("remove", path); } void FileImpl::move(const std::string& path, const std::string& to) { if( 0 != ::rename(path.c_str(), to.c_str()) ) throwFileErrno("rename", path); } void FileImpl::link(const std::string& path, const std::string& to) { if( 0 != ::link(path.c_str(), to.c_str()) ) throwFileErrno("link", path); } void FileImpl::symlink(const std::string& path, const std::string& to) { if( 0 != ::symlink(path.c_str(), to.c_str()) ) throwFileErrno("symlink", path); } void FileImpl::create(const std::string& path) { int fd = open(path.c_str(), O_RDWR|O_EXCL|O_CREAT, 0777); if( fd < 0 ) throwFileErrno("open", path); ::close(fd); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/timer.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000006776�12266277345�012773� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/timer.h" #include "cxxtools/clock.h" #include "cxxtools/selector.h" #include <limits> #include <stdint.h> namespace cxxtools { class Timer::Sentry { public: Sentry(Sentry*& sentry) : _deleted(false) , _sentry(sentry) { sentry = this; } ~Sentry() { if( ! _deleted ) this->detach(); } bool operator!() const { return _deleted; } void detach() { _sentry = 0; _deleted = true; } bool _deleted; Sentry*& _sentry; }; Timer::Timer() : _sentry(0) , _selector(0) , _active(false) , _interval(0) , _remaining(0) , _finished(0) { } Timer::~Timer() { try { if(_selector) _selector->remove(*this); } catch(...) {} if(_sentry) _sentry->detach(); } bool Timer::active() const { return _active; } std::size_t Timer::interval() const { return _interval; } void Timer::start(std::size_t interval) { if( _active) stop(); _active = true; _interval = interval; _remaining = int64_t(_interval) * 1000; _finished = Clock::getSystemTicks() + _remaining; if(_selector) _selector->onTimerChanged(*this); } void Timer::stop() { _active = false; _remaining = 0; _finished = 0; if(_selector) _selector->onTimerChanged(*this); } bool Timer::update() { if(_active == false) return false; Timespan now = Clock::getSystemTicks(); return this->update(now); } bool Timer::update(const Timespan& now) { if(_active == false) return false; bool hasElapsed = now >= _finished; Timer::Sentry sentry(_sentry); while( _active && now >= _finished ) { _finished += (_interval * 1000); if( ! sentry ) return hasElapsed; timeout.send(); } _remaining = _finished - now; return hasElapsed; } void Timer::setSelector(SelectorBase* selector) { if(_selector == selector) return; if(_selector) { _selector->onRemoveTimer(*this); } if(selector) { selector->onAddTimer(*this); } _selector = selector; } } ��cxxtools-2.2.1/src/jsonformatter.cpp����������������������������������������������������������������0000664�0001750�0001750�00000023346�12266277345�014540� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/jsonformatter.h> #include <cxxtools/convert.h> #include <cxxtools/log.h> #include <limits> log_define("cxxtools.jsonformatter") namespace cxxtools { namespace { void checkTs(std::basic_ostream<Char>* _ts) { if (_ts == 0) throw std::logic_error("textstream is not set in JsonFormatter"); } } void JsonFormatter::begin(std::basic_ostream<Char>& ts) { _ts = &ts; _level = 0; _lastLevel = std::numeric_limits<unsigned>::max(); } void JsonFormatter::finish() { log_trace("finish"); if (_beautify) *_ts << L'\n'; _level = 0; _lastLevel = std::numeric_limits<unsigned>::max(); } void JsonFormatter::addValueString(const std::string& name, const std::string& type, const String& value) { log_trace("addValueString name=\"" << name << "\", type=\"" << type << "\", value=\"" << value << '"'); if (type == "bool") { addValueBool(name, type, convert<bool>(value)); } else { beginValue(name); if (type == "int" || type == "double") { stringOut(value); } else if (type == "null") { *_ts << L"null"; } else { *_ts << L'"'; stringOut(value); *_ts << L'"'; } finishValue(); } } void JsonFormatter::addValueStdString(const std::string& name, const std::string& type, const std::string& value) { log_trace("addValueStdString name=\"" << name << "\", type=\"" << type << "\", \" value=\"" << value << '"'); if (type == "bool") { addValueBool(name, type, convert<bool>(value)); } else { beginValue(name); if (type == "int" || type == "double") { stringOut(value); } else if (type == "null") { *_ts << L"null"; } else { *_ts << L'"'; stringOut(value); *_ts << L'"'; } finishValue(); } } void JsonFormatter::addValueBool(const std::string& name, const std::string& type, bool value) { log_trace("addValueBool name=\"" << name << "\", type=\"" << type << "\", \" value=\"" << value << '"'); beginValue(name); *_ts << (value ? L"true" : L"false"); finishValue(); } void JsonFormatter::addValueInt(const std::string& name, const std::string& type, int_type value) { log_trace("addValueInt name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (type == "bool") *_ts << (value ? L"true" : L"false"); else *_ts << value; finishValue(); } void JsonFormatter::addValueUnsigned(const std::string& name, const std::string& type, unsigned_type value) { log_trace("addValueUnsigned name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (type == "bool") *_ts << (value ? L"true" : L"false"); else *_ts << value; finishValue(); } void JsonFormatter::addValueFloat(const std::string& name, const std::string& type, long double value) { log_trace("addValueFloat name=\"" << name << "\", type=\"" << type << "\", \" value=" << value); beginValue(name); if (value != value // check for nan || value == std::numeric_limits<long double>::infinity() || value == -std::numeric_limits<long double>::infinity()) { *_ts << L"null"; } else { *_ts << convert<String>(value); } finishValue(); } void JsonFormatter::addNull(const std::string& name, const std::string& type) { beginValue(name); *_ts << L"null"; finishValue(); } void JsonFormatter::beginArray(const std::string& name, const std::string& type) { checkTs(_ts); if (_level == _lastLevel) { *_ts << L','; if (_beautify) *_ts << L'\n'; } else _lastLevel = _level; if (_beautify) indent(); ++_level; if (!name.empty()) { *_ts << L'"'; stringOut(name); *_ts << L'"' << L':'; if (_beautify) *_ts << L' '; } *_ts << L'['; if (_beautify) *_ts << L'\n'; } void JsonFormatter::finishArray() { checkTs(_ts); --_level; _lastLevel = _level; if (_beautify) { *_ts << L'\n'; indent(); } *_ts << L']'; } void JsonFormatter::beginObject(const std::string& name, const std::string& type) { checkTs(_ts); log_trace("beginObject name=\"" << name << '"'); if (_level == _lastLevel) { *_ts << L','; if (_beautify) *_ts << L'\n'; } else _lastLevel = _level; if (_beautify) indent(); ++_level; if (!name.empty()) { *_ts << L'"'; stringOut(name); *_ts << L'"' << L':'; if (_beautify) *_ts << L' '; } *_ts << L'{'; if (_beautify) *_ts << L'\n'; } void JsonFormatter::beginMember(const std::string& name) { } void JsonFormatter::finishMember() { } void JsonFormatter::finishObject() { checkTs(_ts); log_trace("finishObject"); --_level; _lastLevel = _level; if (_beautify) { *_ts << L'\n'; indent(); } *_ts << L'}'; } void JsonFormatter::indent() { for (unsigned n = 0; n < _level; ++n) *_ts << L'\t'; } void JsonFormatter::stringOut(const std::string& str) { for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == '"') *_ts << L'\\' << L'\"'; else if (*it == '\\') *_ts << L'\\' << L'\\'; else if (*it == '\b') *_ts << L'\\' << L'b'; else if (*it == '\f') *_ts << L'\\' << L'f'; else if (*it == '\n') *_ts << L'\\' << L'n'; else if (*it == '\r') *_ts << L'\\' << L'r'; else if (*it == '\t') *_ts << L'\\' << L't'; else if (static_cast<unsigned char>(*it) >= 0x80 || static_cast<unsigned char>(*it) < 0x20) { *_ts << L'\\' << L'u'; static const char hex[] = "0123456789abcdef"; uint32_t v = static_cast<unsigned char>(*it); for (uint32_t s = 16; s > 0; s -= 4) { *_ts << Char(hex[(v >> (s - 4)) & 0xf]); } } else *_ts << Char(*it); } } void JsonFormatter::stringOut(const cxxtools::String& str) { for (cxxtools::String::const_iterator it = str.begin(); it != str.end(); ++it) { if (*it == L'"') *_ts << L'\\' << L'\"'; else if (*it == L'\\') *_ts << L'\\' << L'\\'; else if (*it == L'\b') *_ts << L'\\' << L'b'; else if (*it == L'\f') *_ts << L'\\' << L'f'; else if (*it == L'\n') *_ts << L'\\' << L'n'; else if (*it == L'\r') *_ts << L'\\' << L'r'; else if (*it == L'\t') *_ts << L'\\' << L't'; else if (it->value() >= 0x80 || it->value() < 0x20) { *_ts << L'\\' << L'u'; static const char hex[] = "0123456789abcdef"; uint32_t v = it->value(); for (uint32_t s = 16; s > 0; s -= 4) { *_ts << Char(hex[(v >> (s - 4)) & 0xf]); } } else *_ts << *it; } } void JsonFormatter::beginValue(const std::string& name) { checkTs(_ts); if (_level == _lastLevel) { *_ts << L','; if (_beautify) { if (name.empty()) *_ts << L' '; else { *_ts << L'\n'; indent(); } } } else { _lastLevel = _level; if (_beautify) indent(); } if (!name.empty()) { *_ts << L'"'; stringOut(name); *_ts << L'"' << L':'; if (_beautify) *_ts << L' '; } ++_level; } void JsonFormatter::finishValue() { --_level; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/time.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000010224�12266277345�012570� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Tommi Maekitalo * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Stefan Bueder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/time.h" #include "cxxtools/convert.h" #include "cxxtools/serializationinfo.h" #include <sstream> #include <cctype> namespace cxxtools { InvalidTime::InvalidTime() : std::invalid_argument("Invalid time") { } namespace { unsigned short getNumber2(const char* s) { if ( ! std::isdigit(s[0]) || ! std::isdigit(s[1]) ) throw ConversionError("Invalid Time format"); return (s[0] - '0') * 10 + (s[1] - '0'); } unsigned short getNumber3(const char* s) { if( ! std::isdigit(s[0]) || ! std::isdigit(s[1]) || ! std::isdigit(s[2]) ) throw ConversionError("Invalid Time format"); return ( s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0' ); } } void convert(Time& time, const std::string& s) { unsigned hour = 0, min = 0, sec = 0, msec = 0; if( s.size() < 11 || s.at(2) != ':' || s.at(5) != ':' || s.at(8) != '.') throw ConversionError("Invalid Time format"); const char* d = s.data(); hour = getNumber2(d); min = getNumber2(d + 3); sec = getNumber2(d + 6); msec = getNumber3(d + 9); time.set(hour, min, sec, msec); } void convert(std::string& str, const Time& time) { unsigned hour = 0, minute = 0, second = 0, msec = 0; time.get(hour, minute, second, msec); // format hh:mm:ss.sssss // 0....+....1....+ char ret[14]; ret[0] = '0' + hour / 10; ret[1] = '0' + hour % 10; ret[2] = ':'; ret[3] = '0' + minute / 10; ret[4] = '0' + minute % 10; ret[5] = ':'; ret[6] = '0' + second / 10; ret[7] = '0' + second % 10; ret[8] = '.'; unsigned short n = msec; ret[11] = '0' + n % 10; n /= 10; ret[10] = '0' + n % 10; n /= 10; ret[9] = '0' + n % 10; str.assign(ret, 12); } void operator >>=(const SerializationInfo& si, Time& time) { if (si.category() == cxxtools::SerializationInfo::Object) { unsigned short hour, min, sec, msec; si.getMember("hour") >>= hour; const cxxtools::SerializationInfo* p; if ((p = si.findMember("minute")) != 0) *p >>= min; else si.getMember("min") >>= min; if ((p = si.findMember("second")) != 0) *p >>= sec; else si.getMember("sec") >>= sec; if ((p = si.findMember("millisecond")) != 0 || (p = si.findMember("msec")) != 0) *p >>= msec; else msec = 0; time.set(hour, min, sec, msec); } else { std::string s; si.getValue(s); convert(time, s); } } void operator <<=(SerializationInfo& si, const Time& time) { std::string s; convert(s, time); si.setValue(s); si.setTypeName("Date"); } } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/file.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000010771�12266277345�012560� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fileimpl.h" #include "cxxtools/file.h" #include "cxxtools/directory.h" namespace cxxtools { File::File() { } File::File(const std::string& path) : _path(path) { if( ! File::exists( path.c_str() ) ) throw FileNotFound(path); } File::File(const FileInfo& fi) : _path( fi.path() ) { if( ! fi.isFile() ) throw FileNotFound(fi.path()); } File::File(const File& file) : _path( file.path() ) { } File::~File() { } File& File::operator=(const File& file) { _path = file.path(); return *this; } std::size_t File::size() const { return FileImpl::size( path().c_str() ); } void File::resize(std::size_t newSize) { FileImpl::resize(path().c_str(), newSize); } void File::remove() { FileImpl::remove( path().c_str() ); } void File::move(const std::string& to) { FileImpl::move(path().c_str(), to.c_str()); _path = to; } void File::link(const std::string& to) { FileImpl::link(path().c_str(), to.c_str()); } void File::symlink(const std::string& to) { FileImpl::symlink(path().c_str(), to.c_str()); } // TODO This should be done on a file system basis. If we'd have a relative file here, // with no path, and try to determine the parent, an empty string would be returned, // though a parent is available. // TODO This is identical to Directory::parentPath(). Maybe this should be moved into // the common base class FileSystemNode. std::string File::dirName() const { // Find last slash. This separates the file name from the path. std::string::size_type separatorPos = path().find_last_of( Directory::sep() ); // If there is no separator, the file is relative to the current directory. So an empty path is returned. if (separatorPos == std::string::npos) { return ""; } // Include trailing separator to be able to distinguish between no path ("") and a path // which is relative to the root ("/"), for example. return path().substr(0, separatorPos + 1); } // TODO This is identical to Directory::name(). Maybe this should be moved into // the common base class FileSystemNode. std::string File::name() const { std::string::size_type separatorPos = path().rfind( Directory::sep() ); if (separatorPos != std::string::npos) { return path().substr(separatorPos + 1); } else { return path(); } } std::string File::baseName() const { std::string fileName = this->name(); std::string::size_type extensionPointPos = fileName.rfind('.'); if (extensionPointPos != std::string::npos) { return fileName.substr(0, extensionPointPos); } else { return fileName; } } std::string File::extension() const { std::string fileName = this->name(); std::string::size_type extensionPointPos = fileName.rfind('.'); if (extensionPointPos != std::string::npos) { return fileName.substr(extensionPointPos + 1); } else { return ""; } } File File::create(const std::string& path) { FileImpl::create( path.c_str() ); return File(path); } bool File::exists(const std::string& path) { return FileInfo::getType( path.c_str() ) == FileInfo::File; } } // namespace cxxtools �������cxxtools-2.2.1/src/library.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000010053�12256773774�013304� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libraryimpl.h" #include "cxxtools/library.h" #include "cxxtools/fileinfo.h" #include "cxxtools/file.h" #include "cxxtools/directory.h" #include "cxxtools/log.h" #include <string> #include <memory> log_define("cxxtools.library") namespace cxxtools { Library::Library() : _impl(0) { _impl = new LibraryImpl(); } Library::Library(const std::string& path) : _impl(0) { std::auto_ptr<LibraryImpl> impl( new LibraryImpl() ); _impl = impl.get(); open(path); impl.release(); } Library::Library(const Library& other) { _path = other._path; _impl = other._impl; _impl->ref(); } Library& Library::operator=(const Library& other) { if(_impl == other._impl) return *this; _path = other._path; other._impl->ref(); if( ! _impl->unref() ) delete _impl; _impl = other._impl; return *this; } Library::~Library() { if ( ! _impl->unref() ) delete _impl; } void Library::detach() { if ( _impl->refs() == 1 ) return; _path.clear(); LibraryImpl* x = _impl; _impl = new LibraryImpl(); if( ! x->unref() ) delete x; } Library& Library::open(const std::string& libname) { this->detach(); try { log_debug("search for library \"" << libname << '"'); _impl->open(libname); _path = libname; return *this; } catch(const OpenLibraryFailed&) { } std::string path = libname; path += suffix(); try { log_debug("search for library \"" << path << '"'); _impl->open(path); _path = path; return *this; } catch(const OpenLibraryFailed&) { } std::string::size_type idx = path.rfind( Directory::sep() ); if(idx == std::string::npos) { idx = 0; } else if( ++idx == path.length() ) { throw OpenLibraryFailed(path); } path.insert( idx, prefix() ); log_debug("search for library \"" << path << '"'); _impl->open(path); _path = path; return *this; } void Library::close() { this->detach(); _impl->close(); } void* Library::resolve(const char* symbol) const { return _impl->resolve(symbol); } Symbol Library::getSymbol(const char* symbol) const { void* sym = this->resolve(symbol); if (sym == 0) { throw SymbolNotFound(symbol); } return Symbol(*this, sym); } Library::operator const void*() const { return _impl->failed() ? 0 : this; } bool Library::operator!() const { return _impl->failed(); } const std::string& Library::path() const { return _path; } std::string Library::suffix() { return LibraryImpl::suffix(); } std::string Library::prefix() { return LibraryImpl::prefix(); } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/textstream.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000004074�12256773774�014046� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2009 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/textstream.h" namespace cxxtools { TextIStream::TextIStream(std::istream& is, Codec* codec) : BasicTextIStream<Char, char>(is, codec) { } TextIStream::TextIStream(Codec* codec) : BasicTextIStream<Char, char>(codec) { } TextIStream::~TextIStream() { } TextOStream::TextOStream(std::ostream& os, Codec* codec) : BasicTextOStream<Char, char>(os, codec) { } TextOStream::TextOStream(Codec* codec) : BasicTextOStream<Char, char>(codec) { } TextOStream::~TextOStream() { } TextStream::TextStream(std::iostream& ios, Codec* codec) : BasicTextStream<Char, char>(ios, codec) { } TextStream::TextStream(Codec* codec) : BasicTextStream<Char, char>(codec) { } TextStream::~TextStream() { } } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/addrinfoimpl.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000005055�12256773774�014316� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "addrinfoimpl.h" #include <cxxtools/systemerror.h> #include <string> #include <sstream> #include <string.h> namespace cxxtools { namespace net { void AddrInfoImpl::init(const std::string& host, unsigned short port) { struct addrinfo hints; // give some useful default values to use for getaddrinfo() memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; init(host, port, hints); } void AddrInfoImpl::init(const std::string& host, unsigned short port, const addrinfo& hints) { if (_ai) { freeaddrinfo(_ai); _ai = 0; } _host = host; _port = port; std::ostringstream p; p << port; // TODO: exception type if (0 != ::getaddrinfo(host.empty() ? 0 : host.c_str(), p.str().c_str(), &hints, &_ai)) throw SystemError(0, ("invalid ipaddress \"" + host + '"').c_str()); // TODO: exception type if (_ai == 0) throw SystemError("getaddrinfo"); } AddrInfoImpl::~AddrInfoImpl() { if (_ai) freeaddrinfo(_ai); } const std::string& AddrInfoImpl::host() const { return _host; } unsigned short AddrInfoImpl::port() const { return _port; } } // namespace net } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/utf8codec.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000023404�12266277345�013522� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/utf8codec.h" #include <cxxtools/conversionerror.h> #define byteMask 0xBF #define byteMark 0x80 namespace cxxtools { const Char ReplacementChar = Char(0x0000FFFD); const Char MaxBmp = Char(0x0000FFFF); const Char MaxUtf16 = Char(0x0010FFFF); const Char MaxUtf32 = Char(0x7FFFFFFF); const Char MaxLegalUtf32 = Char(0x0010FFFF); const Char SurHighStart = Char(0xD800); const Char SurHighEnd = Char(0xDBFF); const Char SurLowStart = Char(0xDC00); const Char SurLowEnd = Char(0xDFFF); const Char ByteOrderMark = Char(0xFEFF); const Char ByteOrderSwapped = Char(0xFFFE); /* * Index into the table below with the first byte of a UTF-8 sequence to * get the number of trailing bytes that are supposed to follow it. * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is * left as-is for anyone who may want to do such conversion, which was * allowed in earlier algorithms. */ const char trailingBytesForUTF8[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* * Magic values subtracted from a buffer value during UTF8 conversion. * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ const Char::value_type offsetsFromUTF8[6] = { Char::value_type(0x00000000), Char::value_type(0x00003080), Char::value_type(0x000E2080), Char::value_type(0x03C82080), Char::value_type(0xFA082080), Char::value_type(0x82082080) }; /* * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed * into the first byte, depending on how many bytes follow. There are * as many entries in this table as there are UTF-8 sequence types. * (I.e., one byte sequence, two byte... etc.). Remember that sequencs * for *legal* UTF-8 will be 4 or fewer bytes total. */ const uint8_t firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; /** * @brief Checks if the given character sequence is a valid UTF-8 character. * * The given array 8-bit-values is "parsed" and tried to be converted into a * Unicode-character using UTF-decoding. If this is not possible $false$ is returned * as the 8-bit-sequence is not a valid UTF-8 character. Otherwise $true$ is * returned. Only the first number of characters as specified in 'length' is * tried to converted. * * @param source An array of 8-bit values containing raw UTF-8 character data. * @param length Number of characters of source which are checked if they are * a valid UTF-8 character. * @return $true$ if the given sequence is a UTF-8-encoded character, $false$ * otherwise. */ inline bool isLegalUTF8(const uint8_t *source, int length) { uint8_t a; const uint8_t *srcptr = source + length; switch (length) { default: return false; // Everything else falls through when "true"... case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 2: if ((a = (*--srcptr)) > 0xBF) return false; switch (*source) { // no fall-through in this inner switch case 0xE0: if (a < 0xA0) return false; break; case 0xED: if (a > 0x9F) return false; break; case 0xF0: if (a < 0x90) return false; break; case 0xF4: if (a > 0x8F) return false; break; default: if (a < 0x80) return false; } case 1: if (*source >= 0x80 && *source < 0xC2) return false; } if (*source > 0xF4) return false; return true; } Utf8Codec::Utf8Codec(size_t ref) : TextCodec<Char, char>(ref) {} Utf8Codec::result Utf8Codec::do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, Char* toBegin, Char* toEnd, Char*& toNext) const { Utf8Codec::result retstat = ok; fromNext = fromBegin; toNext = toBegin; while(fromNext < fromEnd) { uint8_t* fnext = (uint8_t *)(fromNext); if(toNext >= toEnd) { retstat = partial; break; } const size_t extraBytesToRead = trailingBytesForUTF8[*fnext]; if(fromNext + extraBytesToRead >= fromEnd) { retstat = partial; break; } if( !isLegalUTF8( (const uint8_t*)fnext, extraBytesToRead + 1 ) ) { retstat = error; break; } *toNext = Char(0); switch (extraBytesToRead) { case 5: *toNext = Char((toNext->value() + *fnext++) << 6); // We should never get this for legal UTF-8 case 4: *toNext = Char((toNext->value() + *fnext++) << 6); // We should never get this for legal UTF-8 case 3: *toNext = Char((toNext->value() + *fnext++) << 6); case 2: *toNext = Char((toNext->value() + *fnext++) << 6); case 1: *toNext = Char((toNext->value() + *fnext++) << 6); case 0: *toNext = Char((toNext->value() + *fnext++)); } *toNext = Char(toNext->value() - offsetsFromUTF8[extraBytesToRead]); // UTF-16 surrogate values are illegal in UTF-32, and anything // over Plane 17 (> 0x10FFFF) is illegal. if(*toNext > MaxLegalUtf32) { *toNext = ReplacementChar; } else if(*toNext >= SurHighStart && *toNext <= SurLowEnd) { *toNext = ReplacementChar; } ++toNext; fromNext += (extraBytesToRead + 1); } return retstat; } Utf8Codec::result Utf8Codec::do_out(MBState& s, const Char* fromBegin, const Char* fromEnd, const Char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { result retstat = ok; fromNext = fromBegin; toNext = toBegin; Char ch; size_t bytesToWrite; while(fromNext < fromEnd) { ch = *fromNext; if (ch >= SurHighStart && ch <= SurLowEnd) { retstat = error; break; } // Figure out how many bytes the result will require. Turn any // illegally large UTF32 things (> Plane 17) into replacement chars. if (ch < Char(0x80)) { bytesToWrite = 1; } else if (ch < Char(0x800)) { bytesToWrite = 2; } else if (ch < Char(0x10000)) { bytesToWrite = 3; } else if (ch <= MaxLegalUtf32) { bytesToWrite = 4; } else { bytesToWrite = 3; ch = ReplacementChar; } uint8_t* current = (uint8_t*)(toNext + bytesToWrite); if( current >= (uint8_t*)(toEnd) ) { retstat = partial; break; } Char::value_type chValue = ch.value(); switch(bytesToWrite) { // note: everything falls through... case 4: *--current = static_cast<uint8_t>((chValue | byteMark) & byteMask); chValue >>= 6; case 3: *--current = static_cast<uint8_t>((chValue | byteMark) & byteMask); chValue >>= 6; case 2: *--current = static_cast<uint8_t>((chValue | byteMark) & byteMask); chValue >>= 6; case 1: *--current = static_cast<uint8_t> (chValue | firstByteMark[bytesToWrite]); } toNext += bytesToWrite; ++fromNext; } return retstat; } int Utf8Codec::do_length(MBState& s, const char* fromBegin, const char* fromEnd, size_t max) const { const char* fromNext = fromBegin; size_t counter = 0; while(fromNext < fromEnd && counter <= max) { int extraBytesToRead = trailingBytesForUTF8[ (unsigned char)*fromNext ]; // NOTE: check again... if(fromNext + extraBytesToRead >= fromEnd) { break; } if(!isLegalUTF8( (const uint8_t*) fromNext, extraBytesToRead + 1 ) ) { break; } fromNext += extraBytesToRead + 1; counter += extraBytesToRead + 1; } return fromNext - fromBegin; } int Utf8Codec::do_max_length() const throw() { return 4; } bool Utf8Codec::do_always_noconv() const throw() { return false; } } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/muteximpl.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000007350�12256773774�013672� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 - 2007 by Marc Boris Duerner * Copyright (C) 2005 - 2007 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "muteximpl.h" #include "cxxtools/systemerror.h" #include <errno.h> namespace cxxtools { MutexImpl::MutexImpl() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK ); int rc = pthread_mutex_init(&_handle, &attr); if (rc != 0) throw SystemError(rc, "pthread_mutex_init"); } MutexImpl::MutexImpl(int recursive) { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE ); int rc = pthread_mutex_init(&_handle, &attr); if (rc != 0) throw SystemError(rc, "pthread_mutex_init"); } MutexImpl::~MutexImpl() { pthread_mutex_destroy(&_handle); } void MutexImpl::lock() { int rc = pthread_mutex_lock(&_handle); if( rc != 0 ) throw SystemError(rc, "pthread_mutex_lock failed"); } bool MutexImpl::tryLock() { int rc = pthread_mutex_trylock(&_handle); if( rc != 0 && rc != EBUSY ) throw SystemError(rc, "pthread_mutex_trylock"); return rc != EBUSY; } void MutexImpl::unlock() { int rc = pthread_mutex_unlock(&_handle); if( rc != 0 ) throw SystemError(rc, "pthread_mutex_unlock"); } ReadWriteMutexImpl::ReadWriteMutexImpl() { int rc = pthread_rwlock_init(&_rwl, NULL); if( rc != 0 ) throw SystemError(rc, "pthread_rwlock_init"); } ReadWriteMutexImpl::~ReadWriteMutexImpl() { pthread_rwlock_destroy(&_rwl); } void ReadWriteMutexImpl::readLock() { int rc = pthread_rwlock_rdlock(&_rwl); if( rc != 0 ) throw SystemError(rc, "pthread_rwlock_rdlock"); } bool ReadWriteMutexImpl::tryReadLock() { int rc = pthread_rwlock_tryrdlock(&_rwl); if( rc != 0 && rc != EBUSY ) throw SystemError(rc, "pthread_rwlock_tryrdlock"); return rc != EBUSY; } void ReadWriteMutexImpl::writeLock() { int rc = pthread_rwlock_wrlock(&_rwl); if( rc != 0) throw SystemError(rc, "pthread_rwlock_wrlock"); } bool ReadWriteMutexImpl::tryWriteLock() { int rc = pthread_rwlock_trywrlock(&_rwl); if( rc != 0 && rc != EBUSY) throw SystemError(rc, "pthread_rwlock_trywrlock"); return rc != EBUSY; } void ReadWriteMutexImpl::unlock() { int rc = pthread_rwlock_unlock(&_rwl); if( rc != 0 ) throw SystemError(rc, "pthread_rwlock_unlock"); } } // !namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/base64codec.cpp������������������������������������������������������������������0000664�0001750�0001750�00000017050�12256773774�013726� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2012 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/base64codec.h> namespace cxxtools { namespace { inline char toBase64(uint8_t n) { static const char b64enc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; return b64enc[n]; } inline uint8_t fromBase64(char b64) { static const uint8_t b64dec[] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63, 52,53,54,55,56,57,58,59,60,61,255,255,255,64,255,255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, 15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255, 255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, 41,42,43,44,45,46,47,48,49,50,51,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 }; return b64dec[(int)b64]; } } Base64Codec::result Base64Codec::do_in(MBState& s, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { fromNext = fromBegin; toNext = toBegin; while( (fromEnd - fromNext) >= 4 && (toEnd - toNext) >= 3 ) { uint8_t first = fromBase64( *(fromNext++) ); uint8_t second = fromBase64( *(fromNext++) ); uint8_t third = fromBase64( *(fromNext++) ); uint8_t fourth = fromBase64( *(fromNext++) ); *(toNext++) = (first << 2) + (second >> 4); if(third != 64) *(toNext++) = (second << 4) + (third >> 2); if(fourth != 64) *(toNext++) = (third << 6) + (fourth); } if( fromEnd == fromNext ) return std::codecvt_base::ok; return std::codecvt_base::partial; } Base64Codec::result Base64Codec::do_out(cxxtools::MBState& state, const char* fromBegin, const char* fromEnd, const char*& fromNext, char* toBegin, char* toEnd, char*& toNext) const { fromNext = fromBegin; toNext = toBegin; const char* first = 0; const char* second = 0; const char* third = 0; if(fromEnd - fromNext < 1) return std::codecvt_base::partial; if(toEnd - toNext < 4) return std::codecvt_base::partial; switch( state.n ) { case 2: first = &state.value.mbytes[0]; second = &state.value.mbytes[1]; third = fromNext++; break; case 1: if(fromEnd - fromNext < 2) { state.value.mbytes[1] = *fromNext++; state.n = 2; return std::codecvt_base::partial; } first = &state.value.mbytes[0]; second = fromNext++; third = fromNext++; break; default: first = fromNext++; second = fromNext++; third = fromNext++; break; } while (true) { *toNext++ = toBase64( (static_cast<unsigned char>(*first) >> 2) & 0x3f ); *(toNext++) = toBase64( ((static_cast<unsigned char>(*first) << 4) + (static_cast<unsigned char>(*second) >> 4)) & 0x3f ); *(toNext++) = toBase64( (static_cast<unsigned char>(*second << 2) + (static_cast<unsigned char>(*third) >> 6)) & 0x3f ); *(toNext++) = toBase64( static_cast<unsigned char>(*third) & 0x3f ); if(toEnd - toNext < 4) { state = MBState(); return std::codecvt_base::partial; } if( fromEnd - fromNext < 3 ) break; first = fromNext++; second = fromNext++; third = fromNext++; } switch( fromEnd - fromNext ) { case 2: state.value.mbytes[0] = *fromNext++; state.value.mbytes[1] = *fromNext++; state.n = 2; break; case 1: state.value.mbytes[0] = *fromNext++; state.n = 1; break; default: state = MBState(); break; } return std::codecvt_base::ok; } Base64Codec::result Base64Codec::do_unshift(MBState& state, char* toBegin, char* toEnd, char*& toNext) const { toNext = toBegin; if(toEnd - toBegin < 4) { return std::codecvt_base::partial; } switch(state.n) { case 2: *toNext++ = toBase64( (static_cast<unsigned char>(state.value.mbytes[0]) >> 2) & 0x3f ); *(toNext++) = toBase64( ((static_cast<unsigned char>(state.value.mbytes[0]) << 4) + (static_cast<unsigned char>(state.value.mbytes[1]) >> 4)) & 0x3f ); *(toNext++) = toBase64( (static_cast<unsigned char>(state.value.mbytes[1]) << 2) & 0x3f ); *(toNext++) = '='; break; case 1: *toNext++ = toBase64( (static_cast<unsigned char>(state.value.mbytes[0]) >> 2) & 0x3f ); *(toNext++) = toBase64( (static_cast<unsigned char>(state.value.mbytes[0]) << 4) & 0x3f ); *(toNext++) = '='; *(toNext++) = '='; break; case 0: return std::codecvt_base::noconv; } state = MBState(); return std::codecvt_base::ok; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/mutex.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000005516�12256773774�013012� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "muteximpl.h" #include "cxxtools/mutex.h" namespace cxxtools { Mutex::Mutex() { _impl = new MutexImpl(); } Mutex::~Mutex() { delete _impl; } void Mutex::lock() { _impl->lock(); } bool Mutex::tryLock() { return _impl->tryLock(); } void Mutex::unlock() { _impl->unlock(); } bool Mutex::unlockNoThrow() { try { _impl->unlock(); return true; } catch(...) {} return false; } RecursiveMutex::RecursiveMutex() { _impl = new MutexImpl(1); } RecursiveMutex::~RecursiveMutex() { delete _impl; } void RecursiveMutex::lock() { _impl->lock(); } bool RecursiveMutex::tryLock() { return _impl->tryLock(); } void RecursiveMutex::unlock() { _impl->unlock(); } bool RecursiveMutex::unlockNoThrow() { try { _impl->unlock(); return true; } catch(...) {} return false; } ReadWriteMutex::ReadWriteMutex() { _impl = new ReadWriteMutexImpl(); } ReadWriteMutex::~ReadWriteMutex() { delete _impl; } void ReadWriteMutex::readLock() { _impl->readLock(); } bool ReadWriteMutex::tryReadLock() { return _impl->tryReadLock(); } void ReadWriteMutex::writeLock() { _impl->writeLock(); } bool ReadWriteMutex::tryWriteLock() { return _impl->tryWriteLock(); } void ReadWriteMutex::unlock() { _impl->unlock(); } bool ReadWriteMutex::unlockNoThrow() { try { _impl->unlock(); return true; } catch(...) {} return false; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/streambuffer.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000022723�12256773774�014334� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/streambuffer.h" #include <algorithm> #include <stdexcept> #include <cstring> #include <cxxtools/log.h> log_define("cxxtools.streambuffer") namespace cxxtools { StreamBuffer::StreamBuffer(IODevice& ioDevice, size_t bufferSize, bool extend) : _ioDevice(&ioDevice), _ibufferSize(bufferSize+4), _ibuffer(0), _obufferSize(bufferSize), _obuffer(0), _pbmax(4), _oextend(extend) { this->setg(0, 0, 0); this->setp(0, 0); this->attach(ioDevice); } StreamBuffer::StreamBuffer(size_t bufferSize, bool extend) : _ioDevice(0), _ibufferSize(bufferSize+4), _ibuffer(0), _obufferSize(bufferSize), _obuffer(0), _pbmax(4), _oextend(extend) { this->setg(0, 0, 0); this->setp(0, 0); } StreamBuffer::~StreamBuffer() { delete[] _ibuffer; delete[] _obuffer; } void StreamBuffer::attach(IODevice& ioDevice) { if( ioDevice.busy() ) throw IOPending("IODevice in use"); if(_ioDevice) { if( _ioDevice->busy() ) throw IOPending("IODevice in use"); disconnect(ioDevice.inputReady, *this, &StreamBuffer::onRead); disconnect(ioDevice.outputReady, *this, &StreamBuffer::onWrite); } _ioDevice = &ioDevice; connect(ioDevice.inputReady, *this, &StreamBuffer::onRead); connect(ioDevice.outputReady, *this, &StreamBuffer::onWrite); } IODevice* StreamBuffer::device() { return _ioDevice; } void StreamBuffer::beginRead() { if(_ioDevice == 0 || _ioDevice->reading()) return; if( ! _ibuffer ) { _ibuffer = new char[_ibufferSize]; } size_t putback = _pbmax; size_t leftover = 0; // keep chars for putback if( this->gptr() ) { putback = std::min<size_t>( gptr() - eback(), _pbmax); char* to = _ibuffer + _pbmax - putback; char* from = this->gptr() - putback; leftover = egptr() - gptr(); std::memmove( to, from, putback + leftover ); } size_t used = _pbmax + leftover; if( _ibufferSize == used ) throw std::logic_error("StreamBuffer is full"); _ioDevice->beginRead( _ibuffer + used, _ibufferSize - used ); this->setg( _ibuffer + (_pbmax - putback), // start of get area _ibuffer + used, // gptr position _ibuffer + used ); // end of get area } void StreamBuffer::onRead(IODevice& dev) { inputReady.send(*this); } void StreamBuffer::endRead() { size_t readSize = _ioDevice->endRead(); this->setg( this->eback(), // start of get area this->gptr(), // gptr position this->egptr() + readSize ); // end of get area } StreamBuffer::int_type StreamBuffer::underflow() { log_trace("underflow"); if( ! _ioDevice ) return traits_type::eof(); if(_ioDevice->reading()) this->endRead(); if( this->gptr() < this->egptr() ) return traits_type::to_int_type( *(this->gptr()) ); if( _ioDevice->eof() ) return traits_type::eof(); if( ! _ibuffer ) { _ibuffer = new char[_ibufferSize]; } size_t putback = _pbmax; if( this->gptr() ) { putback = std::min<size_t>(this->gptr() - this->eback(), _pbmax); std::memmove( _ibuffer + (_pbmax - putback), this->gptr() - putback, putback ); } size_t readSize = _ioDevice->read( _ibuffer + _pbmax, _ibufferSize - _pbmax ); this->setg( _ibuffer + _pbmax - putback, // start of get area _ibuffer + _pbmax, // gptr position _ibuffer + _pbmax + readSize ); // end of get area if( _ioDevice->eof() ) return traits_type::eof(); return traits_type::to_int_type( *(this->gptr()) ); } std::streamsize StreamBuffer::showfull() { return 0; } size_t StreamBuffer::beginWrite() { log_trace("beginWrite; out_avail=" << out_avail()); if(_ioDevice == 0 || _ioDevice->writing()) return 0; if( this->pptr() ) { size_t avail = this->pptr() - this->pbase(); if(avail > 0) { return _ioDevice->beginWrite(_obuffer, avail); } } return 0; } void StreamBuffer::discard() { if (_ioDevice && (_ioDevice->reading() || _ioDevice->writing())) throw IOPending("discard failed - streambuffer is in use"); if (gptr()) this->setg(_ibuffer, _ibuffer + _ibufferSize, _ibuffer + _ibufferSize); if (pptr()) this->setp(_obuffer, _obuffer + _obufferSize); } void StreamBuffer::onWrite(IODevice& dev) { outputReady.send(*this); } size_t StreamBuffer::endWrite() { log_trace("endWrite; out_avail=" << out_avail()); size_t leftover = 0; size_t written = 0; if( this->pptr() ) { size_t avail = this->pptr() - this->pbase(); written = _ioDevice->endWrite(); leftover = avail - written; if(leftover > 0) { traits_type::move(_obuffer, _obuffer + written, leftover); } } this->setp(_obuffer, _obuffer + _obufferSize); this->pbump( leftover ); return written; } StreamBuffer::int_type StreamBuffer::overflow(int_type ch) { log_trace("overflow(" << ch << ')'); if( ! _ioDevice ) return traits_type::eof(); if( ! _obuffer ) { _obuffer = new char[_obufferSize]; this->setp(_obuffer, _obuffer + _obufferSize); } else if(_ioDevice->writing()) // beginWrite is unfinished { this->endWrite(); } else if (traits_type::eq_int_type( ch, traits_type::eof() ) || !_oextend) { // normal blocking overflow case size_t avail = this->pptr() - _obuffer; size_t written = _ioDevice->write(_obuffer, avail); size_t leftover = avail - written; if(leftover > 0) { traits_type::move(_obuffer, _obuffer + written, leftover); } this->setp(_obuffer, _obuffer + _obufferSize); this->pbump( leftover ); } else { // if the buffer area is extensible and overflow is not called by // sync/flush we copy the output buffer to a larger one size_t bufsize = _obufferSize + (_obufferSize/2); char* buf = new char[ bufsize ]; traits_type::copy(buf, _obuffer, _obufferSize); std::swap(_obuffer, buf); this->setp(_obuffer, _obuffer + bufsize); this->pbump( _obufferSize ); _obufferSize = bufsize; delete [] buf; } // if the overflow char is not EOF put it in buffer if( traits_type::eq_int_type(ch, traits_type::eof()) == false ) { *this->pptr() = traits_type::to_char_type(ch); this->pbump(1); } return traits_type::not_eof(ch); } StreamBuffer::int_type StreamBuffer::pbackfail(StreamBuffer::int_type) { return traits_type::eof(); } int StreamBuffer::sync() { log_trace("sync"); if( ! _ioDevice ) return 0; if( pptr() ) { while( this->pptr() > this->pbase() ) { const int_type ch = this->overflow( traits_type::eof() ); if( ch == traits_type::eof() ) { return -1; } _ioDevice->sync(); } } return 0; } std::streamsize StreamBuffer::xspeekn(char* buffer, std::streamsize size) { if( traits_type::eof() == this->underflow() ) return 0; const std::streamsize avail = this->egptr() - this->gptr(); size = std::min(avail, size); if(size == 0) { return 0; } std::memcpy(buffer, this->gptr(), sizeof(char) * size); return size; } StreamBuffer::pos_type StreamBuffer::seekoff(off_type off, std::ios::seekdir dir, std::ios::openmode) { pos_type ret = pos_type( off_type(-1) ); if ( ! _ioDevice || ! _ioDevice->enabled() || ! _ioDevice->seekable() || off == 0) { return ret; } if(_ioDevice->writing()) { this->endWrite(); } if(_ioDevice->reading()) { this->endRead(); } ret = _ioDevice->seek(off, dir); // eliminate currently buffered sequence discard(); return ret; } StreamBuffer::pos_type StreamBuffer::seekpos(pos_type p, std::ios::openmode mode) { return this->seekoff(p, std::ios::beg, mode); } } ���������������������������������������������cxxtools-2.2.1/src/net.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000007700�12256773774�012433� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/net.h> #include <cxxtools/log.h> #include <cxxtools/systemerror.h> #include "tcpsocketimpl.h" #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <sys/poll.h> #include <stdio.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include "config.h" log_define("cxxtools.net.net") namespace cxxtools { namespace net { //////////////////////////////////////////////////////////////////////// // implementation of Socket // Socket::Socket(int domain, int type, int protocol) : m_timeout(-1) { if ((m_sockFd = ::socket(domain, type, protocol)) < 0) throw SystemError("socket"); } Socket::~Socket() { if (m_sockFd >= 0) { if (::close(m_sockFd) < 0) fprintf(stderr, "error in close(%d)\n", (int)m_sockFd); } } void Socket::create(int domain, int type, int protocol) { close(); log_debug("create socket"); int fd = ::socket(domain, type, protocol); if (fd < 0) throw SystemError("socket"); setFd(fd); } void Socket::close() { if (m_sockFd >= 0) { log_debug("close socket"); ::close(m_sockFd); m_sockFd = -1; } } std::string Socket::getSockAddr() const { return net::getSockAddr(getFd()); } void Socket::setTimeout(int t) { if (m_timeout != t) { log_debug("set timeout " << t << ", fd=" << getFd() << ", previous=" << m_timeout); if (getFd() >= 0 && ((t >= 0 && m_timeout < 0) || (t < 0 && m_timeout >= 0))) { long a = t >= 0 ? O_NONBLOCK : 0; log_debug("fcntl(" << getFd() << ", F_SETFL, " << a << ')'); int ret = fcntl(getFd(), F_SETFL, a); if (ret < 0) throw SystemError("fcntl"); } m_timeout = t; } } void Socket::setFd(int sockFd) { close(); m_sockFd = sockFd; long a = m_timeout >= 0 ? O_NONBLOCK : 0; log_debug("fcntl(" << getFd() << ", F_SETFL, " << a << ')'); int ret = ::fcntl(getFd(), F_SETFL, a); if (ret < 0) throw SystemError("fcntl"); } short Socket::poll(short events) const { struct pollfd fds; fds.fd = getFd(); fds.events = events; log_debug("poll timeout " << getTimeout()); int p = ::poll(&fds, 1, getTimeout()); log_debug("poll returns " << p << " revents " << fds.revents); if (p < 0) { log_error("error in poll; errno=" << errno); throw SystemError("poll"); } else if (p == 0) { log_debug("poll timeout (" << getTimeout() << ')'); throw IOTimeout(); } return fds.revents; } } // namespace net } // namespace cxxtools ����������������������������������������������������������������cxxtools-2.2.1/src/unicode.h������������������������������������������������������������������������0000664�0001750�0001750�00004663365�12256773774�012763� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ const std::ctype_base::mask digit = std::ctype_base::digit; const std::ctype_base::mask xdigit = std::ctype_base::xdigit; const std::ctype_base::mask cntrl = std::ctype_base::cntrl; const std::ctype_base::mask space = std::ctype_base::space; const std::ctype_base::mask upper = std::ctype_base::upper; const std::ctype_base::mask lower = std::ctype_base::lower; const std::ctype_base::mask alpha = std::ctype_base::alpha; const std::ctype_base::mask punct = std::ctype_base::punct; const std::ctype_base::mask print = std::ctype_base::print; const std::ctype_base::mask alnum = std::ctype_base::alnum; const std::ctype_base::mask graph = std::ctype_base::graph; const std::ctype_base::mask ctype_data[13936]= { std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl|space) & ~(print)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper|xdigit) & ~(digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower|xdigit) & ~(digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|upper) & ~(xdigit|digit|lower|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|print|punct) & ~(xdigit|digit|upper|lower|alpha|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha|lower) & ~(xdigit|digit|upper|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|digit|xdigit) & ~(upper|lower|alpha|space|punct)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((graph|alnum|print|alpha) & ~(xdigit|digit|upper|lower|punct|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl|print|space) & ~(xdigit|digit|upper|lower|punct|alpha)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask((cntrl) & ~(xdigit|digit|upper|lower|punct|alpha|space)), std::ctype_base::mask(0) }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/quotedprintablestream.cpp��������������������������������������������������������0000664�0001750�0001750�00000004660�12266277345�016257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/quotedprintablestream.h" namespace cxxtools { std::streambuf::int_type QuotedPrintable_streambuf::overflow(std::streambuf::int_type ch) { if (ch > 32 && ch < 128) { sinksource->sputc(ch); if (++col > 76) { sinksource->sputc('\n'); col = 0; } } else if (ch == 32) { sinksource->sputc(ch); if (++col > 70) { sinksource->sputc('='); sinksource->sputc('\n'); col = 0; } } else if (ch == '\n') { sinksource->sputc('\n'); col = 0; } else { if (col > 73) { sinksource->sputc('='); sinksource->sputc('\n'); col = 0; } static const char hex[] = "0123456789ABCDEF"; sinksource->sputc('='); sinksource->sputc(hex[(ch >> 4) & 0xf]); sinksource->sputc(hex[ch & 0xf]); if (++col > 73) { sinksource->sputc('='); sinksource->sputc('\n'); col = 0; } } return 0; } std::streambuf::int_type QuotedPrintable_streambuf::underflow() { return traits_type::eof(); } int QuotedPrintable_streambuf::sync() { return sinksource->pubsync(); } } ��������������������������������������������������������������������������������cxxtools-2.2.1/src/fileinfo.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000007270�12266277345�013434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fileinfoimpl.h" #include "fileimpl.h" #include "directoryimpl.h" #include "cxxtools/fileinfo.h" #include "cxxtools/directory.h" namespace cxxtools { FileInfo::FileInfo() : _type(FileInfo::Invalid) {} FileInfo::FileInfo(const std::string& path) : _path(path) { _type = FileInfoImpl::getType( path.c_str() ); } FileInfo::FileInfo(const DirectoryIterator& it) : _path(it.path()) { _type = FileInfoImpl::getType( _path.c_str() ); } FileInfo::FileInfo(const FileInfo& fi) : _type(fi._type) , _path(fi._path) { } FileInfo::~FileInfo() { } FileInfo& FileInfo::operator=(const FileInfo& fi) { _type = fi._type; _path = fi._path; return *this; } FileInfo::Type FileInfo::type() const { return _type; } std::string FileInfo::name() const { std::string::size_type pos = _path.rfind( DirectoryImpl::sep() ); if (pos != std::string::npos) { return _path.substr(pos + 1); } else { return _path; } } const std::string& FileInfo::path() const { return _path; } std::string FileInfo::dirName() const { // Find last slash. This separates the file name from the path. std::string::size_type pos = _path.find_last_of( DirectoryImpl::sep() ); // If there is no separator, the file is relative to the current // directory. So an empty path is returned. if (pos == std::string::npos) { return ""; } // Include trailing separator to be able to distinguish between no // path ("") and a path which is relative to the root ("/"), for example. return _path.substr(0, pos + 1); } std::size_t FileInfo::size() const { if(_type == FileInfo::File) { return FileImpl::size( _path.c_str() ); } return 0; } void FileInfo::remove() { if (_type == FileInfo::Directory) { return DirectoryImpl::remove( _path.c_str() ); } return FileImpl::remove( _path.c_str() ); } void FileInfo::move(const std::string& to) { if(_type == FileInfo::Directory) { return DirectoryImpl::move( _path.c_str(), to.c_str() ); } return FileImpl::move( _path.c_str(), to.c_str() ); } bool FileInfo::exists(const std::string& path) { return FileInfo::getType( path ) != FileInfo::Invalid; } FileInfo::Type FileInfo::getType(const std::string& path) { return FileInfoImpl::getType( path ); } } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/selectorimpl.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000015642�12260020530�014315� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "selectorimpl.h" #include "selectableimpl.h" #include "cxxtools/ioerror.h" #include "cxxtools/systemerror.h" #include "cxxtools/selector.h" #include "cxxtools/log.h" #include <cerrno> #include <unistd.h> #include <fcntl.h> #include <signal.h> #include <cassert> #include <iostream> #include <limits> log_define("cxxtools.selector.impl") namespace cxxtools { const short SelectorImpl::POLL_ERROR_MASK= POLLERR | POLLHUP | POLLNVAL; SelectorImpl::SelectorImpl() : _isDirty(true) { _current = _devices.end(); //Open a pipe to send wake up message. if( ::pipe( _wakePipe ) ) throwSystemError("pipe"); int flags = ::fcntl(_wakePipe[0], F_GETFL); if(-1 == flags) throwSystemError("fcntl"); int ret = ::fcntl(_wakePipe[0], F_SETFL, flags|O_NONBLOCK); if(-1 == ret) throwSystemError("fcntl"); flags = ::fcntl(_wakePipe[1], F_GETFL); if(-1 == flags) throwSystemError("fcntl"); ret = ::fcntl(_wakePipe[1], F_SETFL, flags|O_NONBLOCK); if(-1 == ret) throwSystemError("fcntl"); } SelectorImpl::~SelectorImpl() { std::set<Selectable*>::iterator it; while( _devices.size() ) { it = _devices.begin(); (*it)->setSelector(0); } if( _wakePipe[0] != -1 && _wakePipe[1] != -1 ) { ::close(_wakePipe[0]); ::close(_wakePipe[1]); } } void SelectorImpl::add(Selectable& dev) { _devices.insert(&dev); _isDirty = true; } void SelectorImpl::remove(Selectable& dev) { std::set<Selectable*>::iterator it = _devices.find( &dev ); if( it == _devices.end() ) return; if (_current == _devices.end()) { _devices.erase(it); } else if (*_current == *it) { _devices.erase(_current++); } else { _devices.erase(it); } _isDirty = true; } void SelectorImpl::changed( Selectable& s ) { if( s.avail() ) { _avail.insert(&s); } else { _avail.erase(&s); } } bool SelectorImpl::wait(std::size_t umsecs) { _clock.start(); umsecs = _avail.size() ? 0 : umsecs; int msecs = umsecs; if (umsecs != SelectorBase::WaitInfinite && umsecs > static_cast<std::size_t>(std::numeric_limits<int>::max())) { msecs = std::numeric_limits<int>::max(); } if (_isDirty) { _pollfds.clear(); // Groesse neu berechnen size_t pollSize= 1; std::set<Selectable*>::iterator iter; for( iter= _devices.begin(); iter != _devices.end(); ++iter) { if( (*iter)->enabled() ) pollSize+= (*iter)->simpl().pollSize(); } pollfd pfd; pfd.fd = -1; pfd.events = 0; pfd.revents = 0; _pollfds.assign(pollSize, pfd); // Eintraege einfuegen pollfd* pCurr= &_pollfds[0]; // Event Pipe einfuegen TODO cxxtools::Pipe verwenden pCurr->fd = _wakePipe[0]; pCurr->events = POLLIN; ++pCurr; for( iter= _devices.begin(); iter != _devices.end(); ++iter) { if( (*iter)->enabled() ) { const size_t availableSpace= &_pollfds.back() - pCurr + 1; size_t required = (*iter)->simpl().pollSize(); assert( required <= availableSpace); pCurr+= (*iter)->simpl().initializePoll( pCurr, required); } } _isDirty= false; } int ret = -1; while( true ) { if(umsecs != SelectorBase::WaitInfinite) { int64_t diff = _clock.stop().totalMSecs(); _clock.start(); if (diff < msecs) { msecs -= int(diff); } else { msecs = 0; } } log_debug("poll with " << _pollfds.size() << " fds, timeout=" << msecs << "ms"); ret = ::poll(&_pollfds[0], _pollfds.size(), msecs); log_debug("poll returns " << ret); if( ret != -1 ) break; if( errno != EINTR ) throw IOError("Could not poll on file descriptors"); } if( ret == 0 && _avail.empty() ) return false; bool avail = false; try { if (_pollfds[0].revents != 0) { if ( _pollfds[0].revents & POLL_ERROR_MASK) { throw IOError("poll error on event pipe"); } static char buffer[1024]; while(true) { int ret = ::read(_wakePipe[0], buffer, sizeof(buffer)); if(ret > 0) { avail = true; continue; } if (ret == -1) { if(errno == EINTR) continue; if(errno == EAGAIN) break; } throw IOError("Could not read from pipe"); } } for( _current = _devices.begin(); _current != _devices.end(); ) { Selectable* dev = *_current; if ( dev->enabled() && dev->simpl().checkPollEvent() ) { avail = true; } if (_current != _devices.end()) { if (*_current == dev) { ++_current; } } } } catch (...) { _current= _devices.end(); throw; } return avail; } void SelectorImpl::wake() { ::write( _wakePipe[1], "W", 1); ::fsync( _wakePipe[1] ); } } //namespace cxxtools ����������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.gcc.sparc32.cpp��������������������������������������������������������0000664�0001750�0001750�00000013745�12256773774�015664� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.sparc32.h> #include <csignal> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile("stbar" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile("stbar" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " add %%o4, 1, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); return ret; } atomic_t atomicDecrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " sub %%o4, 1, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " sub %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); return ret; } atomic_t atomicExchangeAdd(volatile atomic_t& val, atomic_t add) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " add %%o4, %3, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, %3, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest), "r" (add) : "memory", "cc"); return ret; } atomic_t atomicCompareExchange(volatile atomic_t& val, atomic_t exch, atomic_t comp) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t _comp asm("o4") = comp; register atomic_t _exch asm("o5") = exch; asm volatile( /* cas [%%g1], %%o4, %%o5 */ ".word 0xdbe0500c" : "=r" (_exch) : "0" (_exch), "r" (dest), "r" (_comp) : "memory"); return exch; } void* atomicCompareExchange(void* volatile& ptr, void* exch, void* comp) { register void* volatile* dest asm("g1") = &ptr; register void* _comp asm("o4") = comp; register void* _exch asm("o5") = exch; asm volatile( #if defined(__sparcv9) /* casx [%%g1], %%o4, %%o5 */ ".word 0xdbf0500c" #else /* cas [%%g1], %%o4, %%o5 */ ".word 0xdbe0500c" #endif : "=r" (_exch) : "0" (_exch), "r" (dest), "r" (_comp) : "memory"); return exch; } atomic_t atomicExchange(volatile atomic_t& val, atomic_t exch) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile( "1: ld [%%g1], %%o4\n\t" " mov %3, %%o5\n\t" /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " nop" : "=&r" (tmp), "=&r" (ret) : "r" (dest), "r" (exch) : "memory", "cc"); return ret; } void* atomicExchange(void* volatile& ptr, void* exch) { register void* volatile* dest asm("g1") = &ptr; register void* tmp asm("o4"); register void* ret asm("o5"); asm volatile( #if defined(__sparcv9) "1: ldx [%%g1], %%o4\n\t" #else "1: ld [%%g1], %%o4\n\t" #endif " mov %3, %%o5\n\t" #if defined(__sparcv9) /* casx [%%g1], %%o4, %%o5 */ " .word 0xdbf0500c\n\t" #else /* cas [%%g1], %%o4, %%o5 */ " .word 0xdbe0500c\n\t" #endif " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " nop" : "=&r" (tmp), "=&r" (ret) : "r" (dest), "r" (exch) : "memory", "cc"); return ret; } } // namespace cxxtools ���������������������������cxxtools-2.2.1/src/ioerror.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000004353�12256773774�013327� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Marc Boris Duerner * Copyright (C) 2005 Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/ioerror.h" #include <string> namespace cxxtools { IOError::IOError(const std::string& what) : std::ios::failure(what) { } IOTimeout::IOTimeout() : IOError("Timeout") { } AccessFailed::AccessFailed(const std::string& resource) : IOError("could not access " + resource) { } PermissionDenied::PermissionDenied(const std::string& resource) : AccessFailed(resource) { } DeviceNotFound::DeviceNotFound(const std::string& device) : AccessFailed(device) {} FileNotFound::FileNotFound(const std::string& path) : AccessFailed(path) {} DirectoryNotFound::DirectoryNotFound(const std::string& path) : AccessFailed(path) { } IOPending::IOPending(const std::string& what) : IOError(what) { } DeviceClosed::DeviceClosed(const std::string& what) : IOError(what) { } DeviceClosed::DeviceClosed(const char* msg) : IOError(msg) { } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/Makefile.in����������������������������������������������������������������������0000664�0001750�0001750�00000153054�12266277545�013206� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @MAKE_ICONVSTREAM_TRUE@am__append_1 = \ @MAKE_ICONVSTREAM_TRUE@ iconvwrap.cpp \ @MAKE_ICONVSTREAM_TRUE@ iconvstream.cpp @MAKE_ATOMICITY_SUN_TRUE@am__append_2 = \ @MAKE_ATOMICITY_SUN_TRUE@ atomicity.sun.cpp @MAKE_ATOMICITY_WINDOWS_TRUE@am__append_3 = \ @MAKE_ATOMICITY_WINDOWS_TRUE@ atomicity.windows.cpp @MAKE_ATOMICITY_GCC_ARM_TRUE@am__append_4 = \ @MAKE_ATOMICITY_GCC_ARM_TRUE@ atomicity.gcc.arm.cpp @MAKE_ATOMICITY_GCC_MIPS_TRUE@am__append_5 = \ @MAKE_ATOMICITY_GCC_MIPS_TRUE@ atomicity.gcc.mips.cpp @MAKE_ATOMICITY_GCC_PPC_TRUE@am__append_6 = \ @MAKE_ATOMICITY_GCC_PPC_TRUE@ atomicity.gcc.ppc.cpp @MAKE_ATOMICITY_GCC_X86_64_TRUE@am__append_7 = \ @MAKE_ATOMICITY_GCC_X86_64_TRUE@ atomicity.gcc.x86_64.cpp @MAKE_ATOMICITY_GCC_X86_TRUE@am__append_8 = \ @MAKE_ATOMICITY_GCC_X86_TRUE@ atomicity.gcc.x86.cpp @MAKE_ATOMICITY_GCC_SPARC32_TRUE@am__append_9 = \ @MAKE_ATOMICITY_GCC_SPARC32_TRUE@ atomicity.gcc.sparc32.cpp @MAKE_ATOMICITY_GCC_SPARC64_TRUE@am__append_10 = \ @MAKE_ATOMICITY_GCC_SPARC64_TRUE@ atomicity.gcc.sparc64.cpp @MAKE_ATOMICITY_GCC_AVR32_TRUE@am__append_11 = \ @MAKE_ATOMICITY_GCC_AVR32_TRUE@ atomicity.gcc.avr32.cpp @MAKE_ATOMICITY_PTHREAD_TRUE@am__append_12 = \ @MAKE_ATOMICITY_PTHREAD_TRUE@ atomicity.pthread.cpp @MAKE_ATOMICITY_GENERIC_TRUE@am__append_13 = \ @MAKE_ATOMICITY_GENERIC_TRUE@ atomicity.generic.cpp subdir = src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libcxxtools_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libcxxtools_la_SOURCES_DIST = addrinfo.cpp addrinfoimpl.cpp \ application.cpp applicationimpl.cpp base64codec.cpp \ csvdeserializer.cpp csvformatter.cpp csvparser.cpp char.cpp \ clock.cpp clockimpl.cpp condition.cpp conditionimpl.cpp \ connectable.cpp connection.cpp cgi.cpp conversionerror.cpp \ convert.cpp date.cpp datetime.cpp decomposer.cpp \ deserializer.cpp directory.cpp directoryimpl.cpp error.cpp \ eventloop.cpp eventsink.cpp eventsource.cpp fdstream.cpp \ file.cpp filedevice.cpp filedeviceimpl.cpp fileimpl.cpp \ fileinfo.cpp formatter.cpp hdstream.cpp inifile.cpp \ iniparser.cpp iodevice.cpp iodeviceimpl.cpp ioerror.cpp \ iostream.cpp jsondeserializer.cpp jsonformatter.cpp \ jsonparser.cpp jsonserializer.cpp library.cpp libraryimpl.cpp \ log.cpp md5.c md5stream.cpp mime.cpp multifstream.cpp \ mutex.cpp muteximpl.cpp pipe.cpp pipeimpl.cpp \ posix/commandinput.cpp posix/commandoutput.cpp \ posix/pipestream.cpp posix/posixpipe.cpp properties.cpp \ propertiesdeserializer.cpp query_params.cpp \ quotedprintablestream.cpp regex.cpp remoteclient.cpp \ selectable.cpp selector.cpp selectorimpl.cpp semaphore.cpp \ semaphoreimpl.cpp serviceregistry.cpp settings.cpp \ settingsreader.cpp settingswriter.cpp serializationerror.cpp \ serializationinfo.cpp signal.cpp streambuffer.cpp string.cpp \ stringstream.cpp systemerror.cpp tee.cpp textbuffer.cpp \ textcodec.cpp textstream.cpp thread.cpp threadimpl.cpp \ threadpool.cpp threadpoolimpl.cpp time.cpp timer.cpp \ timespan.cpp uri.cpp utf8codec.cpp uuencode.cpp xmltag.cpp \ net.cpp tcpserverimpl.cpp tcpserver.cpp tcpsocket.cpp \ tcpsocketimpl.cpp tcpstream.cpp udp.cpp udpstream.cpp \ xml/characters.cpp xml/endelement.cpp xml/entityresolver.cpp \ xml/namespacecontext.cpp xml/startelement.cpp \ xml/xmldeserializer.cpp xml/xmlerror.cpp xml/xmlformatter.cpp \ xml/xmlreader.cpp xml/xmlserializer.cpp xml/xmlwriter.cpp \ iconvwrap.cpp iconvstream.cpp atomicity.sun.cpp \ atomicity.windows.cpp atomicity.gcc.arm.cpp \ atomicity.gcc.mips.cpp atomicity.gcc.ppc.cpp \ atomicity.gcc.x86_64.cpp atomicity.gcc.x86.cpp \ atomicity.gcc.sparc32.cpp atomicity.gcc.sparc64.cpp \ atomicity.gcc.avr32.cpp atomicity.pthread.cpp \ atomicity.generic.cpp @MAKE_ICONVSTREAM_TRUE@am__objects_1 = iconvwrap.lo iconvstream.lo @MAKE_ATOMICITY_SUN_TRUE@am__objects_2 = atomicity.sun.lo @MAKE_ATOMICITY_WINDOWS_TRUE@am__objects_3 = atomicity.windows.lo @MAKE_ATOMICITY_GCC_ARM_TRUE@am__objects_4 = atomicity.gcc.arm.lo @MAKE_ATOMICITY_GCC_MIPS_TRUE@am__objects_5 = atomicity.gcc.mips.lo @MAKE_ATOMICITY_GCC_PPC_TRUE@am__objects_6 = atomicity.gcc.ppc.lo @MAKE_ATOMICITY_GCC_X86_64_TRUE@am__objects_7 = \ @MAKE_ATOMICITY_GCC_X86_64_TRUE@ atomicity.gcc.x86_64.lo @MAKE_ATOMICITY_GCC_X86_TRUE@am__objects_8 = atomicity.gcc.x86.lo @MAKE_ATOMICITY_GCC_SPARC32_TRUE@am__objects_9 = \ @MAKE_ATOMICITY_GCC_SPARC32_TRUE@ atomicity.gcc.sparc32.lo @MAKE_ATOMICITY_GCC_SPARC64_TRUE@am__objects_10 = \ @MAKE_ATOMICITY_GCC_SPARC64_TRUE@ atomicity.gcc.sparc64.lo @MAKE_ATOMICITY_GCC_AVR32_TRUE@am__objects_11 = \ @MAKE_ATOMICITY_GCC_AVR32_TRUE@ atomicity.gcc.avr32.lo @MAKE_ATOMICITY_PTHREAD_TRUE@am__objects_12 = atomicity.pthread.lo @MAKE_ATOMICITY_GENERIC_TRUE@am__objects_13 = atomicity.generic.lo am_libcxxtools_la_OBJECTS = addrinfo.lo addrinfoimpl.lo application.lo \ applicationimpl.lo base64codec.lo csvdeserializer.lo \ csvformatter.lo csvparser.lo char.lo clock.lo clockimpl.lo \ condition.lo conditionimpl.lo connectable.lo connection.lo \ cgi.lo conversionerror.lo convert.lo date.lo datetime.lo \ decomposer.lo deserializer.lo directory.lo directoryimpl.lo \ error.lo eventloop.lo eventsink.lo eventsource.lo fdstream.lo \ file.lo filedevice.lo filedeviceimpl.lo fileimpl.lo \ fileinfo.lo formatter.lo hdstream.lo inifile.lo iniparser.lo \ iodevice.lo iodeviceimpl.lo ioerror.lo iostream.lo \ jsondeserializer.lo jsonformatter.lo jsonparser.lo \ jsonserializer.lo library.lo libraryimpl.lo log.lo md5.lo \ md5stream.lo mime.lo multifstream.lo mutex.lo muteximpl.lo \ pipe.lo pipeimpl.lo commandinput.lo commandoutput.lo \ pipestream.lo posixpipe.lo properties.lo \ propertiesdeserializer.lo query_params.lo \ quotedprintablestream.lo regex.lo remoteclient.lo \ selectable.lo selector.lo selectorimpl.lo semaphore.lo \ semaphoreimpl.lo serviceregistry.lo settings.lo \ settingsreader.lo settingswriter.lo serializationerror.lo \ serializationinfo.lo signal.lo streambuffer.lo string.lo \ stringstream.lo systemerror.lo tee.lo textbuffer.lo \ textcodec.lo textstream.lo thread.lo threadimpl.lo \ threadpool.lo threadpoolimpl.lo time.lo timer.lo timespan.lo \ uri.lo utf8codec.lo uuencode.lo xmltag.lo net.lo \ tcpserverimpl.lo tcpserver.lo tcpsocket.lo tcpsocketimpl.lo \ tcpstream.lo udp.lo udpstream.lo characters.lo endelement.lo \ entityresolver.lo namespacecontext.lo startelement.lo \ xmldeserializer.lo xmlerror.lo xmlformatter.lo xmlreader.lo \ xmlserializer.lo xmlwriter.lo $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_8) $(am__objects_9) $(am__objects_10) \ $(am__objects_11) $(am__objects_12) $(am__objects_13) libcxxtools_la_OBJECTS = $(am_libcxxtools_la_OBJECTS) libcxxtools_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libcxxtools_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcxxtools_la_SOURCES) DIST_SOURCES = $(am__libcxxtools_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools.la libcxxtools_la_SOURCES = addrinfo.cpp addrinfoimpl.cpp application.cpp \ applicationimpl.cpp base64codec.cpp csvdeserializer.cpp \ csvformatter.cpp csvparser.cpp char.cpp clock.cpp \ clockimpl.cpp condition.cpp conditionimpl.cpp connectable.cpp \ connection.cpp cgi.cpp conversionerror.cpp convert.cpp \ date.cpp datetime.cpp decomposer.cpp deserializer.cpp \ directory.cpp directoryimpl.cpp error.cpp eventloop.cpp \ eventsink.cpp eventsource.cpp fdstream.cpp file.cpp \ filedevice.cpp filedeviceimpl.cpp fileimpl.cpp fileinfo.cpp \ formatter.cpp hdstream.cpp inifile.cpp iniparser.cpp \ iodevice.cpp iodeviceimpl.cpp ioerror.cpp iostream.cpp \ jsondeserializer.cpp jsonformatter.cpp jsonparser.cpp \ jsonserializer.cpp library.cpp libraryimpl.cpp log.cpp md5.c \ md5stream.cpp mime.cpp multifstream.cpp mutex.cpp \ muteximpl.cpp pipe.cpp pipeimpl.cpp posix/commandinput.cpp \ posix/commandoutput.cpp posix/pipestream.cpp \ posix/posixpipe.cpp properties.cpp propertiesdeserializer.cpp \ query_params.cpp quotedprintablestream.cpp regex.cpp \ remoteclient.cpp selectable.cpp selector.cpp selectorimpl.cpp \ semaphore.cpp semaphoreimpl.cpp serviceregistry.cpp \ settings.cpp settingsreader.cpp settingswriter.cpp \ serializationerror.cpp serializationinfo.cpp signal.cpp \ streambuffer.cpp string.cpp stringstream.cpp systemerror.cpp \ tee.cpp textbuffer.cpp textcodec.cpp textstream.cpp thread.cpp \ threadimpl.cpp threadpool.cpp threadpoolimpl.cpp time.cpp \ timer.cpp timespan.cpp uri.cpp utf8codec.cpp uuencode.cpp \ xmltag.cpp net.cpp tcpserverimpl.cpp tcpserver.cpp \ tcpsocket.cpp tcpsocketimpl.cpp tcpstream.cpp udp.cpp \ udpstream.cpp xml/characters.cpp xml/endelement.cpp \ xml/entityresolver.cpp xml/namespacecontext.cpp \ xml/startelement.cpp xml/xmldeserializer.cpp xml/xmlerror.cpp \ xml/xmlformatter.cpp xml/xmlreader.cpp xml/xmlserializer.cpp \ xml/xmlwriter.cpp $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) \ $(am__append_6) $(am__append_7) $(am__append_8) \ $(am__append_9) $(am__append_10) $(am__append_11) \ $(am__append_12) $(am__append_13) noinst_HEADERS = \ addrinfoimpl.h \ applicationimpl.h \ clockimpl.h \ conditionimpl.h \ directoryimpl.h \ error.h \ facets.cpp \ fileimpl.h \ filedeviceimpl.h \ fileinfoimpl.h \ iodeviceimpl.h \ libraryimpl.h \ md5.h \ muteximpl.h \ pipeimpl.h \ selectableimpl.h \ selectorimpl.h \ semaphoreimpl.h \ settingsreader.h \ settingswriter.h \ threadimpl.h \ threadpoolimpl.h \ unicode.h \ tcpserverimpl.h \ tcpsocketimpl.h libcxxtools_la_LIBADD = $(LIBICONV) libcxxtools_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools.la: $(libcxxtools_la_OBJECTS) $(libcxxtools_la_DEPENDENCIES) $(EXTRA_libcxxtools_la_DEPENDENCIES) $(libcxxtools_la_LINK) -rpath $(libdir) $(libcxxtools_la_OBJECTS) $(libcxxtools_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addrinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addrinfoimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/application.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/applicationimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.arm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.avr32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.mips.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.ppc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.sparc32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.sparc64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.x86.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.gcc.x86_64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.generic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.pthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.sun.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicity.windows.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64codec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/char.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/characters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clockimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandoutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/condition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditionimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connectable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conversionerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvdeserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvformatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csvparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datetime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decomposer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directoryimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endelement.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entityresolver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventloop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventsink.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventsource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filedevice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filedeviceimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvwrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inifile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iodevice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iodeviceimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iostream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsondeserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonformatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsonserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libraryimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multifstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mutex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muteximpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namespacecontext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipeimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipestream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixpipe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propertiesdeserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query_params.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotedprintablestream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remoteclient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selectable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/selectorimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphoreimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializationerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serializationinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serviceregistry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settingsreader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settingswriter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/startelement.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streambuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systemerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpserver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpserverimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpsocket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpsocketimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textbuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textcodec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadpool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadpoolimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udpstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8codec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuencode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmldeserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlformatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlreader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlserializer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmltag.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwriter.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< commandinput.lo: posix/commandinput.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT commandinput.lo -MD -MP -MF $(DEPDIR)/commandinput.Tpo -c -o commandinput.lo `test -f 'posix/commandinput.cpp' || echo '$(srcdir)/'`posix/commandinput.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/commandinput.Tpo $(DEPDIR)/commandinput.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='posix/commandinput.cpp' object='commandinput.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o commandinput.lo `test -f 'posix/commandinput.cpp' || echo '$(srcdir)/'`posix/commandinput.cpp commandoutput.lo: posix/commandoutput.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT commandoutput.lo -MD -MP -MF $(DEPDIR)/commandoutput.Tpo -c -o commandoutput.lo `test -f 'posix/commandoutput.cpp' || echo '$(srcdir)/'`posix/commandoutput.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/commandoutput.Tpo $(DEPDIR)/commandoutput.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='posix/commandoutput.cpp' object='commandoutput.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o commandoutput.lo `test -f 'posix/commandoutput.cpp' || echo '$(srcdir)/'`posix/commandoutput.cpp pipestream.lo: posix/pipestream.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT pipestream.lo -MD -MP -MF $(DEPDIR)/pipestream.Tpo -c -o pipestream.lo `test -f 'posix/pipestream.cpp' || echo '$(srcdir)/'`posix/pipestream.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/pipestream.Tpo $(DEPDIR)/pipestream.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='posix/pipestream.cpp' object='pipestream.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o pipestream.lo `test -f 'posix/pipestream.cpp' || echo '$(srcdir)/'`posix/pipestream.cpp posixpipe.lo: posix/posixpipe.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT posixpipe.lo -MD -MP -MF $(DEPDIR)/posixpipe.Tpo -c -o posixpipe.lo `test -f 'posix/posixpipe.cpp' || echo '$(srcdir)/'`posix/posixpipe.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/posixpipe.Tpo $(DEPDIR)/posixpipe.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='posix/posixpipe.cpp' object='posixpipe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o posixpipe.lo `test -f 'posix/posixpipe.cpp' || echo '$(srcdir)/'`posix/posixpipe.cpp characters.lo: xml/characters.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT characters.lo -MD -MP -MF $(DEPDIR)/characters.Tpo -c -o characters.lo `test -f 'xml/characters.cpp' || echo '$(srcdir)/'`xml/characters.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/characters.Tpo $(DEPDIR)/characters.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/characters.cpp' object='characters.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o characters.lo `test -f 'xml/characters.cpp' || echo '$(srcdir)/'`xml/characters.cpp endelement.lo: xml/endelement.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT endelement.lo -MD -MP -MF $(DEPDIR)/endelement.Tpo -c -o endelement.lo `test -f 'xml/endelement.cpp' || echo '$(srcdir)/'`xml/endelement.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/endelement.Tpo $(DEPDIR)/endelement.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/endelement.cpp' object='endelement.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o endelement.lo `test -f 'xml/endelement.cpp' || echo '$(srcdir)/'`xml/endelement.cpp entityresolver.lo: xml/entityresolver.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT entityresolver.lo -MD -MP -MF $(DEPDIR)/entityresolver.Tpo -c -o entityresolver.lo `test -f 'xml/entityresolver.cpp' || echo '$(srcdir)/'`xml/entityresolver.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/entityresolver.Tpo $(DEPDIR)/entityresolver.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/entityresolver.cpp' object='entityresolver.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o entityresolver.lo `test -f 'xml/entityresolver.cpp' || echo '$(srcdir)/'`xml/entityresolver.cpp namespacecontext.lo: xml/namespacecontext.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT namespacecontext.lo -MD -MP -MF $(DEPDIR)/namespacecontext.Tpo -c -o namespacecontext.lo `test -f 'xml/namespacecontext.cpp' || echo '$(srcdir)/'`xml/namespacecontext.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/namespacecontext.Tpo $(DEPDIR)/namespacecontext.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/namespacecontext.cpp' object='namespacecontext.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o namespacecontext.lo `test -f 'xml/namespacecontext.cpp' || echo '$(srcdir)/'`xml/namespacecontext.cpp startelement.lo: xml/startelement.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT startelement.lo -MD -MP -MF $(DEPDIR)/startelement.Tpo -c -o startelement.lo `test -f 'xml/startelement.cpp' || echo '$(srcdir)/'`xml/startelement.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/startelement.Tpo $(DEPDIR)/startelement.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/startelement.cpp' object='startelement.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o startelement.lo `test -f 'xml/startelement.cpp' || echo '$(srcdir)/'`xml/startelement.cpp xmldeserializer.lo: xml/xmldeserializer.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xmldeserializer.lo -MD -MP -MF $(DEPDIR)/xmldeserializer.Tpo -c -o xmldeserializer.lo `test -f 'xml/xmldeserializer.cpp' || echo '$(srcdir)/'`xml/xmldeserializer.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/xmldeserializer.Tpo $(DEPDIR)/xmldeserializer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/xmldeserializer.cpp' object='xmldeserializer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xmldeserializer.lo `test -f 'xml/xmldeserializer.cpp' || echo '$(srcdir)/'`xml/xmldeserializer.cpp xmlerror.lo: xml/xmlerror.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xmlerror.lo -MD -MP -MF $(DEPDIR)/xmlerror.Tpo -c -o xmlerror.lo `test -f 'xml/xmlerror.cpp' || echo '$(srcdir)/'`xml/xmlerror.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/xmlerror.Tpo $(DEPDIR)/xmlerror.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/xmlerror.cpp' object='xmlerror.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xmlerror.lo `test -f 'xml/xmlerror.cpp' || echo '$(srcdir)/'`xml/xmlerror.cpp xmlformatter.lo: xml/xmlformatter.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xmlformatter.lo -MD -MP -MF $(DEPDIR)/xmlformatter.Tpo -c -o xmlformatter.lo `test -f 'xml/xmlformatter.cpp' || echo '$(srcdir)/'`xml/xmlformatter.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/xmlformatter.Tpo $(DEPDIR)/xmlformatter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/xmlformatter.cpp' object='xmlformatter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xmlformatter.lo `test -f 'xml/xmlformatter.cpp' || echo '$(srcdir)/'`xml/xmlformatter.cpp xmlreader.lo: xml/xmlreader.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xmlreader.lo -MD -MP -MF $(DEPDIR)/xmlreader.Tpo -c -o xmlreader.lo `test -f 'xml/xmlreader.cpp' || echo '$(srcdir)/'`xml/xmlreader.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/xmlreader.Tpo $(DEPDIR)/xmlreader.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/xmlreader.cpp' object='xmlreader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xmlreader.lo `test -f 'xml/xmlreader.cpp' || echo '$(srcdir)/'`xml/xmlreader.cpp xmlserializer.lo: xml/xmlserializer.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xmlserializer.lo -MD -MP -MF $(DEPDIR)/xmlserializer.Tpo -c -o xmlserializer.lo `test -f 'xml/xmlserializer.cpp' || echo '$(srcdir)/'`xml/xmlserializer.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/xmlserializer.Tpo $(DEPDIR)/xmlserializer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/xmlserializer.cpp' object='xmlserializer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xmlserializer.lo `test -f 'xml/xmlserializer.cpp' || echo '$(srcdir)/'`xml/xmlserializer.cpp xmlwriter.lo: xml/xmlwriter.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xmlwriter.lo -MD -MP -MF $(DEPDIR)/xmlwriter.Tpo -c -o xmlwriter.lo `test -f 'xml/xmlwriter.cpp' || echo '$(srcdir)/'`xml/xmlwriter.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/xmlwriter.Tpo $(DEPDIR)/xmlwriter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='xml/xmlwriter.cpp' object='xmlwriter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xmlwriter.lo `test -f 'xml/xmlwriter.cpp' || echo '$(srcdir)/'`xml/xmlwriter.cpp mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/serializationinfo.cpp������������������������������������������������������������0000664�0001750�0001750�00000045420�12266277345�015371� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/serializationinfo.h> #include <stdexcept> #include <sstream> namespace cxxtools { SerializationInfo::SerializationInfo() : _parent(0) , _category(Void) , _t(t_none) { } SerializationInfo::SerializationInfo(const SerializationInfo& si) : _parent(si._parent) , _category(si._category) , _name(si._name) , _type(si._type) , _u(si._u) , _t(si._t) , _nodes(si._nodes) { switch (_t) { case t_string: new (_StringPtr()) String(si._String()); break; case t_string8: new (_String8Ptr()) std::string(si._String8()); break; default: ; } } SerializationInfo& SerializationInfo::operator=(const SerializationInfo& si) { _parent = si._parent; _category = si._category; _name = si._name; _type = si._type; _nodes = si._nodes; if (si._t == t_string) _setString( si._String() ); else if (si._t == t_string8) _setString8( si._String8() ); else { _releaseValue(); _u = si._u; _t = si._t; } return *this; } void SerializationInfo::reserve(size_t n) { _nodes.reserve(n); } SerializationInfo& SerializationInfo::addMember(const std::string& name) { _nodes.resize(_nodes.size() + 1); _nodes.back().setParent(*this); _nodes.back().setName(name); // category Array overrides Object (is this a hack?) // This is needed for xmldeserialization. In the xml file the root node of a array // has a category attribute. When the serializationinfo of the array is created // it is known, that it is of category Array. When the members of the array are read, // they should not make an object out of the array. if (_category != Array) _category = Object; return _nodes.back(); } SerializationInfo::Iterator SerializationInfo::begin() { if(_nodes.size() == 0) return 0; return &( _nodes[0] ); } SerializationInfo::Iterator SerializationInfo::end() { if(_nodes.size() == 0) return 0; return &_nodes[0] + _nodes.size(); } SerializationInfo::ConstIterator SerializationInfo::begin() const { if(_nodes.size() == 0) return 0; return &( _nodes[0] ); } SerializationInfo::ConstIterator SerializationInfo::end() const { if(_nodes.size() == 0) return 0; return &_nodes[0] + _nodes.size(); } const SerializationInfo& SerializationInfo::getMember(const std::string& name) const { Nodes::const_iterator it = _nodes.begin(); for(; it != _nodes.end(); ++it) { if( it->name() == name ) return *it; } throw SerializationMemberNotFound(name); } const SerializationInfo& SerializationInfo::getMember(unsigned idx) const { if (idx >= _nodes.size()) { std::ostringstream msg; msg << "requested member index " << idx << " exceeds number of members " << _nodes.size(); throw std::range_error(msg.str()); } return _nodes[idx]; } const SerializationInfo* SerializationInfo::findMember(const std::string& name) const { Nodes::const_iterator it = _nodes.begin(); for(; it != _nodes.end(); ++it) { if( it->name() == name ) return &(*it); } return 0; } SerializationInfo* SerializationInfo::findMember(const std::string& name) { Nodes::iterator it = _nodes.begin(); for(; it != _nodes.end(); ++it) { if( it->name() == name ) return &(*it); } return 0; } void SerializationInfo::clear() { _category = Void; _name.clear(); _type.clear(); _nodes.clear(); switch (_t) { case t_string: _String().clear(); break; case t_string8: _String8().clear(); break; default: _t = t_none; break; } } void SerializationInfo::swap(SerializationInfo& si) { if (this == &si) return; std::swap(_parent, si._parent); std::swap(_category, si._category); std::swap(_name, si._name); std::swap(_type, si._type); if (_t == t_string) { if (si._t == t_string) { // this: String, other: String _String().swap(si._String()); } else if (si._t == t_string8) { // this: String, other: std::string std::string s; si._String8().swap(s); si.setValue(String()); si._String().swap(_String()); setValue(s); } else { // this: String, other: something U u = si._u; T t = si._t; si.setValue(String()); _String().swap(si._String()); _releaseValue(); _u = u; _t = t; } } else if (_t == t_string8) { if (si._t == t_string) { // this: std::string, other: String String s; si._String().swap(s); si.setValue(std::string()); _String8().swap(si._String8()); setValue(s); } else if (si._t == t_string8) { // this: std::string, other: std::string _String8().swap(si._String8()); } else { // this: std::string, other: something U u = si._u; T t = si._t; si.setValue(_String8()); _releaseValue(); _u = u; _t = t; } } else { if (si._t == t_string) { // this: something, other: String U u = _u; T t = _t; setValue(si._String()); si._releaseValue(); si._u = u; si._t = t; } else if (si._t == t_string8) { // this: something, other: std::string U u = _u; T t = _t; setValue(si._String8()); si._releaseValue(); si._u = u; si._t = t; } else { // this: something, other: something std::swap(_u, si._u); std::swap(_t, si._t); } } _nodes.swap(si._nodes); } void SerializationInfo::dump(std::ostream& out, const std::string& praefix) const { if (!_name.empty()) out << praefix << "name = \"" << _name << "\"\n"; if (_t != t_none) { out << praefix << "type = " << (_t == t_none ? "none" : _t == t_string ? "string" : _t == t_string8 ? "string8" : _t == t_char ? "char" : _t == t_bool ? "bool" : _t == t_int ? "int" : _t == t_uint ? "uint" : _t == t_float ? "float" : "?") << '\n'; out << praefix << "value = "; switch (_t) { case t_none: out << '-'; break; case t_string: out << '"' << _String().narrow() << '"'; break; case t_string8: out << '"' << _String8() << '"'; break; case t_char: out << '\'' << _u._c << '\''; break; case t_bool: out << _u._b; break; case t_int: out << _u._i; break; case t_uint: out << _u._u; break; case t_float: out << _u._f; break; } out << '\n'; } if (!_type.empty()) out << praefix << "typeName = " << _type << '\n'; if (!_nodes.empty()) { std::string p = praefix + '\t'; for (std::vector<SerializationInfo>::size_type n = 0; n < _nodes.size(); ++n) { out << praefix << "node[" << n << "]\n"; _nodes[n].dump(out, p); } } } void SerializationInfo::_releaseValue() { switch (_t) { case t_string: _String().~String(); break; case t_string8: { // I don't know how to call the destructor without 'using' so that // both gcc and xlc understand it. using std::string; _String8().~string(); break; } default: ; } _t = t_none; } void SerializationInfo::setNull() { _releaseValue(); _t = t_none; _category = Void; } void SerializationInfo::_setString(const String& value) { if (_t != t_string) { _releaseValue(); new (_StringPtr()) String(value); _t = t_string; } else { _String().assign(value); } _category = Value; } void SerializationInfo::_setString8(const std::string& value) { if (_t != t_string8) { _releaseValue(); new (_String8Ptr()) std::string(value); _t = t_string8; } else { _String8().assign(value); } _category = Value; } void SerializationInfo::_setString8(const char* value) { if (_t != t_string8) { _releaseValue(); new (_String8Ptr()) std::string(value); _t = t_string8; } else { _String8().assign(value); } _category = Value; } void SerializationInfo::_setChar(char value) { if (_t != t_char) { _releaseValue(); _t = t_char; } _u._c = value; _category = Value; } void SerializationInfo::_setBool(bool value) { if (_t != t_bool) { _releaseValue(); _t = t_bool; } _u._b = value; _category = Value; } void SerializationInfo::_setInt(int_type value) { if (_t != t_int) { _releaseValue(); _t = t_int; } _u._i = value; _category = Value; } void SerializationInfo::_setUInt(unsigned_type value) { if (_t != t_uint) { _releaseValue(); _t = t_uint; } _u._u= value; _category = Value; } void SerializationInfo::_setFloat(long double value) { if (_t != t_float) { _releaseValue(); _t = t_float; } _u._f = value; _category = Value; } void SerializationInfo::getValue(String& value) const { switch (_t) { case t_none: value.clear(); break; case t_string: value.assign(_String()); break; case t_string8: value.assign(_String8()); break; case t_char: value.assign(1, _u._c); break; case t_bool: convert(value, _u._b); break; case t_int: convert(value, _u._i); break; case t_uint: convert(value, _u._u); break; case t_float: convert(value, _u._f); break; } } void SerializationInfo::getValue(std::string& value) const { switch (_t) { case t_none: value.clear(); break; case t_string: value = _String().narrow(); break; case t_string8: value.assign(_String8()); break; case t_char: value.assign(1, _u._c); break; case t_bool: convert(value, _u._b); break; case t_int: convert(value, _u._i); break; case t_uint: convert(value, _u._u); break; case t_float: convert(value, _u._f); break; } } namespace { inline bool isFalse(char c) { return c == '\0' || c == '0' || c == 'f' || c == 'F' || c == 'n' || c == 'N'; } } bool SerializationInfo::_getBool() const { switch (_t) { case t_none: return false; case t_string: return !_String().empty() && !isFalse((_String())[0].narrow()); case t_string8: return !_String8().empty() && !isFalse((_String8())[0]); case t_char: return !isFalse(_u._c); case t_bool: return _u._b; case t_int: return _u._i; case t_uint: return _u._u; case t_float: return _u._f; } // never reached return false; } wchar_t SerializationInfo::_getWChar() const { switch (_t) { case t_none: return L'\0'; case t_string: return _String().empty() ? L'\0' : _String()[0].toWchar(); case t_string8: return _String8().empty() ? '\0' : _String8()[0]; case t_char: return _u._c; case t_bool: return _u._b; case t_int: return _u._i; case t_uint: return _u._u; case t_float: return static_cast<wchar_t>(_u._f); } // never reached return 0; } char SerializationInfo::_getChar() const { switch (_t) { case t_none: return '\0'; break; case t_string: return _String().empty() ? '\0' : (_String())[0].narrow(); break; case t_string8: return _String8().empty() ? '\0' : (_String8())[0]; break; case t_char: return _u._c; break; case t_bool: return _u._b; break; case t_int: return _u._i; break; case t_uint: return _u._u; break; case t_float: return static_cast<char>(_u._f); break; } // never reached return 0; } SerializationInfo::int_type SerializationInfo::_getInt(const char* type, int_type min, int_type max) const { int_type ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert<int_type>(_String()); } catch (const ConversionError&) { ConversionError::doThrow(type, "String", _String().narrow().c_str()); } break; case t_string8: try { ret = convert<int_type>(_String8()); } catch (const ConversionError&) { ConversionError::doThrow(type, "string", _String8().c_str()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: ret = _u._i; break; case t_uint: if (_u._u > static_cast<unsigned_type>(std::numeric_limits<int_type>::max())) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } ret = _u._u; break; case t_float: ret = static_cast<int_type>(_u._f); break; } if (ret < min || ret > max) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } return ret; } SerializationInfo::unsigned_type SerializationInfo::_getUInt(const char* type, unsigned_type max) const { unsigned_type ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert<unsigned_type>(_String()); } catch (const ConversionError&) { ConversionError::doThrow(type, "String", _String().narrow().c_str()); } break; case t_string8: try { ret = convert<unsigned_type>(_String8()); } catch (const ConversionError&) { ConversionError::doThrow(type, "string", _String8().c_str()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: if (_u._i < 0) throw std::range_error(std::string("negative values do not fit into ") + type); ret = _u._i; break; case t_uint: ret = _u._u; break; case t_float: ret = static_cast<unsigned_type>(_u._f); break; } if (ret > max) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } return ret; } long double SerializationInfo::_getFloat(const char* type, long double max) const { long double ret = 0; switch (_t) { case t_none: break; case t_string: try { ret = convert<long double>(_String()); } catch (const ConversionError&) { ConversionError::doThrow(type, "String", _String().narrow().c_str()); } break; case t_string8: try { ret = convert<long double>(_String8()); } catch (const ConversionError&) { ConversionError::doThrow(type, "string", _String8().c_str()); } break; case t_char: ret = _u._c - '0'; break; case t_bool: ret = _u._b; break; case t_int: ret = _u._i; break; case t_uint: ret = _u._u; break; case t_float: ret = _u._f; break; } if (ret != std::numeric_limits<long double>::infinity() && ret != -std::numeric_limits<long double>::infinity() && ret == ret // check for NaN && (ret < -max || ret > max)) { std::ostringstream msg; msg << "value " << ret << " does not fit into " << type; throw std::range_error(msg.str()); } return ret; } } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/directoryimpl.h������������������������������������������������������������������0000664�0001750�0001750�00000004770�12256773774�014204� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <string> #include <dirent.h> namespace cxxtools { class DirectoryIteratorImpl { public: DirectoryIteratorImpl(); DirectoryIteratorImpl(const char* path, bool skipHidden); ~DirectoryIteratorImpl(); const std::string& name() const; const std::string& path() const; int ref(); int deref(); bool advance(); private: unsigned int _refs; mutable std::string _path; mutable std::string _name; DIR* _handle; ::dirent* _current; bool _dirty; bool _skipHidden; }; class DirectoryImpl { public: static void create(const std::string& path); static void remove(const std::string& path); static void move(const std::string& oldName, const std::string& newName); static bool exists(const std::string& path); static void chdir(const std::string& path); static std::string cwd(); static std::string curdir(); static std::string updir(); static std::string rootdir(); static std::string tmpdir(); static std::string sep(); }; } // namespace cxxtools ��������cxxtools-2.2.1/src/jsondeserializer.cpp�������������������������������������������������������������0000664�0001750�0001750�00000004305�12266277345�015211� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/jsondeserializer.h> namespace cxxtools { JsonDeserializer::JsonDeserializer(std::istream& in, TextCodec<Char, char>* codec) : _ts(new TextIStream(in, codec)), _in(*_ts) { } JsonDeserializer::JsonDeserializer(TextIStream& in) : _ts(0), _in(in) { } JsonDeserializer::~JsonDeserializer() { delete _ts; } void JsonDeserializer::doDeserialize() { JsonParser parser; parser.begin(*this); Char ch; int ret; while (_in.get(ch)) { ret = parser.advance(ch); if (ret == -1) _in.putback(ch); if (ret != 0) return; } if (_in.rdstate() & std::ios::badbit) SerializationError::doThrow("json deserialization failed"); parser.finish(); } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/iodeviceimpl.h�������������������������������������������������������������������0000664�0001750�0001750�00000007757�12260020530�013741� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 Laurentiu-Gheorghe Crisan * Copyright (C) 2006-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_IODEVICEIMPL_H #define CXXTOOLS_SYSTEM_IODEVICEIMPL_H #include "selectableimpl.h" #include <cxxtools/iodevice.h> #include <string> #include <iostream> struct pollfd; namespace cxxtools { struct DestructionSentry { DestructionSentry(DestructionSentry*& sentry) : _deleted(false) , _sentry(sentry) { sentry = this; } ~DestructionSentry() { if( ! _deleted ) this->detach(); } bool operator!() const { return _deleted; } void detach() { _sentry = 0; _deleted = true; } bool _deleted; DestructionSentry*& _sentry; }; class IODeviceImpl : public SelectableImpl { public: static const short POLLERR_MASK; static const short POLLIN_MASK; static const short POLLOUT_MASK; IODeviceImpl(IODevice&); virtual ~IODeviceImpl(); int fd() const { return _fd; } void setTimeout(std::size_t msecs) { _timeout = msecs; } std::size_t timeout() const { return _timeout; } virtual void open(const std::string& path, IODevice::OpenMode mode, bool inherit); virtual void open(int fd, bool isAsync, bool inherit); virtual void close(); virtual size_t beginRead(char* buffer, size_t n, bool& eof); virtual size_t endRead(bool& eof); virtual size_t read( char* buffer, size_t count, bool& eof ); virtual size_t beginWrite(const char* buffer, size_t n); virtual size_t endWrite(); virtual size_t write( const char* buffer, size_t count ); void sigwrite(int sig); virtual void cancel(); virtual void sync() const; void attach(SelectorBase& s); void detach(SelectorBase& s); virtual bool wait(std::size_t msecs); virtual bool wait(std::size_t msecs, pollfd& pfd); virtual void initWait(pollfd& pfd); virtual size_t pollSize() const { return 1; } virtual size_t initializePoll(pollfd* pfd, size_t pollSize); virtual bool checkPollEvent(); virtual bool checkPollEvent(pollfd& pfd); protected: IODevice& _device; int _fd; std::size_t _timeout; pollfd* _pfd; DestructionSentry* _sentry; bool _errorPending; }; } //namespace cxxtools #endif �����������������cxxtools-2.2.1/src/atomicity.gcc.arm.cpp������������������������������������������������������������0000664�0001750�0001750�00000012117�12256773774�015156� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.gcc.arm.h> #include <csignal> #include <cstdio> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { asm volatile ("" : : : "memory"); return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; asm volatile ("" : : : "memory"); } atomic_t atomicIncrement(volatile atomic_t& dest) { int a, b, c; asm volatile ( "0:\n\t" "ldr %0, [%3]\n\t" "add %1, %0, %4\n\t" "swp %2, %1, [%3]\n\t" "cmp %0, %2\n\t" "swpne %1, %2, [%3]\n\t" "bne 0b" : "=&r" (a), "=&r" (b), "=&r" (c) : "r" (&dest), "r" (1) : "cc", "memory"); return b; } atomic_t atomicDecrement(volatile atomic_t& dest) { int a, b, c; asm volatile ( "0:\n\t" "ldr %0, [%3]\n\t" "add %1, %0, %4\n\t" "swp %2, %1, [%3]\n\t" "cmp %0, %2\n\t" "swpne %1, %2, [%3]\n\t" "bne 0b" : "=&r" (a), "=&r" (b), "=&r" (c) : "r" (&dest), "r" (-1) : "cc", "memory"); return b; } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { int a, b; asm volatile ( "0:\n\t" "ldr %1, [%2]\n\t" "cmp %1, %4\n\t" "mov %0, %1\n\t" "bne 1f\n\t" "swp %0, %3, [%2]\n\t" "cmp %0, %1\n\t" "swpne %3, %0, [%2]\n\t" "bne 0b\n\t" "1:" : "=&r" (a), "=&r" (b) : "r" (&dest), "r" (exch), "r" (comp) : "cc", "memory"); return a; } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { volatile void* a; volatile void* b; asm volatile ( "0:\n\t" "ldr %1, [%2]\n\t" "cmp %1, %4\n\t" "mov %0, %1\n\t" "bne 1f\n\t" "swpeq %0, %3, [%2]\n\t" "cmp %0, %1\n\t" "swpne %3, %0, [%2]\n\t" "bne 0b\n\t" "1:" : "=&r" (a), "=&r" (b) : "r" (&dest), "r" (exch), "r" (comp) : "cc", "memory"); return (void*)a; } atomic_t atomicExchange(volatile atomic_t& dest, atomic_t exch) { int a; asm volatile ( "swp %0, %2, [%1]" : "=&r" (a) : "r" (&dest), "r" (exch)); return a; } void* atomicExchange(void* volatile& dest, void* exch) { void* a; asm volatile ( "swp %0, %2, [%1]" : "=&r" (a) : "r" (&dest), "r" (exch)); return a; } atomic_t atomicExchangeAdd(volatile atomic_t& dest, atomic_t add) { int a, b, c; asm volatile ( "0:\n\t" "ldr %0, [%3]\n\t" "add %1, %0, %4\n\t" "swp %2, %1, [%3]\n\t" "cmp %0, %2\n\t" "swpne %1, %2, [%3]\n\t" "bne 0b" : "=&r" (a), "=&r" (b), "=&r" (c) : "r" (&dest), "r" (add) : "cc", "memory"); return a; } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/��������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�012516� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/responder.cpp�������������������������������������������������������������0000775�0001750�0001750�00000024700�12256773774�015155� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/responder.h" #include "cxxtools/xmlrpc/service.h" #include "cxxtools/remoteexception.h" #include "cxxtools/xml/xmlerror.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/http/reply.h" #include "cxxtools/utf8codec.h" #include "cxxtools/log.h" log_define("cxxtools.xmlrpc.responder") namespace cxxtools { namespace xmlrpc { XmlRpcResponder::XmlRpcResponder(Service& service) : http::Responder(service) , _state(OnBegin) , _ts(new Utf8Codec) , _reader(_ts) , _formatter(_writer) , _service(&service) , _proc(0) , _args(0) { _writer.useIndent(false); _writer.useEndl(false); _formatter.addAlias("bool", "boolean"); } XmlRpcResponder::~XmlRpcResponder() { if(_proc) _service->releaseProcedure(_proc); } void XmlRpcResponder::beginRequest(std::istream& is, http::Request& request) { _fault.clear(); _state = OnBegin; _ts.attach( is ); _args = 0; } std::size_t XmlRpcResponder::readBody(std::istream& is) { std::size_t n = 0; try { while(true) { std::streamsize m = _ts.buffer().import(); if( ! m) break; n += m; while( _reader.advance() ) { const xml::Node& node = _reader.get(); this->advance(node); } } } catch(const xml::XmlError& error) { _fault.rc(1); _fault.text( error.what() ); throw _fault; } catch(const SerializationError& error) { _fault.rc(2); _fault.text( error.what() ); throw _fault; } catch(const ConversionError& error) { _fault.rc(3); _fault.text( error.what() ); throw _fault; } return n; } void XmlRpcResponder::replyError(std::ostream& os, http::Request& request, http::Reply& reply, const std::exception& ex) { reply.setHeader("Content-Type", "text/xml"); _writer.begin(os); _writer.writeStartElement( L"methodResponse" ); _writer.writeStartElement( L"fault" ); _writer.writeStartElement( L"value" ); _writer.writeStartElement( L"struct" ); _writer.writeStartElement( L"member" ); _writer.writeElement( L"name", L"faultCode" ); _writer.writeStartElement( L"value" ); _writer.writeElement( L"int", cxxtools::convert<cxxtools::String>(_fault.rc()) ); _writer.writeEndElement(); // value _writer.writeEndElement(); // member _writer.writeStartElement( L"member" ); _writer.writeElement( L"name", L"faultString" ); _writer.writeStartElement( L"value" ); const char* msg = (_fault.rc() ? _fault.what() : ex.what()); _writer.writeElement( L"string", cxxtools::String::widen(msg)); _writer.writeEndElement(); // value _writer.writeEndElement(); // member _writer.writeEndElement(); // struct _writer.writeEndElement(); // value _writer.writeEndElement(); // fault _writer.writeEndElement(); // methodResponse _writer.flush(); } void XmlRpcResponder::reply(std::ostream& os, http::Request& request, http::Reply& reply) { try { if( ! _proc ) { _fault.rc(4); _fault.text("invalid XML-RPC"); throw _fault; } if( _args ) { ++_args; if( * _args ) { _fault.rc(5); _fault.text("invalid XML-RPC, missing arguments"); throw _fault; } } IDecomposer* rh = _proc->endCall(); reply.setHeader("Content-Type", "text/xml"); _writer.begin(os); _writer.writeStartElement( L"methodResponse" ); _writer.writeStartElement( L"params" ); _writer.writeStartElement( L"param" ); rh->format(_formatter); _writer.writeEndElement(); // param _writer.writeEndElement(); // params _writer.writeEndElement(); // methodResponse _writer.flush(); } catch (const RemoteException& fault) { _fault.rc(fault.rc()); _fault.text(fault.text()); replyError(reply.body(), request, reply, fault); } catch (...) { _writer.flush(); throw; } } void XmlRpcResponder::advance(const cxxtools::xml::Node& node) { switch(_state) { case OnBegin: { //std::cerr << "OnBegin" << std::endl; if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if( se.name() != L"methodCall" ) throw xml::XmlError( "invalid XML-RPC methodCall", _reader.line() ); _state = OnMethodCallBegin; } break; } case OnMethodCallBegin: { //std::cerr << "OnMethodCallBegin" << std::endl; if(node.type() == xml::Node::StartElement) { _state = OnMethodNameBegin; } break; } case OnMethodNameBegin: { //std::cerr << "OnMethodNameBegin" << std::endl; if(node.type() == xml::Node::Characters) { const xml::Characters& chars = static_cast<const xml::Characters&>(node); log_info("xmlrpc method <" << chars.content().narrow() << '>'); _proc = _service->getProcedure( chars.content().narrow() ); if( ! _proc ) throw std::runtime_error("no such procedure \"" + chars.content().narrow() + '"'); //std::cerr << "-> Found Procedure: " << chars.content().narrow() << std::endl; _state = OnMethodName; } break; } case OnMethodName: { //std::cerr << "OnMethodName" << std::endl; if(node.type() == xml::Node::EndElement) { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if( ee.name() != L"methodName" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnMethodNameEnd; } break; } case OnMethodNameEnd: { //std::cerr << "OnMethodNameEnd" << std::endl; if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if( se.name() != L"params" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnParams; } break; } case OnParams: { //std::cerr << "OnParams" << std::endl; if(node.type() == xml::Node::EndElement) // </params> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if( ee.name() != L"params" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnParamsEnd; break; } if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if( se.name() != L"param" ) throw std::runtime_error("invalid XML-RPC methodCall"); //std::cerr << "-> Found param" << std::endl; if( ! _args ) { //std::cerr << "-> begin call" << std::endl; _args = _proc->beginCall(); if( ! *_args) throw std::runtime_error("too many arguments"); } else { //std::cerr << "-> next argument" << std::endl; ++_args; if( ! *_args) throw std::runtime_error("too many arguments"); } _scanner.begin(_deserializer, **_args); _state = OnParam; break; } break; } case OnParam: { //std::cerr << "S: OnParam" << std::endl; bool finished = _scanner.advance(node); if(finished) { //std::cerr << "-> param finished" << std::endl; // node is </param> _state = OnParams; } break; } case OnParamsEnd: { //std::cerr << "OnParamsEnd" << std::endl; if(node.type() == xml::Node::EndElement) // </methodCall> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if( ee.name() != L"methodCall" ) throw std::runtime_error("invalid XML-RPC methodCall"); _state = OnMethodCallEnd; } break; } case OnMethodCallEnd: { //std::cerr << "OnMethodCallEnd" << std::endl; if(node.type() == xml::Node::EndDocument) { _state = OnMethodCallEnd; } break; } } } } } ����������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/formatter.cpp�������������������������������������������������������������0000775�0001750�0001750�00000006000�12256773774�015150� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/xmlrpc/formatter.h> #include <cxxtools/serializationinfo.h> namespace cxxtools { namespace xmlrpc { void Formatter::addValueString(const std::string& name, const std::string& type, const cxxtools::String& value) { _writer->writeStartElement( L"value" ); if (type == "string" || type.empty()) { _writer->writeCharacters(value); } else { std::map<std::string, std::string>::iterator it = _typemap.find(type); if( it != _typemap.end() ) _writer->writeElement( cxxtools::String::widen(it->second), value ); else _writer->writeElement( cxxtools::String::widen(type), value ); } _writer->writeEndElement(); } void Formatter::beginArray(const std::string&, const std::string&) { _writer->writeStartElement( L"value" ); _writer->writeStartElement( L"array" ); _writer->writeStartElement( L"data" ); } void Formatter::finishArray() { _writer->writeEndElement(); _writer->writeEndElement(); _writer->writeEndElement(); } void Formatter::beginObject(const std::string& name, const std::string& type) { _writer->writeStartElement( L"value" ); _writer->writeStartElement( L"struct" ); } void Formatter::beginMember(const std::string& name) { _writer->writeStartElement( L"member" ); _writer->writeElement( L"name", cxxtools::String::widen(name) ); } void Formatter::finishMember() { _writer->writeEndElement(); } void Formatter::finishObject() { _writer->writeEndElement(); _writer->writeEndElement(); } void Formatter::finish() { _writer->writeEndElement(); } } } cxxtools-2.2.1/src/xmlrpc/client.cpp����������������������������������������������������������������0000775�0001750�0001750�00000004254�12266277345�014426� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/client.h" #include "clientimpl.h" namespace cxxtools { namespace xmlrpc { Client::~Client() { } void Client::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->beginCall(r, method, argv, argc); } void Client::endCall() { _impl->endCall(); } void Client::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _impl->call(r, method, argv, argc); } std::size_t Client::timeout() const { return _impl->timeout(); } void Client::timeout(std::size_t t) { _impl->timeout(t); } std::string Client::url() const { return _impl->url(); } const IRemoteProcedure* Client::activeProcedure() const { return _impl->activeProcedure(); } void Client::cancel() { _impl->cancel(); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/httpclientimpl.h����������������������������������������������������������0000664�0001750�0001750�00000006416�12266277345�015654� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_HttpClientImpl_h #define cxxtools_xmlrpc_HttpClientImpl_h #include <cxxtools/http/client.h> #include <cxxtools/http/request.h> #include "clientimpl.h" namespace cxxtools { namespace net { class AddrInfo; } namespace xmlrpc { class HttpClientImpl : public ClientImpl { public: HttpClientImpl(); HttpClientImpl(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& url); HttpClientImpl(const std::string& addr, unsigned short port, const std::string& url); void connect(const net::AddrInfo& addrinfo, const std::string& url) { _client.connect(addrinfo); _request.url(url); } void connect(const std::string& addr, unsigned short port, const std::string& url) { _client.connect(addr, port); _request.url(url); } void url(const std::string& url) { _request.url(url); } void auth(const std::string& username, const std::string& password) { _client.auth(username, password); } void clearAuth() { _client.clearAuth(); } void setSelector(SelectorBase& selector) { _client.setSelector(selector); } std::string url() const; virtual void wait(std::size_t msecs); protected: void onReplyHeader(http::Client& client); std::size_t onReplyBody(http::Client& client); void onReplyFinished(http::Client& client); virtual void beginExecute(); virtual void endExecute(); virtual std::string execute(); virtual std::ostream& prepareRequest(); virtual void cancel(); private: static void verifyHeader(const http::ReplyHeader& header); http::Client _client; http::Request _request; }; } } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/Makefile.am���������������������������������������������������������������0000664�0001750�0001750�00000001031�12256773774�014471� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-xmlrpc.la libcxxtools_xmlrpc_la_SOURCES = \ client.cpp \ clientimpl.cpp \ httpclient.cpp \ httpclientimpl.cpp \ formatter.cpp \ responder.cpp \ scanner.cpp \ service.cpp noinst_HEADERS = \ clientimpl.h \ httpclientimpl.h libcxxtools_xmlrpc_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_xmlrpc_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/httpclient.cpp������������������������������������������������������������0000664�0001750�0001750�00000006216�12266277345�015323� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/httpclient.h" #include "cxxtools/net/uri.h" #include "httpclientimpl.h" namespace cxxtools { namespace xmlrpc { HttpClient::HttpClient() : _impl(new HttpClientImpl()) { impl(_impl); } HttpClient::HttpClient(SelectorBase& selector, const std::string& server, unsigned short port, const std::string& url) : _impl(new HttpClientImpl(selector, server, port, url)) { impl(_impl); } HttpClient::HttpClient(SelectorBase& selector, const net::Uri& uri) : _impl(new HttpClientImpl(selector, uri.host(), uri.port(), uri.path())) { impl(_impl); auth(uri.user(), uri.password()); } HttpClient::HttpClient(const std::string& server, unsigned short port, const std::string& url) : _impl(new HttpClientImpl(server, port, url)) { impl(_impl); } HttpClient::HttpClient(const net::Uri& uri) : _impl(new HttpClientImpl(uri.host(), uri.port(), uri.path())) { impl(_impl); auth(uri.user(), uri.password()); } HttpClient::~HttpClient() { delete _impl; } void HttpClient::connect(const net::AddrInfo& addrinfo, const std::string& url) { _impl->connect(addrinfo, url); } void HttpClient::connect(const net::Uri& uri) { _impl->connect(uri.host(), uri.port(), uri.path()); auth(uri.user(), uri.password()); } void HttpClient::connect(const std::string& addr, unsigned short port, const std::string& url) { _impl->connect(addr, port, url); } void HttpClient::url(const std::string& url) { _impl->url(url); } void HttpClient::auth(const std::string& username, const std::string& password) { _impl->auth(username, password); } void HttpClient::clearAuth() { _impl->clearAuth(); } void HttpClient::setSelector(SelectorBase& selector) { _impl->setSelector(selector); } void HttpClient::wait(std::size_t msecs) { _impl->wait(msecs); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/clientimpl.cpp������������������������������������������������������������0000664�0001750�0001750�00000024200�12266277345�015276� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/client.h" #include "clientimpl.h" #include "cxxtools/remoteprocedure.h" #include "cxxtools/xml/xmlerror.h" #include "cxxtools/xml/startelement.h" #include "cxxtools/xml/characters.h" #include "cxxtools/xml/endelement.h" #include "cxxtools/selectable.h" #include "cxxtools/utf8codec.h" #include "cxxtools/xmlrpc/errorcodes.h" #include "cxxtools/serializationerror.h" #include "cxxtools/log.h" #include <stdexcept> log_define("cxxtools.xmlrpc.client.impl") namespace cxxtools { inline void operator >>=(const cxxtools::SerializationInfo& si, RemoteException& fault) { int faultCode; std::string faultString; si.getMember("faultCode") >>= faultCode; si.getMember("faultString") >>= faultString; fault.rc(faultCode); fault.text(faultString); } inline void operator <<=(cxxtools::SerializationInfo& si, const RemoteException& fault) { si.addMember("faultCode") <<= fault.rc(); si.addMember("faultString") <<= fault.text(); } namespace xmlrpc { namespace { static const String methodCall = L"methodCall"; static const String methodName = L"methodName"; static const String params = L"params"; static const String param = L"param"; } ClientImpl::ClientImpl() : _state(OnBegin) , _ts( new Utf8Codec ) , _reader(_ts) , _formatter(_writer) , _method(0) , _timeout(Selectable::WaitInfinite) , _errorPending(false) { _writer.useIndent(false); _writer.useEndl(false); _formatter.addAlias("bool", "boolean"); } ClientImpl::~ClientImpl() { } void ClientImpl::beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { if (_method) throw std::logic_error("asyncronous request already running"); _method = &method; _state = OnBegin; prepareRequest(method.name(), argv, argc); beginExecute(); _reader.reset(_ts); _scanner.begin(_deserializer, r); } void ClientImpl::endCall() { endExecute(); } void ClientImpl::call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc) { _method = &method; _state = OnBegin; prepareRequest(method.name(), argv, argc); std::istringstream is(execute()); _ts.attach(is); _reader.reset(_ts); _deserializer.begin(); _scanner.begin(_deserializer, r); while( _reader.get().type() != cxxtools::xml::Node::EndDocument ) { const cxxtools::xml::Node& node = _reader.get(); advance(node); _reader.next(); } // let xml::ParseError SerializationError, ConversionError propagate if (_method->failed() ) { _method = 0; _state = OnBegin; throw _fault; } _method = 0; _state = OnBegin; // _method contains a valid return value now } const IRemoteProcedure* ClientImpl::activeProcedure() const { return _method; } void ClientImpl::cancel() { _method = 0; } void ClientImpl::onReadReplyBegin(std::istream& is) { _ts.attach(is); } std::size_t ClientImpl::onReadReply() { std::size_t n = 0; try { _errorPending = false; while(true) { std::streamsize m = _ts.buffer().import(); if( ! m ) break; n += m; while( _reader.advance() ) // xml::ParseError { const cxxtools::xml::Node& node = _reader.get(); advance(node); // SerializationError, ConversionError } } } catch(const xml::XmlError& error) { _method->setFault(ErrorCodes::invalidXmlRpc, error.what()); _method->onFinished(); } catch(const SerializationError& error) { _method->setFault(ErrorCodes::invalidMethodParameters, error.what()); _method->onFinished(); } catch(const ConversionError& error) { _method->setFault(ErrorCodes::invalidMethodParameters, error.what()); _method->onFinished(); } catch(const std::exception& error) { _errorPending = true; _method->onFinished(); } return n; } void ClientImpl::onReplyFinished() { log_debug("onReplyFinished; method=" << static_cast<void*>(_method)); try { _errorPending = false; endExecute(); } catch (const std::exception& e) { if (!_method) throw; _errorPending = true; IRemoteProcedure* method = _method; _method = 0; method->onFinished(); if (_errorPending) { _errorPending = false; throw; } return; } IRemoteProcedure* method = _method; _method = 0; method->onFinished(); } void ClientImpl::prepareRequest(const String& name, IDecomposer** argv, unsigned argc) { _writer.begin( prepareRequest() ); _writer.writeStartElement( methodCall ); _writer.writeElement( methodName, name ); _writer.writeStartElement( params ); for(unsigned n = 0; n < argc; ++n) { _writer.writeStartElement( param ); argv[n]->format(_formatter); _writer.writeEndElement(); } _writer.writeEndElement(); _writer.writeEndElement(); _writer.flush(); } void ClientImpl::advance(const cxxtools::xml::Node& node) { switch(_state) { case OnBegin: { if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if( se.name() != L"methodResponse" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnMethodResponseBegin; } break; } case OnMethodResponseBegin: { if(node.type() == xml::Node::StartElement) // <params> or <fault> { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if( se.name() == L"params") { _state = OnParamsBegin; break; } else if( se.name() == L"fault") { _fh.begin(_fault); _scanner.begin(_deserializer, _fh); _state = OnFaultBegin; break; } SerializationError::doThrow("invalid XML-RPC methodCall"); } break; } case OnFaultBegin: { bool finished = _scanner.advance(node); // start with <value> if(finished) { // </fault> _state = OnFaultEnd; } break; } case OnFaultEnd: { if(node.type() == xml::Node::EndElement) // </methodResponse> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if( ee.name() != L"methodResponse" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _method->setFault(_fault.rc(), _fault.text()); _state = OnFaultResponseEnd; } break; } case OnFaultResponseEnd: { _state = OnFaultResponseEnd; break; } case OnParamsBegin: { if(node.type() == xml::Node::StartElement) // <param> { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if( se.name() != L"param" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnParam; } break; } case OnParam: { bool finished = _scanner.advance(node); // start with <value> if(finished) { // </param> _state = OnParamEnd; } break; } case OnParamEnd: { if(node.type() == xml::Node::EndElement) // </params> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if( ee.name() != L"params" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnParamsEnd; } break; } case OnParamsEnd: { if(node.type() == xml::Node::EndElement) // </methodResponse> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if( ee.name() != L"methodResponse" ) SerializationError::doThrow("invalid XML-RPC methodCall"); _state = OnMethodResponseEnd; } break; } case OnMethodResponseEnd: { _state = OnMethodResponseEnd; break; } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/httpclientimpl.cpp��������������������������������������������������������0000664�0001750�0001750�00000013072�12266277345�016203� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "httpclientimpl.h" #include "cxxtools/log.h" #include "cxxtools/http/replyheader.h" #include "cxxtools/ioerror.h" #include "cxxtools/remoteclient.h" #include "cxxtools/clock.h" #include <string.h> log_define("cxxtools.xmlrpc.httpclient.impl") namespace cxxtools { namespace xmlrpc { HttpClientImpl::HttpClientImpl() { _request.method("POST"); cxxtools::connect(_client.headerReceived, *this, &HttpClientImpl::onReplyHeader); cxxtools::connect(_client.bodyAvailable, *this, &HttpClientImpl::onReplyBody); cxxtools::connect(_client.replyFinished, *this, &HttpClientImpl::onReplyFinished); } HttpClientImpl::HttpClientImpl(SelectorBase& selector, const std::string& addr, unsigned short port, const std::string& url) : _client(selector, addr, port) , _request(url) { _request.method("POST"); cxxtools::connect(_client.headerReceived, *this, &HttpClientImpl::onReplyHeader); cxxtools::connect(_client.bodyAvailable, *this, &HttpClientImpl::onReplyBody); cxxtools::connect(_client.replyFinished, *this, &HttpClientImpl::onReplyFinished); } HttpClientImpl::HttpClientImpl(const std::string& addr, unsigned short port, const std::string& url) : _client(addr, port) , _request(url) { _request.method("POST"); cxxtools::connect(_client.headerReceived, *this, &HttpClientImpl::onReplyHeader); cxxtools::connect(_client.bodyAvailable, *this, &HttpClientImpl::onReplyBody); cxxtools::connect(_client.replyFinished, *this, &HttpClientImpl::onReplyFinished); } std::string HttpClientImpl::url() const { std::ostringstream s; s << "http://" << _client.host() << ':' << _client.port() << _request.url(); return s.str(); } void HttpClientImpl::onReplyHeader(http::Client& client) { log_debug("httpReturnCode=" << client.header().httpReturnCode() << " content-type=" << client.header().getHeader("Content-Type")); verifyHeader(client.header()); ClientImpl::onReadReplyBegin(client.in()); } std::size_t HttpClientImpl::onReplyBody(http::Client& client) { return ClientImpl::onReadReply(); } void HttpClientImpl::onReplyFinished(http::Client& client) { ClientImpl::onReplyFinished(); } void HttpClientImpl::beginExecute() { _client.beginExecute(_request); } void HttpClientImpl::endExecute() { if (_errorPending) { _errorPending = false; throw; } _client.endExecute(); } std::string HttpClientImpl::execute() { _client.execute(_request, timeout()); std::string body; try { verifyHeader(_client.header()); _client.readBody(body); } catch (...) { _client.cancel(); throw; } return body; } std::ostream& HttpClientImpl::prepareRequest() { _request.clear(); _request.setHeader("Content-Type", "text/xml"); _request.method("POST"); return _request.body(); } void HttpClientImpl::cancel() { _client.cancel(); ClientImpl::cancel(); } void HttpClientImpl::wait(std::size_t msecs) { if (!_client.selector()) throw std::logic_error("cannot run async rpc request without a selector"); Clock clock; if (msecs != RemoteClient::WaitInfinite) clock.start(); std::size_t remaining = msecs; while (activeProcedure() != 0) { if (_client.selector()->wait(remaining) == false) throw IOTimeout(); if (msecs != RemoteClient::WaitInfinite) { std::size_t diff = static_cast<std::size_t>(clock.stop().totalMSecs()); remaining = diff >= msecs ? 0 : msecs - diff; } } } void HttpClientImpl::verifyHeader(const http::ReplyHeader& header) { if (header.httpReturnCode() != 200) { std::ostringstream msg; msg << "invalid http return code " << header.httpReturnCode() << ": " << header.httpReturnText(); throw std::runtime_error(msg.str()); } const char* contentType = header.getHeader("Content-Type"); if (contentType == 0) throw std::runtime_error("missing content type header"); if (::strncasecmp(contentType, "text/xml", 8) != 0) { std::ostringstream msg; msg << "invalid content type " << contentType; throw std::runtime_error(msg.str()); } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/Makefile.in���������������������������������������������������������������0000664�0001750�0001750�00000047357�12266277545�014523� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/xmlrpc DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_xmlrpc_la_DEPENDENCIES = \ $(top_builddir)/src/libcxxtools.la \ $(top_builddir)/src/http/libcxxtools-http.la am_libcxxtools_xmlrpc_la_OBJECTS = client.lo clientimpl.lo \ httpclient.lo httpclientimpl.lo formatter.lo responder.lo \ scanner.lo service.lo libcxxtools_xmlrpc_la_OBJECTS = $(am_libcxxtools_xmlrpc_la_OBJECTS) libcxxtools_xmlrpc_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libcxxtools_xmlrpc_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcxxtools_xmlrpc_la_SOURCES) DIST_SOURCES = $(libcxxtools_xmlrpc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-xmlrpc.la libcxxtools_xmlrpc_la_SOURCES = \ client.cpp \ clientimpl.cpp \ httpclient.cpp \ httpclientimpl.cpp \ formatter.cpp \ responder.cpp \ scanner.cpp \ service.cpp noinst_HEADERS = \ clientimpl.h \ httpclientimpl.h libcxxtools_xmlrpc_la_LIBADD = $(top_builddir)/src/libcxxtools.la $(top_builddir)/src/http/libcxxtools-http.la libcxxtools_xmlrpc_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xmlrpc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/xmlrpc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-xmlrpc.la: $(libcxxtools_xmlrpc_la_OBJECTS) $(libcxxtools_xmlrpc_la_DEPENDENCIES) $(EXTRA_libcxxtools_xmlrpc_la_DEPENDENCIES) $(libcxxtools_xmlrpc_la_LINK) -rpath $(libdir) $(libcxxtools_xmlrpc_la_OBJECTS) $(libcxxtools_xmlrpc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpclientimpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/responder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/service.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/service.cpp���������������������������������������������������������������0000775�0001750�0001750�00000003513�12256773774�014613� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/xmlrpc/service.h" #include "cxxtools/xmlrpc/responder.h" #include "cxxtools/http/request.h" namespace cxxtools { namespace xmlrpc { Service::~Service() { } http::Responder* Service::createResponder(const http::Request& req) { if (req.header().isHeaderValue("Content-Type", "text/xml")) return new XmlRpcResponder(*this); return 0; } void Service::releaseResponder(http::Responder* resp) { delete resp; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/clientimpl.h��������������������������������������������������������������0000664�0001750�0001750�00000007043�12266277345�014751� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Marc Boris Duerner, Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef cxxtools_xmlrpc_ClientImpl_h #define cxxtools_xmlrpc_ClientImpl_h #include <cxxtools/xmlrpc/api.h> #include <cxxtools/remoteexception.h> #include <cxxtools/xmlrpc/formatter.h> #include <cxxtools/xmlrpc/scanner.h> #include <cxxtools/xml/xmlreader.h> #include <cxxtools/xml/xmlwriter.h> #include <cxxtools/composer.h> #include <cxxtools/decomposer.h> #include <cxxtools/deserializer.h> #include <cxxtools/connectable.h> #include <cxxtools/textstream.h> #include <string> namespace cxxtools { class IRemoteProcedure; namespace xmlrpc { class ClientImpl : public cxxtools::Connectable { enum State { OnBegin, OnMethodResponseBegin, OnFaultBegin, OnFaultEnd, OnFaultResponseEnd, OnParamsBegin, OnParam, OnParamEnd, OnParamsEnd, OnMethodResponseEnd }; public: ClientImpl(); virtual ~ClientImpl(); void beginCall(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); void endCall(); void call(IComposer& r, IRemoteProcedure& method, IDecomposer** argv, unsigned argc); std::size_t timeout() const { return _timeout; } void timeout(std::size_t t) { _timeout = t; } virtual std::string url() const = 0; const IRemoteProcedure* activeProcedure() const; virtual void cancel(); protected: void onReadReplyBegin(std::istream& is); std::size_t onReadReply(); void onReplyFinished(); virtual void beginExecute() = 0; virtual void endExecute() = 0; virtual std::string execute() = 0; virtual std::ostream& prepareRequest() = 0; protected: void prepareRequest(const String& name, IDecomposer** argv, unsigned argc); void advance(const xml::Node& node); State _state; TextIStream _ts; xml::XmlReader _reader; xml::XmlWriter _writer; Formatter _formatter; DeserializerBase _deserializer; Scanner _scanner; IRemoteProcedure* _method; RemoteException _fault; Composer<RemoteException> _fh; std::size_t _timeout; bool _errorPending; }; } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/xmlrpc/scanner.cpp���������������������������������������������������������������0000775�0001750�0001750�00000030566�12256773774�014614� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 by Dr. Marc Boris Duerner * Copyright (C) 2009 by Tommi Meakitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/xmlrpc/scanner.h> #include <cxxtools/xml/startelement.h> #include <cxxtools/xml/endelement.h> #include <cxxtools/xml/characters.h> #include <cxxtools/serializationinfo.h> #include <cxxtools/serializationerror.h> #include <cxxtools/deserializerbase.h> #include <cxxtools/composer.h> namespace cxxtools { namespace xmlrpc { namespace { void throwSerializationError(const char* msg = "invalid XML-RPC parameter") { SerializationError::doThrow(msg); } } void Scanner::begin(DeserializerBase& handler, IComposer& composer) { _state = OnParam; _deserializer = &handler; _composer = &composer; _deserializer->begin(); } bool Scanner::advance(const cxxtools::xml::Node& node) { switch(_state) { case OnParam: { if(node.type() == xml::Node::StartElement) // value { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() != L"value") throwSerializationError(); _state = OnValueBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnValueBegin: { if(node.type() == xml::Node::StartElement) // i4, struct, array... { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() == L"struct") { _state = OnStructBegin; } else if(se.name() == L"array") { _state = OnArrayBegin; } else { _state = OnScalarBegin; } _value.clear(); _type = se.name(); } else if(node.type() == xml::Node::Characters) { // maybe <value>...<type>...</type>...</value> (case 1) // or <value>...</value> (case 2) const xml::Characters& chars = static_cast<const xml::Characters&>(node); _value = chars.content(); } else if(node.type() == xml::Node::EndElement) { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"value") throwSerializationError(); // is always type string _deserializer->setValue( _value ); _value.clear(); _state = OnValueEnd; } else { throwSerializationError(); } break; } case OnValueEnd: { if(node.type() == xml::Node::EndElement) { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() == L"member") { _deserializer->leaveMember(); _state = OnStructBegin; } else if(ee.name() == L"data") { _deserializer->leaveMember(); _state = OnDataEnd; } else if(ee.name() == L"param") { _composer->fixup(*_deserializer->si()); _state = OnValueEnd; return true; } else if(ee.name() == L"fault") { _composer->fixup(*_deserializer->si()); _state = OnValueEnd; return true; } else { throwSerializationError(); } } else if(node.type() == xml::Node::StartElement) { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() == L"value") { _deserializer->leaveMember(); _deserializer->beginMember(std::string(), _type.narrow(), SerializationInfo::Value); _state = OnValueBegin; } else { throwSerializationError(); } } break; } case OnStructBegin: { if(node.type() == xml::Node::StartElement) // <member> { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() != L"member") throwSerializationError(); _state = OnMemberBegin; } else if(node.type() == xml::Node::EndElement) // </struct> { _state = OnStructEnd; } break; } case OnStructEnd: { if(node.type() == xml::Node::EndElement) // </value> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"value") throwSerializationError(); _state = OnValueEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnMemberBegin: { if(node.type() == xml::Node::StartElement) // name { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() != L"name") throwSerializationError(); _state = OnNameBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnNameBegin: { if(node.type() == xml::Node::Characters) // member-name { const xml::Characters& chars = static_cast<const xml::Characters&>(node); const std::string& name = chars.content().narrow(); _deserializer->beginMember(name, std::string(), SerializationInfo::Object); _state = OnName; } else { throwSerializationError(); } break; } case OnName: { if(node.type() == xml::Node::EndElement) // </name> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"name") throwSerializationError(); _state = OnNameEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnNameEnd: { if(node.type() == xml::Node::StartElement) // <value> { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() != L"value") throwSerializationError(); _state = OnValueBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnScalarBegin: { if(node.type() == xml::Node::Characters) { const xml::Characters& chars = static_cast<const xml::Characters&>(node); _state = OnScalar; _deserializer->setValue( chars.content() ); } else if(node.type() == xml::Node::EndElement) // no content, for example empty strings { _deserializer->setValue( cxxtools::String() ); _state = OnScalarEnd; } else { throwSerializationError(); } break; } case OnScalar: { if(node.type() == xml::Node::EndElement) // </int>, boolean ... { _state = OnScalarEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnScalarEnd: { if(node.type() == xml::Node::EndElement) // </value> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"value") throwSerializationError(); _state = OnValueEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnArrayBegin: { if(node.type() == xml::Node::StartElement) // <data> { const xml::StartElement& se = static_cast<const xml::StartElement&>(node); if(se.name() != L"data") throwSerializationError(); _state = OnDataBegin; } else if(node.type() == xml::Node::EndElement) { throwSerializationError(); } break; } case OnDataBegin: { if(node.type() == xml::Node::StartElement) // value { _deserializer->beginMember(std::string(), std::string(), SerializationInfo::Array); _state = OnValueBegin; } else if(node.type() == xml::Node::EndElement) // empty array { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"data") throwSerializationError(); _state = OnDataEnd; } break; } case OnDataEnd: { if(node.type() == xml::Node::EndElement) // </array> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"array") throwSerializationError(); _state = OnArrayEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } case OnArrayEnd: { if(node.type() == xml::Node::EndElement) // </value> { const xml::EndElement& ee = static_cast<const xml::EndElement&>(node); if(ee.name() != L"value") throwSerializationError(); _state = OnValueEnd; } else if(node.type() == xml::Node::StartElement) { throwSerializationError(); } break; } } return false; } } } ������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/uri.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000017212�12256773774�012443� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/uri.h> #include <stdexcept> #include <sstream> #include <cctype> namespace cxxtools { namespace net { namespace { void throwInvalid(const std::string& uri) { throw std::runtime_error("invalid uri <" + uri + '>'); } } Uri::Uri(const std::string& uri) : _ipv6(false), _port(0) { enum { state_0, state_protocol, state_postprotocol, state_postprotocol2, state_postprotocol3, state_user_or_host, state_password_or_port, state_password, state_host, state_ipv6, state_ipv6ok, state_ipv6end, state_port, state_path, state_query, state_fragment } state = state_0; std::string token; bool hasPort = false; for (std::string::const_iterator it = uri.begin(); it != uri.end(); ++it) { char ch = *it; switch (state) { case state_0: if (std::isalpha(ch)) { _protocol = ch; state = state_protocol; } else if (!std::isspace(ch)) throwInvalid(uri); break; case state_protocol: if (std::isalpha(ch)) _protocol += ch; else if (ch == ':') state = state_postprotocol; else throwInvalid(uri); break; case state_postprotocol: if (ch == '/') state = state_postprotocol2; else throwInvalid(uri); break; case state_postprotocol2: if (ch == '/') state = state_postprotocol3; else throwInvalid(uri); break; case state_postprotocol3: if (ch == '[') { _ipv6 = true; state = state_ipv6; } else { _user = ch; state = state_user_or_host; } break; case state_user_or_host: if (ch == ':') state = state_password_or_port; else if (ch == '/') { _host = _user; _user.clear(); _path = ch; state = state_path; } else if (ch == '@') state = state_host; else _user += ch; break; case state_password_or_port: if (ch == '@') { _port = 0; state = state_host; } else if (ch == '/') { _host = _user; _user.clear(); _password.clear(); _path = ch; state = state_path; } else if (std::isdigit(ch)) { hasPort = true; _password += ch; _port = _port * 10 + ch - '0'; } else { _port = 0; hasPort = false; _password += ch; state = state_password; } break; case state_password: if (ch == '@') state = state_host; else _password += ch; break; case state_host: if (ch == '/') { _path = ch; state = state_path; } else if (ch == ':') state = state_port; else if (_host.empty() && ch == '[') { _ipv6 = true; state = state_ipv6; } else _host += ch; break; case state_ipv6: if (ch == ':') { _host += ch; state = state_ipv6ok; } else if (std::isdigit(ch) || (ch >= 'a' && ch <= 'f') || (ch >= 'F' && ch <= 'F')) _host += ch; else throwInvalid(uri); break; case state_ipv6ok: if (ch == ']') state = state_ipv6end; else if (std::isdigit(ch) || (ch >= 'a' && ch <= 'f') || (ch >= 'F' && ch <= 'F') || ch == ':') _host += ch; else throwInvalid(uri); break; case state_ipv6end: if (ch == ':') { hasPort = true; state = state_port; } else if (ch == '/') { _path = ch; state = state_path; } else throwInvalid(uri); break; case state_port: if (ch == '/') { _path = ch; state = state_path; } else if (std::isdigit(ch)) { hasPort = true; _port = _port * 10 + ch - '0'; } else throwInvalid(uri); break; case state_path: if (ch == '?') state = state_query; else if (ch == '#') state = state_fragment; else _path += ch; break; case state_query: if (ch == '#') state = state_fragment; else _query += ch; break; case state_fragment: _fragment += ch; break; } } switch (state) { case state_port: case state_host: case state_path: case state_query: case state_fragment: break; case state_user_or_host: _host = _user; _user.clear(); break; default: throwInvalid(uri); } if (!hasPort) { if (_protocol == "http") _port = 80; else if (_protocol == "https") _port = 443; else if (_protocol == "ftp") _port = 21; } } std::string Uri::str() const { std::ostringstream s; s << _protocol << "://"; if (!_user.empty() || !_password.empty()) { s << _user; if (!_password.empty()) s << ':' << _password; s << '@'; } if (_ipv6) s << '[' << _host << ']'; else s << _host; if (!(_port == 0 || (_protocol == "http" && _port == 80) || (_protocol == "https" && _port == 443) || (_protocol == "ftp" && _port == 21))) s << ':' << _port; s << _path; if (!_query.empty()) s << '?' << _query; if (!_fragment.empty()) s << '#' << _fragment; return s.str(); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/threadimpl.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000007635�12266277345�013777� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "threadimpl.h" #include "cxxtools/systemerror.h" #include "cxxtools/timespan.h" #include <errno.h> #include <signal.h> #include <unistd.h> #include <iostream> extern "C" { static void* thread_entry(void* arg) { cxxtools::ThreadImpl* impl = (cxxtools::ThreadImpl*)arg; if( impl->cb() ) { try { impl->cb()->call(); } catch (const std::exception& e) { std::cerr << "exception occured: " << e.what() << std::endl; } catch (...) { std::cerr << "exception occured" << std::endl; } } return 0; } } namespace cxxtools { void ThreadImpl::detach() { _detached = true; if( _id ) { int ret = pthread_detach(_id); if(ret != 0) throw SystemError("pthread_detach"); } } void ThreadImpl::init(const Callable<void>& cb) { delete _cb; _cb = cb.clone(); } void ThreadImpl::start() { size_t stacksize = 0; pthread_attr_t attrs; pthread_attr_init(&attrs); //pthread_attr_setinheritsched(&attrs, PTHREAD_INHERIT_SCHED); if (stacksize > 0) pthread_attr_setstacksize(&attrs ,stacksize); if (_detached) { pthread_t id; int ret = pthread_create(&id, &attrs, thread_entry, this); pthread_attr_destroy(&attrs); if (ret != 0) throw SystemError("pthread_create"); ret = pthread_detach(id); if (ret != 0) throw SystemError("pthread_detach"); } else { int ret = pthread_create(&_id, &attrs, thread_entry, this); pthread_attr_destroy(&attrs); if (ret != 0) throw SystemError("pthread_create"); } } void ThreadImpl::join() { void* threadRet = 0; int ret = pthread_join(_id, &threadRet); if (ret != 0) throw SystemError("pthread_join"); } void ThreadImpl::terminate() { int ret = pthread_kill(_id, SIGKILL); if(ret != 0) throw SystemError("pthread_kill"); } void ThreadImpl::sleep(unsigned int ms) { Timespan ts = Timespan::gettimeofday(); useconds_t us = static_cast<useconds_t>(ms) * 1000; if (usleep(us) == -1 && errno == EINTR) { ts = Timespan(ts.totalUSecs() + ms * 1000); do { Timespan ts2 = Timespan::gettimeofday(); if (ts2.totalUSecs() >= ts.totalUSecs()) break; us = ts.totalUSecs() - ts2.totalUSecs(); } while (usleep(us) == -1 && errno == EINTR); } } } ���������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/signal.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000021244�12256773774�013121� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Dr. Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/signal.h" namespace cxxtools { SignalBase::Sentry::Sentry(const SignalBase* signal) : _signal(signal) { _signal->_sentry = this; _signal->_sending = true; _signal->_dirty = false; } SignalBase::Sentry::~Sentry() { if( _signal ) this->detach(); } void SignalBase::Sentry::detach() { _signal->_sending = false; if( _signal->_dirty == false ) { _signal->_sentry = 0; _signal = 0; return; } std::list<Connection>::iterator it = _signal->_connections.begin(); while( it != _signal->_connections.end() ) { if( it->valid() ) { ++it; } else { it = _signal->_connections.erase(it); } } _signal->_dirty = false; _signal->_sentry = 0; _signal = 0; } SignalBase::SignalBase() : _sentry(0) , _sending(false) , _dirty(false) { } SignalBase::~SignalBase() { if(_sentry) { _sentry->detach(); } } SignalBase& SignalBase::operator=(const SignalBase& other) { this->clear(); std::list<Connection>::const_iterator it = other.connections().begin(); std::list<Connection>::const_iterator end = other.connections().end(); for( ; it != end; ++it) { const Connectable& signal = it->sender(); if( &signal == &other) { const Slot& slot = it->slot(); Connection connection( *this, slot.clone() ); } } return *this; } void SignalBase::onConnectionOpen(const Connection& c) { Connectable::onConnectionOpen(c); } void SignalBase::onConnectionClose(const Connection& c) { // if the signal is currently calling its slots, do not // remove the connection now, but only set the cleanup flag // Any invalid connection objects will be removed after // the signal has finished calling its slots by the Sentry. if( _sending ) { _dirty = true; } else { Connectable::onConnectionClose(c); } } void SignalBase::disconnectSlot(const Slot& slot) { std::list<Connection>::iterator it = Connectable::connections().begin(); std::list<Connection>::iterator end = Connectable::connections().end(); for(; it != end; ++it) { if( it->slot().equals(slot) ) { it->close(); return; } } } bool CompareEventTypeInfo::operator()(const std::type_info* t1, const std::type_info* t2) const { if(t2 == 0) return false; if(t1 == 0) return true; return t1->before(*t2) != 0; } Signal<const cxxtools::Event&>::Sentry::Sentry(const Signal* signal) : _signal(signal) { _signal->_sentry = this; _signal->_sending = true; _signal->_dirty = false; } Signal<const cxxtools::Event&>::Sentry::~Sentry() { if( _signal ) this->detach(); } void Signal<const cxxtools::Event&>::Sentry::detach() { _signal->_sending = false; if( _signal->_dirty == false ) { _signal->_sentry = 0; _signal = 0; return; } Signal::RouteMap::iterator it = _signal->_routes.begin(); while( it != _signal->_routes.end() ) { if( it->second->valid() ) { ++it; } else { delete it->second; _signal->_routes.erase(it++); } } _signal->_dirty = false; _signal->_sentry = 0; _signal = 0; } Signal<const cxxtools::Event&>::Signal() : _sentry(0) , _sending(false) , _dirty(false) {} Signal<const cxxtools::Event&>::~Signal() { if(_sentry) _sentry->detach(); while( ! _routes.empty() ) { IEventRoute* route = _routes.begin()->second; route->connection().close(); } } void Signal<const cxxtools::Event&>::send(const cxxtools::Event& ev) const { // The sentry will set the Signal to the sending state and // reset it to not-sending upon destruction. In the sending // state, removing connection will leave invalid connections // in the connection list to keep the iterator valid, but mark // the Signal dirty. If the Signal is dirty, all invalid // connections will be removed by the Sentry when it destructs.. Signal::Sentry sentry(this); RouteMap::iterator it = _routes.begin(); while( true ) { if( it == _routes.end() ) return; if(it->first != 0) break; // The following scenarios must be considered when the // slot is called: // - The slot might get deleted and thus disconnected from // this signal // - The slot might delete this signal and we must end // calling any slots immediately // - A new Connection might get added to this Signal in // the slot IEventRoute* route = it->second; if( route->valid() ) route->route(ev); // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; ++it; } const std::type_info& ti = ev.typeInfo(); it = _routes.lower_bound( &ti ); while(it != _routes.end() && *(it->first) == ti) { IEventRoute* route = it->second; if(route) route->route(ev); ++it; // if this signal gets deleted by the slot, the Sentry // will be detached. In this case we bail out immediately if( !sentry ) return; } } void Signal<const cxxtools::Event&>::onConnectionOpen(const Connection& c) { const Connectable& sender = c.sender(); if(&sender != this) { return Connectable::onConnectionOpen(c); } } void Signal<const cxxtools::Event&>::onConnectionClose(const Connection& c) { // if the signal is currently calling its slots, do not // remove the connection now, but only set the cleanup flag // Any invalid connection objects will be removed after // the signal has finished calling its slots by the Sentry. if( _sending ) { _dirty = true; } else { RouteMap::iterator it; for(it = _routes.begin(); it != _routes.end(); ++it ) { IEventRoute* route = it->second; if(route->connection() == c ) { delete route; _routes.erase(it++); return; } } Connectable::onConnectionClose(c); } } void Signal<const cxxtools::Event&>::addRoute(const std::type_info* ti, IEventRoute* route) { RouteMap::value_type elem(ti, route); _routes.insert( elem ); } void Signal<const cxxtools::Event&>::removeRoute(const Slot& slot) { RouteMap::iterator it = _routes.begin(); while( it != _routes.end() && it->first == 0 ) { IEventRoute* route = it->second; if(route->connection().slot().equals(slot) ) { route->connection().close(); break; } } } void Signal<const cxxtools::Event&>::removeRoute(const std::type_info* ti, const Slot& slot) { RouteMap::iterator it = _routes.lower_bound( ti ); while(it != _routes.end() && *(it->first) == *ti) { IEventRoute* route = it->second; if(route->connection().slot().equals(slot) ) { route->connection().close(); break; } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/threadpoolimpl.cpp���������������������������������������������������������������0000664�0001750�0001750�00000007576�12256773774�014703� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "threadpoolimpl.h" #include <stdexcept> #include <cxxtools/log.h> log_define("cxxtools.threadpool.impl") namespace cxxtools { ThreadPoolImpl::~ThreadPoolImpl() { log_debug("delete " << _threads.size() << " threads"); for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) delete *it; log_debug("delete " << _queue.size() << " left tasks"); while (!_queue.empty()) delete _queue.get(); } void ThreadPoolImpl::start() { if (_state != Stopped) throw std::logic_error("invalid state"); _state = Starting; while (_threads.size() < _size) _threads.push_back(new AttachedThread(callable(*this, &ThreadPoolImpl::threadFunc))); _state = Running; for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) { log_debug("start thread " << static_cast<void*>(*it)); (*it)->start(); } } void ThreadPoolImpl::stop(bool cancel) { if (_state != Running) throw std::logic_error("thread pool not running"); log_debug("stop " << _threads.size() << " threads"); _state = Stopping; if (cancel) { std::pair<Callable<void>*, bool> c; while ((c = _queue.tryGet()).second) delete c.first; } for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) _queue.put(0); for (ThreadsType::iterator it = _threads.begin(); it != _threads.end(); ++it) { (*it)->join(); log_debug("joined thread " << static_cast<void*>(*it)); delete *it; } _threads.clear(); _state = Stopped; } void ThreadPoolImpl::schedule(const Callable<void>& cb) { Callable<void>* c = cb.clone(); log_debug("queue new task " << static_cast<void*>(c)); _queue.put(c); log_debug("queue size " << _queue.size()); } void ThreadPoolImpl::threadFunc() { Callable<void>* c = 0; while ((c = _queue.get()) != 0) { log_debug("new task " << static_cast<void*>(c) << " received " << _queue.size() << " tasks left"); try { (*c)(); delete c; } catch (...) { delete c; } log_debug("task " << static_cast<void*>(c) << " finished"); } log_debug("end thread"); } } ����������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/semaphoreimpl.cpp����������������������������������������������������������������0000664�0001750�0001750�00000004305�12256773774�014510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "semaphoreimpl.h" #include "cxxtools/systemerror.h" #include <cerrno> namespace cxxtools { SemaphoreImpl::SemaphoreImpl(unsigned int initial) { int ret = sem_init(&_handle, 0, initial); if( ret == -1 ) throw SystemError("sem_init"); } SemaphoreImpl::~SemaphoreImpl() { sem_destroy( &_handle ); } void SemaphoreImpl::wait() { int ret = sem_wait(&_handle); if(ret == -1) throw SystemError("sem_wait"); } bool SemaphoreImpl::tryWait() { int ret = sem_trywait( &_handle ); if(ret == -1) { if(errno == EAGAIN) return false; throw SystemError("sem_trywait"); } return true; } void SemaphoreImpl::post() { again: if( 0 != sem_post(&_handle) ) { if(errno == EINTR) goto again; throw SystemError("sem_post"); } } } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/libraryimpl.cpp������������������������������������������������������������������0000664�0001750�0001750�00000004155�12256773774�014174� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libraryimpl.h" namespace cxxtools { void LibraryImpl::open(const std::string& path) { if(_handle) return; /* RTLD_NOW: since lazy loading is not supported by every target platform RTLD_GLOBAL: make the external symbols in the loaded library available for subsequent libraries. see also http://gcc.gnu.org/faq.html#dso */ int flags = RTLD_NOW | RTLD_GLOBAL; _handle = ::dlopen(path.c_str(), flags); if( !_handle ) { throw OpenLibraryFailed(dlerror()); } } void LibraryImpl::close() { if(_handle) ::dlclose(_handle); } void* LibraryImpl::resolve(const char* symbol) const { if(_handle) { return ::dlsym(_handle, symbol); } return 0; } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/cgi.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000003000�12256773774�012374� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/cgi.h" #include <stdlib.h> namespace cxxtools { Cgi::Cgi() { char* q = getenv("QUERY_STRING"); if (q) parse_url(q); parse_url(std::cin); } } cxxtools-2.2.1/src/jsonserializer.cpp���������������������������������������������������������������0000664�0001750�0001750�00000003532�12256773774�014707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/jsonserializer.h> #include <cxxtools/utf8codec.h> namespace cxxtools { JsonSerializer::JsonSerializer(std::ostream& os, TextCodec<Char, char>* codec) : _ts(new TextOStream(os, codec ? codec : new Utf8Codec())), _inObject(false) { _formatter.begin(*_ts); } JsonSerializer& JsonSerializer::begin(std::ostream& os, TextCodec<Char, char>* codec) { delete _ts; _ts = new TextOStream(os, codec ? codec : new Utf8Codec()); _formatter.begin(*_ts); return *this; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/deserializer.cpp�����������������������������������������������������������������0000664�0001750�0001750�00000006061�12256773774�014326� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 by Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/deserializer.h" #include <stdexcept> namespace cxxtools { void DeserializerBase::setCategory(SerializationInfo::Category category) { _current->setCategory(category); } void DeserializerBase::setName(const std::string& name) { _current->setName(name); } void DeserializerBase::setTypeName(const std::string& type) { _current->setTypeName(type); } void DeserializerBase::setValue(const String& value) { _current->setValue(value); } void DeserializerBase::setValue(const std::string& value) { _current->setValue(value); } void DeserializerBase::setValue(const char* value) { _current->setValue(value); } void DeserializerBase::setValue(bool value) { _current->setValue(value); } void DeserializerBase::setValue(int_type value) { _current->setValue(value); } void DeserializerBase::setValue(unsigned_type value) { _current->setValue(value); } void DeserializerBase::setValue(long double value) { _current->setValue(value); } void DeserializerBase::setNull() { _current->setNull(); } void DeserializerBase::beginMember(const std::string& name, const std::string& type, SerializationInfo::Category category) { SerializationInfo& child = _current->addMember(name); child.setTypeName(type); child.setCategory(category); _current = &child; } void DeserializerBase::leaveMember() { SerializationInfo* p = _current->parent(); if( !p ) SerializationError::doThrow("invalid member"); _current = p; } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/error.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000005716�12256773774�013003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "error.h" #include <sstream> #include <vector> #include <string.h> namespace cxxtools { namespace { // XSI compliant strerror_r inline void errorOut(int (*errfn)(int, char*, size_t), std::ostream& out, int errnum) { std::vector<char> buffer(512); while (errfn(errnum, &buffer[0], buffer.size()) != 0) { if (errno != ERANGE) { out << "Unknown error " << errnum; return; } buffer.resize(buffer.size() * 2); } out << &buffer[0]; } // GNU specific strerror_r inline void errorOut(char* (*errfn)(int, char*, size_t), std::ostream& out, int errnum) { std::vector<char> buffer(512); while (true) { char* f = errfn(errnum, &buffer[0], buffer.size()); if (f != &buffer[0]) { out << f; return; } if (strlen(&buffer[0]) < buffer.size() - 1) break; buffer.resize(buffer.size() * 2); } out << &buffer[0]; } inline void errorOut(std::ostream& out, int errnum) { errorOut(strerror_r, out, errnum); } } std::string getErrnoString(int errnum) { std::ostringstream msg; msg << "errno " << errnum << ": "; errorOut(msg, errnum); return msg.str(); } std::string getErrnoString(int errnum, const char* fn) { if (errnum != 0) { std::ostringstream msg; msg << fn << ": errno " << errnum << ": "; errorOut(msg, errnum); return msg.str(); } else return fn; } } ��������������������������������������������������cxxtools-2.2.1/src/selectorimpl.h�������������������������������������������������������������������0000664�0001750�0001750�00000004251�12260020530�013754� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef CXXTOOLS_SYSTEM_POSIX_SELECTORIMPL_H #define CXXTOOLS_SYSTEM_POSIX_SELECTORIMPL_H #include <cxxtools/api.h> #include <cxxtools/selectable.h> #include <cxxtools/clock.h> #include <sys/poll.h> #include <vector> #include <set> namespace cxxtools { class SelectorImpl { public: SelectorImpl(); ~SelectorImpl(); void add( Selectable& dev ); void remove( Selectable& dev ); void changed( Selectable& dev ); bool wait(std::size_t msecs); void wake(); private: static const short POLL_ERROR_MASK; int _wakePipe[2]; bool _isDirty; std::vector<pollfd> _pollfds; std::set<Selectable*>::iterator _current; std::set<Selectable*> _devices; std::set<Selectable*> _avail; Clock _clock; }; }//namespace xpr #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/iconvstream.cpp������������������������������������������������������������������0000664�0001750�0001750�00000015604�12266277345�014173� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/iconvstream.h" #include "cxxtools/log.h" #include <string.h> #include "config.h" #include <errno.h> #include <stdexcept> #include <sstream> log_define("cxxtools.iconvstream") namespace cxxtools { iconv_error::iconv_error(size_t pos) : std::runtime_error(std::string()), pos(pos) { } size_t iconv_error::position() const throw() { return pos; } const char *iconv_error::what() const throw() { if (msg.empty()) { std::ostringstream ss; ss << "iconv failed to convert character at position: " << pos; msg = ss.str(); } return msg.c_str(); } iconv_error::~iconv_error() throw() { } iconvstreambuf* iconvstreambuf::open(std::ostream& sink_, const char* tocode, const char* fromcode) { open(sink_, tocode, fromcode, iconvstreambuf::mode_default); } iconvstreambuf* iconvstreambuf::open(std::ostream& sink_, const char* tocode, const char* fromcode, mode_t mode_) { log_debug("iconv_open(\"" << tocode << "\", \"" << fromcode << "\", " << mode_ << ")"); mode = mode_; sink = &sink_; pos = 0; if (!conv.open(tocode, fromcode)) { if (errno == EINVAL) { std::string msg = "conversion not supported; from=\""; msg += fromcode; msg += "\" to \""; msg += tocode; log_warn(msg); throw std::runtime_error(msg); } return 0; } log_debug("iconv-opened"); return this; } iconvstreambuf* iconvstreambuf::close() throw() { if (conv.is_open()) { sync(); log_debug("iconv.close(...)"); if (conv.close()) { return this; } else return 0; } else return this; } iconvstreambuf::int_type iconvstreambuf::overflow(int_type c) { log_debug("overflow(" << c << ')'); if (sink == 0) { log_error("no sink"); return traits_type::eof(); } else if (pptr() == 0 || pptr() == buffer) { log_debug("empty put-area"); if (c != traits_type::eof()) { if (pptr() == 0) { log_debug("initialize buffer"); setp(buffer, buffer + (sizeof(buffer) - 1)); } *pptr() = (char_type)c; pbump(1); } return 0; } else { char outbuf[sizeof(buffer)*2];; size_t inbytesleft = pptr() - buffer; if (c != traits_type::eof()) { *pptr() = (char_type)c; ++inbytesleft; } size_t outbytesleft = sizeof(outbuf); ICONV_CONST char* inbufptr = buffer; char* outbufptr = outbuf; // convert as many charachters as possible log_debug("iconv(...) " << inbytesleft << " bytes"); bool iconv_ret = conv.convert(&inbufptr, &inbytesleft, &outbufptr, &outbytesleft); pos += inbufptr - buffer; iconv_ret = iconv_ret || errno == EINVAL || errno == E2BIG; log_debug("pass " << outbufptr - outbuf << " bytes to sink"); sink->write(outbuf, outbufptr - outbuf); if (sink->fail()) { log_warn("sink failed"); return traits_type::eof(); } log_debug("reinitialize put area"); setp(buffer, buffer + (sizeof(buffer) - 1)); if (!iconv_ret) { switch (mode) { case iconvstreambuf::mode_skip: log_warn("convert failed, skipping byte"); --inbytesleft; ++inbufptr; iconv_ret = true; break; case iconvstreambuf::mode_throw: log_warn("convert failed, throwing exception"); throw iconv_error(pos); default: return traits_type::eof(); } } // move left bytes to the start of buffer and reinitialize buffer if (inbytesleft > 0) { log_debug("move " << inbytesleft << " bytes to the start"); sputn(inbufptr, inbytesleft); } return 0; } } iconvstream::int_type iconvstreambuf::underflow() { log_warn("underflow not supported in iconvstreambuf"); return traits_type::eof(); } int iconvstreambuf::sync() { log_debug("sync"); if (pptr() == 0 || pptr() == buffer) return 0; else if (sink) { size_t ob, ob2; int_type ret; do { ob = pptr() - buffer; ret = overflow(traits_type::eof()); ob2 = pptr() - buffer; } while (ob2 > 0 && ob2 < ob); log_debug("flush sink"); sink->flush(); return ret == traits_type::eof() || sink->fail() ? -1 : 0; } else { log_warn("no sink"); return 0; } } std::streampos iconvstreambuf::seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which) { // modify off to by relative position from current position switch (way) { case std::ios_base::beg: off -= pos; case std::ios_base::cur: break; default: return std::streampos(-1); } if (which == std::ios_base::in) { char *buf_p = gptr() + off; // alow seek only on valid data if (buf_p < eback() || buf_p > pptr()) return std::streampos(-1); gbump(off); pos += off; return pos; } if (which == std::ios_base::out) { char *buf_p = pptr() + off; // alow seek only on valid data if (buf_p < pbase() || buf_p > pptr()) return std::streampos(-1); pbump(off); return pos + off; } return std::streampos(-1); } std::streampos iconvstreambuf::seekpos(std::streampos sp, std::ios_base::openmode which) { return seekoff(sp, std::ios_base::beg, which); } void iconvstream::open(std::ostream& sink_, const char* tocode, const char* fromcode) { open(sink_, tocode, fromcode, iconvstreambuf::mode_default); } void iconvstream::open(std::ostream& sink_, const char* tocode, const char* fromcode, iconvstreambuf::mode_t mode) { if (!fail() && streambuf.open(sink_, tocode, fromcode, mode) == 0) setstate(std::ios::failbit); } } ����������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/����������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�012170� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/testprotocol.cpp������������������������������������������������������������0000664�0001750�0001750�00000003104�12256773774�015357� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testprotocol.h" #include "cxxtools/unit/testsuite.h" namespace cxxtools { namespace unit { void TestProtocol::run(TestSuite& suite) { suite.runAll(); } } // namespace Unit } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/reporter.cpp����������������������������������������������������������������0000664�0001750�0001750�00000004672�12256773774�014473� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/reporter.h" #include <iostream> namespace cxxtools { namespace unit { BriefReporter::BriefReporter(std::ostream* out) : _out(out) { } BriefReporter::~BriefReporter() { } void BriefReporter::setOutput(std::ostream& out) { _out = &out; } void BriefReporter::reportStart(const TestContext& test) { *_out << test.testName() << ": "; } void BriefReporter::reportFinish(const TestContext&) { } void BriefReporter::reportMessage(const std::string& msg) { *_out << msg << std::endl; } void BriefReporter::reportSuccess(const TestContext&) { *_out << "OK" << std::endl; } void BriefReporter::reportAssertion(const TestContext&, const Assertion& a) { *_out << "ASSERTION at " << a.sourceInfo().file() << ":" << a.sourceInfo().line() << std::endl; *_out << '\t' << a.what() << std::endl; } void BriefReporter::reportException(const TestContext&, const std::exception& ex) { *_out << "EXCEPTION" << std::endl; *_out << '\t' << ex.what() << std::endl; } void BriefReporter::reportError(const TestContext&) { *_out << "ERROR" << std::endl; } } } ����������������������������������������������������������������������cxxtools-2.2.1/src/unit/assertion.cpp���������������������������������������������������������������0000664�0001750�0001750�00000003175�12256773774�014635� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/unit/assertion.h> #include <iostream> namespace cxxtools { namespace unit { Assertion::Assertion(const std::string& what, const SourceInfo& si) : _sourceInfo(si) , _what(what) { } const SourceInfo& Assertion::sourceInfo() const { return _sourceInfo; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/application.cpp�������������������������������������������������������������0000664�0001750�0001750�00000011271�12256773774�015125� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/unit/application.h> namespace cxxtools { namespace unit { class ErrorCounter : public Reporter { public: ErrorCounter() : _errors(0) {} unsigned errors() { return _errors; } virtual void reportStart(const TestContext& test) {} virtual void reportFinish(const TestContext& test) {} virtual void reportMessage(const std::string& msg) {} virtual void reportSuccess(const TestContext& test) {} virtual void reportAssertion(const TestContext& test, const Assertion& a) { ++_errors; } virtual void reportException(const TestContext& test, const std::exception& ex) { ++_errors; } virtual void reportError(const TestContext& test) { ++_errors; } private: unsigned _errors; }; Application* Application::_app = 0; Application::Application() : Test("") , _errors(0) { _app = this; std::list<Test*>::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { (*it)->setParent( this ); } } Application::~Application() { std::list<Test*>::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { (*it)->setParent( 0 ); } } Application& Application::instance() { if( ! _app ) throw std::logic_error("application not initialized"); return *_app; } Test* Application::findTest(const std::string& testname) { std::list<Test*>::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { if( (*it)->name() == testname) return *it; } return 0; } void Application::attachReporter(Reporter& r) { Test::attachReporter(r); } void Application::attachReporter(Reporter& r, const std::string& testname) { Test* test = this->findTest(testname); if( ! test ) return; test->attachReporter(r); } void Application::run(const std::string& testName) { ErrorCounter ec; this->attachReporter(ec); std::list<Test*>::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { if(testName == "" || (*it)->name() == testName) (*it)->run(); } this->detachReporter(ec); _errors = ec.errors(); } void Application::run() { ErrorCounter ec; this->attachReporter(ec); std::list<Test*>::iterator it; for(it = Application::tests().begin(); it != Application::tests().end(); ++it) { (*it)->run(); } this->detachReporter(ec); _errors = ec.errors(); } void Application::staticRegisterTest(Test& test) { for (std::list<Test*>::iterator it = Application::tests().begin(); it != Application::tests().end(); ++it) { if ((*it)->name() > test.name()) { Application::tests().insert(it, &test); return; } } Application::tests().push_back(&test); } void Application::registerTest(Test& test) { test.setParent(this); staticRegisterTest(test); } void Application::deregisterTest(Test& test) { Application::tests().remove(&test); test.setParent(0); } std::list<Test*>& Application::tests() { static std::list<Test*> _allTests; return _allTests; } } // namespace unit } // namespace cxxtools ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/Makefile.am�����������������������������������������������������������������0000664�0001750�0001750�00000000656�12256773774�014157� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-unit.la libcxxtools_unit_la_SOURCES = \ application.cpp \ testcase.cpp \ test.cpp \ testsuite.cpp \ assertion.cpp \ reporter.cpp \ testcontext.cpp \ testprotocol.cpp libcxxtools_unit_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_unit_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ ����������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/testcontext.cpp�������������������������������������������������������������0000664�0001750�0001750�00000004657�12256773774�015220� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2006 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/test.h" #include "cxxtools/unit/testcontext.h" #include "cxxtools/unit/testfixture.h" #include "cxxtools/log.h" log_define("cxxtools.unit.testcontext") namespace cxxtools { namespace unit { TestContext::TestContext(TestFixture& fixture, Test& test ) : _fixture(fixture) , _test(test) , _setUp(false) { } TestContext::~TestContext() { try { if( _setUp ) _fixture.tearDown(); } catch(...) {} try { _test.reportFinish(*this); } catch(...) {} } std::string TestContext::testName() const { return _test.name(); } void TestContext::run() { try { log_debug("run test " << _test.name()); _test.reportStart(*this); _fixture.setUp(); _setUp = true; this->exec(); _test.reportSuccess(*this); } catch(const Assertion& assertion) { _test.reportAssertion(*this, assertion); } catch(const std::exception& ex) { _test.reportException(*this, ex); } catch(...) { _test.reportError(*this); } } } } ���������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/test.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000007226�12256773774�013606� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/unit/test.h> namespace cxxtools { namespace unit { const std::string& Test::name() const { return _name; } void Test::reportStart(const TestContext& ctx) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportStart(ctx); } if(_parent) _parent->reportStart(ctx); } void Test::reportFinish(const TestContext& ctx) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportFinish(ctx); } if(_parent) _parent->reportFinish(ctx); } void Test::reportSuccess(const TestContext& ctx) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportSuccess(ctx); } if(_parent) _parent->reportSuccess(ctx); } void Test::reportAssertion(const TestContext& ctx, const Assertion& ass) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportAssertion(ctx, ass); } if(_parent) _parent->reportAssertion(ctx, ass); } void Test::reportException(const TestContext& ctx, const std::exception& ex) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportException(ctx, ex); } if(_parent) _parent->reportException(ctx, ex); } void Test::reportError(const TestContext& ctx) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportError(ctx); } if(_parent) _parent->reportError(ctx); } void Test::reportMessage(const std::string& msg) { std::list<Reporter*>::iterator it; for(it = _reporter.begin(); it != _reporter.end(); ++it) { (*it)->reportMessage(msg); } if(_parent) _parent->reportMessage(msg); } void Test::setParent(Test* test) { _parent = test; } Test* Test::parent() { return _parent; } const Test* Test::parent() const { return _parent; } void Test::attachReporter(Reporter& r) { connect(r.destroyed, *this, &Test::detachReporter); _reporter.push_back(&r); } void Test::detachReporter(Reporter& r) { _reporter.remove(&r); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/testsuite.cpp���������������������������������������������������������������0000664�0001750�0001750�00000006006�12256773774�014653� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testsuite.h" #include "cxxtools/unit/testcontext.h" namespace cxxtools { namespace unit { TestProtocol TestSuite::defaultProtocol; TestSuite::TestSuite(const std::string& name, TestProtocol& protocol) : Test(name) , _protocol(&protocol) { } TestSuite::~TestSuite() { Tests::iterator it; for(it = _tests.begin(); it != _tests.end(); ++it) { delete it->second; } } void TestSuite::setParameter(const std::string&, const SerializationInfo&) { } void TestSuite::setProtocol(TestProtocol* protocol) { _protocol = protocol; } void TestSuite::setUp() { } void TestSuite::tearDown() { } void TestSuite::run() { _protocol->run(*this); } void TestSuite::runTest( const std::string& name, const SerializationInfo* si, size_t argCount ) { TestMethod* test = this->findTest(name); if(!test) throw std::runtime_error("No such test"); Context ctx(*this, *test, si, argCount); ctx.run(); } void TestSuite::runAll() { const SerializationInfo* si = 0; Tests::iterator it; for(it = _tests.begin(); it != _tests.end(); ++it) { TestMethod* test = it->second; Context ctx(*this, *test, si, 0); ctx.run(); } } TestMethod* TestSuite::findTest(const std::string& name) { Tests::iterator it; for (it = _tests.begin(); it != _tests.end() && it->first != name; ++it) ; if( it== _tests.end() ) return 0; return it->second; } void TestSuite::registerTest(TestMethod* test) { test->setParent(this); std::pair<const std::string, TestMethod*> p( test->name(), test ); _tests.push_back( p ); } } // namespace unit } // namespace cxxtools ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/unit/Makefile.in�����������������������������������������������������������������0000664�0001750�0001750�00000046762�12266277545�014174� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/unit DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libcxxtools_unit_la_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_libcxxtools_unit_la_OBJECTS = application.lo testcase.lo test.lo \ testsuite.lo assertion.lo reporter.lo testcontext.lo \ testprotocol.lo libcxxtools_unit_la_OBJECTS = $(am_libcxxtools_unit_la_OBJECTS) libcxxtools_unit_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libcxxtools_unit_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcxxtools_unit_la_SOURCES) DIST_SOURCES = $(libcxxtools_unit_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include lib_LTLIBRARIES = libcxxtools-unit.la libcxxtools_unit_la_SOURCES = \ application.cpp \ testcase.cpp \ test.cpp \ testsuite.cpp \ assertion.cpp \ reporter.cpp \ testcontext.cpp \ testprotocol.cpp libcxxtools_unit_la_LIBADD = $(top_builddir)/src/libcxxtools.la libcxxtools_unit_la_LDFLAGS = -version-info @sonumber@ @SHARED_LIB_FLAG@ all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/unit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/unit/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcxxtools-unit.la: $(libcxxtools_unit_la_OBJECTS) $(libcxxtools_unit_la_DEPENDENCIES) $(EXTRA_libcxxtools_unit_la_DEPENDENCIES) $(libcxxtools_unit_la_LINK) -rpath $(libdir) $(libcxxtools_unit_la_OBJECTS) $(libcxxtools_unit_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/application.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assertion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reporter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcontext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testprotocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsuite.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������cxxtools-2.2.1/src/unit/testcase.cpp����������������������������������������������������������������0000664�0001750�0001750�00000003234�12256773774�014435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 by Dr. Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/unit/testcase.h" #include "cxxtools/unit/testcontext.h" namespace cxxtools { namespace unit { TestCase::TestCase(const std::string& name) : Test(name) { } void TestCase::run() { Context ctx(*this, *this); ctx.run(); } void TestCase::setUp() { } void TestCase::tearDown() { } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/settings.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000003572�12256773774�013510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2007 by Dr. Marc Boris Duerner * Copyright (C) 2005 Stephan Beal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/settings.h" #include "settingsreader.h" #include "settingswriter.h" namespace cxxtools { SettingsError::SettingsError(const std::string& what, unsigned line) : SerializationError(what) , _line(line) {} Settings::Settings() {} void Settings::load(std::basic_istream<cxxtools::Char>& is) { SettingsReader reader(is); reader.parse(*this); } void Settings::save(std::basic_ostream<cxxtools::Char>& os ) const { SettingsWriter writer(os); writer.write(*this); } } ��������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/pipe.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000003366�12256773774�012606� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/pipe.h" #include "pipeimpl.h" namespace cxxtools { Pipe::Pipe(OpenMode mode) { _impl = new PipeImpl(mode & IODevice::Async); } Pipe::~Pipe() { delete _impl; } IODevice& Pipe::out() { return _impl->out(); } const IODevice& Pipe::out() const { return _impl->out(); } IODevice& Pipe::in() { return _impl->in(); } const IODevice& Pipe::in() const { return _impl->in(); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/directory.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000012236�12256773774�013651� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "directoryimpl.h" #include "cxxtools/directory.h" namespace cxxtools { DirectoryIterator::DirectoryIterator() : _impl(0) { } DirectoryIterator::DirectoryIterator(const std::string& path, bool skipHidden) { _impl = new DirectoryIteratorImpl( path.c_str(), skipHidden ); } DirectoryIterator::DirectoryIterator(const DirectoryIterator& it) : _impl(0) { _impl = it._impl; if (_impl) _impl->ref(); } DirectoryIterator::~DirectoryIterator() { if (_impl && 0 == _impl->deref()) { delete _impl; } } DirectoryIterator& DirectoryIterator::operator++() { if (_impl && !_impl->advance()) { if (0 == _impl->deref()) delete _impl; _impl = 0; } return *this; } DirectoryIterator& DirectoryIterator::operator=(const DirectoryIterator& it) { if (_impl == it._impl) return *this; if (_impl && 0 == _impl->deref()) { delete _impl; } _impl = it._impl; if (_impl) _impl->ref(); return *this; } const std::string& DirectoryIterator::path() const { return _impl->path(); } const std::string& DirectoryIterator::operator*() const { return _impl->name(); } const std::string* DirectoryIterator::operator->() const { return &_impl->name(); } Directory::Directory() { } Directory::Directory(const std::string& path) : _path(path) { if ( ! Directory::exists( path.c_str() ) ) throw DirectoryNotFound(path); } Directory::Directory(const FileInfo& fi) : _path( fi.path() ) { if (! fi.isDirectory()) throw DirectoryNotFound(fi.path()); } Directory::Directory(const Directory& dir) : _path(dir._path) { } Directory::~Directory() { } Directory& Directory::operator=(const Directory& dir) { _path = dir._path; return *this; } std::size_t Directory::size() const { return 0; } Directory::const_iterator Directory::begin(bool skipHidden) const { return DirectoryIterator( path().c_str(), skipHidden ); } Directory::const_iterator Directory::end() const { return DirectoryIterator(); } void Directory::remove() { DirectoryImpl::remove( path() ); } void Directory::move(const std::string& to) { DirectoryImpl::move(path(), to); _path = to; } std::string Directory::dirName() const { // Find last slash. This separates the last path segment from the rest of the path std::string::size_type separatorPos = path().find_last_of( this->sep() ); // If there is no separator, this directory is relative to the current current directory. // So an empty path is returned. if (separatorPos == std::string::npos) { return ""; } // Include trailing separator to be able to distinguish between no path ("") and a path // which is relative to the root ("/"), for example. return path().substr(0, separatorPos + 1); } std::string Directory::name() const { std::string::size_type separatorPos = path().rfind( this->sep() ); if (separatorPos != std::string::npos) { return path().substr(separatorPos + 1); } else { return path(); } } Directory Directory::create(const std::string& path) { DirectoryImpl::create( path.c_str() ); return Directory(path); } bool Directory::exists(const std::string& path) { return FileInfo::getType( path.c_str() ) == FileInfo::Directory; } void Directory::chdir(const std::string& path) { DirectoryImpl::chdir(path); } std::string Directory::cwd() { return DirectoryImpl::cwd(); } std::string Directory::curdir() { return DirectoryImpl::curdir(); } std::string Directory::updir() { return DirectoryImpl::updir(); } std::string rootdir() { return DirectoryImpl::rootdir(); } std::string tmpdir() { return DirectoryImpl::tmpdir(); } std::string Directory::sep() { return DirectoryImpl::sep(); } } // namespace cxxtools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/semaphore.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000003425�12256773774�013630� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 by Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "semaphoreimpl.h" #include "cxxtools/semaphore.h" namespace cxxtools { Semaphore::Semaphore(unsigned int initial) { _impl = new SemaphoreImpl(initial); } Semaphore::~Semaphore() { delete _impl; } Semaphore& Semaphore::wait() { _impl->wait(); return *this; } bool Semaphore::tryWait() { return _impl->tryWait(); } Semaphore& Semaphore::post() { _impl->post(); return *this; } } // namespace cxxtools �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/selector.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000012276�12266277345�013463� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "selectorimpl.h" #include "cxxtools/selector.h" #include "cxxtools/timer.h" #include "cxxtools/clock.h" namespace cxxtools { const std::size_t SelectorBase::WaitInfinite; SelectorBase::~SelectorBase() { while( _timers.size() ) { Timer* timer = _timers.begin()->second; timer->setSelector(0); } } void SelectorBase::add(Selectable& s) { s.setSelector(this); } void SelectorBase::remove(Selectable& s) { if(s.selector() == this) s.setSelector(0); } void SelectorBase::add(Timer& timer) { timer.setSelector(this); } void SelectorBase::remove( Timer& timer ) { if(timer.selector() == this) timer.setSelector(0); } void SelectorBase::onAddTimer(Timer& timer) { if( timer.active() ) { TimerMap::value_type elem(timer.finished(), &timer); _timers.insert(elem); //_timers.insert( std::make_pair(timer.finished(), &timer) ); } } void SelectorBase::onRemoveTimer( Timer& timer ) { std::multimap<Timespan, Timer*>::iterator it; for(it = _timers.begin(); it != _timers.end(); ++it) { if(it->second == &timer) { _timers.erase(it); return; } } } void SelectorBase::onTimerChanged(Timer& timer) { if( timer.active() ) { TimerMap::value_type elem(timer.finished(), &timer); _timers.insert(elem); //_timers.insert( std::make_pair(timer.finished(), &timer) ); } else { SelectorBase::onRemoveTimer(timer); } } bool SelectorBase::updateTimer(std::size_t& lowestTimeout) { if( _timers.empty() ) return false; Timespan now = Clock::getSystemTicks(); Timer* timer = _timers.begin()->second; bool timerActive = now >= timer->finished(); while( ! _timers.empty() ) { timer = _timers.begin()->second; if( now < timer->finished() ) { int64_t remaining = (timer->finished() - now).toUSecs(); lowestTimeout = (remaining / 1000); if(remaining % 1000 > 0) ++lowestTimeout; break; } timer->update(now); if( ! _timers.empty() ) { timer = _timers.begin()->second; _timers.erase( _timers.begin() ); TimerMap::value_type elem(timer->finished(), timer); _timers.insert(elem); //_timers.insert( std::make_pair(timer->finished(), timer) ); } } return timerActive; } bool SelectorBase::wait(std::size_t msecs) { size_t timerTimeout = Selector::WaitInfinite; // If a timer is immediately ready, still check for an // active selectable to avoid timer preemption if ( updateTimer(timerTimeout) ) { this->onWait(0); return true; } // This handles the case when no timer will become // active in the given timeout. The result of the // wait call indicates activity if(timerTimeout > msecs || timerTimeout == Selector::WaitInfinite) { return this->onWait(msecs); } // A timer will become active before the timeout expires while(true) { if( this->onWait(timerTimeout) ) return true; if( updateTimer(timerTimeout) ) return true; } return false; } void SelectorBase::wake() { this->onWake(); } SelectorBase::SelectorBase() {} Selector::Selector() : _impl( 0 ) { _impl = new SelectorImpl(); } Selector::~Selector() { delete _impl; } void Selector::onAdd( Selectable& selectable ) { _impl->add(selectable); } void Selector::onRemove( Selectable& selectable ) { _impl->remove(selectable); } void Selector::onChanged(Selectable& s) { _impl->changed(s); } void Selector::onReinit(Selectable& s) { } bool Selector::onWait(std::size_t msecs) { return _impl->wait(msecs); } void Selector::onWake() { _impl->wake(); } SelectorImpl& Selector::impl() { return *_impl; } }//namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/applicationimpl.cpp��������������������������������������������������������������0000664�0001750�0001750�00000007465�12256773774�015042� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "applicationimpl.h" #include "cxxtools/pipe.h" #include "cxxtools/selector.h" #include "cxxtools/application.h" #include "cxxtools/systemerror.h" #include "iodeviceimpl.h" #include <string.h> #include <fcntl.h> #include <signal.h> #include <unistd.h> #include <iostream> namespace { cxxtools::Pipe* cxxtools_signal_pipe = 0; static char _signalBuffer[128]; void initSignalPipe() { if( ! cxxtools_signal_pipe ) { cxxtools_signal_pipe = new cxxtools::Pipe(cxxtools::Pipe::Async); cxxtools_signal_pipe->out().beginRead( _signalBuffer, sizeof(_signalBuffer) ); } } void processSignal(cxxtools::IODevice& device) { try { size_t n = device.endRead(); int sigNo = 0; char* it = _signalBuffer; char* last = &_signalBuffer[ n- sizeof(sigNo) ]; while(it <= last) { memcpy(&sigNo, it, sizeof(sigNo)); cxxtools::Application::instance().systemSignal.send(sigNo); it += sizeof(sigNo); } device.beginRead( _signalBuffer, sizeof(_signalBuffer) ); } catch(...) { device.beginRead( _signalBuffer, sizeof(_signalBuffer) ); throw; } } } extern "C" void cxxtools_system_application_sighandler(int sigNo) { if (cxxtools_signal_pipe) { cxxtools_signal_pipe->in().ioimpl().sigwrite(sigNo); } } namespace cxxtools { ApplicationImpl::ApplicationImpl() { ::initSignalPipe(); } ApplicationImpl::~ApplicationImpl() { disconnect(cxxtools_signal_pipe->out().inputReady, processSignal); } void ApplicationImpl::init(SelectorBase& s) { cxxtools_signal_pipe->out().setSelector(&s); connect(cxxtools_signal_pipe->out().inputReady, processSignal); } bool ApplicationImpl::catchSystemSignal(int sig) { if (sig > 0 && sig < NSIG) { struct sigaction act; act.sa_handler = cxxtools_system_application_sighandler; sigemptyset(&act.sa_mask); act.sa_flags = SA_RESTART; if (-1 == ::sigaction(sig, &act, NULL)) { throw SystemError("sigaction failed"); } return true; } return false; } bool ApplicationImpl::raiseSystemSignal(int sig) { if (sig > 0 && sig < NSIG) { if( 0 != ::raise(sig) ) { throw SystemError("sigaction failed"); } return true; } return false; } } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/threadpool.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000004106�12256773774�014003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/threadpool.h> #include "threadpoolimpl.h" namespace cxxtools { ThreadPool::ThreadPool(unsigned size, bool doStart) : _impl(new ThreadPoolImpl(size)) { if (doStart) start(); } ThreadPool::~ThreadPool() { if (running()) stop(); delete _impl; } void ThreadPool::start() { _impl->start(); } void ThreadPool::stop(bool cancel) { _impl->stop(cancel); } void ThreadPool::schedule(const Callable<void>& cb) { _impl->schedule(cb); } bool ThreadPool::running() const { return _impl->running(); } bool ThreadPool::stopped() const { return _impl->stopped(); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.windows.cpp������������������������������������������������������������0000664�0001750�0001750�00000005561�12256773774�015343� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.windows.h> #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ #include <windows.h> namespace cxxtools { typedef LONG atomic_t; atomic_t atomicGet(volatile atomic_t& val) { #if ! defined(_WIN32_WCE) && (_MSC_VER >= 1400) && ! defined(__GNUC__) MemoryBarrier(); #endif return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; #if ! defined(_WIN32_WCE) && (_MSC_VER >= 1400) && ! defined(__GNUC__) MemoryBarrier(); #endif } atomic_t atomicIncrement(volatile atomic_t& value) { return InterlockedIncrement( const_cast<atomic_t*>(&value) ); } atomic_t atomicDecrement(volatile atomic_t& value) { return InterlockedDecrement( const_cast<atomic_t*>(&value) ); } atomic_t atomicExchangeAdd(volatile atomic_t& value, atomic_t n) { return InterlockedExchangeAdd(const_cast<atomic_t*>(&value), n); } atomic_t atomicExchange(volatile atomic_t& value, atomic_t new_val) { return InterlockedExchange(const_cast<atomic_t*>(&value), new_val); } void* atomicExchange(void* volatile& ptr, void* new_val) { return InterlockedExchangePointer( const_cast<void**>(&ptr), new_val ); } atomic_t atomicCompareExchange(volatile atomic_t& value, atomic_t ex, atomic_t cmp) { return InterlockedCompareExchange(const_cast<atomic_t*>(&value), ex, cmp); } void* atomicCompareExchange(void* volatile& ptr, void* ex, void* cmp) { return InterlockedCompareExchangePointer(&ptr, ex, cmp); } } // namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/atomicity.generic.cpp������������������������������������������������������������0000664�0001750�0001750�00000004727�12256773774�015270� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2007 by Marc Boris Duerner * Copyright (C) 2006 by Aloysius Indrayanto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/atomicity.generic.h> #include <csignal> namespace cxxtools { atomic_t atomicGet(volatile atomic_t& val) { return val; } void atomicSet(volatile atomic_t& val, atomic_t n) { val = n; } atomic_t atomicIncrement(volatile atomic_t& dest) { return dest++; } atomic_t atomicDecrement(volatile atomic_t& dest) { return dest--; } atomic_t atomicCompareExchange(volatile atomic_t& dest, atomic_t exch, atomic_t comp) { atomic_t tmp = dest; if(dest== comp) dest = exch; return tmp; } void* atomicCompareExchange(void* volatile& dest, void* exch, void* comp) { void* tmp = dest; if(dest== comp) dest = exch; return tmp; } atomic_t atomicExchange(volatile atomic_t& dest, atomic_t exch) { atomic_t tmp = dest; dest = exch; return tmp; } void* atomicExchange(void* volatile& dest, void* exch) { void* tmp = dest; dest = exch; return tmp; } atomic_t atomicExchangeAdd(volatile atomic_t& dest, atomic_t add) { atomic_t tmp = dest; dest += add; return tmp; } } // namespace cxxtools �����������������������������������������cxxtools-2.2.1/src/regex.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000010653�12266277345�012752� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/regex.h" #include <stdexcept> #include <locale> #include <cctype> namespace cxxtools { unsigned RegexSMatch::size() const { unsigned n; for (n = 0; n < 10 && matchbuf[n].rm_so >= 0; ++n) ; return n; } std::string RegexSMatch::get(unsigned n) const { return has(n) ? str.substr(matchbuf[n].rm_so, matchbuf[n].rm_eo - matchbuf[n].rm_so) : std::string(); } std::string RegexSMatch::format(const std::string& s) const { enum state_type { state_0, state_esc, state_var0, state_var1, state_1 } state; state = state_0; std::string ret; for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) { char ch = *it; switch (state) { case state_0: if (ch == '$') state = state_var0; else if (ch == '\\') state = state_esc; break; case state_esc: ret += ch; state = state_1; break; case state_var0: if (std::isdigit(ch)) { ret = std::string(s.begin(), it - 1); regoff_t s = matchbuf[ch - '0'].rm_so; regoff_t e = matchbuf[ch - '0'].rm_eo; if (s >= 0 && e >= 0) ret.append(str, s, e-s); state = state_1; } else state = state_0; break; case state_1: if (ch == '$') state = state_var1; else if (ch == '\\') state = state_esc; else ret += ch; break; case state_var1: if (std::isdigit(ch)) { regoff_t s = matchbuf[ch - '0'].rm_so; regoff_t e = matchbuf[ch - '0'].rm_eo; if (s >= 0 && e >= 0) ret.append(str, s, e-s); state = state_1; } else if (ch == '$') ret += '$'; else { ret += '$'; ret += ch; } break; } } switch (state) { case state_0: case state_var0: return s; case state_esc: return ret + '\\'; case state_var1: return ret + '$'; case state_1: return ret; } return ret; } void Regex::checkerr(int ret) const { if (ret != 0) { char errbuf[256]; regerror(ret, expr.getPointer(), errbuf, sizeof(errbuf)); throw std::runtime_error(errbuf); } } bool Regex::match(const std::string& str_, int eflags) const { RegexSMatch smatch; return match(str_, smatch, eflags); } bool Regex::match(const std::string& str_, RegexSMatch& smatch, int eflags) const { if (expr.getPointer() == 0) { smatch.matchbuf[0].rm_so = 0; return true; } smatch.str = str_; int ret = regexec(expr.getPointer(), str_.c_str(), sizeof(smatch.matchbuf) / sizeof(regmatch_t), smatch.matchbuf, eflags); if (ret ==REG_NOMATCH) return false; checkerr(ret); return true; } } �������������������������������������������������������������������������������������cxxtools-2.2.1/src/fileinfoimpl.h�������������������������������������������������������������������0000664�0001750�0001750�00000005166�12266277345�013765� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/fileinfo.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> namespace cxxtools { class FileInfoImpl { public: static FileInfo::Type getType(const std::string& path) { struct stat st; if( 0 != ::stat(path.c_str(), &st) ) { return FileInfo::Invalid; } if( S_ISREG(st.st_mode) ) { return FileInfo::File; } else if( S_ISDIR(st.st_mode) ) { return FileInfo::Directory; } else if( S_ISCHR(st.st_mode) ) { return FileInfo::Chardev; } else if( S_ISBLK(st.st_mode) ) { return FileInfo::Blockdev; } else if( S_ISFIFO(st.st_mode) ) { return FileInfo::Fifo; } else if( S_ISSOCK(st.st_mode) ) { return FileInfo::Symlink; } return FileInfo::File; } }; } // namespace cxxtools ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/facets.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000005055�12256773774�013113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004-2007 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace std { locale::id numpunct<cxxtools::Char>::id; numpunct<cxxtools::Char>::numpunct(size_t refs) : locale::facet(refs) { } numpunct<cxxtools::Char>::~numpunct() { } cxxtools::Char numpunct<cxxtools::Char>::decimal_point() const { return this->do_decimal_point(); } cxxtools::Char numpunct<cxxtools::Char>::thousands_sep() const { return this->do_thousands_sep(); } string numpunct<cxxtools::Char>::grouping() const { return this->do_grouping(); } cxxtools::String numpunct<cxxtools::Char>::truename() const { return this->do_truename(); } cxxtools::String numpunct<cxxtools::Char>::falsename() const { return this->do_falsename(); } cxxtools::Char numpunct<cxxtools::Char>::do_decimal_point() const { return '.'; } cxxtools::Char numpunct<cxxtools::Char>::do_thousands_sep() const { return ','; } std::string numpunct<cxxtools::Char>::do_grouping() const { return ""; } cxxtools::String numpunct<cxxtools::Char>::do_truename() const { static const cxxtools::Char truename[] = {'t', 'r', 'u', 'e', '\0'}; return truename; } cxxtools::String numpunct<cxxtools::Char>::do_falsename() const { static const cxxtools::Char falsename[] = {'f', 'a', 'l', 's', 'e', '\0'}; return falsename; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/posix/���������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277563�012353� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/posix/pipestream.cpp�������������������������������������������������������������0000664�0001750�0001750�00000010614�12256773774�015156� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/posix/pipestream.h> #include <cxxtools/systemerror.h> #include <algorithm> #include <unistd.h> #include <cxxtools/log.h> #include <cstring> #include <errno.h> #include <unistd.h> #include <fcntl.h> log_define("cxxtools.pipestream") namespace cxxtools { namespace posix { Pipestreambuf::Pipestreambuf(unsigned bufsize_) : bufsize(bufsize_), ibuffer(0), obuffer(0) { } Pipestreambuf::~Pipestreambuf() { log_debug("Pipestreambuf::~Pipestreambuf()"); try { closeReadFd(); } catch (const std::exception& e) { log_debug("ignore exception in closing read pipe: " << e.what()); } try { closeWriteFd(); } catch (const std::exception& e) { log_debug("ignore exception in closing write pipe: " << e.what()); } delete [] ibuffer; delete [] obuffer; } std::streambuf::int_type Pipestreambuf::overflow(std::streambuf::int_type ch) { log_debug("overflow(" << ch << ')'); if (pptr() != pbase()) { log_debug("write " << (pptr() - pbase()) << " bytes to fd " << getWriteFd()); ssize_t ret = ::write(getWriteFd(), pbase(), pptr() - pbase()); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); else { log_debug(ret << " bytes written to fd " << getWriteFd()); if (static_cast<unsigned>(ret) < bufsize) std::memmove(obuffer, obuffer + ret, bufsize - ret); setp(obuffer, obuffer + bufsize); pbump(bufsize - ret); } } else { log_debug("initialize outputbuffer"); if (obuffer == 0) { log_debug("allocate " << bufsize << " bytes output buffer"); obuffer = new char[bufsize]; } setp(obuffer, obuffer + bufsize); } if (ch != traits_type::eof()) { *pptr() = traits_type::to_char_type(ch); pbump(1); } return 0; } std::streambuf::int_type Pipestreambuf::underflow() { log_debug("underflow()"); if (ibuffer == 0) { log_debug("allocate " << bufsize << " bytes input buffer"); ibuffer = new char[bufsize]; } log_debug("read from fd " << getReadFd()); int ret = ::read(getReadFd(), ibuffer, bufsize); log_debug("read returned " << ret); if(ret < 0) throw SystemError(errno, "read"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes read"); setg(ibuffer, ibuffer, ibuffer + ret); return *gptr(); } int Pipestreambuf::sync() { log_debug("sync()"); if (pptr() != pbase()) { char* p = pbase(); while (p < pptr()) { log_debug("write " << (pptr() - p) << " bytes to fd " << getWriteFd()); ssize_t ret = ::write(getWriteFd(), p, pptr() - p); if(ret < 0) throw SystemError(errno, "write"); if (ret == 0) return traits_type::eof(); log_debug(ret << " bytes written to fd " << getWriteFd()); p += ret; } setp(obuffer, obuffer + bufsize); } return 0; } } } ��������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/posix/posixpipe.cpp��������������������������������������������������������������0000664�0001750�0001750�00000004072�12256773774�015026� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "cxxtools/posix/pipe.h" #include "pipeimpl.h" namespace cxxtools { namespace posix { int Pipe::getReadFd() const { return impl()->out().fd(); } int Pipe::getWriteFd() const { return impl()->in().fd(); } /// Redirect read-end to stdin. /// When the close argument is set, closes the original filedescriptor void Pipe::redirectStdin(bool close, bool inherit) { impl()->out().redirect(0, close, inherit); } void Pipe::redirectStdout(bool close, bool inherit) { impl()->in().redirect(1, close, inherit); } /// Redirect write-end to stdout. /// When the close argument is set, closes the original filedescriptor void Pipe::redirectStderr(bool close, bool inherit) { impl()->in().redirect(2, close, inherit); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/posix/commandinput.cpp�����������������������������������������������������������0000664�0001750�0001750�00000003472�12256773774�015507� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/posix/commandinput.h> #include <cxxtools/posix/pipestream.h> #include <stdexcept> namespace cxxtools { namespace posix { void CommandInput::run() { _fork.fork(); if (_fork.child()) { streambuf.redirectStdin(); streambuf.closeWriteFd(); try { _exec.exec(); } catch (const SystemError&) { ::_exit(-1); } } streambuf.closeReadFd(); } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/posix/commandoutput.cpp����������������������������������������������������������0000664�0001750�0001750�00000003626�12256773774�015711� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/posix/commandoutput.h> #include <cxxtools/posix/pipestream.h> #include <stdexcept> namespace cxxtools { namespace posix { void CommandOutput::run(bool combineStderr) { _fork.fork(); if (_fork.child()) { streambuf.redirectStdout(); if (combineStderr) streambuf.redirectStderr(false); streambuf.closeReadFd(); try { _exec.exec(); } catch (const SystemError&) { ::_exit(-1); } } streambuf.closeWriteFd(); } } } ����������������������������������������������������������������������������������������������������������cxxtools-2.2.1/src/thread.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000005237�12266277345�013111� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006-2008 Marc Boris Duerner * Copyright (C) 2006-2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "threadimpl.h" #include "cxxtools/thread.h" namespace cxxtools { Thread::Thread() : _state(Thread::Ready) , _impl(0) { _impl = new ThreadImpl(); } Thread::Thread(const Callable<void>& cb) : _state(Thread::Ready) , _impl(0) { _impl = new ThreadImpl(); _impl->init(cb); } Thread::~Thread() { delete _impl; } void Thread::init(const Callable<void>& cb) { _impl->init(cb); } void Thread::start() { if( this->state() == Ready || this->state() == Finished ) { _state = Thread::Running; _impl->start(); } } void Thread::exit() { ThreadImpl::exit(); } void Thread::yield() { ThreadImpl::yield(); } void Thread::sleep(unsigned int ms) { ThreadImpl::sleep(ms); } void Thread::detach() { _impl->detach(); } void Thread::join() { if( this->state() == Running ) { _impl->join(); _state = Thread::Finished; } } bool Thread::joinNoThrow() { bool ret = true; if( this->state() == Running ) { try { _impl->join(); } catch(...) { ret = false; } _state = Thread::Finished; } return ret; } void Thread::terminate() { _impl->terminate(); _state = Thread::Finished; } } // !namespace cxxtools �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/��������������������������������������������������������������������������������0000775�0001750�0001750�00000000000�12266277565�011350� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/arg.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000006057�12256773774�012557� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/arg.h> #include <iostream> void print_int(const char* txt, int i) { std::cout << txt << ": " << i << std::endl; } void print_charp(const char* txt, const char* p) { std::cout << txt << ": " << (p ? p : "NULL") << std::endl; } void print_string(const char* txt, const std::string& s) { std::cout << txt << ": " << s << std::endl; } int main(int argc, char* argv[]) { try { cxxtools::Arg<int> int_param(argc, argv, 'i'); cxxtools::Arg<int> long_int_param(argc, argv, "--int"); cxxtools::Arg<int> int_param_def(argc, argv, 'I', 5); print_int("option -i", int_param); print_int("option --int", long_int_param); print_int("option -I", int_param_def); cxxtools::Arg<const char*> charp_param(argc, argv, 'p'); cxxtools::Arg<const char*> long_charp_param(argc, argv, "--charp"); cxxtools::Arg<const char*> charp_param_def(argc, argv, 'P', "hi"); print_charp("option -p", charp_param); print_charp("option --charp", long_charp_param); print_charp("option -P", charp_param_def); cxxtools::Arg<std::string> string_param(argc, argv, 's'); cxxtools::Arg<std::string> long_string_param(argc, argv, "--string"); cxxtools::Arg<std::string> string_param_def(argc, argv, 'S', "hi"); cxxtools::Arg<std::string> string_arg(argc, argv); print_string("option -s", string_param); print_string("option --string", long_string_param); print_string("option -S", string_param_def); print_string("string-Arg", string_arg); std::cout << "unprocessed arguments:\n"; for (int i = 1; i < argc; ++i) std::cout << '\t' << i << ": " << argv[i] << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/uuencode.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000003433�12256773774�013610� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/arg.h> #include <cxxtools/uuencode.h> int main(int argc, char* argv[]) { try { cxxtools::Arg<const char*> fname(argc, argv, 'f'); cxxtools::Arg<unsigned> mode(argc, argv, 'm', 0644); cxxtools::UuencodeOstream out(std::cout); if (fname) out.begin(fname.getValue(), mode); out << std::cin.rdbuf(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/netio.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000010556�12256773774�013123� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/tcpstream.h> #include <cxxtools/arg.h> #include <cxxtools/log.h> #include <sys/time.h> #include <vector> #include <stdlib.h> const unsigned BUFSIZE = 65536; //////////////////////////////////////////////////////////////////////// // Server // int server(int argc, char* argv[]) { cxxtools::Arg<unsigned short> port(argc, argv, 'p', 1234); cxxtools::Arg<const char*> ip(argc, argv, 'i'); cxxtools::Arg<bool> verbose(argc, argv, 'v'); cxxtools::net::TcpServer server(ip.getValue(), port); while (1) { cxxtools::net::TcpSocket worker(server); std::cout << "connection accepted" << std::endl; char buffer[BUFSIZE]; // NOTE: use std::streamsize, not TcpSocket::size_type std::streamsize count = 0; std::streamsize n = 0; while ( (n = worker.read(buffer, BUFSIZE)) > 0) { count += n; if (verbose) std::cout << '.' << std::flush; } if (verbose) std::cout << std::endl << (count / 1024) << " Kbytes received" << std::endl; std::cout << "test ready " << (count / 1024) << " Kbytes received" << std::endl; } return 0; } //////////////////////////////////////////////////////////////////////// // Client // void run_test(cxxtools::net::TcpSocket& conn, unsigned bs, const char* buffer, unsigned secs) { std::cout << "bs " << bs << std::flush; timeval start; gettimeofday(&start, 0); timeval end = start; end.tv_sec += secs; timeval current; // NOTE: use std::streamsize, not TcpSocket::size_type std::streamsize count = 0; while (1) { gettimeofday(¤t, 0); if (current.tv_sec > end.tv_sec || (current.tv_sec == end.tv_sec && current.tv_usec >= end.tv_usec)) break; count += conn.write(buffer, bs); } double dstart = start.tv_sec + start.tv_usec / 1e6; double dend = current.tv_sec + current.tv_usec / 1e6; double dur = dend - dstart; double bps = count / dur; std::cout << " kBps=" << static_cast<unsigned>(bps / 1024) << std::endl; } int client(int argc, char* argv[]) { cxxtools::Arg<unsigned short> port(argc, argv, 'p', 1234); cxxtools::Arg<const char*> ip(argc, argv, 'i'); cxxtools::Arg<unsigned> secs(argc, argv, 't', 1); cxxtools::Arg<unsigned> bufsize(argc, argv, 't', BUFSIZE); cxxtools::Arg<unsigned> B(argc, argv, 'B', 0); cxxtools::net::TcpSocket conn(ip.getValue(), port); std::vector<char> buffer(bufsize); std::generate(&buffer[0], &buffer[bufsize], rand); std::cout << "test" << std::endl; if (B.isSet()) run_test(conn, B, &buffer[0], secs); else { for (unsigned bs=256; bs <= bufsize.getValue(); bs <<= 1) run_test(conn, bs, &buffer[0], secs); } return 0; } //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg<bool> isServer(argc, argv, 's'); if (isServer) return server(argc, argv); else return client(argc, argv); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ��������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/md5sum.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000003265�12256773774�013216� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <fstream> #include <iostream> #include <cxxtools/md5stream.h> int main(int argc, char* argv[]) { cxxtools::Md5stream s; for (int i = 1; i < argc; ++i) { std::ifstream in(argv[i]); if (in) { // copy file to md5stream: s << in.rdbuf(); std::cout << s.getHexDigest() << " " << argv[i] << std::endl; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/README��������������������������������������������������������������������������0000664�0001750�0001750�00000004402�12266277345�012144� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This directory contains some demonstrations for cxxtools. The examples are as minimal as possible to demonstrate simple usage-patterns. arg === Demonstration of template cxxtools::Arg getini ====== Read value from ini-file. Try "./getini test.ini sec1 value" hdstream ======== Just a little hexdumper. To print a hexdump of a file use "./hexdump filename" md5sum ====== Calculate md5sum of files. Try "./md5sum file1 file2" multifstream ============ Concatenate multipe files to stdout. Try "./multiifstream file1 file2". cgi === Cgi-program. Copy binary to a webserver into the directory cgi-bin and try it. With "cgi -t" it just prints a html-file to stdout. log === Demonstration of cxxtools-meta-logging-library. It uses a configurationfile to determine the amount of logging. The name of this file depends on the library, you configure cxxtools for. dir === Print contents of a directory. Try "./dir .". pipestream ========== This demo shows, how to create a child-process, use a pipe to signal from child to parent and another pipe to send a datastream. pool ==== Demonstration of template pool. Example connectionpool. Useful for multithreaded applications. dlloader ======== Load shared library and call a function. Useful to create plugins in your applications. netcat/netecho ============== Demonstration of a simple network-server and -client. Netcat listens to a port (default 1234) and prints all input to stdout. Netecho connects to netcat and copies stdin to netcat. To try out enter "./netcat" in one terminal and then "./netcat <netcat.cpp" in another. Netcat prints the sourcecode of netcat.cpp. If netcat runs on another machine, you need to tell netcat the ip-address of the netcat-server with "./netcat -i host". netio ===== Network-performance tool. Netio has 2 modes: server and client. To enable server-mode start with option -s. It waits for a incoming connection on port 1234 (adjustable with -p). In client-mode you need to give netio the ip-address (or hostname) of the server with -i. The clients sends random data with different package-sizes to the server and computes the network-througput. It starts with 256 bytes and doubles until 64k. Each package-size is sent for 1 second (adjustable with -t). With -B you can specify a single fixed block-size. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/splitter.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000004454�12256773774�013653� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/arg.h> #include <cxxtools/split.h> #include <cxxtools/join.h> #include <vector> int main(int argc, char* argv[]) { try { cxxtools::Arg<char> inputFieldSeparator(argc, argv, 'f', '\t'); cxxtools::Arg<std::string> fieldRegex(argc, argv, 'r'); cxxtools::Arg<char> outputFieldSeparator(argc, argv, 'o', '\t'); cxxtools::Regex re; if (fieldRegex.isSet()) re = cxxtools::Regex(fieldRegex); std::string line; while (std::getline(std::cin, line)) { std::vector<std::string> tokens; if (fieldRegex.isSet()) cxxtools::split(re, line, std::back_inserter(tokens)); else cxxtools::split(inputFieldSeparator.getValue(), line, std::back_inserter(tokens)); std::string l = cxxtools::join(tokens.begin(), tokens.end(), outputFieldSeparator.getValue()); std::cout << l << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/iconv.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000005426�12256773774�013123� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/arg.h> #include <cxxtools/iconverter.h> #include <cxxtools/log.h> #include <iostream> #include <fstream> /** * synopsis: * iconv -f UTF8 -t LATIN1 -i file * prints UTF8-file to std::cout as LATIN1 * * iconf -f LATIN1 -t ISO8859-1 'some text' * prints 'some text' in ISO8859-1 to std::cout * (bad example - same as <echo 'some text'>, because * conversion does not change anything, but it is difficult to * show a better one) * * iconv <file * prints UTF8-file to std::cout as LATIN1 (default conversion) */ int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg<const char*> from(argc, argv, 'f', "UTF8"); cxxtools::Arg<const char*> to(argc, argv, 't', "LATIN1"); cxxtools::Arg<const char*> infile(argc, argv, 'i'); // inputfile if (infile.isSet()) { // read from file std::ifstream in(infile); cxxtools::iconvstream ic(std::cout, to, from); ic << in.rdbuf(); } if (argc > 1) { // convert arguments to cout cxxtools::IConverter ic(to.getValue(), from.getValue()); for (int a = 1; a < argc; ++a) std::cout << ic.convert(argv[a]); } if (!infile.isSet() && argc <= 1) { // filter cin to cout cxxtools::iconvstream ic(std::cout, to, from); ic << std::cin.rdbuf(); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/multifstream.cpp����������������������������������������������������������������0000664�0001750�0001750�00000003271�12256773774�014515� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/multifstream.h> #include <iostream> #include <algorithm> int main(int argc, char* argv[]) { try { cxxtools::multi_ifstream in; std::copy(argv + 1, argv + argc, in.back_inserter()); std::cout << in.rdbuf(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/pipestream.cpp������������������������������������������������������������������0000664�0001750�0001750�00000005161�12256773774�014152� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * This demo shows, how to create a child-process, use a pipe to signal * from child to parent and another pipe to send a datastream. */ #include <cxxtools/pipe.h> #include <cxxtools/posix/pipestream.h> #include <cxxtools/posix/fork.h> int main(int argc, char* argv[]) { try { // create pipe, where child signals, that he is initialized cxxtools::posix::Pipe pipe; cxxtools::posix::Pipestream pstream; // fork child-process cxxtools::posix::Fork fork; if (fork.parent()) { pipe.closeWriteFd(); pstream.closeWriteFd(); std::cout << "waiting for child to become ready" << std::endl; char ch = pipe.read(); std::cout << "child is ready - he sent '" << ch << '\'' << std::endl; // now we copy everything, the child sends through the stream std::cout << pstream.rdbuf() << std::flush; fork.wait(); std::cout << "child terminated normally" << std::endl; } else // child { pipe.closeReadFd(); pstream.closeReadFd(); // we simulate some long initialization: ::sleep(1); pipe.write('a'); // make another break ::sleep(1); pstream << "Hello World!" << std::endl; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/rpcaddclient.cpp����������������������������������������������������������������0000664�0001750�0001750�00000006713�12266277345�014433� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/arg.h> #include <cxxtools/log.h> #include <cxxtools/remoteprocedure.h> #include <cxxtools/xmlrpc/httpclient.h> #include <cxxtools/bin/rpcclient.h> #include <cxxtools/json/rpcclient.h> #include <cxxtools/json/httpclient.h> //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg<std::string> ip(argc, argv, 'i'); cxxtools::Arg<bool> binary(argc, argv, 'b'); cxxtools::Arg<bool> json(argc, argv, 'j'); cxxtools::Arg<bool> jsonhttp(argc, argv, 'J'); cxxtools::Arg<unsigned short> port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); // Normally we would define just one rpc client for the protocol we use but // here we want to demonstrate, that it is just up to the client, which protocol // is used for the remote call. // define a xlmrpc client cxxtools::xmlrpc::HttpClient xmlrpcClient(ip, port, "/xmlrpc"); // and a binary rpc client cxxtools::bin::RpcClient binaryClient(ip, port); // and a tcp json rpc client cxxtools::json::RpcClient jsonClient(ip, port); // and a http json rpc client cxxtools::json::HttpClient httpJsonClient(ip, port,"/jsonrpc"); // now se welect the client depending on the command line flags cxxtools::RemoteClient& theClient = binary ? static_cast<cxxtools::RemoteClient&>(binaryClient) : json ? static_cast<cxxtools::RemoteClient&>(jsonClient) : jsonhttp ? static_cast<cxxtools::RemoteClient&>(httpJsonClient) : static_cast<cxxtools::RemoteClient&>(xmlrpcClient); // define remote procedure with dobule return value and a double and a std::string parameter: // Note: We send the second parameter as a string since it is converted by the server anyway. cxxtools::RemoteProcedure<double, double, std::string> add(theClient, "add"); double sum = 0; for (int a = 1; a < argc; ++a) sum = add(sum, argv[a]); std::cout << "sum=" << sum << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } �����������������������������������������������������cxxtools-2.2.1/demo/logsh.cpp�����������������������������������������������������������������������0000664�0001750�0001750�00000005767�12256773774�013131� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/log.h> #include <cxxtools/arg.h> #include <iostream> const char* category = "logsh"; log_define(category) int main(int argc, char* argv[]) { try { cxxtools::Arg<bool> fatal; fatal.set(argc, argv, 'f'); fatal.set(argc, argv, "--fatal"); cxxtools::Arg<bool> error; error.set(argc, argv, 'e'); error.set(argc, argv, "--error"); cxxtools::Arg<bool> warn; warn.set(argc, argv, 'w'); warn.set(argc, argv, "--warn"); cxxtools::Arg<bool> info; info.set(argc, argv, 'i'); info.set(argc, argv, "--info"); cxxtools::Arg<bool> debug; debug.set(argc, argv, 'd'); debug.set(argc, argv, "--debug"); cxxtools::Arg<std::string> properties("log4j.properties"); properties.set(argc, argv, 'p'); properties.set(argc, argv, "--properties"); if (argc <= 2) { std::cerr << "usage: " << argv[0] << " [options] category message\n" "\toptions: -f|--fatal\n" "\t -e|--error\n" "\t -w|--warn\n" "\t -i|--info\n" "\t -d|--debug\n" "\t -p|--properties filename" << std::endl; return -1; } log_init(properties.getValue()); category = argv[1]; for (int a = 2; a < argc; ++a) { if (fatal) log_fatal(argv[a]); else if (error) log_error(argv[a]); else if (warn) log_warn(argv[a]); else if (info) log_info(argv[a]); else if (debug) log_debug(argv[a]); } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return -1; } } ���������cxxtools-2.2.1/demo/rpcasyncaddclient.cpp�����������������������������������������������������������0000664�0001750�0001750�00000012444�12266277345�015467� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011,2013 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* This demo program shows how to run multiple remote rpc calls asncronously so that they run in parallel. */ #include <iostream> #include <cxxtools/arg.h> #include <cxxtools/log.h> #include <cxxtools/xmlrpc/httpclient.h> #include <cxxtools/bin/rpcclient.h> #include <cxxtools/json/rpcclient.h> #include <cxxtools/json/httpclient.h> #include <cxxtools/remoteprocedure.h> #include <cxxtools/selector.h> int main(int argc, char* argv[]) { try { // initialize logging - this reads the file log.xml from the current directory log_init(); // read the command line options cxxtools::Arg<std::string> ip(argc, argv, 'i'); // option -i <ip-addres> defines the address where to find the server cxxtools::Arg<bool> binary(argc, argv, 'b'); cxxtools::Arg<bool> json(argc, argv, 'j'); cxxtools::Arg<bool> jsonhttp(argc, argv, 'J'); cxxtools::Arg<std::size_t> timeout(argc, argv, 't', cxxtools::RemoteClient::WaitInfinite); cxxtools::Arg<unsigned short> port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); // we need a selector, which controls the network activity cxxtools::Selector selector; // Normally we would define just one rpc client for the protocol we use but // here we want to demonstrate, that it is just up to the client, which protocol // is used for the remote call. // One client can run just one request at a time. To run parallel requests // we need 2 clients. So we define 2 clients for each protocol. // define a xlmrpc client cxxtools::xmlrpc::HttpClient xmlrpcClient1(selector, ip, port, "/xmlrpc"); cxxtools::xmlrpc::HttpClient xmlrpcClient2(selector, ip, port, "/xmlrpc"); // and a binary rpc client cxxtools::bin::RpcClient binaryClient1(selector, ip, port); cxxtools::bin::RpcClient binaryClient2(selector, ip, port); // and a tcp json rpc client cxxtools::json::RpcClient jsonClient1(selector, ip, port); cxxtools::json::RpcClient jsonClient2(selector, ip, port); // and a http json rpc client cxxtools::json::HttpClient httpJsonClient1(selector, ip, port, "/jsonrpc"); cxxtools::json::HttpClient httpJsonClient2(selector, ip, port, "/jsonrpc"); // now se select the client depending on the command line flags cxxtools::RemoteClient& client1( binary ? static_cast<cxxtools::RemoteClient&>(binaryClient1) : json ? static_cast<cxxtools::RemoteClient&>(jsonClient1) : jsonhttp ? static_cast<cxxtools::RemoteClient&>(httpJsonClient1) : static_cast<cxxtools::RemoteClient&>(xmlrpcClient1)); cxxtools::RemoteClient& client2( binary ? static_cast<cxxtools::RemoteClient&>(binaryClient2) : json ? static_cast<cxxtools::RemoteClient&>(jsonClient2) : jsonhttp ? static_cast<cxxtools::RemoteClient&>(httpJsonClient2) : static_cast<cxxtools::RemoteClient&>(xmlrpcClient2)); // define remote procedure with dobule return value and two double parameters cxxtools::RemoteProcedure<double, double, double> add1(client1, "add"); cxxtools::RemoteProcedure<double, double, double> add2(client2, "add"); // initiate the execution of our method add1.begin(5, 6); add2.begin(1, 2); // Calling RemoteProcedure::end will run the underlying event loop until // the remote procedure is finished and return the result. // In case of a error, an exception is thrown. // Note that waiting for the end of one remote procedure will also start // and maybe finish the second remote procedure. double result1 = add1.end(timeout); std::cout << "result1=" << result1 << std::endl; // Here we run the loop again until the second procedure is finished. It // may well be, that the procedure is already finished and we get the // result immediately. double result2 = add2.end(timeout); std::cout << "result2=" << result2 << std::endl; } catch (const std::exception& e) { std::cerr << "error: " << e.what() << std::endl; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/hd.cpp��������������������������������������������������������������������������0000664�0001750�0001750�00000003720�12256773774�012373� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <fstream> #include "cxxtools/hdstream.h" #include "cxxtools/arg.h" #include <algorithm> class Hexdumper { unsigned offset; public: explicit Hexdumper(unsigned offset_) : offset(offset_) { } void operator() (const char* file) { std::ifstream in(file); cxxtools::Hdostream hd; if (offset) { in.seekg(offset); hd.setOffset(offset); } hd << in.rdbuf() << std::flush; } }; int main(int argc, char* argv[]) { cxxtools::Arg<unsigned> offset(argc, argv, 'o', 0); std::for_each(argv + 1, argv + argc, Hexdumper(offset)); } ������������������������������������������������cxxtools-2.2.1/demo/arg-set.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000004762�12256773774�013351� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/arg.h> #include <iostream> void print_int(const char* txt, int i) { std::cout << txt << ": " << i << std::endl; } void print_charp(const char* txt, const char* p) { std::cout << txt << ": " << (p ? p : "NULL") << std::endl; } void print_string(const char* txt, const std::string& s) { std::cout << txt << ": " << s << std::endl; } int main(int argc, char* argv[]) { try { cxxtools::Arg<int> int_param(5); // default-value 5 int_param.set(argc, argv, 'i'); int_param.set(argc, argv, "--int"); print_int("option -i|--int", int_param); cxxtools::Arg<const char*> charp_param("hi"); // default-value charp_param.set(argc, argv, 'p'); charp_param.set(argc, argv, "--charp"); print_charp("option -p|--charp", charp_param); cxxtools::Arg<std::string> string_param("hi"); // default-value string_param.set(argc, argv, 's'); string_param.set(argc, argv, "--string"); std::cout << "unprocessed arguments:\n"; for (int i = 1; i < argc; ++i) std::cout << '\t' << i << ": " << argv[i] << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } ��������������cxxtools-2.2.1/demo/Makefile.am���������������������������������������������������������������������0000664�0001750�0001750�00000004376�12266277345�013332� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������noinst_PROGRAMS = arg arg-set cgi dir dlloader getini hd \ httprequest httpserver log logbench logsh md5sum mime multifstream netcat \ netio netmsg pipestream pool signals thread threadpool uuencode cxxlog \ rpcserver rpcechoclient rpcaddclient splitter json regex execLs rpcasyncaddclient arg_SOURCES = arg.cpp arg_set_SOURCES = arg-set.cpp cgi_SOURCES = cgi.cpp dir_SOURCES = dir.cpp dlloader_SOURCES = dlloader.cpp getini_SOURCES = getini.cpp hd_SOURCES = hd.cpp httprequest_SOURCES = httprequest.cpp httpserver_SOURCES = httpserver.cpp log_SOURCES = log.cpp logbench_SOURCES = logbench.cpp logsh_SOURCES = logsh.cpp md5sum_SOURCES = md5sum.cpp mime_SOURCES = mime.cpp multifstream_SOURCES = multifstream.cpp netcat_SOURCES = netcat.cpp netio_SOURCES = netio.cpp netmsg_SOURCES = netmsg.cpp pipestream_SOURCES = pipestream.cpp pool_SOURCES = pool.cpp signals_SOURCES = signals.cpp thread_SOURCES = thread.cpp threadpool_SOURCES = threadpool.cpp uuencode_SOURCES = uuencode.cpp cxxlog_SOURCES = cxxlog.cpp rpcserver_SOURCES = rpcserver.cpp rpcechoclient_SOURCES = rpcechoclient.cpp rpcaddclient_SOURCES = rpcaddclient.cpp splitter_SOURCES = splitter.cpp json_SOURCES = json.cpp regex_SOURCES = regex.cpp execLs_SOURCES = execLs.cpp rpcasyncaddclient_SOURCES = rpcasyncaddclient.cpp if MAKE_ICONVSTREAM noinst_PROGRAMS += iconv iconv_SOURCES = iconv.cpp endif BASE_LIBS = $(top_builddir)/src/libcxxtools.la HTTP_LIBS = $(BASE_LIBS) $(top_builddir)/src/http/libcxxtools-http.la XMLRPC_LIBS = $(BASE_LIBS) $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la BIN_LIBS = $(HTTP_LIBS) $(top_builddir)/src/bin/libcxxtools-bin.la JSON_LIBS = $(HTTP_LIBS) $(top_builddir)/src/json/libcxxtools-json.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = $(top_builddir)/src/libcxxtools.la httpserver_LDADD = $(HTTP_LIBS) httprequest_LDADD = $(HTTP_LIBS) rpcserver_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcechoclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) json_LDADD = $(HTTP_LIBS) rpcasyncaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) log.xml: /bin/sh $(top_builddir)/cxxtools-config --logxml cxxtools >$@ noinst_DATA = log.xml CLEANFILES = log.xml EXTRA_DIST = README ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/mime.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000004434�12256773774�012732� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <fstream> #include <stdexcept> #include <cxxtools/mime.h> #include <cxxtools/log.h> int main(int argc, char* argv[]) { try { log_init(); cxxtools::Mime mime; for (int a = 1; a < argc; ++a) { std::string fname = argv[a]; std::ifstream ifile(argv[a]); if (!ifile) throw std::runtime_error("cannot open file " + fname); if (fname.size() >= 4 && fname.compare(fname.size() - 4, 4, ".jpg") == 0) mime.addBinaryFile("image/jpg", fname, ifile); else if (fname.size() >= 4 && fname.compare(fname.size() - 4, 4, ".gif") == 0) mime.addBinaryFile("image/gif", fname, ifile); else if (fname.size() >= 4 && fname.compare(fname.size() - 4, 4, ".png") == 0) mime.addBinaryFile("image/png", fname, ifile); else mime.addPart(ifile); } std::cout << mime; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/pool.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000011032�12256773774�012744� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/thread.h> #include <cxxtools/pool.h> #include <cxxtools/log.h> #include <unistd.h> log_define("pooldemo") // define a dummy dbconnection-object class Connection { std::string db; public: Connection() { log_info("create connection"); } explicit Connection(const std::string& db_) : db(db_) { log_info("create connection to \"" << db << '"'); } ~Connection() { log_info("destroy connection"); } void doSomething() { sleep(1); } }; // define a custom connector for passing the connection string class Connector { std::string db; public: explicit Connector(const std::string& db_) : db(db_) { } Connection* operator() () { return new Connection(db); } }; // define a connection-pool-type typedef cxxtools::Pool<Connection, Connector> ConnectionPoolType; // define a thread, which fetches a connection from a pool // and does something class MyThread { cxxtools::AttachedThread thread; ConnectionPoolType& pool; unsigned threadNum; unsigned sec; public: explicit MyThread (ConnectionPoolType& pool_, unsigned threadNum_, unsigned sec_ = 1) : thread( cxxtools::callable(*this, &MyThread::run) ), pool(pool_), threadNum(threadNum_), sec(sec_) { } void create() { thread.start(); } void join() { thread.join(); } void run() { log_info("start thread " << threadNum); sleep(sec); // We fetch a object from the pool, and call a method pool.get() does // not return a connection, but a proxy object, so we have to take // care not to assign the object to a Connection, but use that proxy // directy. // // This would be wrong: // Connection conn = *pool.get(); // convert the proxy-object // conn.doSomething(threadNum); // the connection is back in the pool here :-( // // The reason is, that the proxy object is destroyed too early. // The proxy object puts the connection back to the free-list of the // pool, before we use the connection. // log_info("doSomething in thread " << threadNum); pool.get()->doSomething(); log_info("doSomething ends in thread " << threadNum); log_info("thread ready " << threadNum); } }; int main(int argc, char* argv[]) { try { log_init(); ConnectionPoolType connectionPool(3, Connector("mydb")); MyThread th1(connectionPool, 1, 2); MyThread th2(connectionPool, 2); MyThread th3(connectionPool, 3, 3); MyThread th4(connectionPool, 4, 3); MyThread th5(connectionPool, 5, 4); th1.create(); th2.create(); th3.create(); th4.create(); th5.create(); log_info("threads created"); th1.join(); // Thread 1 is ready and the connection is put back into the pool. // We release all free connections here. At least one connection // from thread 1 is released. log_info("pool drop"); connectionPool.drop(); th2.join(); th4.join(); th3.join(); th5.join(); log_info("threads joined"); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/rpcserver.cpp�������������������������������������������������������������������0000664�0001750�0001750�00000014322�12266277345�014005� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009,2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Cxxtools implements a rpc framework, which can run with 4 protocols. Xmlrpc is a simple xml based standard protocol. The spec can be found at http://www.xmlrpc.org/. Json rpc is a json based standard protocol. The sepc can be found at http://json-rpc.org. Json is less verbose than xml and therefore jsonrpc is a little faster than xmlrpc. Json rpc comes in cxxtools in 2 flavours: raw and http. And last but not least cxxtools has a own non standard binary protocol. It is faster than xmlrpc or jsonrpc but works only with cxxtools. This demo program implements a server, which runs all 4 flavours in a single event loop. */ #include <iostream> #include <cxxtools/arg.h> #include <cxxtools/log.h> #include <cxxtools/xmlrpc/service.h> #include <cxxtools/http/server.h> #include <cxxtools/bin/rpcserver.h> #include <cxxtools/json/rpcserver.h> #include <cxxtools/json/httpservice.h> #include <cxxtools/eventloop.h> //////////////////////////////////////////////////////////////////////// // This defines functions, which we want to be called remotely. // // Parameters and return values of the functions, which can be exported must be // serializable and deserializable with the cxxtools serialization framework. // For all standard types including container classes in the standard library // proper operators are defined in cxxtools. // std::string echo(const std::string& message) { std::cout << message << std::endl; return message; } double add(double a1, double a2) { return a1 + a2; } //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { // initialize logging - this reads the file log.xml from the current directory log_init(); // read the command line options // option -i <ip-address> defines the ip address of the interface, where the // server waits for connections. Default is empty, which tells the server to // listen on all local interfaces cxxtools::Arg<std::string> ip(argc, argv, 'i'); // option -p <number> specifies the port, where http requests are expected. // This port is valid for xmlrpc and json over http. It defaults to 7002. cxxtools::Arg<unsigned short> port(argc, argv, 'p', 7002); // option -b <number> specifies the port, where the binary server waits for // requests. It defaults to port 7003. cxxtools::Arg<unsigned short> bport(argc, argv, 'b', 7003); // option -j <number> specifies the port, where the json server wait for // requests. It defaults to port 7004. cxxtools::Arg<unsigned short> jport(argc, argv, 'j', 7004); std::cout << "run rpcecho server\n" << "http protocol on port "<< port.getValue() << "\n" << "binary protocol on port " << bport.getValue() << "\n" << "json protocol on port " << jport.getValue() << std::endl; // create an event loop cxxtools::EventLoop loop; // the http server is instantiated with an ip address and a port number // It will be used for xmlrpc and json over http on different urls. cxxtools::http::Server httpServer(loop, ip, port); //////////////////////////////////////////////////////////////////////// // Xmlrpc // we create an instance of the service class cxxtools::xmlrpc::Service xmlrpcService; // we register our functions xmlrpcService.registerFunction("echo", echo); xmlrpcService.registerFunction("add", add); // ... and register the service under a url httpServer.addService("/xmlrpc", xmlrpcService); //////////////////////////////////////////////////////////////////////// // Binary rpc // for the binary rpc server we define a binary server cxxtools::bin::RpcServer binServer(loop, ip, bport); // and register the functions in the server binServer.registerFunction("echo", echo); binServer.registerFunction("add", add); //////////////////////////////////////////////////////////////////////// // Json rpc // for the json rpc server we define a json server cxxtools::json::RpcServer jsonServer(loop, ip, jport); // and register the functions in the server jsonServer.registerFunction("echo", echo); jsonServer.registerFunction("add", add); //////////////////////////////////////////////////////////////////////// // Json rpc over http // for json over http we need a service object cxxtools::json::HttpService jsonhttpService; // we register our functions jsonhttpService.registerFunction("echo", echo); jsonhttpService.registerFunction("add", add); // ... and register the service under a url httpServer.addService("/jsonrpc", jsonhttpService); //////////////////////////////////////////////////////////////////////// // Run // now start the servers by running the event loop loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/json.cpp������������������������������������������������������������������������0000664�0001750�0001750�00000017651�12266277345�012753� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <fstream> #include <cxxtools/log.h> #include <cxxtools/arg.h> #include <cxxtools/jsonserializer.h> #include <cxxtools/serializationinfo.h> #include <cxxtools/thread.h> #include <cxxtools/http/server.h> #include <cxxtools/http/service.h> #include <cxxtools/http/responder.h> #include <cxxtools/http/reply.h> #include <cxxtools/eventloop.h> struct ProcStat { ProcStat() : user(0), nice(0), system(0), idle(0), iowait(0), irq(0), softirq(0) { } std::string cpu; unsigned user; unsigned nice; unsigned system; unsigned idle; unsigned iowait; unsigned irq; unsigned softirq; }; std::istream& operator>> (std::istream& in, ProcStat& p) { in >> p.cpu >> p.user >> p.nice >> p.system >> p.idle >> p.iowait >> p.irq >> p.softirq; return in; } std::ostream& operator<< (std::ostream& out, ProcStat& p) { out << p.cpu << ' ' << p.user << ' ' << p.nice << ' ' << p.system << ' ' << p.idle << ' ' << p.iowait << ' ' << p.irq << ' ' << p.softirq; return out; } void operator<<= (cxxtools::SerializationInfo& si, const ProcStat& p) { si.addMember("cpu") <<= p.cpu; si.addMember("user") <<= p.user; si.addMember("nice") <<= p.nice; si.addMember("system") <<= p.system; si.addMember("idle") <<= p.idle; si.addMember("iowait") <<= p.iowait; si.addMember("irq") <<= p.irq; si.addMember("softirq") <<= p.softirq; } ProcStat operator- (const ProcStat& p1, const ProcStat& p2) { ProcStat p; p.cpu = p1.cpu; p.user = p1.user - p2.user; p.nice = p1.nice - p2.nice; p.system = p1.system - p2.system; p.idle = p1.idle - p2.idle; p.iowait = p1.iowait - p2.iowait; p.irq = p1.irq - p2.irq; p.softirq = p1.softirq - p2.softirq; return p; } ProcStat currentStat; cxxtools::Mutex statMutex; void statThread() { ProcStat p0; { std::ifstream f("/proc/stat"); f >> p0; } while (true) { cxxtools::Thread::sleep(1000); std::ifstream f("/proc/stat"); ProcStat p1; f >> p1; cxxtools::MutexLock lock(statMutex); currentStat = p1 - p0; p0 = p1; } } class MainResponder : public cxxtools::http::Responder { public: explicit MainResponder(cxxtools::http::Service& service) : cxxtools::http::Responder(service) { } virtual void reply(std::ostream&, cxxtools::http::Request& request, cxxtools::http::Reply& reply); }; void MainResponder::reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) { reply.addHeader("Content-Type", "text/html"); out << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n" "<html>\n" " <head>\n" " <script type='text/javascript'>\n" " function getRequest()\n" " {\n" " try { return new XMLHttpRequest(); } catch (e) { }\n" " try { return new ActiveXObject(\"Msxml2.XMLHttp\"); } catch (e) { }\n" " try { return new ActiveXObject(\"Microsoft.XMLHTTP\"); } catch (e) { }\n" " return null;\n" " }\n" "\n" " function ajaxGet(url, fn)\n" " {\n" " request = getRequest();\n" " request.open('GET', url);\n" " request.onreadystatechange = function () {\n" " if (request.readyState == 4)\n" " {\n" " if (request.status == 200)\n" " fn(request);\n" " }\n" " }\n" " request.send(null);\n" " }\n" "\n" " function updateStat()\n" " {\n" " ajaxGet('/stat',\n" " function(request)\n" " {\n" " var r = eval('(' + request.responseText + ')');\n" " document.getElementById('cpu').innerHTML = r.cpu;\n" " document.getElementById('user').innerHTML = r.user;\n" " document.getElementById('nice').innerHTML = r.nice;\n" " document.getElementById('system').innerHTML = r.system;\n" " document.getElementById('idle').innerHTML = r.idle;\n" " document.getElementById('iowait').innerHTML = r.iowait;\n" " document.getElementById('irq').innerHTML = r.irq;\n" " document.getElementById('softirq').innerHTML = r.softirq;\n" " document.getElementById('user').innerHTML = r.user;\n" " });\n" " }\n" "\n" " window.setInterval('updateStat()', 1000);\n" " </script>\n" " </head>\n" "\n" " <body bgcolor='#FFFFFF'>\n" "\n" " <table>\n" " <tr><th>cpu</th><td id='cpu'></td></tr>\n" " <tr><th>user</th><td id='user'></td></tr>\n" " <tr><th>nice</th><td id='nice'></td></tr>\n" " <tr><th>system</th><td id='system'></td></tr>\n" " <tr><th>idle</th><td id='idle'></td></tr>\n" " <tr><th>iowait</th><td id='iowait'></td></tr>\n" " <tr><th>irq</th><td id='irq'></td></tr>\n" " <tr><th>softirq</th><td id='softirq'></td></tr>\n" " </table>\n" "\n" " </body>\n" "</html>\n"; } class StatResponder : public cxxtools::http::Responder { public: explicit StatResponder(cxxtools::http::Service& service) : cxxtools::http::Responder(service) { } virtual void reply(std::ostream&, cxxtools::http::Request& request, cxxtools::http::Reply& reply); }; void StatResponder::reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) { cxxtools::MutexLock lock(statMutex); reply.addHeader("Content-Type", "application/json"); cxxtools::JsonSerializer serializer(out); serializer.serialize(currentStat); serializer.finish(); } typedef cxxtools::http::CachedService<StatResponder> StatService; typedef cxxtools::http::CachedService<MainResponder> MainService; int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg<std::string> listenIp(argc, argv, 'l'); cxxtools::Arg<unsigned short int> listenPort(argc, argv, 'p', 8001); cxxtools::EventLoop loop; cxxtools::http::Server server(loop, listenIp, listenPort); MainService mainService; StatService statService; server.addService("/", mainService); server.addService("/stat", statService); cxxtools::AttachedThread thread(cxxtools::callable(statThread)); thread.start(); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ���������������������������������������������������������������������������������������cxxtools-2.2.1/demo/log.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000004753�12256773774�012570� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/log.h> #include <iostream> #include <stdexcept> log_define("global") // global definition namespace ns { log_define("namespace") // namespace scope definition void main1() { // this is logged at category "namespace" log_trace("main"); log_fatal("fatal message in namespace ns"); log_error("error message in namespace ns"); log_warn("warn message in namespace ns"); log_info("info message in namespace ns"); log_debug("debug message in namespace ns"); } } class cl { log_define("class.cl") // class-scope definition public: cl() { log_debug("constructor here"); // this is logged at category "class.cl" } ~cl() { log_debug("destructor here"); } }; int main(int argc, char* argv[]) { try { log_init(); // this is logged at category "global" log_fatal("fatal message " << 1); log_error("error message " << 2); log_warn("warn message " << 3); log_info("info message " << 4); log_debug("debug message " << 5); ns::main1(); cl c; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return -1; } } ���������������������cxxtools-2.2.1/demo/logbench.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000010436�12256773774�013563� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/log.h> #include <cxxtools/smartptr.h> #include <cxxtools/refcounted.h> #include <iostream> #include <vector> #include <stdexcept> #include <cxxtools/arg.h> #include <cxxtools/thread.h> #include <sys/time.h> #include <iomanip> namespace bench { log_define("bench") class Logtester : public cxxtools::RefCounted { cxxtools::AttachedThread thread; unsigned long count; unsigned long loops; unsigned long enabled; public: Logtester(unsigned long count_, unsigned long loops_, unsigned long enabled_) : thread( cxxtools::callable(*this, &Logtester::run) ), count(count_), loops(loops_), enabled(enabled_) { } void start() { thread.start(); } void join() { thread.join(); } void setCount(unsigned long count_) { count = count_; } void setLoops(unsigned long loops_) { loops = loops_; } void setEnabled(bool sw = true) { enabled = sw; } void run(); }; void Logtester::run() { for (unsigned long l = 0; l < loops; ++l) { if (enabled) for (unsigned long i = 0; i < count; ++i) log_fatal("fatal message"); else for (unsigned long i = 0; i < count; ++i) log_debug("info message"); } } } int main(int argc, char* argv[]) { try { cxxtools::Arg<bool> enable(argc, argv, 'e'); cxxtools::Arg<double> total(argc, argv, 'T', 5.0); // minimum runtime cxxtools::Arg<long> loops(argc, argv, 'l', 1000); cxxtools::Arg<unsigned> numthreads(argc, argv, 't', 1); unsigned long count = 1; double T; log_init(); typedef std::vector<cxxtools::SmartPtr<bench::Logtester> > Threads; Threads threads; for (unsigned t = 0; t < numthreads; ++t) threads.push_back(new bench::Logtester(count, loops.getValue() / numthreads.getValue(), enable)); while (count > 0) { std::cout << "count=" << (count * loops) << '\t' << std::flush; for (Threads::iterator it = threads.begin(); it != threads.end(); ++it) (*it)->setCount(count); struct timeval tv0; struct timeval tv1; gettimeofday(&tv0, 0); if (threads.size() == 1) { (*threads.begin())->run(); } else { for (Threads::iterator it = threads.begin(); it != threads.end(); ++it) (*it)->start(); for (Threads::iterator it = threads.begin(); it != threads.end(); ++it) (*it)->join(); } gettimeofday(&tv1, 0); double t0 = tv0.tv_sec + tv0.tv_usec / 1e6; double t1 = tv1.tv_sec + tv1.tv_usec / 1e6; T = t1 - t0; std::cout.precision(6); std::cout << " T=" << T << '\t' << std::setprecision(12) << (count / T * loops) << " msg/s" << std::endl; if (T >= total) break; count <<= 1; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return -1; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/signals.cpp���������������������������������������������������������������������0000664�0001750�0001750�00000004431�12256773774�013440� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Marc Boris Duerner * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/signal.h> #include <iostream> int function() { std::cout << "function called." << std::endl; return 0; } struct Object : public cxxtools::Connectable { bool method() { std::cout << "Object::method called." << std::endl; return true; } char constMethod() const { std::cout << "Object::constMethod called." << std::endl; return 'r'; } static std::string staticMethod() { std::cout << "Object::staticMethod called." << std::endl; return "test"; } }; int main(int argc, char* argv[]) { try { Object obj; cxxtools::Signal<> signal; signal.connect( cxxtools::slot(function) ); signal.connect( cxxtools::slot(obj, &Object::method) ); signal.connect( cxxtools::slot(obj, &Object::constMethod) ); signal.connect( cxxtools::slot(&Object::staticMethod) ); signal.send(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; return 1; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/execLs.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000003624�12256773774�013226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/posix/commandoutput.h> // example for starting a sub process and reading its output through a stream // int main(int argc, char* argv[]) { try { // create a class of type CommandOutput cxxtools::posix::CommandOutput ls("ls"); // add some parameters ls.push_back("-l"); ls.push_back("/bin"); // run the process ls.run(); // read the output of the process (copy it to std::cout here) std::cout << ls.rdbuf(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/cxxlog.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000006663�12256773774�013315� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <algorithm> #include <iterator> #include <cxxtools/arg.h> #include <cxxtools/log.h> // Normally the category parameter is a constant. // // log_define defines a function, which fetches a logger class using that // constant. Since this is done only the first time something is logged, it is // important to set the category before the first logging output statement. // std::string category; log_define(category) int main(int argc, char* argv[]) { try { cxxtools::Arg<bool> fatal(argc, argv, 'f'); cxxtools::Arg<bool> fatal_l(argc, argv, "--fatal"); cxxtools::Arg<bool> error(argc, argv, 'e'); cxxtools::Arg<bool> error_l(argc, argv, "--error"); cxxtools::Arg<bool> warn(argc, argv, 'w'); cxxtools::Arg<bool> warn_l(argc, argv, "--warn"); cxxtools::Arg<bool> info(argc, argv, 'i'); cxxtools::Arg<bool> info_l(argc, argv, "--info"); cxxtools::Arg<bool> debug(argc, argv, 'd'); cxxtools::Arg<bool> debug_l(argc, argv, "--debug"); cxxtools::Arg<std::string> properties(argc, argv, 'p', "log.properties"); cxxtools::Arg<std::string> properties_l(argc, argv, "--properties", properties); if (argc <= 2) { std::cerr << "usage: " << argv[0] << " options category message\n" "\toptions: -f|--fatal\n" "\t -e|--error\n" "\t -w|--warn\n" "\t -i|--info\n" "\t -d|--debug\n" "\t -p|--properties filename" << std::endl; return -1; } category = argv[1]; log_init(properties_l.getValue()); std::ostringstream msg; std::copy(argv + 2, argv + argc, std::ostream_iterator<char*>(msg, " ")); if (fatal || fatal_l) log_fatal(msg.str()); if (error || error_l) log_error(msg.str()); if (warn || warn_l) log_warn(msg.str()); if (info || info_l) log_info(msg.str()); if (debug || debug_l) log_debug(msg.str()); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } �����������������������������������������������������������������������������cxxtools-2.2.1/demo/dlloader.cpp��������������������������������������������������������������������0000664�0001750�0001750�00000004557�12256773774�013577� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <exception> #include <iostream> #include <cxxtools/dlloader.h> #include <cxxtools/log.h> typedef double (*function_type)(double); // to run the program you may have to set LTDL_LIBRARY_PATH // to the path of libm.so int main(int argc, char* argv[]) { try { log_init(); if (argc == 1) { std::cout << "load libm.so" << std::endl; cxxtools::dl::Library lib("m"); std::cout << "sym cos" << std::endl; function_type cosine = (function_type)(lib["cos"]); std::cout << "call cos" << std::endl; std::cout << "cos(2.0) = " << cosine(2.0) << std::endl; } else { std::cout << "load " << argv[1] << std::endl; cxxtools::dl::Library lib(argv[1]); for (int a = 2; argv[a]; ++a) { std::cout << "sym " << argv[a] << std::endl; cxxtools::dl::Symbol sym = lib.getSymbol(argv[a]); std::cout << " => " << static_cast<void*>(sym) << std::endl; } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } �������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/getini.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000005520�12256773774�013257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <exception> #include <iostream> #include <fstream> #include <iterator> #include <stdexcept> #include <cxxtools/inifile.h> #include <cxxtools/log.h> #include <cxxtools/arg.h> int main(int argc, char* argv[]) { log_init(); try { cxxtools::Arg<bool> quiet(argc, argv, 'q'); if (argc <= 1) { std::cerr << "usage: " << argv[0] << " inifile [-q] [section [key [default]]]" << std::endl; return -1; } const char* fname = argv[1]; std::ifstream in(fname); if (!in) throw std::runtime_error(std::string("error reading input file \"") + fname + '"'); cxxtools::IniFile ini(in); if (argc <= 2) { // list sections if (!quiet) std::cout << "sections in " << fname << ": "; ini.getSections(std::ostream_iterator<std::string>(std::cout, "\t")); std::cout << std::endl; return 0; } const char* section = argv[2]; if (argc <= 3) { // list keys if (!quiet) std::cout << "keys in " << fname << " [" << section << "]: "; ini.getKeys(section, std::ostream_iterator<std::string>(std::cout, "\t")); std::cout << std::endl; return 0; } const char* key = argv[3]; const char* defvalue = argv[4] ? argv[4] : ""; if (!quiet) std::cout << "value of " << fname << " [" << section << "]." << key << ": "; std::cout << ini.getValue(section, key, defvalue) << std::endl; } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/netmsg.cpp����������������������������������������������������������������������0000664�0001750�0001750�00000010772�12256773774�013302� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/net/udp.h> #include <cxxtools/arg.h> #include <cxxtools/log.h> #include <vector> #include <iostream> void usage(const char* progname) { std::cerr << "usage: " << progname << " [-h host] [-p port] [-e] {message}\n" " " << progname << " -l [-h host] [-p port] [-s size] [-c] [-e] [-n]\n" "options:\n" " -l receiver-mode\n" " -h host hostname (default localhost in sender, any in receiver)\n" " -p port udp-port to use\n" " -s size size of receive-buffer in bytes (default 1024)\n" " -c continuous-mode - don't stop after receiving message\n" " -e echo message back or receive echo-reply\n" " -n don't output newline\n" " -b enable broadcast" << std::endl; } int main(int argc, char* argv[]) { try { cxxtools::Arg<bool> help(argc, argv, '?'); if (help) { usage(argv[0]); return 0; } cxxtools::Arg<bool> receive(argc, argv, 'l'); cxxtools::Arg<unsigned short> port(argc, argv, 'p', 1234); cxxtools::Arg<bool> echo(argc, argv, 'e'); cxxtools::Arg<bool> nonewline(argc, argv, 'n'); cxxtools::Arg<int> timeout(argc, argv, 't', 0); log_init(); if (receive) { cxxtools::Arg<unsigned> size(argc, argv, 's', 1024); cxxtools::Arg<std::string> host(argc, argv, 'h'); cxxtools::Arg<bool> continuous(argc, argv, 'c'); if (argc > 1) { usage(argv[0]); return -1; } cxxtools::net::UdpReceiver receiver(host, port); if (timeout.isSet()) receiver.setTimeout(timeout); std::vector<char> buffer(size); std::cout << "waiting for messages on port " << port << std::endl; do { cxxtools::net::UdpReceiver::size_type s = receiver.recv(&buffer[0], size); std::string msg(&buffer[0], s); std::cout << msg; if (!nonewline) std::cout << std::endl; else std::cout.flush(); if (echo) receiver.send(msg); } while (continuous); } else { cxxtools::Arg<std::string> host(argc, argv, 'h'); cxxtools::Arg<bool> broadcast(argc, argv, 'b'); if (argc <= 1) { usage(argv[0]); return -1; } cxxtools::net::UdpSender sender(host, port, broadcast); if (timeout.isSet()) sender.setTimeout(timeout); for (int a = 1; a < argc; ++a) { std::string msg = argv[a]; std::cout << "send message \"" << msg << "\" to " << host << ':' << port << std::endl; cxxtools::net::UdpSender::size_type n = sender.send(msg); std::cout << n << " bytes sent " << msg.size() << " bytes queued" << std::endl; if (echo) { std::string reply = sender.recv(msg.size()); std::cout << "reply: " << reply; if (!nonewline) std::cout << std::endl; else std::cout.flush(); } } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ������cxxtools-2.2.1/demo/Makefile.in���������������������������������������������������������������������0000664�0001750�0001750�00000101257�12266277545�013341� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.12.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = arg$(EXEEXT) arg-set$(EXEEXT) cgi$(EXEEXT) \ dir$(EXEEXT) dlloader$(EXEEXT) getini$(EXEEXT) hd$(EXEEXT) \ httprequest$(EXEEXT) httpserver$(EXEEXT) log$(EXEEXT) \ logbench$(EXEEXT) logsh$(EXEEXT) md5sum$(EXEEXT) mime$(EXEEXT) \ multifstream$(EXEEXT) netcat$(EXEEXT) netio$(EXEEXT) \ netmsg$(EXEEXT) pipestream$(EXEEXT) pool$(EXEEXT) \ signals$(EXEEXT) thread$(EXEEXT) threadpool$(EXEEXT) \ uuencode$(EXEEXT) cxxlog$(EXEEXT) rpcserver$(EXEEXT) \ rpcechoclient$(EXEEXT) rpcaddclient$(EXEEXT) splitter$(EXEEXT) \ json$(EXEEXT) regex$(EXEEXT) execLs$(EXEEXT) \ rpcasyncaddclient$(EXEEXT) $(am__EXEEXT_1) @MAKE_ICONVSTREAM_TRUE@am__append_1 = iconv subdir = demo DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/asmtype.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @MAKE_ICONVSTREAM_TRUE@am__EXEEXT_1 = iconv$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_arg_OBJECTS = arg.$(OBJEXT) arg_OBJECTS = $(am_arg_OBJECTS) arg_LDADD = $(LDADD) arg_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_arg_set_OBJECTS = arg-set.$(OBJEXT) arg_set_OBJECTS = $(am_arg_set_OBJECTS) arg_set_LDADD = $(LDADD) arg_set_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_cgi_OBJECTS = cgi.$(OBJEXT) cgi_OBJECTS = $(am_cgi_OBJECTS) cgi_LDADD = $(LDADD) cgi_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_cxxlog_OBJECTS = cxxlog.$(OBJEXT) cxxlog_OBJECTS = $(am_cxxlog_OBJECTS) cxxlog_LDADD = $(LDADD) cxxlog_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_dir_OBJECTS = dir.$(OBJEXT) dir_OBJECTS = $(am_dir_OBJECTS) dir_LDADD = $(LDADD) dir_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_dlloader_OBJECTS = dlloader.$(OBJEXT) dlloader_OBJECTS = $(am_dlloader_OBJECTS) dlloader_LDADD = $(LDADD) dlloader_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_execLs_OBJECTS = execLs.$(OBJEXT) execLs_OBJECTS = $(am_execLs_OBJECTS) execLs_LDADD = $(LDADD) execLs_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_getini_OBJECTS = getini.$(OBJEXT) getini_OBJECTS = $(am_getini_OBJECTS) getini_LDADD = $(LDADD) getini_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_hd_OBJECTS = hd.$(OBJEXT) hd_OBJECTS = $(am_hd_OBJECTS) hd_LDADD = $(LDADD) hd_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_httprequest_OBJECTS = httprequest.$(OBJEXT) httprequest_OBJECTS = $(am_httprequest_OBJECTS) httprequest_DEPENDENCIES = $(HTTP_LIBS) am_httpserver_OBJECTS = httpserver.$(OBJEXT) httpserver_OBJECTS = $(am_httpserver_OBJECTS) httpserver_DEPENDENCIES = $(HTTP_LIBS) am__iconv_SOURCES_DIST = iconv.cpp @MAKE_ICONVSTREAM_TRUE@am_iconv_OBJECTS = iconv.$(OBJEXT) iconv_OBJECTS = $(am_iconv_OBJECTS) iconv_LDADD = $(LDADD) iconv_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_json_OBJECTS = json.$(OBJEXT) json_OBJECTS = $(am_json_OBJECTS) json_DEPENDENCIES = $(HTTP_LIBS) am_log_OBJECTS = log.$(OBJEXT) log_OBJECTS = $(am_log_OBJECTS) log_LDADD = $(LDADD) log_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_logbench_OBJECTS = logbench.$(OBJEXT) logbench_OBJECTS = $(am_logbench_OBJECTS) logbench_LDADD = $(LDADD) logbench_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_logsh_OBJECTS = logsh.$(OBJEXT) logsh_OBJECTS = $(am_logsh_OBJECTS) logsh_LDADD = $(LDADD) logsh_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_md5sum_OBJECTS = md5sum.$(OBJEXT) md5sum_OBJECTS = $(am_md5sum_OBJECTS) md5sum_LDADD = $(LDADD) md5sum_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_mime_OBJECTS = mime.$(OBJEXT) mime_OBJECTS = $(am_mime_OBJECTS) mime_LDADD = $(LDADD) mime_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_multifstream_OBJECTS = multifstream.$(OBJEXT) multifstream_OBJECTS = $(am_multifstream_OBJECTS) multifstream_LDADD = $(LDADD) multifstream_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_netcat_OBJECTS = netcat.$(OBJEXT) netcat_OBJECTS = $(am_netcat_OBJECTS) netcat_LDADD = $(LDADD) netcat_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_netio_OBJECTS = netio.$(OBJEXT) netio_OBJECTS = $(am_netio_OBJECTS) netio_LDADD = $(LDADD) netio_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_netmsg_OBJECTS = netmsg.$(OBJEXT) netmsg_OBJECTS = $(am_netmsg_OBJECTS) netmsg_LDADD = $(LDADD) netmsg_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_pipestream_OBJECTS = pipestream.$(OBJEXT) pipestream_OBJECTS = $(am_pipestream_OBJECTS) pipestream_LDADD = $(LDADD) pipestream_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_pool_OBJECTS = pool.$(OBJEXT) pool_OBJECTS = $(am_pool_OBJECTS) pool_LDADD = $(LDADD) pool_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_regex_OBJECTS = regex.$(OBJEXT) regex_OBJECTS = $(am_regex_OBJECTS) regex_LDADD = $(LDADD) regex_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_rpcaddclient_OBJECTS = rpcaddclient.$(OBJEXT) rpcaddclient_OBJECTS = $(am_rpcaddclient_OBJECTS) rpcaddclient_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) am_rpcasyncaddclient_OBJECTS = rpcasyncaddclient.$(OBJEXT) rpcasyncaddclient_OBJECTS = $(am_rpcasyncaddclient_OBJECTS) rpcasyncaddclient_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) \ $(JSON_LIBS) am_rpcechoclient_OBJECTS = rpcechoclient.$(OBJEXT) rpcechoclient_OBJECTS = $(am_rpcechoclient_OBJECTS) rpcechoclient_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) am_rpcserver_OBJECTS = rpcserver.$(OBJEXT) rpcserver_OBJECTS = $(am_rpcserver_OBJECTS) rpcserver_DEPENDENCIES = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) am_signals_OBJECTS = signals.$(OBJEXT) signals_OBJECTS = $(am_signals_OBJECTS) signals_LDADD = $(LDADD) signals_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_splitter_OBJECTS = splitter.$(OBJEXT) splitter_OBJECTS = $(am_splitter_OBJECTS) splitter_LDADD = $(LDADD) splitter_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_thread_OBJECTS = thread.$(OBJEXT) thread_OBJECTS = $(am_thread_OBJECTS) thread_LDADD = $(LDADD) thread_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_threadpool_OBJECTS = threadpool.$(OBJEXT) threadpool_OBJECTS = $(am_threadpool_OBJECTS) threadpool_LDADD = $(LDADD) threadpool_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la am_uuencode_OBJECTS = uuencode.$(OBJEXT) uuencode_OBJECTS = $(am_uuencode_OBJECTS) uuencode_LDADD = $(LDADD) uuencode_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(arg_SOURCES) $(arg_set_SOURCES) $(cgi_SOURCES) \ $(cxxlog_SOURCES) $(dir_SOURCES) $(dlloader_SOURCES) \ $(execLs_SOURCES) $(getini_SOURCES) $(hd_SOURCES) \ $(httprequest_SOURCES) $(httpserver_SOURCES) $(iconv_SOURCES) \ $(json_SOURCES) $(log_SOURCES) $(logbench_SOURCES) \ $(logsh_SOURCES) $(md5sum_SOURCES) $(mime_SOURCES) \ $(multifstream_SOURCES) $(netcat_SOURCES) $(netio_SOURCES) \ $(netmsg_SOURCES) $(pipestream_SOURCES) $(pool_SOURCES) \ $(regex_SOURCES) $(rpcaddclient_SOURCES) \ $(rpcasyncaddclient_SOURCES) $(rpcechoclient_SOURCES) \ $(rpcserver_SOURCES) $(signals_SOURCES) $(splitter_SOURCES) \ $(thread_SOURCES) $(threadpool_SOURCES) $(uuencode_SOURCES) DIST_SOURCES = $(arg_SOURCES) $(arg_set_SOURCES) $(cgi_SOURCES) \ $(cxxlog_SOURCES) $(dir_SOURCES) $(dlloader_SOURCES) \ $(execLs_SOURCES) $(getini_SOURCES) $(hd_SOURCES) \ $(httprequest_SOURCES) $(httpserver_SOURCES) \ $(am__iconv_SOURCES_DIST) $(json_SOURCES) $(log_SOURCES) \ $(logbench_SOURCES) $(logsh_SOURCES) $(md5sum_SOURCES) \ $(mime_SOURCES) $(multifstream_SOURCES) $(netcat_SOURCES) \ $(netio_SOURCES) $(netmsg_SOURCES) $(pipestream_SOURCES) \ $(pool_SOURCES) $(regex_SOURCES) $(rpcaddclient_SOURCES) \ $(rpcasyncaddclient_SOURCES) $(rpcechoclient_SOURCES) \ $(rpcserver_SOURCES) $(signals_SOURCES) $(splitter_SOURCES) \ $(thread_SOURCES) $(threadpool_SOURCES) $(uuencode_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(noinst_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXTOOLS_ATOMICITY = @CXXTOOLS_ATOMICITY@ CXXTOOLS_CXXFLAGS = @CXXTOOLS_CXXFLAGS@ CXXTOOLS_LDFLAGS = @CXXTOOLS_LDFLAGS@ CXXTOOLS_STD_LOCALE = @CXXTOOLS_STD_LOCALE@ CXXTOOLS_SUSECONDS = @CXXTOOLS_SUSECONDS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_LONG_LONG = @HAVE_LONG_LONG@ HAVE_REVERSE_ITERATOR = @HAVE_REVERSE_ITERATOR@ HAVE_REVERSE_ITERATOR_4 = @HAVE_REVERSE_ITERATOR_4@ HAVE_UNSIGNED_LONG_LONG = @HAVE_UNSIGNED_LONG_LONG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHARED_LIB_FLAG = @SHARED_LIB_FLAG@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sonumber = @sonumber@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ arg_SOURCES = arg.cpp arg_set_SOURCES = arg-set.cpp cgi_SOURCES = cgi.cpp dir_SOURCES = dir.cpp dlloader_SOURCES = dlloader.cpp getini_SOURCES = getini.cpp hd_SOURCES = hd.cpp httprequest_SOURCES = httprequest.cpp httpserver_SOURCES = httpserver.cpp log_SOURCES = log.cpp logbench_SOURCES = logbench.cpp logsh_SOURCES = logsh.cpp md5sum_SOURCES = md5sum.cpp mime_SOURCES = mime.cpp multifstream_SOURCES = multifstream.cpp netcat_SOURCES = netcat.cpp netio_SOURCES = netio.cpp netmsg_SOURCES = netmsg.cpp pipestream_SOURCES = pipestream.cpp pool_SOURCES = pool.cpp signals_SOURCES = signals.cpp thread_SOURCES = thread.cpp threadpool_SOURCES = threadpool.cpp uuencode_SOURCES = uuencode.cpp cxxlog_SOURCES = cxxlog.cpp rpcserver_SOURCES = rpcserver.cpp rpcechoclient_SOURCES = rpcechoclient.cpp rpcaddclient_SOURCES = rpcaddclient.cpp splitter_SOURCES = splitter.cpp json_SOURCES = json.cpp regex_SOURCES = regex.cpp execLs_SOURCES = execLs.cpp rpcasyncaddclient_SOURCES = rpcasyncaddclient.cpp @MAKE_ICONVSTREAM_TRUE@iconv_SOURCES = iconv.cpp BASE_LIBS = $(top_builddir)/src/libcxxtools.la HTTP_LIBS = $(BASE_LIBS) $(top_builddir)/src/http/libcxxtools-http.la XMLRPC_LIBS = $(BASE_LIBS) $(top_builddir)/src/xmlrpc/libcxxtools-xmlrpc.la BIN_LIBS = $(HTTP_LIBS) $(top_builddir)/src/bin/libcxxtools-bin.la JSON_LIBS = $(HTTP_LIBS) $(top_builddir)/src/json/libcxxtools-json.la AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = $(top_builddir)/src/libcxxtools.la httpserver_LDADD = $(HTTP_LIBS) httprequest_LDADD = $(HTTP_LIBS) rpcserver_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcechoclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) rpcaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) json_LDADD = $(HTTP_LIBS) rpcasyncaddclient_LDADD = $(XMLRPC_LIBS) $(BIN_LIBS) $(JSON_LIBS) noinst_DATA = log.xml CLEANFILES = log.xml EXTRA_DIST = README all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu demo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu demo/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list arg$(EXEEXT): $(arg_OBJECTS) $(arg_DEPENDENCIES) $(EXTRA_arg_DEPENDENCIES) @rm -f arg$(EXEEXT) $(CXXLINK) $(arg_OBJECTS) $(arg_LDADD) $(LIBS) arg-set$(EXEEXT): $(arg_set_OBJECTS) $(arg_set_DEPENDENCIES) $(EXTRA_arg_set_DEPENDENCIES) @rm -f arg-set$(EXEEXT) $(CXXLINK) $(arg_set_OBJECTS) $(arg_set_LDADD) $(LIBS) cgi$(EXEEXT): $(cgi_OBJECTS) $(cgi_DEPENDENCIES) $(EXTRA_cgi_DEPENDENCIES) @rm -f cgi$(EXEEXT) $(CXXLINK) $(cgi_OBJECTS) $(cgi_LDADD) $(LIBS) cxxlog$(EXEEXT): $(cxxlog_OBJECTS) $(cxxlog_DEPENDENCIES) $(EXTRA_cxxlog_DEPENDENCIES) @rm -f cxxlog$(EXEEXT) $(CXXLINK) $(cxxlog_OBJECTS) $(cxxlog_LDADD) $(LIBS) dir$(EXEEXT): $(dir_OBJECTS) $(dir_DEPENDENCIES) $(EXTRA_dir_DEPENDENCIES) @rm -f dir$(EXEEXT) $(CXXLINK) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) dlloader$(EXEEXT): $(dlloader_OBJECTS) $(dlloader_DEPENDENCIES) $(EXTRA_dlloader_DEPENDENCIES) @rm -f dlloader$(EXEEXT) $(CXXLINK) $(dlloader_OBJECTS) $(dlloader_LDADD) $(LIBS) execLs$(EXEEXT): $(execLs_OBJECTS) $(execLs_DEPENDENCIES) $(EXTRA_execLs_DEPENDENCIES) @rm -f execLs$(EXEEXT) $(CXXLINK) $(execLs_OBJECTS) $(execLs_LDADD) $(LIBS) getini$(EXEEXT): $(getini_OBJECTS) $(getini_DEPENDENCIES) $(EXTRA_getini_DEPENDENCIES) @rm -f getini$(EXEEXT) $(CXXLINK) $(getini_OBJECTS) $(getini_LDADD) $(LIBS) hd$(EXEEXT): $(hd_OBJECTS) $(hd_DEPENDENCIES) $(EXTRA_hd_DEPENDENCIES) @rm -f hd$(EXEEXT) $(CXXLINK) $(hd_OBJECTS) $(hd_LDADD) $(LIBS) httprequest$(EXEEXT): $(httprequest_OBJECTS) $(httprequest_DEPENDENCIES) $(EXTRA_httprequest_DEPENDENCIES) @rm -f httprequest$(EXEEXT) $(CXXLINK) $(httprequest_OBJECTS) $(httprequest_LDADD) $(LIBS) httpserver$(EXEEXT): $(httpserver_OBJECTS) $(httpserver_DEPENDENCIES) $(EXTRA_httpserver_DEPENDENCIES) @rm -f httpserver$(EXEEXT) $(CXXLINK) $(httpserver_OBJECTS) $(httpserver_LDADD) $(LIBS) iconv$(EXEEXT): $(iconv_OBJECTS) $(iconv_DEPENDENCIES) $(EXTRA_iconv_DEPENDENCIES) @rm -f iconv$(EXEEXT) $(CXXLINK) $(iconv_OBJECTS) $(iconv_LDADD) $(LIBS) json$(EXEEXT): $(json_OBJECTS) $(json_DEPENDENCIES) $(EXTRA_json_DEPENDENCIES) @rm -f json$(EXEEXT) $(CXXLINK) $(json_OBJECTS) $(json_LDADD) $(LIBS) log$(EXEEXT): $(log_OBJECTS) $(log_DEPENDENCIES) $(EXTRA_log_DEPENDENCIES) @rm -f log$(EXEEXT) $(CXXLINK) $(log_OBJECTS) $(log_LDADD) $(LIBS) logbench$(EXEEXT): $(logbench_OBJECTS) $(logbench_DEPENDENCIES) $(EXTRA_logbench_DEPENDENCIES) @rm -f logbench$(EXEEXT) $(CXXLINK) $(logbench_OBJECTS) $(logbench_LDADD) $(LIBS) logsh$(EXEEXT): $(logsh_OBJECTS) $(logsh_DEPENDENCIES) $(EXTRA_logsh_DEPENDENCIES) @rm -f logsh$(EXEEXT) $(CXXLINK) $(logsh_OBJECTS) $(logsh_LDADD) $(LIBS) md5sum$(EXEEXT): $(md5sum_OBJECTS) $(md5sum_DEPENDENCIES) $(EXTRA_md5sum_DEPENDENCIES) @rm -f md5sum$(EXEEXT) $(CXXLINK) $(md5sum_OBJECTS) $(md5sum_LDADD) $(LIBS) mime$(EXEEXT): $(mime_OBJECTS) $(mime_DEPENDENCIES) $(EXTRA_mime_DEPENDENCIES) @rm -f mime$(EXEEXT) $(CXXLINK) $(mime_OBJECTS) $(mime_LDADD) $(LIBS) multifstream$(EXEEXT): $(multifstream_OBJECTS) $(multifstream_DEPENDENCIES) $(EXTRA_multifstream_DEPENDENCIES) @rm -f multifstream$(EXEEXT) $(CXXLINK) $(multifstream_OBJECTS) $(multifstream_LDADD) $(LIBS) netcat$(EXEEXT): $(netcat_OBJECTS) $(netcat_DEPENDENCIES) $(EXTRA_netcat_DEPENDENCIES) @rm -f netcat$(EXEEXT) $(CXXLINK) $(netcat_OBJECTS) $(netcat_LDADD) $(LIBS) netio$(EXEEXT): $(netio_OBJECTS) $(netio_DEPENDENCIES) $(EXTRA_netio_DEPENDENCIES) @rm -f netio$(EXEEXT) $(CXXLINK) $(netio_OBJECTS) $(netio_LDADD) $(LIBS) netmsg$(EXEEXT): $(netmsg_OBJECTS) $(netmsg_DEPENDENCIES) $(EXTRA_netmsg_DEPENDENCIES) @rm -f netmsg$(EXEEXT) $(CXXLINK) $(netmsg_OBJECTS) $(netmsg_LDADD) $(LIBS) pipestream$(EXEEXT): $(pipestream_OBJECTS) $(pipestream_DEPENDENCIES) $(EXTRA_pipestream_DEPENDENCIES) @rm -f pipestream$(EXEEXT) $(CXXLINK) $(pipestream_OBJECTS) $(pipestream_LDADD) $(LIBS) pool$(EXEEXT): $(pool_OBJECTS) $(pool_DEPENDENCIES) $(EXTRA_pool_DEPENDENCIES) @rm -f pool$(EXEEXT) $(CXXLINK) $(pool_OBJECTS) $(pool_LDADD) $(LIBS) regex$(EXEEXT): $(regex_OBJECTS) $(regex_DEPENDENCIES) $(EXTRA_regex_DEPENDENCIES) @rm -f regex$(EXEEXT) $(CXXLINK) $(regex_OBJECTS) $(regex_LDADD) $(LIBS) rpcaddclient$(EXEEXT): $(rpcaddclient_OBJECTS) $(rpcaddclient_DEPENDENCIES) $(EXTRA_rpcaddclient_DEPENDENCIES) @rm -f rpcaddclient$(EXEEXT) $(CXXLINK) $(rpcaddclient_OBJECTS) $(rpcaddclient_LDADD) $(LIBS) rpcasyncaddclient$(EXEEXT): $(rpcasyncaddclient_OBJECTS) $(rpcasyncaddclient_DEPENDENCIES) $(EXTRA_rpcasyncaddclient_DEPENDENCIES) @rm -f rpcasyncaddclient$(EXEEXT) $(CXXLINK) $(rpcasyncaddclient_OBJECTS) $(rpcasyncaddclient_LDADD) $(LIBS) rpcechoclient$(EXEEXT): $(rpcechoclient_OBJECTS) $(rpcechoclient_DEPENDENCIES) $(EXTRA_rpcechoclient_DEPENDENCIES) @rm -f rpcechoclient$(EXEEXT) $(CXXLINK) $(rpcechoclient_OBJECTS) $(rpcechoclient_LDADD) $(LIBS) rpcserver$(EXEEXT): $(rpcserver_OBJECTS) $(rpcserver_DEPENDENCIES) $(EXTRA_rpcserver_DEPENDENCIES) @rm -f rpcserver$(EXEEXT) $(CXXLINK) $(rpcserver_OBJECTS) $(rpcserver_LDADD) $(LIBS) signals$(EXEEXT): $(signals_OBJECTS) $(signals_DEPENDENCIES) $(EXTRA_signals_DEPENDENCIES) @rm -f signals$(EXEEXT) $(CXXLINK) $(signals_OBJECTS) $(signals_LDADD) $(LIBS) splitter$(EXEEXT): $(splitter_OBJECTS) $(splitter_DEPENDENCIES) $(EXTRA_splitter_DEPENDENCIES) @rm -f splitter$(EXEEXT) $(CXXLINK) $(splitter_OBJECTS) $(splitter_LDADD) $(LIBS) thread$(EXEEXT): $(thread_OBJECTS) $(thread_DEPENDENCIES) $(EXTRA_thread_DEPENDENCIES) @rm -f thread$(EXEEXT) $(CXXLINK) $(thread_OBJECTS) $(thread_LDADD) $(LIBS) threadpool$(EXEEXT): $(threadpool_OBJECTS) $(threadpool_DEPENDENCIES) $(EXTRA_threadpool_DEPENDENCIES) @rm -f threadpool$(EXEEXT) $(CXXLINK) $(threadpool_OBJECTS) $(threadpool_LDADD) $(LIBS) uuencode$(EXEEXT): $(uuencode_OBJECTS) $(uuencode_DEPENDENCIES) $(EXTRA_uuencode_DEPENDENCIES) @rm -f uuencode$(EXEEXT) $(CXXLINK) $(uuencode_OBJECTS) $(uuencode_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg-set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cxxlog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlloader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execLs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getini.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httprequest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logbench.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logsh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5sum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multifstream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netcat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netmsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipestream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcaddclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcasyncaddclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcechoclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcserver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splitter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadpool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuencode.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am log.xml: /bin/sh $(top_builddir)/cxxtools-config --logxml cxxtools >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/dir.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000005332�12256773774�012557� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/directory.h> #include <cxxtools/fileinfo.h> #include <cxxtools/arg.h> #include <iterator> int main(int argc, char* argv[]) { try { cxxtools::Arg<bool> longdir(argc, argv, 'l'); cxxtools::Arg<bool> showHidden(argc, argv, 'h'); for (int a = 1; a < argc; ++a) { std::cout << "directory content of \"" << argv[a] << "\":\n"; cxxtools::Directory d(argv[a]); for (cxxtools::Directory::const_iterator it = d.begin(!showHidden); it != d.end(); ++it) { if (longdir) { cxxtools::FileInfo fi(it); switch (fi.type()) { case cxxtools::FileInfo::Directory: std::cout << 'D'; break; case cxxtools::FileInfo::File: std::cout << '-'; break; case cxxtools::FileInfo::Chardev: std::cout << 'C'; break; case cxxtools::FileInfo::Blockdev: std::cout << 'B'; break; case cxxtools::FileInfo::Fifo: std::cout << 'F'; break; case cxxtools::FileInfo::Symlink: std::cout << 'S'; break; default: std::cout << '?'; break; } std::cout << '\t' << fi.size() << '\t' << fi.name() << '\n'; } else { std::cout << *it << '\n'; } } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/cgi.cpp�������������������������������������������������������������������������0000664�0001750�0001750�00000005653�12256773774�012551� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <exception> #include <iostream> #include <cxxtools/cgi.h> #include <cxxtools/xmltag.h> #include <cxxtools/arg.h> int cgidemo() { cxxtools::Cgi q; // this parses all input-parameters // print standard-header std::cout << cxxtools::Cgi::header(); cxxtools::Xmltag html("html"); // start html-block cxxtools::Xmltag body("body"); // start body-block cxxtools::Xmltag form("form"); // start form std::cout << "<input type=\"text\" name=\"v\">" "<br>" "<input type=\"submit\">"; form.close(); // alternative 1: explicitly trigger closing form-tag std::cout << "<hr>\n" "you entered: "; { cxxtools::Xmltag bold("b"); // bold here in an embedded scope std::cout << q["v"]; } // alternative 2: implicitly closing bold-tag by leaving scope // automatically close body and html by leaving scope return 0; } int tagstest() { cxxtools::Xmltag("html"); // prints <html></html> std::cout << '\n'; cxxtools::Xmltag("test param=1"); // prints <test param=1></test> std::cout << '\n'; cxxtools::Xmltag("<noparam>"); // prints <noparam></noparam> std::cout << '\n'; cxxtools::Xmltag("<param p=1>"); // prints <param p=1></param> std::cout << '\n'; cxxtools::Xmltag("<param>", "p=1"); // prints <param p=1></param> std::cout << '\n'; cxxtools::Xmltag("<br>").clear(); // prints <br> std::cout << '\n'; std::cout << std::endl; return 0; } int main(int argc, char* argv[]) { cxxtools::Arg<bool> do_tagstest(argc, argv, 't'); return do_tagstest ? tagstest() : cgidemo(); } �������������������������������������������������������������������������������������cxxtools-2.2.1/demo/rpcechoclient.cpp���������������������������������������������������������������0000664�0001750�0001750�00000006245�12266277345�014621� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <iostream> #include <cxxtools/arg.h> #include <cxxtools/log.h> #include <cxxtools/remoteprocedure.h> #include <cxxtools/xmlrpc/httpclient.h> #include <cxxtools/bin/rpcclient.h> #include <cxxtools/json/rpcclient.h> #include <cxxtools/json/httpclient.h> //////////////////////////////////////////////////////////////////////// // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg<std::string> ip(argc, argv, 'i'); cxxtools::Arg<bool> binary(argc, argv, 'b'); cxxtools::Arg<bool> json(argc, argv, 'j'); cxxtools::Arg<bool> jsonhttp(argc, argv, 'J'); cxxtools::Arg<unsigned short> port(argc, argv, 'p', binary ? 7003 : json ? 7004 : 7002); // define a xlmrpc client cxxtools::xmlrpc::HttpClient xmlrpcClient(ip, port, "/xmlrpc"); // and a binary rpc client cxxtools::bin::RpcClient binaryClient(ip, port); // and a json rpc client cxxtools::json::RpcClient jsonClient(ip, port); // and a json rpc http client cxxtools::json::HttpClient jsonHttpClient(ip, port, "/jsonrpc"); // define remote procedure with std::string return value and a std::string parameter, // which uses one of the clients cxxtools::RemoteProcedure<std::string, std::string> echo( binary ? static_cast<cxxtools::RemoteClient&>(binaryClient) : json ? static_cast<cxxtools::RemoteClient&>(jsonClient) : jsonhttp ? static_cast<cxxtools::RemoteClient&>(jsonHttpClient) : static_cast<cxxtools::RemoteClient&>(xmlrpcClient), "echo"); for (int a = 1; a < argc; ++a) { std::string v = echo(argv[a]); std::cout << v << '\n'; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cxxtools-2.2.1/demo/httpserver.cpp������������������������������������������������������������������0000664�0001750�0001750�00000007711�12256773774�014212� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <cxxtools/http/server.h> #include <cxxtools/http/request.h> #include <cxxtools/http/reply.h> #include <cxxtools/http/responder.h> #include <cxxtools/eventloop.h> #include <cxxtools/regex.h> #include <cxxtools/log.h> #include <cxxtools/arg.h> log_define("cxxtools.demo.httpserver") // HelloResponder // class HelloResponder : public cxxtools::http::Responder { public: explicit HelloResponder(cxxtools::http::Service& service) : cxxtools::http::Responder(service) { } virtual void reply(std::ostream&, cxxtools::http::Request& request, cxxtools::http::Reply& reply); }; void HelloResponder::reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) { log_debug("send hello"); reply.addHeader("Content-Type", "text/html"); out << "<html>\n" " <head>\n" " <title>Hello World-application\n" " \n" " \n" "

Hello World

\n" " \n" "\n"; } // HelloService // typedef cxxtools::http::CachedService HelloService; // implement authenticator // class MyAuthenticator : public cxxtools::http::Authenticator { public: virtual bool checkAuth(const cxxtools::http::Request&) const; }; bool MyAuthenticator::checkAuth(const cxxtools::http::Request& request) const { cxxtools::http::Request::Auth auth = request.auth(); if (auth.user != "cxxtools" || auth.password != "mypassword") return false; return true; } // main // int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg listenIp(argc, argv, 'l'); cxxtools::Arg listenPort(argc, argv, 'p', 8001); cxxtools::Arg auth(argc, argv, 'a'); cxxtools::EventLoop loop; cxxtools::http::Server server(loop, listenIp, listenPort); cxxtools::Arg minThreads(argc, argv, 't', server.minThreads()); cxxtools::Arg maxThreads(argc, argv, 'T', server.maxThreads()); server.minThreads(minThreads); server.maxThreads(maxThreads); // collect additional ports to listen on while (true) { cxxtools::Arg listenPort(argc, argv, 'p'); if (!listenPort.isSet()) break; server.listen(listenIp, listenPort); } HelloService service; MyAuthenticator authenticator; if (auth) service.addAuthenticator(&authenticator); server.addService(cxxtools::Regex("ll"), service); //server.addService("/hello", service); loop.run(); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-2.2.1/demo/threadpool.cpp0000664000175000017500000000420612256773774014141 00000000000000/* * Copyright (C) 2010 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include cxxtools::Mutex mutex; unsigned count = 0; void funct() { for (unsigned n = 0; n < 10; ++n) { { cxxtools::MutexLock lock(mutex); std::cout << "Hello " << ++count << std::endl; } cxxtools::Thread::sleep(100); } } int main(int argc, char* argv[]) { try { cxxtools::Arg threads(argc, argv, 't', 5); cxxtools::Arg tasks(argc, argv, 'n', 20); cxxtools::Arg docancel(argc, argv, 'c'); cxxtools::ThreadPool p(threads); for (unsigned n = 0; n < tasks; ++n) p.schedule(cxxtools::callable(funct)); if (docancel) p.stop(docancel); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-2.2.1/demo/regex.cpp0000664000175000017500000000372212256773774013114 00000000000000/* * Copyright (C) 2011 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include int main(int argc, char* argv[]) { try { static cxxtools::Regex checkIpV4("^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)$"); for (int a = 1; a < argc; ++a) { cxxtools::RegexSMatch m; if (checkIpV4.match(argv[a], m)) { std::cout << argv[a] << " is a ipv4 address with components " << m[1] << " . " << m[2] << " . " << m[3] << " . " << m[4] << std::endl; } else { std::cout << argv[a] << " is not a ipv4 address" << std::endl; } } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-2.2.1/demo/thread.cpp0000664000175000017500000000751012256773774013250 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include cxxtools::Mutex coutMutex; cxxtools::Mutex conditionMutex; cxxtools::Condition running; #define PRINTLN(expr) \ do { \ cxxtools::MutexLock lock(coutMutex); \ std::cout << time(0) << ' ' << expr << std::endl; \ } while (false) class myDetachedThread : public cxxtools::DetachedThread { ~myDetachedThread(); protected: void run(); }; myDetachedThread::~myDetachedThread() { PRINTLN("myDetachedThread::~myDetachedThread() called"); } void myDetachedThread::run() { PRINTLN("myDetachedThread is starting"); cxxtools::MutexLock lock(conditionMutex); running.broadcast(); lock.unlock(); ::sleep(1); PRINTLN("myDetachedThread waits"); ::sleep(2); PRINTLN("myDetachedThread is ready"); } void someFunction() { PRINTLN("someFunction()"); ::sleep(1); PRINTLN("someFunction() ends"); } class AClass { std::string id; public: AClass(const std::string& id_) : id(id_) { } ~AClass() { PRINTLN("AClass::~AClass of object \"" << id << '"'); } void run() { PRINTLN("aFunction() of object \"" << id << '"'); ::sleep(1); PRINTLN("aFunction() of object \"" << id << "\" ends"); } }; int main() { try { cxxtools::MutexLock lock(conditionMutex); // detached threads are created on the heap. // They are deleted automatically when the thread ends. cxxtools::Thread* d = new myDetachedThread; d->create(); running.wait(lock); PRINTLN("myDetachedThread is running"); // run a function as a attached thread cxxtools::AttachedThread th( cxxtools::callable(someFunction) ); th.start(); // run a method of a object as a thread AClass aInstance("a instance"); AClass aInstance2("a instance 2"); cxxtools::AttachedThread aclassThread( cxxtools::callable(aInstance, &AClass::run) ); cxxtools::AttachedThread aclassThread2( cxxtools::callable(aInstance2, &AClass::run) ); aclassThread.start(); aclassThread2.start(); ::sleep(2); aclassThread.join(); aclassThread2.join(); // The detached thread is killed, if it does not come to an end before main. // The attached thread blocks the main-program, until it is ready. PRINTLN("main stops"); } catch (const std::exception& e) { std::cerr << "ERROR: " << e.what() << std::endl; } std::cout << "main stopped" << std::endl; } cxxtools-2.2.1/demo/netcat.cpp0000664000175000017500000000471512256773774013263 00000000000000/* * Copyright (C) 2003 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg ip(argc, argv, 'i'); cxxtools::Arg port(argc, argv, 'p', 1234); cxxtools::Arg bufsize(argc, argv, 'b', 8192); cxxtools::Arg listen(argc, argv, 'l'); cxxtools::Arg read_reply(argc, argv, 'r'); if (listen) { // I'm a server // listen to a port cxxtools::net::TcpServer server(ip.getValue(), port); // accept a connetion cxxtools::net::iostream worker(server, bufsize); // copy to stdout std::cout << worker.rdbuf(); } else { // I'm a client // connect to server cxxtools::net::iostream peer(ip, port, bufsize); // copy stdin to server peer << std::cin.rdbuf() << std::flush; if (read_reply) // copy answer to stdout std::cout << peer.rdbuf() << std::flush; } } catch (const std::exception& e) { std::cerr << e.what() << std::endl; } } cxxtools-2.2.1/demo/httprequest.cpp0000664000175000017500000001032112256773774014363 00000000000000/* * Copyright (C) 2003,2009 Tommi Maekitalo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * As a special exception, you may use this file as part of a free * software library without restriction. Specifically, if other files * instantiate templates or use macros or inline functions from this * file, or you compile this file and link it with other files to * produce an executable, this file does not by itself cause the * resulting executable to be covered by the GNU General Public * License. This exception does not however invalidate any other * reasons why the executable file might be covered by the GNU Library * General Public License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include class AsyncRequester : public cxxtools::Connectable { cxxtools::http::Client& _client; char** _argv; unsigned _wait; cxxtools::http::Request _request; cxxtools::EventLoop _loop; cxxtools::Timer _timer; std::size_t onBodyAvailable(cxxtools::http::Client& client); void onReady(cxxtools::http::Client& client); void onTimeout(); public: AsyncRequester(cxxtools::http::Client& client, char** argv, unsigned wait) : _client(client), _argv(argv), _wait(wait) { connect(_client.bodyAvailable, *this, &AsyncRequester::onBodyAvailable); connect(_client.replyFinished, *this, &AsyncRequester::onReady); connect(_timer.timeout, *this, &AsyncRequester::onTimeout); _client.setSelector(_loop); _loop.add(_timer); } void run() { if (*_argv) { _request.url(*_argv++); _client.beginExecute(_request); _loop.run(); } } }; std::size_t AsyncRequester::onBodyAvailable(cxxtools::http::Client& client) { char buffer[8192]; std::streamsize n = client.in().readsome(buffer, sizeof(buffer)); std::cout.write(buffer, n); return n; } void AsyncRequester::onReady(cxxtools::http::Client& client) { if (*_argv) { if (_wait) _timer.start(_wait); else { _request.url(*_argv++); client.beginExecute(_request); } } else { _loop.exit(); } } void AsyncRequester::onTimeout() { _timer.stop(); _request.url(*_argv++); _client.beginExecute(_request); } int main(int argc, char* argv[]) { try { log_init(); cxxtools::Arg user(argc, argv, 'u'); // passed as "username:password" cxxtools::Arg server(argc, argv, 's'); cxxtools::Arg port(argc, argv, 'p', 80); cxxtools::Arg async(argc, argv, 'a'); cxxtools::Arg wait(argc, argv, 'w'); // wait between requests in seconds cxxtools::http::Client client(server, port); if (user.isSet()) { std::string::size_type p = user.getValue().find(':'); if (p != std::string::npos) { client.auth(user.getValue().substr(0, p), user.getValue().substr(p + 1)); } else { client.auth(user, std::string()); } } if (async) { AsyncRequester ar(client, argv + 1, wait * 1000); ar.run(); } else { for (int a = 1; a < argc; ++a) { if (wait > 0 && a > 1) cxxtools::Thread::sleep(wait * 1000); std::cout << client.get(argv[a]); } } } catch (const std::exception& e) { std::cerr << "ERROR: " << e.what() << std::endl; } } cxxtools-2.2.1/configure0000775000175000017500000232437712266277546012274 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for cxxtools 2.2.1. # # Report bugs to >. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and Tommi Maekitalo $0: about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cxxtools' PACKAGE_TARNAME='cxxtools' PACKAGE_VERSION='2.2.1' PACKAGE_STRING='cxxtools 2.2.1' PACKAGE_BUGREPORT='Tommi Maekitalo ' PACKAGE_URL='' ac_unique_file="src/log.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS MAKE_UNITTEST_FALSE MAKE_UNITTEST_TRUE MAKE_DEMOS_FALSE MAKE_DEMOS_TRUE HAVE_REVERSE_ITERATOR_4 HAVE_REVERSE_ITERATOR CXXTOOLS_STD_LOCALE CXXTOOLS_SUSECONDS MAKE_ATOMICITY_GENERIC_FALSE MAKE_ATOMICITY_GENERIC_TRUE MAKE_ATOMICITY_PTHREAD_FALSE MAKE_ATOMICITY_PTHREAD_TRUE MAKE_ATOMICITY_GCC_AVR32_FALSE MAKE_ATOMICITY_GCC_AVR32_TRUE MAKE_ATOMICITY_GCC_SPARC64_FALSE MAKE_ATOMICITY_GCC_SPARC64_TRUE MAKE_ATOMICITY_GCC_SPARC32_FALSE MAKE_ATOMICITY_GCC_SPARC32_TRUE MAKE_ATOMICITY_GCC_X86_FALSE MAKE_ATOMICITY_GCC_X86_TRUE MAKE_ATOMICITY_GCC_X86_64_FALSE MAKE_ATOMICITY_GCC_X86_64_TRUE MAKE_ATOMICITY_GCC_PPC_FALSE MAKE_ATOMICITY_GCC_PPC_TRUE MAKE_ATOMICITY_GCC_MIPS_FALSE MAKE_ATOMICITY_GCC_MIPS_TRUE MAKE_ATOMICITY_GCC_ARM_FALSE MAKE_ATOMICITY_GCC_ARM_TRUE MAKE_ATOMICITY_WINDOWS_FALSE MAKE_ATOMICITY_WINDOWS_TRUE MAKE_ATOMICITY_SUN_FALSE MAKE_ATOMICITY_SUN_TRUE CXXTOOLS_ATOMICITY SHARED_LIB_FLAG CXXTOOLS_LDFLAGS CXXTOOLS_CXXFLAGS OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CXX PTHREAD_CC acx_pthread_config host_os host_vendor host_cpu host build_os build_vendor build_cpu build MAKE_ICONVSTREAM_FALSE MAKE_ICONVSTREAM_TRUE LTLIBICONV LIBICONV HAVE_UNSIGNED_LONG_LONG HAVE_LONG_LONG EGREP GREP CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC sonumber am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_iconvstream enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_atomictype enable_demos enable_unittest ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures cxxtools 2.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/cxxtools] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of cxxtools 2.2.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-demos disable building demos --disable-unittest disable building unittest Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-iconvstream=yes|no compile iconv stream (default: no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-atomictype force atomic type. Accepted arguments: sun, windows, att_x86, att_x86_64, att_arm, att_mips, att_ppc, att_sparc32, att_sparc64, pthread, generic, probe Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to >. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF cxxtools configure 2.2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to Tommi Maekitalo ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by cxxtools $as_me 2.2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.12' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='cxxtools' VERSION='2.2.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' abi_current=9 abi_revision=0 abi_age=0 sonumber=${abi_current}:${abi_revision}:${abi_age} unset CDPATH ac_config_headers="$ac_config_headers src/config.h" ac_config_files="$ac_config_files include/cxxtools/config.h" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler vendor" >&5 $as_echo_n "checking for C++ compiler vendor... " >&6; } if ${ax_cv_cxx_compiler_vendor+:} false; then : $as_echo_n "(cached) " >&6 else # note: don't check for gcc first since some other compilers define __GNUC__ vendors="intel: __ICC,__ECC,__INTEL_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ gnu: __GNUC__ sun: __SUNPRO_C,__SUNPRO_CC hp: __HP_cc,__HP_aCC dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland: __BORLANDC__,__TURBOC__ comeau: __COMO__ cray: _CRAYC kai: __KCC lcc: __LCC__ sgi: __sgi,sgi microsoft: _MSC_VER metrowerks: __MWERKS__ watcom: __WATCOMC__ portland: __PGI unknown: UNKNOWN" for ventest in $vendors; do case $ventest in *:) vendor=$ventest; continue ;; *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if !($vencpp) thisisanerror; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done ax_cv_cxx_compiler_vendor=`echo $vendor | cut -d: -f1` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compiler_vendor" >&5 $as_echo "$ax_cv_cxx_compiler_vendor" >&6; } if test "$ax_cv_cxx_compiler_vendor" = "ibm"; then : CPPFLAGS="$CPPFLAGS -qrtti -qlanglvl=newexcp -D__NOLOCK_ON_INPUT -D__NOLOCK_ON_OUTPUT" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wno-long-long" >&5 $as_echo_n "checking whether C++ compiler accepts -Wno-long-long... " >&6; } if ${ax_cv_check_cxxflags___Wno_long_long+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Wno-long-long" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___Wno_long_long=yes else ax_cv_check_cxxflags___Wno_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wno_long_long" >&5 $as_echo "$ax_cv_check_cxxflags___Wno_long_long" >&6; } if test x"$ax_cv_check_cxxflags___Wno_long_long" = xyes; then : CPPFLAGS="$CPPFLAGS -Wno-long-long" else : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wall" >&5 $as_echo_n "checking whether C++ compiler accepts -Wall... " >&6; } if ${ax_cv_check_cxxflags___Wall+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___Wall=yes else ax_cv_check_cxxflags___Wall=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wall" >&5 $as_echo "$ax_cv_check_cxxflags___Wall" >&6; } if test x"$ax_cv_check_cxxflags___Wall" = xyes; then : CPPFLAGS="$CPPFLAGS -Wall" else : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -pedantic" >&5 $as_echo_n "checking whether C++ compiler accepts -pedantic... " >&6; } if ${ax_cv_check_cxxflags___pedantic+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -pedantic" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_check_cxxflags___pedantic=yes else ax_cv_check_cxxflags___pedantic=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___pedantic" >&5 $as_echo "$ax_cv_check_cxxflags___pedantic" >&6; } if test x"$ax_cv_check_cxxflags___pedantic" = xyes; then : CPPFLAGS="$CPPFLAGS -pedantic" else : fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/filio.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_filio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_FILIO_H 1 _ACEOF fi done for ac_header in csignal do : ac_fn_cxx_check_header_mongrel "$LINENO" "csignal" "ac_cv_header_csignal" "$ac_includes_default" if test "x$ac_cv_header_csignal" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CSIGNAL 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lnsl" >&5 $as_echo_n "checking for setsockopt in -lnsl... " >&6; } if ${ac_cv_lib_nsl_setsockopt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_nsl_setsockopt=yes else ac_cv_lib_nsl_setsockopt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_setsockopt" >&5 $as_echo "$ac_cv_lib_nsl_setsockopt" >&6; } if test "x$ac_cv_lib_nsl_setsockopt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept in -lsocket" >&5 $as_echo_n "checking for accept in -lsocket... " >&6; } if ${ac_cv_lib_socket_accept+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char accept (); int main () { return accept (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_socket_accept=yes else ac_cv_lib_socket_accept=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_accept" >&5 $as_echo "$ac_cv_lib_socket_accept" >&6; } if test "x$ac_cv_lib_socket_accept" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_destroy in -lrt" >&5 $as_echo_n "checking for sem_destroy in -lrt... " >&6; } if ${ac_cv_lib_rt_sem_destroy+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_destroy (); int main () { return sem_destroy (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_rt_sem_destroy=yes else ac_cv_lib_rt_sem_destroy=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sem_destroy" >&5 $as_echo "$ac_cv_lib_rt_sem_destroy" >&6; } if test "x$ac_cv_lib_rt_sem_destroy" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "dlopen not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl socket resolv; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } if ${ac_cv_search_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_clock_gettime+:} false; then : break fi done if ${ac_cv_search_clock_gettime+:} false; then : else ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 $as_echo "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in inet_ntop accept4 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in clock_gettime do : ac_fn_cxx_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CLOCK_GETTIME 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 $as_echo_n "checking for long long int... " >&6; } if ${ac_cv_type_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if test "$cross_compiling" = yes; then : ac_cv_type_long_long_int=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX # define HALF \ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif int main () { long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_type_long_long_int=yes else ac_cv_type_long_long_int=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else ac_cv_type_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 $as_echo "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 $as_echo_n "checking for unsigned long long int... " >&6; } if ${ac_cv_type_unsigned_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main () { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_type_unsigned_long_long_int=yes else ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 $as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi if test "$ac_cv_type_long_long_int" = yes; then HAVE_LONG_LONG=HAVE_LONG_LONG cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void f(short); void f(int); void f(long); void f(long long); void f() { int64_t v = 1; f(v); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define INT64_IS_BASETYPE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: long long not found" >&5 $as_echo "$as_me: WARNING: long long not found" >&2;}; HAVE_LONG_LONG=NO_LONG_LONG cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void f(short); void f(int); void f(long); void f() { int64_t v = 1; f(v); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define INT64_IS_BASETYPE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi HAVE_LONG_LONG="$HAVE_LONG_LONG" if test "$ac_cv_type_unsigned_long_long_int" = yes; then HAVE_UNSIGNED_LONG_LONG=HAVE_UNSIGNED_LONG_LONG else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unsigned long long not found ($ac_cv_type_unsigned_long_long_int)" >&5 $as_echo "$as_me: WARNING: unsigned long long not found ($ac_cv_type_unsigned_long_long_int)" >&2;}; HAVE_UNSIGNED_LONG_LONG=NO_UNSIGNED_LONG_LONG fi HAVE_UNSIGNED_LONG_LONG="$HAVE_UNSIGNED_LONG_LONG" # Check whether --with-iconvstream was given. if test "${with_iconvstream+set}" = set; then : withval=$with_iconvstream; with_iconvstream=$withval else with_iconvstream=no fi if test "$with_iconvstream" = yes; then am_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCICONV" LIBICONV=-liconv { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi if test "$am_cv_func_iconv" != yes; then as_fn_error $? "iconv not found" "$LINENO" 5; fi fi if test $with_iconvstream = yes; then MAKE_ICONVSTREAM_TRUE= MAKE_ICONVSTREAM_FALSE='#' else MAKE_ICONVSTREAM_TRUE='#' MAKE_ICONVSTREAM_FALSE= fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads -mt --thread-safe pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthreads -mt pthread -pthread $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_acx_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$acx_pthread_config"; then ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_acx_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi fi acx_pthread_config=$ac_cv_prog_acx_pthread_config if test -n "$acx_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_config" >&5 $as_echo "$acx_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r # Extract the first word of "cc_r", so it can be a program name with args. set dummy cc_r; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="cc_r" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}" fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "CC_r", so it can be a program name with args. set dummy CC_r; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CXX="CC_r" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PTHREAD_CXX" && ac_cv_prog_PTHREAD_CXX="${CXX}" fi fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 $as_echo "$PTHREAD_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else PTHREAD_CC="$CC" PTHREAD_CXX="$CXX" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else acx_pthread_ok=no fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$PTHREAD_CC" CXX="$PTHREAD_CXX" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" LIBS="$LIBS $PTHREAD_LIBS" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: CXXTOOLS_CXXFLAGS='-I${includedir}' CXXTOOLS_LDFLAGS='-L${libdir} -lcxxtools' case "${host_cpu}-${host_os}" in *-aix*) SHARED_LIB_FLAG=-qmkshrobj ;; *) SHARED_LIB_FLAG= ;; esac # # checking inline assembler type for atomic operations # { $as_echo "$as_me:${as_lineno-$LINENO}: checking atomic type" >&5 $as_echo_n "checking atomic type... " >&6; } # Check whether --with-atomictype was given. if test "${with_atomictype+set}" = set; then : withval=$with_atomictype; ac_cxxtools_atomicity=$withval else ac_cxxtools_atomicity=probe fi if test "$ac_cxxtools_atomicity" = "sun" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { volatile ulong_t* uvalue; atomic_inc_ulong_nv( uvalue ); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_SUN ac_cxxtools_atomicity=sun else if test "$ac_cxxtools_atomicity" = "sun" then as_fn_error $? "atomictype sun failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "windows" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _WINSOCKAPI_ #include int main() { LONG value; InterlockedIncrement(&value); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_WINDOWS ac_cxxtools_atomicity=windows else if test "$ac_cxxtools_atomicity" = "windows" then as_fn_error $? "atomictype windows failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_arm" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& dest) { int a, b, c; asm volatile ( "0:\n\t" "ldr %0, [%3]\n\t" "add %1, %0, %4\n\t" "swp %2, %1, [%3]\n\t" "cmp %0, %2\n\t" "swpne %1, %2, [%3]\n\t" "bne 0b" : "=&r" (a), "=&r" (b), "=&r" (c) : "r" (&dest), "r" (1) : "cc", "memory"); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_ARM ac_cxxtools_atomicity=att_arm else if test "$ac_cxxtools_atomicity" = "att_arm" then as_fn_error $? "atomictype att_arm failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_mips" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { atomic_t tmp, result = 0; asm volatile (" .set mips32\n" "1: ll %0, %2\n" " addu %1, %0, 1\n" " sc %1, %2\n" " beqz %1, 1b\n" " .set mips0\n" : "=&r" (result), "=&r" (tmp), "=m" (val) : "m" (val)); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_MIPS ac_cxxtools_atomicity=att_mips else if test "$ac_cxxtools_atomicity" = "att_mips" then as_fn_error $? "atomictype att_mips failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_ppc" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { atomic_t result = 0, tmp; asm volatile ("\n1:\n\t" "lwarx %0, 0, %2\n\t" "addi %1, %0, 1\n\t" "stwcx. %1, 0, %2\n\t" "bne- 1b\n" "isync\n" : "=&b" (result), "=&b" (tmp): "r" (&val): "cc", "memory"); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_PPC ac_cxxtools_atomicity=att_ppc else if test "$ac_cxxtools_atomicity" = "att_ppc" then as_fn_error $? "atomictype att_ppc failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_sparc64" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile ("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" : : : "memory"); asm volatile( "1: ld %%g1, %%o4\n\t" " add %%o4, 1, %%o5\n\t" /* cas %%g1, %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_SPARC64 ac_cxxtools_atomicity=att_sparc64 else if test "$ac_cxxtools_atomicity" = "att_sparc64" then as_fn_error $? "atomictype att_sparc64 failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_sparc32" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { register volatile atomic_t* dest asm("g1") = &val; register atomic_t tmp asm("o4"); register atomic_t ret asm("o5"); asm volatile("stbar" : : : "memory"); asm volatile( "1: ld %%g1, %%o4\n\t" " add %%o4, 1, %%o5\n\t" /* cas %%g1, %%o4, %%o5 */ " .word 0xdbe0500c\n\t" " cmp %%o4, %%o5\n\t" " bne 1b\n\t" " add %%o5, 1, %%o5" : "=&r" (tmp), "=&r" (ret) : "r" (dest) : "memory", "cc"); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_SPARC32 ac_cxxtools_atomicity=att_sparc32 else if test "$ac_cxxtools_atomicity" = "att_sparc32" then as_fn_error $? "atomictype att_sparc32 failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_x86_64" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef ssize_t atomic_t; void atomicIncrement(volatile atomic_t& val) { static const atomic_t d = 1; atomic_t tmp; asm volatile ("lock; xaddq %0, %1" : "=r" (tmp), "=m" (val) : "0" (d), "m" (val)); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_X86_64 ac_cxxtools_atomicity=att_x86_64 else if test "$ac_cxxtools_atomicity" = "att_x86_64" then as_fn_error $? "atomictype att_x86_64 failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_x86" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef std::sig_atomic_t atomic_t; void atomicIncrement(volatile atomic_t& val) { atomic_t tmp; asm volatile ("lock; xaddl %0, %1" : "=r" (tmp), "=m" (val) : "0" (1), "m" (val)); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_X86 ac_cxxtools_atomicity=att_x86 else if test "$ac_cxxtools_atomicity" = "att_x86" then as_fn_error $? "atomictype att_x86 failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "att_avr32" -o "$ac_cxxtools_atomicity" = "probe" then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef int atomic_t; void atomicIncrement(volatile atomic_t& val) { volatile uint8_t tmp; asm volatile( "in %0, __SREG__" "\n\t" "cli" "\n\t" "ld __tmp_reg__, %a1" "\n\t" "inc __tmp_reg__" "\n\t" "st %a1, __tmp_reg__" "\n\t" "out __SREG__, %0" "\n\t" : "=&r" (tmp) : "e" (&val) : "memory" ); } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GCC_AVR32 ac_cxxtools_atomicity=att_avr32 else if test "$ac_cxxtools_atomicity" = "att_avr32" then as_fn_error $? "atomictype att_avr32 failed" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$ac_cxxtools_atomicity" = "pthread" then CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_PTHREAD fi if test "$ac_cxxtools_atomicity" = "generic" then CXXTOOLS_ATOMICITY=CXXTOOLS_ATOMICITY_GENERIC fi if test "$CXXTOOLS_ATOMICITY" = "" then as_fn_error $? "check for atomictype failed" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cxxtools_atomicity" >&5 $as_echo "$ac_cxxtools_atomicity" >&6; } fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_SUN; then MAKE_ATOMICITY_SUN_TRUE= MAKE_ATOMICITY_SUN_FALSE='#' else MAKE_ATOMICITY_SUN_TRUE='#' MAKE_ATOMICITY_SUN_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_WINDOWS; then MAKE_ATOMICITY_WINDOWS_TRUE= MAKE_ATOMICITY_WINDOWS_FALSE='#' else MAKE_ATOMICITY_WINDOWS_TRUE='#' MAKE_ATOMICITY_WINDOWS_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_ARM; then MAKE_ATOMICITY_GCC_ARM_TRUE= MAKE_ATOMICITY_GCC_ARM_FALSE='#' else MAKE_ATOMICITY_GCC_ARM_TRUE='#' MAKE_ATOMICITY_GCC_ARM_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_MIPS; then MAKE_ATOMICITY_GCC_MIPS_TRUE= MAKE_ATOMICITY_GCC_MIPS_FALSE='#' else MAKE_ATOMICITY_GCC_MIPS_TRUE='#' MAKE_ATOMICITY_GCC_MIPS_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_PPC; then MAKE_ATOMICITY_GCC_PPC_TRUE= MAKE_ATOMICITY_GCC_PPC_FALSE='#' else MAKE_ATOMICITY_GCC_PPC_TRUE='#' MAKE_ATOMICITY_GCC_PPC_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_X86_64; then MAKE_ATOMICITY_GCC_X86_64_TRUE= MAKE_ATOMICITY_GCC_X86_64_FALSE='#' else MAKE_ATOMICITY_GCC_X86_64_TRUE='#' MAKE_ATOMICITY_GCC_X86_64_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_X86; then MAKE_ATOMICITY_GCC_X86_TRUE= MAKE_ATOMICITY_GCC_X86_FALSE='#' else MAKE_ATOMICITY_GCC_X86_TRUE='#' MAKE_ATOMICITY_GCC_X86_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_SPARC32; then MAKE_ATOMICITY_GCC_SPARC32_TRUE= MAKE_ATOMICITY_GCC_SPARC32_FALSE='#' else MAKE_ATOMICITY_GCC_SPARC32_TRUE='#' MAKE_ATOMICITY_GCC_SPARC32_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_SPARC64; then MAKE_ATOMICITY_GCC_SPARC64_TRUE= MAKE_ATOMICITY_GCC_SPARC64_FALSE='#' else MAKE_ATOMICITY_GCC_SPARC64_TRUE='#' MAKE_ATOMICITY_GCC_SPARC64_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GCC_AVR32; then MAKE_ATOMICITY_GCC_AVR32_TRUE= MAKE_ATOMICITY_GCC_AVR32_FALSE='#' else MAKE_ATOMICITY_GCC_AVR32_TRUE='#' MAKE_ATOMICITY_GCC_AVR32_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_PTHREAD; then MAKE_ATOMICITY_PTHREAD_TRUE= MAKE_ATOMICITY_PTHREAD_FALSE='#' else MAKE_ATOMICITY_PTHREAD_TRUE='#' MAKE_ATOMICITY_PTHREAD_FALSE= fi if test "$CXXTOOLS_ATOMICITY" = CXXTOOLS_ATOMICITY_GENERIC; then MAKE_ATOMICITY_GENERIC_TRUE= MAKE_ATOMICITY_GENERIC_FALSE='#' else MAKE_ATOMICITY_GENERIC_TRUE='#' MAKE_ATOMICITY_GENERIC_FALSE= fi # # checking existence of suseconds_t, needed by hirestime.h # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suseconds_t..." >&5 $as_echo "$as_me: checking for suseconds_t..." >&6;} ac_fn_cxx_check_type "$LINENO" "suseconds_t" "ac_cv_type_suseconds_t" "#include " if test "x$ac_cv_type_suseconds_t" = xyes; then : CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_T else CXXTOOLS_SUSECONDS=CXXTOOLS_SUSECONDS_TIME_T fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void foo() { std::numpunct* np; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : CXXTOOLS_STD_LOCALE=CXXTOOLS_WITH_STD_LOCALE else CXXTOOLS_STD_LOCALE=CXXTOOLS_WITHOUT_STD_LOCALE fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int i = TCP_DEFER_ACCEPT; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_TCP_DEFER_ACCEPT 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int i = IPPROTO_IPV6; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_IPV6 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int i = SO_NOSIGPIPE; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_SO_NOSIGPIPE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int i = MSG_NOSIGNAL; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_MSG_NOSIGNAL 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include std::reverse_iterator r; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : HAVE_REVERSE_ITERATOR=HAVE_REVERSE_ITERATOR else HAVE_REVERSE_ITERATOR=NO_REVERSE_ITERATOR fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include std::reverse_iterator r; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : HAVE_REVERSE_ITERATOR_4=HAVE_REVERSE_ITERATOR_4 else HAVE_REVERSE_ITERATOR_4=NO_REVERSE_ITERATOR_4 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext HAVE_REVERSE_ITERATOR="$HAVE_REVERSE_ITERATOR" HAVE_REVERSE_ITERATOR_4="$HAVE_REVERSE_ITERATOR_4" # Check whether --enable-demos was given. if test "${enable_demos+set}" = set; then : enableval=$enable_demos; enable_demos=$enableval else enable_demos=enable_demos fi if test "$enable_demos" = "enable_demos"; then MAKE_DEMOS_TRUE= MAKE_DEMOS_FALSE='#' else MAKE_DEMOS_TRUE='#' MAKE_DEMOS_FALSE= fi # Check whether --enable-unittest was given. if test "${enable_unittest+set}" = set; then : enableval=$enable_unittest; enable_unittest=$enableval else enable_unittest=enable_unittest fi if test "$enable_unittest" = "enable_unittest"; then MAKE_UNITTEST_TRUE= MAKE_UNITTEST_FALSE='#' else MAKE_UNITTEST_TRUE='#' MAKE_UNITTEST_FALSE= fi ac_config_files="$ac_config_files cxxtools-config" ac_config_files="$ac_config_files Makefile src/Makefile src/unit/Makefile src/http/Makefile src/xmlrpc/Makefile src/bin/Makefile src/json/Makefile include/Makefile demo/Makefile test/Makefile" ac_config_files="$ac_config_files pkgconfig/cxxtools-bin.pc pkgconfig/cxxtools-http.pc pkgconfig/cxxtools-json.pc pkgconfig/cxxtools.pc pkgconfig/cxxtools-unit.pc pkgconfig/cxxtools-xmlrpc.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ICONVSTREAM_TRUE}" && test -z "${MAKE_ICONVSTREAM_FALSE}"; then as_fn_error $? "conditional \"MAKE_ICONVSTREAM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_SUN_TRUE}" && test -z "${MAKE_ATOMICITY_SUN_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_SUN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_WINDOWS_TRUE}" && test -z "${MAKE_ATOMICITY_WINDOWS_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_ARM_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_ARM_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_MIPS_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_MIPS_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_MIPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_PPC_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_PPC_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_PPC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_X86_64_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_X86_64_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_X86_64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_X86_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_X86_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_X86\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_SPARC32_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_SPARC32_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_SPARC32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_SPARC64_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_SPARC64_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_SPARC64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GCC_AVR32_TRUE}" && test -z "${MAKE_ATOMICITY_GCC_AVR32_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GCC_AVR32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_PTHREAD_TRUE}" && test -z "${MAKE_ATOMICITY_PTHREAD_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_PTHREAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ATOMICITY_GENERIC_TRUE}" && test -z "${MAKE_ATOMICITY_GENERIC_FALSE}"; then as_fn_error $? "conditional \"MAKE_ATOMICITY_GENERIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_DEMOS_TRUE}" && test -z "${MAKE_DEMOS_FALSE}"; then as_fn_error $? "conditional \"MAKE_DEMOS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_UNITTEST_TRUE}" && test -z "${MAKE_UNITTEST_FALSE}"; then as_fn_error $? "conditional \"MAKE_UNITTEST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by cxxtools $as_me 2.2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to >." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ cxxtools config.status 2.2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "include/cxxtools/config.h") CONFIG_FILES="$CONFIG_FILES include/cxxtools/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "cxxtools-config") CONFIG_FILES="$CONFIG_FILES cxxtools-config" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/unit/Makefile") CONFIG_FILES="$CONFIG_FILES src/unit/Makefile" ;; "src/http/Makefile") CONFIG_FILES="$CONFIG_FILES src/http/Makefile" ;; "src/xmlrpc/Makefile") CONFIG_FILES="$CONFIG_FILES src/xmlrpc/Makefile" ;; "src/bin/Makefile") CONFIG_FILES="$CONFIG_FILES src/bin/Makefile" ;; "src/json/Makefile") CONFIG_FILES="$CONFIG_FILES src/json/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "demo/Makefile") CONFIG_FILES="$CONFIG_FILES demo/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "pkgconfig/cxxtools-bin.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-bin.pc" ;; "pkgconfig/cxxtools-http.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-http.pc" ;; "pkgconfig/cxxtools-json.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-json.pc" ;; "pkgconfig/cxxtools.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools.pc" ;; "pkgconfig/cxxtools-unit.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-unit.pc" ;; "pkgconfig/cxxtools-xmlrpc.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/cxxtools-xmlrpc.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "cxxtools-config":F) chmod +x cxxtools-config ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cxxtools-2.2.1/depcomp0000755000175000017500000005055212030605446011704 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999-2012 Free Software Foundation, Inc. # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: cxxtools-2.2.1/install-sh0000755000175000017500000003325512030605446012334 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: