Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "duktape.h"
Go to the source code of this file.
Macros | |
#define | GREET_CODE(variant) |
#define | MEM_LIMIT_NORMAL (128*1024*1024) /* 128 MB */ |
#define | MEM_LIMIT_HIGH (2047*1024*1024) /* ~2 GB */ |
#define | LINEBUF_SIZE 65536 |
#define | ALLOC_DEFAULT 0 |
#define | ALLOC_LOGGING 1 |
#define | ALLOC_TORTURE 2 |
#define | ALLOC_HYBRID 3 |
#define | ALLOC_AJSHEAP 4 |
Functions | |
static int | get_stack_raw (duk_context *ctx) |
static void | print_pop_error (duk_context *ctx, FILE *f) |
static int | wrapped_compile_execute (duk_context *ctx) |
static int | handle_fh (duk_context *ctx, FILE *f, const char *filename, const char *bytecode_filename) |
static int | handle_file (duk_context *ctx, const char *filename, const char *bytecode_filename) |
static int | handle_eval (duk_context *ctx, char *code) |
static int | handle_interactive (duk_context *ctx) |
static duk_context * | create_duktape_heap (int alloc_provider, int debugger, int ajsheap_log) |
static void | destroy_duktape_heap (duk_context *ctx, int alloc_provider) |
int | main (int argc, char *argv[]) |
Variables | |
static int | main_argc = 0 |
static char ** | main_argv = NULL |
static int | interactive_mode = 0 |
#define ALLOC_AJSHEAP 4 |
Definition at line 998 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by create_duktape_heap(), destroy_duktape_heap(), and main().
#define ALLOC_DEFAULT 0 |
Definition at line 994 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by create_duktape_heap(), and main().
#define ALLOC_HYBRID 3 |
Definition at line 997 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by create_duktape_heap(), and main().
#define ALLOC_LOGGING 1 |
Definition at line 995 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by create_duktape_heap(), and main().
#define ALLOC_TORTURE 2 |
Definition at line 996 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by create_duktape_heap(), and main().
#define GREET_CODE | ( | variant | ) |
Definition at line 31 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by handle_interactive().
#define LINEBUF_SIZE 65536 |
Definition at line 89 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by handle_interactive().
#define MEM_LIMIT_HIGH (2047*1024*1024) /* ~2 GB */ |
Definition at line 88 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by main().
#define MEM_LIMIT_NORMAL (128*1024*1024) /* 128 MB */ |
Definition at line 87 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by main().
|
static |
Definition at line 1000 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References ALLOC_AJSHEAP, ALLOC_DEFAULT, ALLOC_HYBRID, ALLOC_LOGGING, ALLOC_TORTURE, duk_alloc_hybrid(), duk_alloc_hybrid_init(), duk_alloc_logging(), duk_alloc_torture(), duk_create_heap(), duk_create_heap_default, duk_debugger_attach_custom(), duk_debugger_cooperate(), duk_free_hybrid(), duk_free_logging(), duk_free_torture(), duk_push_c_function(), duk_put_global_string(), duk_realloc_hybrid(), duk_realloc_logging(), duk_realloc_torture(), duk_trans_socket_init(), duk_trans_socket_peek_cb(), duk_trans_socket_read_cb(), duk_trans_socket_read_flush_cb(), duk_trans_socket_waitconn(), duk_trans_socket_write_cb(), duk_trans_socket_write_flush_cb(), NULL, and printf.
Referenced by main().
|
static |
Definition at line 1131 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References ALLOC_AJSHEAP, duk_destroy_heap(), and duk_gc().
Referenced by main().
|
static |
Definition at line 144 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References duk_get_prop_string(), duk_has_prop_string(), duk_is_error, duk_is_object(), and duk_remove().
Referenced by print_pop_error().
|
static |
Definition at line 657 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References DUK_EXEC_SUCCESS, duk_pop(), duk_push_pointer(), duk_push_string(), duk_push_uint(), duk_safe_call(), interactive_mode, print_pop_error(), and wrapped_compile_execute().
Referenced by main().
|
static |
Definition at line 493 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References DUK_EXEC_SUCCESS, duk_pop(), duk_push_pointer(), duk_push_string(), duk_push_uint(), duk_safe_call(), error(), fread(), free, interactive_mode, malloc, NULL, print_pop_error(), realloc, and wrapped_compile_execute().
Referenced by handle_file(), and main().
|
static |
Definition at line 620 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References duk_debugger_notify(), duk_push_string(), error(), handle_fh(), NULL, and snprintf.
Referenced by main().
|
static |
Definition at line 755 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References duk_eval_string, DUK_EXEC_SUCCESS, duk_pop(), duk_push_pointer(), duk_push_string(), duk_push_uint(), duk_safe_call(), free, fwrite(), GREET_CODE, interactive_mode, LINEBUF_SIZE, malloc, NULL, print_pop_error(), and wrapped_compile_execute().
Referenced by main().
int main | ( | int | argc, |
char * | argv[] ) |
Definition at line 1163 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References ALLOC_AJSHEAP, ALLOC_DEFAULT, ALLOC_HYBRID, ALLOC_LOGGING, ALLOC_TORTURE, arg, create_duktape_heap(), destroy_duktape_heap(), duk_gc(), handle_eval(), handle_fh(), handle_file(), handle_interactive(), main_argc, main_argv, MEM_LIMIT_HIGH, MEM_LIMIT_NORMAL, NULL, set_sigint_handler(), and usage().
|
static |
Definition at line 162 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References duk_pop(), duk_safe_call(), duk_safe_to_string, and get_stack_raw().
Referenced by handle_eval(), handle_fh(), and handle_interactive().
|
static |
Definition at line 173 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
References duk_call_method(), duk_compile_lstring_filename, duk_dump_function(), duk_dup_top(), DUK_ERR_ERROR, duk_error, duk_is_string(), duk_load_function(), duk_push_global_object(), duk_push_lstring(), duk_require_buffer(), duk_require_pointer(), duk_require_string(), duk_require_uint(), duk_to_buffer, duk_to_string(), fwrite(), interactive_mode, NULL, and snprintf.
Referenced by handle_eval(), handle_fh(), and handle_interactive().
|
static |
Definition at line 93 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by handle_eval(), handle_fh(), handle_interactive(), and wrapped_compile_execute().
|
static |
Definition at line 91 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by main().
|
static |
Definition at line 92 of file duktape-1.5.2/examples/cmdline/duk_cmdline.c.
Referenced by main().