Mercurial > hg > xemacs-beta
diff src/debug.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 74fd4e045ea6 |
children | 11054d720c21 |
line wrap: on
line diff
--- a/src/debug.c Mon Aug 13 11:19:22 2007 +0200 +++ b/src/debug.c Mon Aug 13 11:20:41 2007 +0200 @@ -39,43 +39,44 @@ * 4. Add a FROB line for it in xemacs_debug_loop. */ -static Lisp_Object Qredisplay, Qbuffers, Qfaces, Qwindows, Qframes, Qdevices; +Lisp_Object Qredisplay, Qbuffers, Qfaces; +Lisp_Object Qwindows, Qframes, Qdevices; struct debug_classes active_debug_classes; enum debug_loop { - X_ADD, - X_DELETE, - X_LIST, - X_ACTIVE, - X_INIT, - X_VALIDATE, - X_TYPE, - X_SETTYPE + ADD, + DELETE, + LIST, + ACTIVE, + INIT, + VALIDATE, + TYPE, + SETTYPE }; static Lisp_Object xemacs_debug_loop (enum debug_loop op, Lisp_Object class, Lisp_Object type) { - int flag = (op == X_ADD) ? 1 : 0; + int flag = (op == ADD) ? 1 : 0; Lisp_Object retval = Qnil; #define FROB(item) \ - if (op == X_LIST || op == X_ACTIVE || op == X_INIT || EQ (class, Q##item)) \ + if (op == LIST || op == ACTIVE || op == INIT || EQ (class, Q##item)) \ { \ - if (op == X_ADD || op == X_DELETE || op == X_INIT) \ + if (op == ADD || op == DELETE || op == INIT) \ active_debug_classes.item = flag; \ - else if (op == X_LIST \ - || (op == X_ACTIVE && active_debug_classes.item)) \ + else if (op == LIST \ + || (op == ACTIVE && active_debug_classes.item)) \ retval = Fcons (Q##item, retval); \ - else if (op == X_VALIDATE) \ + else if (op == VALIDATE) \ return Qt; \ - else if (op == X_SETTYPE) \ + else if (op == SETTYPE) \ active_debug_classes.types_of_##item = XINT (type); \ - else if (op == X_TYPE) \ + else if (op == TYPE) \ retval = make_int (active_debug_classes.types_of_##item); \ - if (op == X_INIT) active_debug_classes.types_of_##item = VALBITS; \ + if (op == INIT) active_debug_classes.types_of_##item = VALBITS; \ } FROB (redisplay); @@ -96,12 +97,12 @@ */ (class)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("No such debug class exists"); else - xemacs_debug_loop (X_ADD, class, Qnil); + xemacs_debug_loop (ADD, class, Qnil); - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("delete-debug-class-to-check", Fdelete_debug_class_to_check, 1, 1, 0, /* @@ -109,12 +110,12 @@ */ (class)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("No such debug class exists"); else - xemacs_debug_loop (X_DELETE, class, Qnil); + xemacs_debug_loop (DELETE, class, Qnil); - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("debug-classes-being-checked", Fdebug_classes_being_checked, 0, 0, 0, /* @@ -122,7 +123,7 @@ */ ()) { - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("debug-classes-list", Fdebug_classes_list, 0, 0, 0, /* @@ -130,7 +131,7 @@ */ ()) { - return (xemacs_debug_loop (X_LIST, Qnil, Qnil)); + return (xemacs_debug_loop (LIST, Qnil, Qnil)); } DEFUN ("set-debug-classes-to-check", Fset_debug_classes_to_check, 1, 1, 0, /* @@ -147,14 +148,14 @@ valid, reject the entire list without doing anything. */ LIST_LOOP (rest, classes ) { - if (NILP (xemacs_debug_loop (X_VALIDATE, XCAR (rest), Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, XCAR (rest), Qnil))) error ("Invalid object in class list"); } LIST_LOOP (rest, classes) Fadd_debug_class_to_check (XCAR (rest)); - return (xemacs_debug_loop (X_ACTIVE, Qnil, Qnil)); + return (xemacs_debug_loop (ACTIVE, Qnil, Qnil)); } DEFUN ("set-debug-class-types-to-check", Fset_debug_class_types_to_check, 2, 2, 0, /* @@ -165,12 +166,12 @@ (class, type)) { CHECK_INT (type); - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("Invalid debug class"); - xemacs_debug_loop (X_SETTYPE, class, type); + xemacs_debug_loop (SETTYPE, class, type); - return (xemacs_debug_loop (X_TYPE, class, Qnil)); + return (xemacs_debug_loop (TYPE, class, Qnil)); } DEFUN ("debug-types-being-checked", Fdebug_types_being_checked, 1, 1, 0, /* @@ -178,10 +179,10 @@ */ (class)) { - if (NILP (xemacs_debug_loop (X_VALIDATE, class, Qnil))) + if (NILP (xemacs_debug_loop (VALIDATE, class, Qnil))) error ("Invalid debug class"); - return (xemacs_debug_loop (X_TYPE, class, Qnil)); + return (xemacs_debug_loop (TYPE, class, Qnil)); } void @@ -193,6 +194,7 @@ defsymbol (&Qwindows, "windows"); defsymbol (&Qframes, "frames"); defsymbol (&Qdevices, "devices"); + /* defsymbol (&Qbyte_code, "byte-code"); in bytecode.c */ DEFSUBR (Fadd_debug_class_to_check); DEFSUBR (Fdelete_debug_class_to_check); @@ -204,17 +206,11 @@ } void -reinit_vars_of_debug (void) +vars_of_debug (void) { /* If you need to have any classes active early on in startup, then the flags should be set here. All functions called by this function are "allowed" according to emacs.c. */ - xemacs_debug_loop (X_INIT, Qnil, Qnil); + xemacs_debug_loop (INIT, Qnil, Qnil); } - -void -vars_of_debug (void) -{ - reinit_vars_of_debug (); -}