diff options
author | Rob Kendrick (humdrum) <rjek@rjek.com> | 2012-03-13 13:06:23 +0000 |
---|---|---|
committer | Rob Kendrick (humdrum) <rjek@rjek.com> | 2012-03-13 13:06:23 +0000 |
commit | e73abb47184bc045039c76d436de1ac7bb367ae0 (patch) | |
tree | 1c45f41ad94b43db6d70b9abb55c993e619b46f6 /luxio.c | |
parent | 30a7f9342e9cb9503c0edd65bba6c22577bc7a34 (diff) | |
download | luxio-e73abb47184bc045039c76d436de1ac7bb367ae0.tar.gz |
Expose d_type if under Linux
Diffstat (limited to 'luxio.c')
-rw-r--r-- | luxio.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1510,6 +1510,10 @@ luxio_readdir(lua_State *L) lua_setfield(L, -2, "d_ino"); lua_pushstring(L, s->ent->d_name); lua_setfield(L, -2, "d_name"); +#ifdef HAVE_D_TYPE + lua_pushinteger(L, s->ent->d_type); + lua_setfield(L, -2, "d_type"); +#endif return 2; } @@ -1664,7 +1668,16 @@ luaopen_luxio(lua_State *L) NUMERIC_CONSTANT(SIGRTMIN); NUMERIC_CONSTANT(SIGRTMAX); #endif - +#ifdef HAVE_D_TYPE + NUMERIC_CONSTANT(DT_UNKNOWN); + NUMERIC_CONSTANT(DT_FIFO); + NUMERIC_CONSTANT(DT_CHR); + NUMERIC_CONSTANT(DT_DIR); + NUMERIC_CONSTANT(DT_BLK); + NUMERIC_CONSTANT(DT_REG); + NUMERIC_CONSTANT(DT_LNK); + NUMERIC_CONSTANT(DT_SOCK); +#endif return 1; } |