|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
2 * vim: set ts=8 sts=4 et sw=4 tw=99: |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 // This file contains public type declarations that are used *frequently*. If |
|
8 // it doesn't occur at least 10 times in Gecko, it probably shouldn't be in |
|
9 // here. |
|
10 // |
|
11 // It includes only: |
|
12 // - forward declarations of structs and classes; |
|
13 // - typedefs; |
|
14 // - enums (maybe). |
|
15 // It does *not* contain any struct or class definitions. |
|
16 |
|
17 #ifndef js_TypeDecls_h |
|
18 #define js_TypeDecls_h |
|
19 |
|
20 #include <stddef.h> |
|
21 #include <stdint.h> |
|
22 |
|
23 #include "js-config.h" |
|
24 |
|
25 struct JSContext; |
|
26 class JSFunction; |
|
27 class JSObject; |
|
28 class JSScript; |
|
29 class JSString; |
|
30 |
|
31 struct jsid; |
|
32 |
|
33 typedef char16_t jschar; |
|
34 |
|
35 namespace JS { |
|
36 |
|
37 class Value; |
|
38 template <typename T> class Handle; |
|
39 template <typename T> class MutableHandle; |
|
40 template <typename T> class Rooted; |
|
41 template <typename T> class PersistentRooted; |
|
42 |
|
43 typedef Handle<JSFunction*> HandleFunction; |
|
44 typedef Handle<jsid> HandleId; |
|
45 typedef Handle<JSObject*> HandleObject; |
|
46 typedef Handle<JSScript*> HandleScript; |
|
47 typedef Handle<JSString*> HandleString; |
|
48 typedef Handle<Value> HandleValue; |
|
49 |
|
50 typedef MutableHandle<JSFunction*> MutableHandleFunction; |
|
51 typedef MutableHandle<jsid> MutableHandleId; |
|
52 typedef MutableHandle<JSObject*> MutableHandleObject; |
|
53 typedef MutableHandle<JSScript*> MutableHandleScript; |
|
54 typedef MutableHandle<JSString*> MutableHandleString; |
|
55 typedef MutableHandle<Value> MutableHandleValue; |
|
56 |
|
57 typedef Rooted<JSObject*> RootedObject; |
|
58 typedef Rooted<JSFunction*> RootedFunction; |
|
59 typedef Rooted<JSScript*> RootedScript; |
|
60 typedef Rooted<JSString*> RootedString; |
|
61 typedef Rooted<jsid> RootedId; |
|
62 typedef Rooted<JS::Value> RootedValue; |
|
63 |
|
64 typedef PersistentRooted<JSFunction*> PersistentRootedFunction; |
|
65 typedef PersistentRooted<jsid> PersistentRootedId; |
|
66 typedef PersistentRooted<JSObject*> PersistentRootedObject; |
|
67 typedef PersistentRooted<JSScript*> PersistentRootedScript; |
|
68 typedef PersistentRooted<JSString*> PersistentRootedString; |
|
69 typedef PersistentRooted<Value> PersistentRootedValue; |
|
70 |
|
71 } // namespace JS |
|
72 |
|
73 #endif /* js_TypeDecls_h */ |