This repository was archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.h
More file actions
52 lines (36 loc) · 1.24 KB
/
util.h
File metadata and controls
52 lines (36 loc) · 1.24 KB
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
// misc utilities
// Copyright (C) 2014-2015 Serguei Makarov
// Copyright (C) 2005-2013 Red Hat Inc.
// Copyright (C) 2005-2008 Intel Corporation.
// Copyright (C) 2010 Novell Corporation.
//
// This file is part of EBT, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
#ifndef EBT_UTIL_H
#define EBT_UTIL_H
#include <iostream>
/* XXX this is a primitive version of translator-output.cxx from systemtap */
class translator_output {
std::ostream& o;
unsigned tablevel;
public:
translator_output(std::ostream &file);
std::ostream& newline (int indent_amount = 0);
void indent (int amount);
std::ostream& line();
};
std::string c_stringify(const std::string &unescaped);
std::string c_comment(const std::string &unescaped);
// Miscellaneous debugging utilities:
#ifdef NO_TRACE
#define TRACE(label,x) (x)
#define TRACE_MANY(xs) (0)
#else
#define TRACE(label,x) ( std::cerr << #label << ": " << (x) << endl, (x) )
// XXX be careful of double evaluation when using this
#define TRACE_MANY(xs) ( std::cerr << xs << endl )
// -- designed for use like so: TRACE_MANY(x << y << z)
#endif
#endif // EBT_UTIL_H