source: git/factory/debug.cc @ 362fc67

jengelh-datetimespielwiese
Last change on this file since 362fc67 was 362fc67, checked in by Martin Lee <martinlee84@…>, 11 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 795 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3static int deb_level = -1;
4char * deb_level_msg = (char *)"";
5
6void deb_inc_level()
7{
8    int i;
9
10    // deb_level == -1 iff we enter this function for the first time
11    if ( deb_level == -1 )
12        deb_level = 0;
13    else
14        delete [] deb_level_msg;
15
16    deb_level++;
17    deb_level_msg = new char[3*deb_level+1];
18    for ( i = 0; i < 3*deb_level; i++ )
19        deb_level_msg[i] = ' ';
20    deb_level_msg[3*deb_level] = '\0';
21}
22
23void deb_dec_level()
24{
25    if ( deb_level > 0 ) {
26        int i;
27        deb_level--;
28        delete [] deb_level_msg;
29        deb_level_msg = new char[3*deb_level+1];
30            for ( i = 0; i < 3*deb_level; i++ )
31                deb_level_msg[i] = ' ';
32        deb_level_msg[3*deb_level] = '\0';
33    }
34}
Note: See TracBrowser for help on using the repository browser.