diff options
author | sanine-a <sanine.not@pm.me> | 2021-05-26 20:04:17 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2021-05-26 20:04:17 -0500 |
commit | a1f5b414edccf584518e5829e9797931c791f3fc (patch) | |
tree | 918668783d7dbf9eac38d73c6d012fe562b995c2 /README.md | |
parent | 6e4b4d265e39bb5c208e733df00aedfcdf9333a7 (diff) |
provide stack indices for args and add HS_ANY typecheck test
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -76,20 +76,22 @@ performs typechecking and in case of an error throws with helpful error messages. `hs_parse_args_fast()` does not perform typechecking, and as a result has much less friendly error messages. -`HS_TBL`, `HS_FUNC`, `HS_NIL`, and `HS_ANY` do not take a pointer, and are -simply used to confirm the presence of an argument on the stack. +`HS_TBL`, `HS_FUNC`, `HS_NIL`, and `HS_ANY` take a pointer to an integer +that will be filled with the stack index of the argument. ```C int some_lua_binding(lua_State *L) { bool b; int i; + int tbl_index; lua_Number n; char *str; void* user; hs_parse_args(L, HS_BOOL, &b, HS_INT, &i, + HS_TBL, &tbl_index, HS_NUM, &n, HS_STR, &str, HS_USER, &user, |