2 * Copyright 2005, Ingo Weinhold, bonefish@users.sf.net.
3 * Distributed under the terms of the MIT License.
5 #ifndef STRACE_SYSCALL_H
6 #define STRACE_SYSCALL_H
11 #include <SupportDefs.h>
13 #include "TypeHandler.h"
21 Type(string typeName
, TypeHandler
*handler
)
22 : fTypeName(typeName
), fHandler(handler
) {}
24 const string
&TypeName() const { return fTypeName
; }
26 void SetHandler(TypeHandler
*handler
)
32 TypeHandler
*Handler() const { return fHandler
; }
36 TypeHandler
*fHandler
;
40 class Parameter
: public Type
{
42 Parameter(string name
, int32 offset
, string typeName
, TypeHandler
*handler
)
43 : Type(typeName
, handler
),
49 const string
&Name() const { return fName
; }
50 int32
Offset() const { return fOffset
; }
60 Syscall(string name
, string returnTypeName
, TypeHandler
*returnTypeHandler
)
62 fReturnType(new Type(returnTypeName
, returnTypeHandler
))
66 const string
&Name() const
71 Type
*ReturnType() const
76 void AddParameter(Parameter
*parameter
)
78 fParameters
.push_back(parameter
);
81 void AddParameter(string name
, int32 offset
, string typeName
,
84 AddParameter(new Parameter(name
, offset
, typeName
, handler
));
87 int32
CountParameters() const
89 return fParameters
.size();
92 Parameter
*ParameterAt(int32 index
) const
94 return fParameters
[index
];
97 Parameter
*GetParameter(string name
) const
99 int32 count
= CountParameters();
100 for (int32 i
= 0; i
< count
; i
++) {
101 Parameter
*parameter
= ParameterAt(i
);
102 if (parameter
->Name() == name
)
112 vector
<Parameter
*> fParameters
;
115 #endif // STRACE_SYSCALL_H