satyr  0.24.15.g3735.dirty
Macros | Typedefs | Enumerations | Functions
platform.h File Reference

Platform JavaScript platform. More...

#include <inttypes.h>

Go to the source code of this file.

Macros

#define SR_JS_ENGINE_VALIDITY_CHECK(engine)   (engine > 0 && engine < _SR_JS_ENGINE_UPPER_BOUND)
 
#define SR_JS_RUNTIME_VALIDITY_CHECK(runtime)   (runtime > 0 && runtime < _SR_JS_RUNTIME_UPPER_BOUND)
 
#define SR_JS_PLATFORM_NULL   0
 
#define _sr_js_platform_assemble(runtime, engine)   ((uint32_t)(runtime << 4) | engine)
 
#define sr_js_platform_new()   (_sr_js_platform_assemble(_SR_JS_RUNTIME_UNINIT, _SR_JS_ENGINE_UNINIT))
 
#define sr_js_platform_init(platform, runtime, engine)   do { platform = _sr_js_platform_assemble(runtime, engine); } while (0)
 
#define sr_js_platform_free(platform)   ((void)platform)
 
#define sr_js_platform_dup(platform)   (platform)
 
#define sr_js_platform_engine(platform)   (platform & 0xF)
 
#define sr_js_platform_runtime(platform)   (platform >> 4)
 

Typedefs

typedef uint32_t sr_js_platform_t
 

Enumerations

enum  sr_js_engine { SR_JS_ENGINE_V8 = 0x1, _SR_JS_ENGINE_UPPER_BOUND, _SR_JS_ENGINE_UNINIT = 0xF }
 
enum  sr_js_runtime { SR_JS_RUNTIME_NODEJS = 0x1, _SR_JS_RUNTIME_UPPER_BOUND, _SR_JS_RUNTIME_UNINIT =0xFFF }
 

Functions

const char * sr_js_engine_to_string (enum sr_js_engine engine)
 
enum sr_js_engine sr_js_engine_from_string (const char *engine)
 
const char * sr_js_runtime_to_string (enum sr_js_runtime runtime)
 
enum sr_js_runtime sr_js_runtime_from_string (const char *runtime)
 
sr_js_platform_t sr_js_platform_from_string (const char *runtime_name, const char *runtime_version, char **error_message)
 
char * sr_js_platform_to_json (sr_js_platform_t platform)
 
sr_js_platform_t sr_js_platform_from_json (struct sr_json_value *root, char **error_message)
 
struct sr_js_stacktracesr_js_platform_parse_stacktrace (sr_js_platform_t platform, const char **input, struct sr_location *location)
 
struct sr_js_framesr_js_platform_parse_frame (sr_js_platform_t platform, const char **input, struct sr_location *location)
 

Detailed Description

Platform JavaScript platform.

Definition in file platform.h.