summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjussi2022-12-08 18:24:41 +0200
committerjussi2022-12-08 18:24:41 +0200
commit973d902a16b35258629d2a0b228ad9c3f49b6198 (patch)
tree7ee30310c5c2356cbaf31f9f2d23d21b89770f51 /src
parent79fbb36d2a4d73001c446f75b3b87dc84f1605b6 (diff)
downloadreilua-enhanced-973d902a16b35258629d2a0b228ad9c3f49b6198.tar.gz
reilua-enhanced-973d902a16b35258629d2a0b228ad9c3f49b6198.tar.bz2
reilua-enhanced-973d902a16b35258629d2a0b228ad9c3f49b6198.zip
ReiLuaGui File explorer.
Diffstat (limited to 'src')
-rw-r--r--src/core.c18
-rw-r--r--src/lua_core.c1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index eabfe52..dd2783a 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2244,6 +2244,24 @@ int lcoreChangeDirectory( lua_State *L ) {
}
/*
+> isFile = RL_IsPathFile( string path )
+
+Check if a given path is a file or a directory
+
+- Failure return nil
+- Success return bool
+*/
+int lcoreIsPathFile( lua_State *L ) {
+ if ( !lua_isstring( L, -1 ) ) {
+ TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_IsPathFile( string path )" );
+ lua_pushnil( L );
+ return 1;
+ }
+ lua_pushboolean( L, IsPathFile( lua_tostring( L, -1 ) ) );
+ return 1;
+}
+
+/*
> fileDropped = RL_IsFileDropped()
Check if a file has been dropped into window
diff --git a/src/lua_core.c b/src/lua_core.c
index defd8f2..2a07a90 100644
--- a/src/lua_core.c
+++ b/src/lua_core.c
@@ -750,6 +750,7 @@ void luaRegister() {
lua_register( L, "RL_LoadDirectoryFiles", lcoreLoadDirectoryFiles );
lua_register( L, "RL_LoadDirectoryFilesEx", lcoreLoadDirectoryFilesEx );
lua_register( L, "RL_ChangeDirectory", lcoreChangeDirectory );
+ lua_register( L, "RL_IsPathFile", lcoreIsPathFile );
lua_register( L, "RL_IsFileDropped", lcoreIsFileDropped );
lua_register( L, "RL_LoadDroppedFiles", lcoreLoadDroppedFiles );
lua_register( L, "RL_GetFileModTime", lcoreGetFileModTime );