|
|
|
@ -60,6 +60,7 @@ SOFTWARE.
|
|
|
|
|
#define _LARGEFILE64_SOURCE
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
@ -87,34 +88,6 @@ SOFTWARE.
|
|
|
|
|
#include <utime.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define LFS_VERSION "1.6.2"
|
|
|
|
|
#define LFS_LIBNAME "lfs"
|
|
|
|
|
|
|
|
|
|
#if LUA_VERSION_NUM < 502
|
|
|
|
|
# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Define 'strerror' for systems that do not implement it */
|
|
|
|
|
#ifdef NO_STRERROR
|
|
|
|
|
#define strerror(_) "System unable to describe the error"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Define 'getcwd' for systems that do not implement it */
|
|
|
|
|
#ifdef NO_GETCWD
|
|
|
|
|
#define getcwd(p,s) NULL
|
|
|
|
|
#define getcwd_error "Function 'getcwd' not provided by system"
|
|
|
|
|
#else
|
|
|
|
|
#define getcwd_error strerror(errno)
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
/* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */
|
|
|
|
|
#define LFS_MAXPATHLEN MAX_PATH
|
|
|
|
|
#else
|
|
|
|
|
/* For MAXPATHLEN: */
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#define LFS_MAXPATHLEN MAXPATHLEN
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
typedef struct dir_data {
|
|
|
|
|
int closed;
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|