]> git.cworth.org Git - apitrace/blob - trace_format.hpp
Match GL specs.
[apitrace] / trace_format.hpp
1 /**************************************************************************
2  *
3  * Copyright 2010 VMware, Inc.
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  *
24  **************************************************************************/
25
26 #ifndef _TRACE_FORMAT_HPP_
27 #define _TRACE_FORMAT_HPP_
28
29 namespace Trace {
30
31 #define TRACE_VERSION 0
32
33 enum CallDetail {
34    CALL_END = 0,
35    CALL_ARG,
36    CALL_RET,
37    CALL_THREAD,
38 };
39
40 enum Type {
41    TYPE_NULL = 0,
42    TYPE_FALSE,
43    TYPE_TRUE,
44    TYPE_SINT,
45    TYPE_UINT,
46    TYPE_FLOAT,
47    TYPE_DOUBLE,
48    TYPE_STRING, // Null terminated, human readible string
49    TYPE_BLOB, // Block of bytes
50    TYPE_CONST,
51    TYPE_BITMASK,
52    TYPE_ARRAY,
53    TYPE_STRUCT,
54    TYPE_OPAQUE,
55 };
56
57 /*
58  * trace = call* EOF
59  *
60  * call = name (detail)* END
61  *
62  * detail = ARG name value
63  *        | RET value
64  *        | ...
65  *
66  * value = VOID
67  *       | BOOL BOOL_VALUE
68  *       | SINT INT_VALUE
69  *       | UINT INT_VALUE
70  *       | FLOAT FLOAT_VALUE
71  *       | STRING string
72  *       | BLOB string
73  *       | CONST name value
74  *       | BITMASK value+
75  *       | ARRAY length 
76  *
77  * bool = 0 | 1
78  *
79  * name = string
80  *
81  * string = length (BYTE)*
82  *
83  * length = INT_VALUE
84  */
85
86
87 } /* namespace Trace */
88
89 #endif /* _TRACE_FORMAT_HPP_ */