Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

display_subtrees.C

Go to the documentation of this file.
00001 
00006 
00007 //   version 1:  Nov 1994   Piet Hut
00008 
00009 #include "node.h"
00010 
00011 /*===========================================================================*/
00012 
00013 #ifdef TOOLBOX
00014 
00015 /*-----------------------------------------------------------------------------
00016  *  main  --  driver, to directly display subtrees.
00017  *-----------------------------------------------------------------------------
00018  */
00019 main(int argc, char ** argv)
00020     {
00021     bool  c_flag = FALSE;
00022     char  *comment;
00023 
00024     check_help();
00025 
00026     extern char *poptarg;
00027     int  c;
00028     char* param_string = "c:";
00029 
00030     while ((c = pgetopt(argc, argv, param_string)) != -1)
00031         switch(c)
00032             {
00033             case 'c': c_flag = TRUE;
00034                       comment = poptarg;
00035                       break;
00036             case '?': params_to_usage(cerr, argv[0], param_string);
00037                       get_help();
00038                       exit(1);
00039             }            
00040     
00041     node * root;
00042 
00043     while (root = get_node(cin))
00044         {
00045         for_all_daughters(node, root, daughter)
00046             if (daughter->is_parent())
00047                 {
00048                 if (c_flag == TRUE)
00049                     daughter->log_comment(comment);
00050                 daughter->log_history(argc, argv);
00051 
00052                 put_node(cout, *daughter);
00053                 }
00054         rmtree(root);
00055         }
00056     }
00057 
00058 #endif
00059 
00060 /*===========================================================================*/
00061 
00062 /* endof: display_subtrees.C */
00063 

Generated at Sun Feb 24 09:56:57 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001