HaikuDepot: notify work status from main window
[haiku.git] / src / tools / gensyscalls / gensyscalls.h
blobfe8a19542d55ffea8ecdab7e01f4f454568d9dff
1 /*
2 * Copyright 2004-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef GENSYSCALLS_H
6 #define GENSYSCALLS_H
9 extern const char* const kReturnTypeAlignmentType;
10 extern const char* const kParameterAlignmentType;
11 extern const int kReturnTypeAlignmentSize;
12 extern const int kParameterAlignmentSize;
15 // Type
16 class Type {
17 public:
18 Type(const char* name, int size,
19 int usedSize,
20 const char* alignmentTypeName);
21 ~Type() {}
23 const char* TypeName() const { return fName; }
24 int Size() const { return fSize; }
25 int UsedSize() const { return fUsedSize; }
26 const char* AlignmentTypeName() const
27 { return fAlignmentType; }
29 private:
30 const char* fName;
31 int fSize;
32 int fUsedSize;
33 const char* fAlignmentType;
36 // Parameter
37 class Parameter : public Type {
38 public:
39 Parameter(const char* typeName,
40 const char* parameterName, int size,
41 int usedSize, int offset,
42 const char* alignmentTypeName);
43 ~Parameter() {}
45 const char* ParameterName() const { return fParameterName; }
46 int Offset() const { return fOffset; }
48 private:
49 const char* fParameterName;
50 int fOffset;
53 // Syscall
54 class Syscall {
55 public:
56 Syscall(const char* name,
57 const char* kernelName);
58 ~Syscall();
60 const char* Name() const { return fName; }
61 const char* KernelName() const { return fKernelName; }
62 Type* ReturnType() const { return fReturnType; }
64 int CountParameters() const;
65 Parameter* ParameterAt(int index) const;
66 Parameter* LastParameter() const;
68 void SetReturnType(int size, const char* name);
69 Type* SetReturnType(const char* name, int size,
70 int usedSize,
71 const char* alignmentTypeName);
72 void AddParameter(int size, const char* typeName,
73 const char* parameterName);
74 Parameter* AddParameter(const char* typeName,
75 const char* parameterName, int size,
76 int usedSize, int offset,
77 const char* alignmentTypeName);
79 private:
80 struct ParameterVector;
82 const char* fName;
83 const char* fKernelName;
84 Type* fReturnType;
85 ParameterVector* fParameters;
88 // SyscallVector
89 class SyscallVector {
90 public:
91 SyscallVector();
92 ~SyscallVector();
94 static SyscallVector* Create();
96 int CountSyscalls() const;
97 Syscall* SyscallAt(int index) const;
99 Syscall* CreateSyscall(const char* name,
100 const char* kernelName);
102 private:
103 struct _SyscallVector;
105 _SyscallVector* fSyscalls;
108 extern SyscallVector* create_syscall_vector();
111 #endif // GENSYSCALLS_H