| @@ -1,9 +1,8 @@ | |||
| // base64codec.cpp | |||
| // Copyright (C) 2006 - 2009 MicroNeil Research Corporation | |||
| // See base64codec.hpp | |||
| //typedef vector<char> base64codec_buffer; | |||
| //typedef vector<char>::iterator base64codec_iterator; | |||
| // | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| #include "base64codec.hpp" | |||
| @@ -1,6 +1,10 @@ | |||
| // base64codec.hpp | |||
| // Copyright (C) 2006 - 2009 MicroNeil Research Corporation | |||
| // BASE64 encoder decoder objects extending vectors | |||
| // | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // Tools for encoding and decoding base64 data. | |||
| #pragma once | |||
| @@ -1,25 +1,10 @@ | |||
| // configuration.cpp | |||
| // | |||
| // (C) 2006 - 2009 MicroNeil Research Corporation. | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| // See configuration.hpp for details | |||
| // Tools for efficiently parsing XML, usually in configuration files. | |||
| #include "configuration.hpp" | |||
| @@ -1,28 +1,15 @@ | |||
| // configuration.hpp | |||
| // | |||
| // (C) 2006 - 2009 MicroNeil Research Corporation. | |||
| // See http://www.codedweller.com for details. | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // What about this ============================================================= | |||
| // The configuration module provides a platform for reading configuration files | |||
| // (or string data) containing well-formed xml and mapping that data to program | |||
| // variables. | |||
| // | |||
| // The idea is to provide the ability for an object or application to provide | |||
| // a modular "configuration" object that models a hierarchical collection of | |||
| // "settings" that can be represented easily in code and in xml. | |||
| @@ -1,8 +1,8 @@ | |||
| // faults.hpp | |||
| // | |||
| // Copyright (C) MicroNeil Research Corporation 2009 | |||
| // This file is part of the CodeDweller library. | |||
| // See www.codedweller.com for details. | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // Faults and Checks are classes we can use in place of assert() to handle | |||
| // unreasonable or necessary conditions in our code. They are constructed with | |||
| @@ -1,6 +1,8 @@ | |||
| // histogram.hpp | |||
| // Copyright (C) 2006 - 2009 MicroNeil Research Corporation | |||
| // Class to capture a histogram of events using a <set> | |||
| // | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| #pragma once | |||
| @@ -1,17 +1,12 @@ | |||
| // MANGLER.CPP | |||
| // | |||
| // (C) 1984-2020 MicroNeil Research Corporation | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // Derived from Version 1 of Mangler Encryption Algorythm, 1984. | |||
| // Derived from Version 2 of Mangler Encryption Algorythm, 1998. | |||
| // | |||
| // 20021008 _M | |||
| // Found and corrected range bug in ChaosDriver(void) where | |||
| // ~Position might access a location outside the fill. Replaced | |||
| // ~Position with Position^0xff which has the intended effect. | |||
| // 20020119 _M Version 3.0 | |||
| // | |||
| // Mangler encryption engine object. | |||
| // Using new optimized chaos driver for uniformity experiments. | |||
| // Important in this experiment is proof of highest possible entropy. | |||
| @@ -1,6 +1,9 @@ | |||
| // MANGLER.HPP | |||
| // | |||
| // (C) 1984-2020 MicroNeil Research Corporation | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // Derived from Version 1 of Mangler Encryption Algorythm, 1984. | |||
| // Derived from Version 2 of Mangler Encryption Algorythm, 1998. | |||
| // | |||
| @@ -1,5 +1,10 @@ | |||
| // mishmash.cpp (c) 20190407 _M | |||
| // non-cryptographic has for short strings | |||
| // mishmash.cpp | |||
| // | |||
| // Copyright (C) 2019-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // Mishmash is a non-cryptographic hash optimized for short strings. | |||
| #include "mishmash.hpp" | |||
| @@ -1,5 +1,9 @@ | |||
| // mishmash.hpp (c) 20190407 _M | |||
| // mishmash.hpp// | |||
| // Copyright (C) 2019-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // Mishamash is a non-cryptographic hash optimized for short strings. | |||
| #pragma once | |||
| #include <string> | |||
| @@ -1,25 +1,8 @@ | |||
| // networking.cpp | |||
| // Copyright (C) 2006-2009 MicroNeil Research Corporation. | |||
| // | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| //============================================================================== | |||
| // See networking.hpp for notes. | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| #include "networking.hpp" | |||
| @@ -1,26 +1,11 @@ | |||
| // networking.hpp | |||
| // Copyright (C) 2006-2009 MicroNeil Research Corporation. | |||
| // | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| //============================================================================== | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // The networking module abstracts network communications and provides a set | |||
| // of objects for handling most tasks. | |||
| // of objects for handling most tasks on both win* and *nix. | |||
| #pragma once | |||
| @@ -1,5 +1,8 @@ | |||
| // onetimepad.cpp | |||
| // Copyright (C) 2006-2007 MicroNeil Research Corporation | |||
| // | |||
| // Copyright (C) 2006-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| #include "onetimepad.hpp" | |||
| #include "timing.hpp" | |||
| @@ -1,5 +1,8 @@ | |||
| // onetimepad.hpp | |||
| // Copyright (C) 2006 - 2007 MicroNeil Research Corporation | |||
| // | |||
| // Copyright (C) 2006-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // This module leverages the Mangler encryption engine to create | |||
| // cryptographically strong one-time pads and random numbers upon request. | |||
| @@ -1,25 +1,8 @@ | |||
| // threading.cpp | |||
| // | |||
| // (C) 2006 - 2009 MicroNeil Research Corporation. | |||
| // Copyright (C) 2006-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| // For details on the Threading module and development history see threading.hpp | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| #include "threading.hpp" | |||
| @@ -1,23 +1,8 @@ | |||
| // threading.hpp | |||
| // | |||
| // (C) 2006 - 2009 MicroNeil Research Corporation. | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // The "Threading" module is a basic, cross-platform, multi-threading tool kit. | |||
| // The differences between posix compatible systems and win32 based systems are | |||
| @@ -28,36 +13,6 @@ | |||
| // here are designed to cover all of the basics efficiently while hiding the | |||
| // required under-cover work. | |||
| // A lot of this module is coded here in the header with the inline keyword | |||
| // because it is likely that the more basic objects can be efficiently compiled | |||
| // as inline abstractions to native calls. Really basic systems won't need | |||
| // anything beyond what is in this file. | |||
| // 20070202.1601 _M Further research has suggested that using a Semaphore in | |||
| // WIN32 environments in place of a CRITICAL_SECTION may provide the best | |||
| // performance and stability on all platforms. Specifically, SMP platforms may | |||
| // race and waste resources with CRITICAL_SECTIONs and in those cases it is | |||
| // recommended that the CRITICAL_SECTIONs may be "throttled" using Semaphores | |||
| // to limit the number of threads that may contend for a critical section. It | |||
| // is also suggested that if the Semaphore has an initialization value of 1 | |||
| // the CRITICAL_SECTION is redundant. So this code has been modified to do | |||
| // precisely that! | |||
| // | |||
| // This new version also includes a ProductionGateway object that simplifies | |||
| // the producer/consumer model. The object keeps track of the number of calls | |||
| // to produce() and consume() and ensures that threads will block on consume() | |||
| // until a sufficient number of calls to produce() are made. That is, for every | |||
| // one call to produce(), a call to consume() will be allowed to proceed. The | |||
| // object also allows for the potentially asynchronous nature of these calls. | |||
| // 20070530.1751 _M Added top level exception handling in threads along with | |||
| // isRunning() and isBad() methods. | |||
| // 20060528.1647 _M All of the basics are complete and tested on both WIN32 and | |||
| // RHEL4 single and multiple processors. | |||
| // Include MNR_threading Once Only ============================================= | |||
| #pragma once | |||
| #include <set> | |||
| @@ -1,25 +1,8 @@ | |||
| // timing.cpp | |||
| // | |||
| // Copyright (C) 2006 - 2009 MicroNeil Research Corporation. | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // See the corresponding .hpp file for descriptions and history. | |||
| // | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // | |||
| // This program is distributed in the hope that it will be useful, but WITHOUT | |||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |||
| // more details. | |||
| // | |||
| // You should have received a copy of the GNU General Public License along with | |||
| // this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |||
| // Place, Suite 330, Boston, MA 02111-1307 USA | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| #include <ctime> | |||
| #include <sys/time.h> | |||
| @@ -1,56 +1,14 @@ | |||
| // timing.hpp | |||
| // | |||
| // Copyright (C) 2004-2009 MicroNeil Research Corporation. | |||
| // This program is part of the MicroNeil Research Open Library Project. For | |||
| // more information go to http://www.microneil.com/OpenLibrary/index.html | |||
| // | |||
| // This program is free software; you can redistribute it and/or modify it | |||
| // under the terms of the GNU General Public License as published by the | |||
| // Free Software Foundation; either version 2 of the License, or (at your | |||
| // option) any later version. | |||
| // Copyright (C) 2004-2020 MicroNeil Research Corporation. | |||
| // | |||
| // 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. | |||
| // This software is released under the MIT license. See LICENSE.TXT. | |||
| // | |||
| // 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 | |||
| // The purpose of this module is to abstract timing functions for | |||
| // cross platform C++ development usning GNU compilers in *nix and | |||
| // win32 environments (minGW). Timing resolution is in milliseconds | |||
| // throughout to provide consistency and reasonable expectations. | |||
| // 20060404 _M Added Timer::start(msclock startt) for chaining. | |||
| // 20060403 _M This "timing" module has been completed and tested on | |||
| // win32 (compiled using CodeBlocks and minGW) and on RHES3 (g++). | |||
| // | |||
| // The bottom line is that this code is perfect for most applications that | |||
| // don't need real-time interaction on the win32 platform. That is, for | |||
| // any application that can accept 15ms or so of "wiggle" in their timing | |||
| // functions. On linux I was able to observe very consistent results with | |||
| // variations measured in 1-2ms. | |||
| // | |||
| // Aynone seeking real-time accuracy on the win32 platform will need to contend | |||
| // with all of the landmines in place against that and will need to write more | |||
| // ellaborate versions of Timer::getLocalRawClock() and Sleeper::doRawSleep() | |||
| // aa appropriate for their application. The existing code should work fine for | |||
| // almost all other applications. | |||
| // | |||
| // This code was written with that in mind to some extent. That is why all of | |||
| // the timing functions are measured in milliseconds rather than microseconds | |||
| // or something smaller. Milliseconds are convenient for polling delays, | |||
| // communications timeouts, measuring database application performance, and | |||
| // other similar tasks. For that purpose - this timing module is just fine :-) | |||
| // 20060323 _M Rewrote this module from a combination of previous | |||
| // bits and pieces. This module will provide classes that abstract | |||
| // timing functions for use in GNU projects on *nix and win32 systems. | |||
| #pragma once | |||
| namespace codedweller { | |||