mariadb/extra/yassl/taocrypt/mySTL/stdexcept.hpp

85 lines
2.1 KiB
C++
Raw Normal View History

/* mySTL stdexcept.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL 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.
*
Import yaSSL version 1.3.7 - Fix for "bug#16755 Please find a SSL library that is FLOSS-Exception / LGPL copyrighted" extra/yassl/FLOSS-EXCEPTIONS: Import patch yassl.diff extra/yassl/README: Import patch yassl.diff extra/yassl/include/buffer.hpp: Import patch yassl.diff extra/yassl/include/cert_wrapper.hpp: Import patch yassl.diff extra/yassl/include/crypto_wrapper.hpp: Import patch yassl.diff extra/yassl/include/factory.hpp: Import patch yassl.diff extra/yassl/include/handshake.hpp: Import patch yassl.diff extra/yassl/include/lock.hpp: Import patch yassl.diff extra/yassl/include/log.hpp: Import patch yassl.diff extra/yassl/include/openssl/ssl.h: Import patch yassl.diff extra/yassl/include/socket_wrapper.hpp: Import patch yassl.diff extra/yassl/include/timer.hpp: Import patch yassl.diff extra/yassl/include/yassl_error.hpp: Import patch yassl.diff extra/yassl/include/yassl_imp.hpp: Import patch yassl.diff extra/yassl/include/yassl_int.hpp: Import patch yassl.diff extra/yassl/include/yassl_types.hpp: Import patch yassl.diff extra/yassl/mySTL/algorithm.hpp: Import patch yassl.diff extra/yassl/mySTL/helpers.hpp: Import patch yassl.diff extra/yassl/mySTL/list.hpp: Import patch yassl.diff extra/yassl/mySTL/memory.hpp: Import patch yassl.diff extra/yassl/mySTL/pair.hpp: Import patch yassl.diff extra/yassl/mySTL/stdexcept.hpp: Import patch yassl.diff extra/yassl/mySTL/vector.hpp: Import patch yassl.diff extra/yassl/src/buffer.cpp: Import patch yassl.diff extra/yassl/src/cert_wrapper.cpp: Import patch yassl.diff extra/yassl/src/crypto_wrapper.cpp: Import patch yassl.diff extra/yassl/src/handshake.cpp: Import patch yassl.diff extra/yassl/src/lock.cpp: Import patch yassl.diff extra/yassl/src/log.cpp: Import patch yassl.diff extra/yassl/src/socket_wrapper.cpp: Import patch yassl.diff extra/yassl/src/ssl.cpp: Import patch yassl.diff extra/yassl/src/template_instnt.cpp: Import patch yassl.diff extra/yassl/src/timer.cpp: Import patch yassl.diff extra/yassl/src/yassl.cpp: Import patch yassl.diff extra/yassl/src/yassl_error.cpp: Import patch yassl.diff extra/yassl/src/yassl_imp.cpp: Import patch yassl.diff extra/yassl/src/yassl_int.cpp: Import patch yassl.diff extra/yassl/taocrypt/include/aes.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/algebra.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/arc4.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/asn.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/block.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/blowfish.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/coding.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/des.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/dh.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/dsa.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/error.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/file.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/hash.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/hmac.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/integer.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/kernelc.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/md2.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/md4.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/md5.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/misc.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/modarith.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/modes.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/pwdbased.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/random.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/ripemd.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/rsa.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/runtime.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/sha.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/twofish.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/type_traits.hpp: Import patch yassl.diff extra/yassl/taocrypt/include/types.hpp: Import patch yassl.diff extra/yassl/taocrypt/src/aes.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/aestables.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/algebra.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/arc4.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/asn.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/bftables.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/blowfish.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/coding.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/des.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/dh.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/dsa.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/file.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/hash.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/integer.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/md2.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/md4.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/md5.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/misc.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/random.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/ripemd.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/rsa.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/sha.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/template_instnt.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/tftables.cpp: Import patch yassl.diff extra/yassl/taocrypt/src/twofish.cpp: Import patch yassl.diff
2006-07-17 10:50:20 +02:00
* There are special exceptions to the terms and conditions of the GPL as it
* is applied to yaSSL. View the full text of the exception in the file
* FLOSS-EXCEPTIONS in the directory of this software distribution.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* mySTL memory implements exception, runtime_error
*
*/
#ifndef mySTL_STDEXCEPT_HPP
#define mySTL_STDEXCEPT_HPP
#include <string.h> // strncpy
Merge with latest yaSSL. Fixes IsAligned yaSSL assertion failure. extra/yassl/include/buffer.hpp: Merge with latest yaSSL. extra/yassl/include/factory.hpp: Merge with latest yaSSL. extra/yassl/include/openssl/ssl.h: Merge with latest yaSSL. extra/yassl/include/yassl_int.hpp: Merge with latest yaSSL. extra/yassl/include/yassl_types.hpp: Merge with latest yaSSL. extra/yassl/mySTL/stdexcept.hpp: Merge with latest yaSSL. extra/yassl/src/buffer.cpp: Merge with latest yaSSL. extra/yassl/src/socket_wrapper.cpp: Merge with latest yaSSL. extra/yassl/src/ssl.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/block.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/hash.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/hmac.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/integer.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/modes.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/rsa.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/aes.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/dsa.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/hash.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/integer.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/md5.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/misc.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/ripemd.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/rsa.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/sha.cpp: Merge with latest yaSSL.
2005-06-10 20:09:41 +05:00
#include <assert.h> // assert
#include <stdlib.h> // size_t
namespace mySTL {
class exception {
public:
exception() {}
Merge with latest yaSSL. Fixes IsAligned yaSSL assertion failure. extra/yassl/include/buffer.hpp: Merge with latest yaSSL. extra/yassl/include/factory.hpp: Merge with latest yaSSL. extra/yassl/include/openssl/ssl.h: Merge with latest yaSSL. extra/yassl/include/yassl_int.hpp: Merge with latest yaSSL. extra/yassl/include/yassl_types.hpp: Merge with latest yaSSL. extra/yassl/mySTL/stdexcept.hpp: Merge with latest yaSSL. extra/yassl/src/buffer.cpp: Merge with latest yaSSL. extra/yassl/src/socket_wrapper.cpp: Merge with latest yaSSL. extra/yassl/src/ssl.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/block.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/hash.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/hmac.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/integer.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/modes.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/rsa.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/aes.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/dsa.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/hash.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/integer.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/md5.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/misc.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/ripemd.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/rsa.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/sha.cpp: Merge with latest yaSSL.
2005-06-10 20:09:41 +05:00
virtual ~exception() {} // to shut up compiler warnings
virtual const char* what() const { return ""; }
Merge with latest yaSSL. Fixes IsAligned yaSSL assertion failure. extra/yassl/include/buffer.hpp: Merge with latest yaSSL. extra/yassl/include/factory.hpp: Merge with latest yaSSL. extra/yassl/include/openssl/ssl.h: Merge with latest yaSSL. extra/yassl/include/yassl_int.hpp: Merge with latest yaSSL. extra/yassl/include/yassl_types.hpp: Merge with latest yaSSL. extra/yassl/mySTL/stdexcept.hpp: Merge with latest yaSSL. extra/yassl/src/buffer.cpp: Merge with latest yaSSL. extra/yassl/src/socket_wrapper.cpp: Merge with latest yaSSL. extra/yassl/src/ssl.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/block.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/hash.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/hmac.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/integer.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/modes.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/include/rsa.hpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/aes.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/dsa.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/hash.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/integer.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/md5.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/misc.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/ripemd.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/rsa.cpp: Merge with latest yaSSL. extra/yassl/taocrypt/src/sha.cpp: Merge with latest yaSSL.
2005-06-10 20:09:41 +05:00
// for compiler generated call, never used
static void operator delete(void*) { assert(0); }
private:
// don't allow dynamic creation of exceptions
static void* operator new(size_t);
};
class named_exception : public exception {
public:
enum { NAME_SIZE = 80 };
explicit named_exception(const char* str)
{
strncpy(name_, str, NAME_SIZE);
name_[NAME_SIZE - 1] = 0;
}
virtual const char* what() const { return name_; }
private:
char name_[NAME_SIZE];
};
class runtime_error : public named_exception {
public:
explicit runtime_error(const char* str) : named_exception(str) {}
};
} // namespace mySTL
#endif // mySTL_STDEXCEPT_HPP