File: debug.cpp

package info (click to toggle)
xstow 1.0.2-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,064 kB
  • ctags: 1,073
  • sloc: cpp: 7,264; sh: 1,216; makefile: 196; awk: 26
file content (118 lines) | stat: -rw-r--r-- 2,406 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 * $Log: debug.cpp,v $
 * Revision 1.3  2005/07/04 21:59:42  martin
 * added logging to all files
 *
 */
#include "debug.h"
#include "string_utils.h"

Format::PrintF<std::ostream> out( std::cout );
Format::PrintF<std::ostream> vout( std::cout );
Format::PrintF<std::ostream> eout( std::cerr );

std::string progname = PACKAGE;
/*
DModule string2module( std::string m )
{
  m = toupper( m );

  if( m == "ALL" )
    return MODULE_ALL;

  if( m == "MAIN" )
    return  MODULE_MAIN;

  if( m == "ARG" )
    return MODULE_ARG;       

  if( m == "TREE" )
    return MODULE_TREE;

  if( m == "CPPDIR" )
    return MODULE_CPPDIR;
  
  if( m == "SETUP" )
    return MODULE_SETUP;

  if( m == "NIGNORE" )
    return MODULE_NIGNORE;

  if( m == "MERGE_INFO" )
      return MODULE_MERGE_INFO;

  out[0]( "unkown module name \"%s\". Using default value ALL\n", m );

  return MODULE_ALL;
}

std::string x2s( DModuleRange module )
{
  switch( module )
    {
    case MODULE_ALL:        return "ALL";
    case MODULE_ARG:        return "ARG";
    case MODULE_MAIN:       return "MAIN";
    case MODULE_TREE:       return "TREE";
    case MODULE_CPPDIR:     return "CPPDIR";
    case MODULE_SETUP:      return "SETUP";
    case MODULE_NIGNORE:    return "NIGNORE";
    case MODULE_MERGE_INFO: return "MERGE_INFO";
    }

  return "UNKNOWN";
}
*/

MODULE::ETYPE string2module( std::string m )
{
  m = toupper( m );

  if( m == "ALL" )
    return MODULE::ALL;

  if( m == "MAIN" )
    return  MODULE::MAIN;

  if( m == "ARG" )
    return MODULE::ARG;       

  if( m == "TREE" )
    return MODULE::TREE;

  if( m == "CPPDIR" )
    return MODULE::CPPDIR;
  
  if( m == "SETUP" )
    return MODULE::SETUP;

  if( m == "NIGNORE" )
    return MODULE::NIGNORE;

  if( m == "MERGE_INFO" )
      return MODULE::MERGE_INFO;

  out[0]( "unkown module name \"%s\". Using default value ALL\n", m );

  return MODULE::ALL;
}

std::string x2s( MODULE module )
{
  switch( module )
    {
    case MODULE::ALL:        return "ALL";
    case MODULE::ARG:        return "ARG";
    case MODULE::MAIN:       return "MAIN";
    case MODULE::TREE:       return "TREE";
    case MODULE::CPPDIR:     return "CPPDIR";
    case MODULE::SETUP:      return "SETUP";
    case MODULE::NIGNORE:    return "NIGNORE";
    case MODULE::MERGE_INFO: return "MERGE_INFO";
	case MODULE::FIRST__:
	case MODULE::LAST__:
		break;
    }

  return "UNKNOWN";
}