mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
554 B
25 lines
554 B
name: duk_require_lstring
|
|
|
|
proto: |
|
|
const char *duk_require_lstring(duk_context *ctx, duk_idx_t index, duk_size_t *out_len);
|
|
|
|
stack: |
|
|
[ ... val! ... ]
|
|
|
|
summary: |
|
|
<p>Like <code><a href="#duk_get_lstring">duk_get_lstring()</a></code>,
|
|
but throws an error if the value at <code>index</code> is not a string
|
|
or if the index is invalid.</p>
|
|
|
|
example: |
|
|
const char *buf;
|
|
duk_size_t len;
|
|
|
|
buf = duk_require_lstring(ctx, -3, &len);
|
|
printf("value is a string, %lu bytes\n", (unsigned long) len);
|
|
|
|
tags:
|
|
- stack
|
|
- string
|
|
|
|
introduced: 1.0.0
|
|
|