Browse Source

API docs for new vararg API call variants

api-get-refcount
Sami Vaarala 10 years ago
parent
commit
c54a04ac10
  1. 1
      website/api/duk_error.txt
  2. 30
      website/api/duk_error_va.txt
  3. 3
      website/api/duk_log.txt
  4. 25
      website/api/duk_log_va.txt
  5. 3
      website/api/duk_push_error_object.txt
  6. 33
      website/api/duk_push_error_object_va.txt
  7. 1
      website/api/duk_push_vsprintf.txt

1
website/api/duk_error.txt

@ -25,6 +25,7 @@ duk_error(ctx, DUK_ERR_RANGE_ERROR, "argument out of range: %d", (int) argval);
error
=seealso
duk_error_va
duk_throw
duk_push_error_object

30
website/api/duk_error_va.txt

@ -0,0 +1,30 @@
=proto
void duk_error_va(duk_context *ctx, duk_errcode_t err_code, const char *fmt, va_list ap);
=stack
[ ... ] -> [ ... err! ]
=summary
<p>Vararg variant of
<code><a href="#duk_error">duk_error()</a></code>.</p>
=example
void my_range_error(duk_context *ctx, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
duk_error_va(ctx, DUK_ERR_RANGE_ERROR, fmt, ap);
va_end(ap);
}
=tags
error
vararg
=seealso
duk_error
duk_throw
duk_push_error_object
=introduced
1.1.0

3
website/api/duk_log.txt

@ -10,6 +10,9 @@ built-in logging facility, see
=example
duk_log(ctx, DUK_LOG_INFO, "received message, type: %d", (int) msg_type);
=seealso
duk_log_va
=tags
log

25
website/api/duk_log_va.txt

@ -0,0 +1,25 @@
=proto
void duk_log_va(duk_context *ctx, duk_int_t level, const char *fmt, va_list ap);
=summary
<p>Vararg variant of
<code><a href="#duk_log">duk_log()</a></code>.</p>
=example
void my_log_info(duk_context *ctx, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
duk_log_va(ctx, DUK_LOG_INFO, fmt, ap);
va_end(ap);
}
=tags
log
vararg
=seealso
duk_log
=introduced
1.1.0

3
website/api/duk_push_error_object.txt

@ -24,5 +24,8 @@ stack
object
error
=seealso
duk_push_error_object_va
=introduced
1.0.0

33
website/api/duk_push_error_object_va.txt

@ -0,0 +1,33 @@
=proto
duk_idx_t duk_push_error_object_va(duk_context *ctx, duk_errcode_t err_code, const char *fmt, va_list ap);
=stack
[ ... ] -> [ ... err! ]
=summary
<p>Vararg variant of
<code><a href="#duk_push_error_object">duk_push_error_object()</a></code>.</p>
=example
duk_idx_t my_type_error(duk_context *ctx, const char *fmt, ...) {
va_list ap;
duk_idx_t err_idx;
va_start(ap, fmt);
err_idx = duk_push_error_object_va(ctx, fmt, ap);
va_end(ap);
return err_idx;
}
=tags
stack
object
error
vararg
=seealso
duk_push_error_object
=introduced
1.1.0

1
website/api/duk_push_vsprintf.txt

@ -40,6 +40,7 @@ void test(duk_context *ctx) {
=tags
stack
string
vararg
=introduced
1.0.0

Loading…
Cancel
Save