Main Page   Compound List   File List   Compound Members   File Members  

zpunt.vtc

Go to the documentation of this file.
00001 /* -*- C -*- */
00014 punted ?:= make_tree(.stricmp);
00015 punted_instances ?:= make_tree(.cmp2);
00016 
00026 func Zpunt(a / b)
00027 {
00028   if (b)
00029     insert_tree(punted_instances, table(a, b), 1);
00030   else
00031     insert_tree(punted, a, 1);
00032 }
00033 
00043 func Zunpunt(a / b)
00044 {
00045   if (b)
00046     delete_tree(punted_instances, table(a, b));
00047   else
00048     delete_tree(punted, a);
00049 }
00050 
00056 func save_punts(fp)
00057 {
00058   traverse_tree(punted, .save_punts_internal, fp);
00059   traverse_tree(punted_instances, .save_punt_instances_internal, fp);
00060 }
00061 
00062 func save_punts_internal(name, foo, fp)
00063 {
00064   fprintf(fp, "Zpunt(%s);\n", stringconst(name));
00065 }
00066 
00067 func save_punt_instances_internal(pi, foo, fp)
00068 {
00069   fprintf(fp, "Zpunt(%s,%s);\n", stringconst(pi[0]), stringconst(pi[1]));
00070 }
00071 
00084 func is_zpunted(z) 
00085 {
00086   /* If we've explicitly punted the class/instance pair, return 1. */
00087   if (find_tree(punted_instances, table(z->class, z->instance)))
00088     return 1;
00089   
00090   /* Check to see if we're on class message and we've punted the instance. */
00091   if (stricmp(z->class, "message") == 0 &&
00092       find_tree(punted, z->instance))
00093     return 1;
00094   
00095   /* Otherwise, we haven't punted. */
00096   return 0;
00097 }
00098 
00099 add_to_hook(save_hook, .save_punts);
00100 
00101 add_cmd("zpunt", 1, .Zpunt, "/zpunt <instance>");
00102 add_cmd("zpunti", 2, .Zpunt, "/zpunti <class> <instance>");
00103 add_cmd("zunpunt", 1, .Zunpunt, "/zunpunt <instance>");
00104 add_cmd("zunpunti", 2, .Zunpunt, "/zunpunti <class> <instance>");
00105 

Generated at Mon Aug 13 16:45:52 2001 for dzm-vtc by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001