From a1f5b414edccf584518e5829e9797931c791f3fc Mon Sep 17 00:00:00 2001 From: sanine-a Date: Wed, 26 May 2021 20:04:17 -0500 Subject: provide stack indices for args and add HS_ANY typecheck test --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 05f4ae7..33cdece 100644 --- a/README.md +++ b/README.md @@ -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, -- cgit v1.2.1