From c929720cc8a17334d73054d58e3fe0ca5d808c9a Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Thu, 5 May 2016 00:54:45 +0300 Subject: [PATCH] Merge duk_debugger_{attach,attach_custom}() calls --- src/duk_api_debug.c | 36 ++++++++++++++++++------------------ src/duk_api_public.h.in | 22 +++++++++------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/duk_api_debug.c b/src/duk_api_debug.c index 9698b825..fa397a65 100644 --- a/src/duk_api_debug.c +++ b/src/duk_api_debug.c @@ -40,15 +40,15 @@ DUK_EXTERNAL void duk_push_context_dump(duk_context *ctx) { #if defined(DUK_USE_DEBUGGER_SUPPORT) -DUK_EXTERNAL void duk_debugger_attach_custom(duk_context *ctx, - duk_debug_read_function read_cb, - duk_debug_write_function write_cb, - duk_debug_peek_function peek_cb, - duk_debug_read_flush_function read_flush_cb, - duk_debug_write_flush_function write_flush_cb, - duk_debug_request_function request_cb, - duk_debug_detached_function detached_cb, - void *udata) { +DUK_EXTERNAL void duk_debugger_attach(duk_context *ctx, + duk_debug_read_function read_cb, + duk_debug_write_function write_cb, + duk_debug_peek_function peek_cb, + duk_debug_read_flush_function read_flush_cb, + duk_debug_write_flush_function write_flush_cb, + duk_debug_request_function request_cb, + duk_debug_detached_function detached_cb, + void *udata) { duk_hthread *thr = (duk_hthread *) ctx; duk_heap *heap; const char *str; @@ -206,15 +206,15 @@ DUK_EXTERNAL void duk_debugger_pause(duk_context *ctx) { #else /* DUK_USE_DEBUGGER_SUPPORT */ -DUK_EXTERNAL void duk_debugger_attach_custom(duk_context *ctx, - duk_debug_read_function read_cb, - duk_debug_write_function write_cb, - duk_debug_peek_function peek_cb, - duk_debug_read_flush_function read_flush_cb, - duk_debug_write_flush_function write_flush_cb, - duk_debug_request_function request_cb, - duk_debug_detached_function detached_cb, - void *udata) { +DUK_EXTERNAL void duk_debugger_attach(duk_context *ctx, + duk_debug_read_function read_cb, + duk_debug_write_function write_cb, + duk_debug_peek_function peek_cb, + duk_debug_read_flush_function read_flush_cb, + duk_debug_write_flush_function write_flush_cb, + duk_debug_request_function request_cb, + duk_debug_detached_function detached_cb, + void *udata) { DUK_ASSERT_CTX_VALID(ctx); DUK_UNREF(read_cb); DUK_UNREF(write_cb); diff --git a/src/duk_api_public.h.in b/src/duk_api_public.h.in index 25c04c83..fdabad85 100644 --- a/src/duk_api_public.h.in +++ b/src/duk_api_public.h.in @@ -932,19 +932,15 @@ DUK_EXTERNAL_DECL void duk_push_context_dump(duk_context *ctx); * Debugger (debug protocol) */ -#define duk_debugger_attach(ctx,read_cb,write_cb,peek_cb,read_flush_cb,write_flush_cb,detached_cb,udata) \ - duk_debugger_attach_custom((ctx), (read_cb), (write_cb), (peek_cb), (read_flush_cb), (write_flush_cb), \ - NULL, (detached_cb), (udata)) - -DUK_EXTERNAL_DECL void duk_debugger_attach_custom(duk_context *ctx, - duk_debug_read_function read_cb, - duk_debug_write_function write_cb, - duk_debug_peek_function peek_cb, - duk_debug_read_flush_function read_flush_cb, - duk_debug_write_flush_function write_flush_cb, - duk_debug_request_function request_cb, - duk_debug_detached_function detached_cb, - void *udata); +DUK_EXTERNAL_DECL void duk_debugger_attach(duk_context *ctx, + duk_debug_read_function read_cb, + duk_debug_write_function write_cb, + duk_debug_peek_function peek_cb, + duk_debug_read_flush_function read_flush_cb, + duk_debug_write_flush_function write_flush_cb, + duk_debug_request_function request_cb, + duk_debug_detached_function detached_cb, + void *udata); DUK_EXTERNAL_DECL void duk_debugger_detach(duk_context *ctx); DUK_EXTERNAL_DECL void duk_debugger_cooperate(duk_context *ctx); DUK_EXTERNAL_DECL duk_bool_t duk_debugger_notify(duk_context *ctx, duk_idx_t nvalues);