00001
00009
00010
00011
00012 #include "node.h"
00013
00014 #ifdef TOOLBOX
00015
00016
00017
00018
00019
00020 void rm_all_dyn_q(node * n, char * qname)
00021 {
00022 node * ni;
00023
00024 for (ni=n->get_oldest_daughter(); ni != NULL; ni=ni->get_younger_sister())
00025 rmq(ni->get_dyn_story(), qname);
00026 }
00027
00028
00029
00030
00031
00032 void rm_all_hydro_q(node * n, char * qname)
00033 {
00034 node * ni;
00035
00036 for (ni=n->get_oldest_daughter(); ni != NULL; ni=ni->get_younger_sister())
00037 rmq(ni->get_hydro_story(), qname);
00038 }
00039
00040
00041
00042
00043
00044 void rm_all_star_q(node * n, char * qname)
00045 {
00046 node * ni;
00047
00048 for (ni=n->get_oldest_daughter(); ni != NULL; ni=ni->get_younger_sister())
00049 rmq(ni->get_star_story(), qname);
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 main(int argc, char ** argv)
00063 {
00064 bool h_flag = FALSE;
00065 bool s_flag = FALSE;
00066 bool q_flag = FALSE;
00067 bool c_flag = FALSE;
00068 char *comment;
00069 char *qname;
00070
00071 check_help();
00072
00073 extern char *poptarg;
00074 int c;
00075 char* param_string = "c:q:hs";
00076
00077 while ((c = pgetopt(argc, argv, param_string)) != -1)
00078 switch(c)
00079 {
00080 case 'c': c_flag = TRUE;
00081 comment = poptarg;
00082 break;
00083 case 'q': q_flag = TRUE;
00084 qname = poptarg;
00085 break;
00086 case 'h': h_flag = TRUE;
00087 break;
00088 case 's': s_flag = TRUE;
00089 break;
00090 case '?': params_to_usage(cerr, argv[0], param_string);
00091 get_help();
00092 exit(1);
00093 }
00094
00095 if (q_flag == FALSE)
00096 get_help();
00097
00098 node *n;
00099
00100 while (n = get_node(cin))
00101 {
00102 if (c_flag)
00103 n->log_comment(comment);
00104 n->log_history(argc, argv);
00105
00106 if (h_flag)
00107 rm_all_hydro_q(n, qname);
00108 else if (s_flag)
00109 rm_all_star_q(n, qname);
00110 else
00111 rm_all_dyn_q(n, qname);
00112
00113 put_node(cout, *n);
00114 delete n;
00115 }
00116 }
00117
00118 #endif