aboutsummaryrefslogtreecommitdiff
path: root/manual/manual.of
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2026-01-23 16:25:18 -0300
committerRoberto I <roberto@inf.puc-rio.br>2026-01-23 16:25:18 -0300
commitcfcaa9493b783527e5b5dfb71afb51602b3bccac (patch)
treef6c8d683185a36d5dca81bcfd9ac62c58a3c2a47 /manual/manual.of
parent3360710bd3ea8da06fa5062f9d10c2719083097c (diff)
downloadlua-cfcaa9493b783527e5b5dfb71afb51602b3bccac.tar.gz
lua-cfcaa9493b783527e5b5dfb71afb51602b3bccac.tar.bz2
lua-cfcaa9493b783527e5b5dfb71afb51602b3bccac.zip
Explanation about char* parameters in the C API
Diffstat (limited to 'manual/manual.of')
-rw-r--r--manual/manual.of14
1 files changed, 13 insertions, 1 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 09075346..893592da 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -2692,7 +2692,19 @@ which behaves like a nil value.
2692 2692
2693@sect3{constchar|@title{Pointers to Strings} 2693@sect3{constchar|@title{Pointers to Strings}
2694 2694
2695Several functions in the API return pointers (@T{const char*}) 2695Several functions in the API accept pointers (@T{const char*})
2696to C strings.
2697Some of there parameters have an associated length (@T{size_t}).
2698Unless stated otherwise,
2699when there is an associated length,
2700the string can contain embedded zeros;
2701moreover, the pointer can be @id{NULL} if the length is zero.
2702When there is no associated length,
2703the pointer must point to a zero-terminated string.
2704In any case, the string contents should remain unchanged
2705until the function returns.
2706
2707Several functions in the API also return pointers (@T{const char*})
2696to Lua strings in the stack. 2708to Lua strings in the stack.
2697(See @Lid{lua_pushfstring}, @Lid{lua_pushlstring}, 2709(See @Lid{lua_pushfstring}, @Lid{lua_pushlstring},
2698@Lid{lua_pushstring}, and @Lid{lua_tolstring}. 2710@Lid{lua_pushstring}, and @Lid{lua_tolstring}.