yast2-core
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
libycp
src
include
ycp
ExecutionEnvironment.h
Go to the documentation of this file.
1
/*
2
* YaST2: Core system
3
*
4
* Description:
5
* YaST2 execution environment, i.e. processing context.
6
* Contains reference to the current block, the current statement,
7
* the current file name and backtrace.
8
* This information can be used for logging, debugger etc.
9
*
10
* Authors:
11
* Stanislav Visnovsky <visnov@suse.cz>
12
*
13
*/
14
15
#ifndef _execution_environment_h
16
#define _execution_environment_h
17
18
#include <stack>
19
#include <string>
20
21
#include "
y2log.h
"
22
#include "
ycp/YStatement.h
"
23
#include "
ycp/YExpression.h
"
24
25
#include <
ycp/YCPValue.h
>
26
27
using namespace
std;
28
29
namespace
YaST
30
{
31
33
struct
CallFrame
{
34
YECallPtr
function
;
35
string
filename
;
36
int
linenumber
;
37
YCPValue
*
params
;
38
39
CallFrame
(
const
string
& f,
int
l, YECallPtr func,
YCPValue
* p)
40
: function(func), filename(f), linenumber(l), params(p)
41
{
42
}
43
};
44
53
class
ExecutionEnvironment
{
54
55
public
:
56
typedef
vector<const CallFrame*>
CallStack
;
57
58
private
:
59
int
m_linenumber
;
60
string
m_filename
;
61
bool
m_forced_filename
;
62
YStatementPtr
m_statement
;
63
CallStack
m_backtrace
;
69
size_t
m_recursion_limit
;
70
71
public
:
72
ExecutionEnvironment
();
73
~ExecutionEnvironment
() {};
74
78
int
linenumber ()
const
;
79
83
void
setLinenumber (
int
line);
84
88
const
string
& filename()
const
;
89
93
void
setFilename (
const
string
& filename);
94
98
YStatementPtr statement ()
const
;
99
103
void
setStatement (YStatementPtr s);
104
108
bool
endlessRecursion ();
109
116
void
pushframe (YECallPtr called_function,
YCPValue
params[]);
117
121
void
popframe ();
122
129
void
backtrace (
loglevel_t
level, uint skip = 0)
const
;
130
137
CallStack callstack()
const
;
138
};
139
140
141
extern
ExecutionEnvironment
ee
;
142
}
143
144
#endif
/* _execution_environment_h */
Generated on a sunny day for yast2-core by
1.8.2