Oolite
Loading...
Searching...
No Matches
OOJSPropID.h
Go to the documentation of this file.
1
/*
2
3
OOJSPropID.h (QuickJS-ng)
4
5
Oolite
6
Copyright (C) 2004-2013 Giles C Williams and contributors
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; either version 2
11
of the License, or (at your option) any later version.
12
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
MA 02110-1301, USA.
22
23
*/
24
25
#import "
OOFunctionAttributes.h
"
26
#include <quickjs.h>
27
28
/* Engine-neutral names for a property ID and a value (jsid and jsval with
29
SpiderMonkey). Declared here, rather than in OOJavaScriptEngine.h, so game
30
headers imported by OOJavaScriptEngine.h can use them.
31
*/
32
typedef
JSAtom
OOJSPropID
;
33
typedef
JSValue
OOJSVal
;
34
35
/*
36
OOJSID(const char * [literal])
37
Macro to create a property ID. The string is interned the first time the
38
macro is hit, then cached; the atom lives as long as the runtime.
39
*/
40
#define OOJSID(str) ({ static JSAtom idCache = JS_ATOM_NULL; if (EXPECT_NOT(idCache == JS_ATOM_NULL)) idCache = OOJSInternAtomPRIVATE(""str); idCache; })
41
JSAtom
OOJSInternAtomPRIVATE
(
const
char
* name);
OOFunctionAttributes.h
OOJSPropID
jsid OOJSPropID
Definition
OOJSPropID.h:31
OOJSVal
jsval OOJSVal
Definition
OOJavaScriptEngine.h:143
OOJSInternAtomPRIVATE
JSAtom OOJSInternAtomPRIVATE(const char *name)
Definition
OOJavaScriptEngine.m:1046
src
Core
Scripting
QuickJS
OOJSPropID.h
Generated by
1.15.0