1 2 /****************************************************************************** 3 * MODULE : menus.cpp 4 * DESCRIPTION: A plugin which changes the menus dynamically 5 * The routine menus-add is defined in ../progs/init-menus.scm 6 * COPYRIGHT : (C) 2003 Joris van der Hoeven 7 ******************************************************************************* 8 * This software falls under the GNU general public license version 3 or later. 9 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 10 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>. 11 ******************************************************************************/ 12 13 #include <iostream> 14 using namespace std; 15 16 #define DATA_BEGIN ((char) 2) 17 #define DATA_END ((char) 5) 18 #define DATA_ESCAPE ((char) 27) 19 20 int main()21main () { 22 cout << DATA_BEGIN << "verbatim:"; 23 cout << "Enter the name of a menu to add at each prompt"; 24 cout << DATA_END; 25 cout.flush (); 26 27 while (true) { 28 char buffer[100]; 29 cin.getline (buffer, 100, '\n'); 30 cout << DATA_BEGIN << "verbatim:"; 31 cout << DATA_BEGIN << "command:(menus-add \"" 32 << buffer << "\")" << DATA_END; 33 cout << "Added " << buffer << " to menu"; 34 cout << DATA_END; 35 cout.flush (); 36 } 37 return 0; 38 } 39