Skip to content

Commit

Permalink
src: export additional startup functions
Browse files Browse the repository at this point in the history
This allows embedders enough control to initialize node, run the
event loop, and cleanly exit (including calling handlers).

Signed-off-by: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
deanm authored and indutny committed Jul 23, 2014
1 parent 4c48df5 commit ba09409
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/node.h
Expand Up @@ -170,6 +170,22 @@ namespace node {
NODE_EXTERN extern bool no_deprecation;

NODE_EXTERN int Start(int argc, char *argv[]);
NODE_EXTERN void Init(int* argc,
const char** argv,
int* exec_argc,
const char*** exec_argv);

class Environment;

NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate,
v8::Handle<v8::Context> context,
int argc,
const char* const* argv,
int exec_argc,
const char* const* exec_argv);
NODE_EXTERN void EmitBeforeExit(Environment* env);
NODE_EXTERN int EmitExit(Environment* env);
NODE_EXTERN void RunAtExit(Environment* env);

/* Converts a unixtime to V8 Date */
#define NODE_UNIXTIME_V8(t) v8::Date::New(v8::Isolate::GetCurrent(), \
Expand Down

0 comments on commit ba09409

Please sign in to comment.