|
|
1.1 root 1: -- testdebug.py - support routine for pepy generated routines
2:
3: -- $Header: /f/osi/pepy/RCS/testdebug.py,v 7.0 89/11/23 22:12:07 mrose Rel $
4: --
5: --
6: -- $Log: testdebug.py,v $
7: -- Revision 7.0 89/11/23 22:12:07 mrose
8: -- Release 6.0
9: --
10:
11: --
12: -- NOTICE
13: --
14: -- Acquisition, use, and distribution of this module and related
15: -- materials are subject to the restrictions of a license agreement.
16: -- Consult the Preface in the User's Manual for the full terms of
17: -- this agreement.
18: --
19: --
20:
21:
22: TESTDEBUG DEFINITIONS ::=
23:
24: %{
25: #ifndef lint
26: static char *rcsid = "$Header: /f/osi/pepy/RCS/testdebug.py,v 7.0 89/11/23 22:12:07 mrose Rel $";
27: #endif
28:
29: /* LINTLIBRARY */
30:
31:
32: #include <stdio.h>
33:
34: %}
35:
36: BEGIN
37:
38: END
39:
40: %{
41: int testdebug (pe, s)
42: register PE pe;
43: register char *s;
44: {
45: char *cp;
46: register PS ps;
47: static int debug = OK;
48:
49: switch (debug) {
50: case NOTOK:
51: return;
52:
53: case OK:
54: if ((debug = (cp = getenv ("PEPYDEBUG")) && *cp ? atoi (cp)
55: : NOTOK) == NOTOK)
56: return;
57: (void) fflush (stdout);
58: fprintf (stderr, "testdebug made with %s\n", pepyid);
59: /* and fall... */
60:
61: default:
62: (void) fflush (stdout);
63: fprintf (stderr, "%s\n", s);
64:
65: if ((ps = ps_alloc (std_open)) == NULLPS)
66: break;
67: if (std_setup (ps, stderr) != NOTOK)
68: (void) pe2pl (ps, pe);
69: fprintf (stderr, "--------\n");
70: ps_free (ps);
71: break;
72: }
73: }
74:
75: %}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.