From 148bd343f3e7e32d141f66b5b5c9b98b2975b0b3 Mon Sep 17 00:00:00 2001 From: "Roberto C. Sanchez" Date: Sat, 29 Mar 2014 10:53:52 -0400 Subject: Imported Upstream version 1.5.8 --- examples/classes/Makefile | 7 ------ examples/classes/ciphercng.cpp | 43 ---------------------------------- examples/classes/swmgrex.cpp | 52 ------------------------------------------ 3 files changed, 102 deletions(-) delete mode 100644 examples/classes/Makefile delete mode 100644 examples/classes/ciphercng.cpp delete mode 100644 examples/classes/swmgrex.cpp (limited to 'examples/classes') diff --git a/examples/classes/Makefile b/examples/classes/Makefile deleted file mode 100644 index 6b7a96c..0000000 --- a/examples/classes/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -root := ../.. -subdirs := -pre-targets := -bin := yes -targets := swmgrex ciphercng -include ${root}/Makefile.cfg - diff --git a/examples/classes/ciphercng.cpp b/examples/classes/ciphercng.cpp deleted file mode 100644 index 591cd2d..0000000 --- a/examples/classes/ciphercng.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** - * - * This example demonstrates how to change the cipher key of a module - * The change is only in effect for this run. This DOES NOT change the - * cipherkey in the module's .conf file. - * - */ - -#include - -int main(int argc, char **argv) { - - if (argc != 2) { - fprintf(stderr, "usage: %s \n", *argv); - exit(-1); - } - - SWMgr manager; // create a default manager that looks in the current directory for mods.conf - ModMap::iterator it; - it = manager.Modules.find(argv[1]); - - if (it == manager.Modules.end()) { - fprintf(stderr, "%s: couldn't find module: %s\n", *argv, argv[1]); - exit(-1); - } - - SWModule *module = (*it).second; - string key; - - cout << "\nPress [CTRL-C] to end\n\n"; - while (true) { - cout << "\nModule text:\n"; - module->setKey("1jn 1:9"); - cout << "[ " << module->KeyText() << " ]\n"; - cout << (const char *)*module; - cout << "\n\nEnter new cipher key: "; - cin >> key; - cout << "\nSetting key to: " << key; - manager.setCipherKey(argv[1], (unsigned char *)key.c_str()); - } - - -} diff --git a/examples/classes/swmgrex.cpp b/examples/classes/swmgrex.cpp deleted file mode 100644 index 5cb10ba..0000000 --- a/examples/classes/swmgrex.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Class SWMgr manages installed modules for a frontend. - * SWMgr reads a mods.conf file to discover its information. - * It then instantiates the correct decendent of SWModule for each - * module entry in mods.conf - * The developer may use this class to query what modules are installed - * and to retrieve an (SWModule *) for any one of these modules - * - * SWMgr makes its modules available as an STL Map. - * The Map definition is typedef'ed as ModMap - * ModMap consists of: FIRST : string moduleName - * SECOND: SWModule *module - * - */ - -#include - -main() { - SWMgr manager; // create a default manager that looks in the current directory for mods.conf - - cout << "\nInstalled Modules:\n\n"; - - ModMap::iterator modIterator; - -// Loop thru all installed modules and print out information - - for (modIterator = manager.Modules.begin(); modIterator != manager.Modules.end(); modIterator++) { - string modName = (*modIterator).first; // mod.conf section name (stored in module->Name()) - SWModule *module = (*modIterator).second; - - cout << modName << "(" << module->Name() << ") | " << module->Type() << "\n"; - } - -// Print out a verse from the first module: - - cout << "\n" << manager.Modules.begin()->second->KeyText() << ":\n"; - cout << (const char *)(*manager.Modules.begin()->second); - cout << " (" << manager.Modules.begin()->second->Name() << ")\n"; - -// Print out the same verse from the second module (less confusing): - - modIterator = manager.Modules.begin(); // get first module - modIterator++; // increment to next module - - SWModule *mod = modIterator->second; - - cout << "\n" << mod->KeyText() << ":\n"; -// cout << (const char *)(*mod); // we could do this, the same as above - mod->Display(); // instead of casting mod to const char * to get its contents, we'll call the default display method that writes to stdout; - cout << " (" << mod->Name() << ")\n\n"; - -} -- cgit v1.2.3