@@ -51,7 +51,7 @@ static int lua_file_close(lua_State *L)
51
51
return 1 ;
52
52
}
53
53
54
- static int lua_file_read (lua_State * L )
54
+ static int lua_read (lua_State * L )
55
55
{
56
56
int fd = luaL_checkinteger (L , 1 );
57
57
size_t n = luaL_checkinteger (L , 2 );
@@ -85,7 +85,7 @@ static int lua_file_read(lua_State *L)
85
85
return 1 ;
86
86
}
87
87
88
- static int lua_file_write (lua_State * L )
88
+ static int lua_write (lua_State * L )
89
89
{
90
90
int fd = luaL_checkinteger (L , 1 );
91
91
size_t len ;
@@ -109,7 +109,7 @@ static int lua_file_write(lua_State *L)
109
109
return 1 ;
110
110
}
111
111
112
- static int lua_file_lseek (lua_State * L )
112
+ static int lua_lseek (lua_State * L )
113
113
{
114
114
int fd = luaL_checkinteger (L , 1 );
115
115
off_t offset = luaL_checkinteger (L , 2 );
@@ -126,7 +126,7 @@ static int lua_file_lseek(lua_State *L)
126
126
return 1 ;
127
127
}
128
128
129
- static int lua_file_access (lua_State * L )
129
+ static int lua_access (lua_State * L )
130
130
{
131
131
const char * file = luaL_checkstring (L , 1 );
132
132
const char * mode = lua_tostring (L , 2 );
@@ -210,7 +210,7 @@ static int __lua_file_stat(lua_State *L, struct stat *st)
210
210
return 1 ;
211
211
}
212
212
213
- static int lua_file_stat (lua_State * L )
213
+ static int lua_stat (lua_State * L )
214
214
{
215
215
const char * path = luaL_checkstring (L , 1 );
216
216
struct stat st ;
@@ -224,7 +224,7 @@ static int lua_file_stat(lua_State *L)
224
224
return __lua_file_stat (L , & st );
225
225
}
226
226
227
- static int lua_file_fstat (lua_State * L )
227
+ static int lua_fstat (lua_State * L )
228
228
{
229
229
int fd = luaL_checkinteger (L , 1 );
230
230
struct stat st ;
@@ -239,7 +239,7 @@ static int lua_file_fstat(lua_State *L)
239
239
}
240
240
241
241
/* get filesystem statistics in kibibytes */
242
- static int lua_file_statvfs (lua_State * L )
242
+ static int lua_statvfs (lua_State * L )
243
243
{
244
244
const char * path = luaL_checkstring (L , 1 );
245
245
struct statvfs s ;
@@ -325,7 +325,7 @@ static const struct luaL_Reg dir_methods[] = {
325
325
{NULL , NULL }
326
326
};
327
327
328
- static int lua_file_chown (lua_State * L )
328
+ static int lua_chown (lua_State * L )
329
329
{
330
330
const char * pathname = luaL_checkstring (L , 1 );
331
331
uid_t uid = -1 ;
@@ -348,7 +348,7 @@ static int lua_file_chown(lua_State *L)
348
348
return 1 ;
349
349
}
350
350
351
- static int lua_file_dirname (lua_State * L )
351
+ static int lua_dirname (lua_State * L )
352
352
{
353
353
const char * path = luaL_checkstring (L , 1 );
354
354
char * buf = strdup (path );
@@ -359,7 +359,7 @@ static int lua_file_dirname(lua_State *L)
359
359
return 1 ;
360
360
}
361
361
362
- static int lua_file_basename (lua_State * L )
362
+ static int lua_basename (lua_State * L )
363
363
{
364
364
const char * path = luaL_checkstring (L , 1 );
365
365
char * buf = strdup (path );
@@ -370,7 +370,7 @@ static int lua_file_basename(lua_State *L)
370
370
return 1 ;
371
371
}
372
372
373
- static int lua_file_flock (lua_State * L )
373
+ static int lua_flock (lua_State * L )
374
374
{
375
375
int fd = luaL_checkinteger (L , 1 );
376
376
int operation = luaL_checkinteger (L , 2 );
@@ -389,18 +389,18 @@ static int lua_file_flock(lua_State *L)
389
389
static const luaL_Reg funcs [] = {
390
390
{"open" , lua_file_open },
391
391
{"close" , lua_file_close },
392
- {"read" , lua_file_read },
393
- {"write" , lua_file_write },
394
- {"lseek" , lua_file_lseek },
395
- {"access" , lua_file_access },
392
+ {"read" , lua_read },
393
+ {"write" , lua_write },
394
+ {"lseek" , lua_lseek },
395
+ {"access" , lua_access },
396
396
{"readlink" , lua_readlink },
397
- {"stat" , lua_file_stat },
398
- {"fstat" , lua_file_fstat },
399
- {"statvfs" , lua_file_statvfs },
400
- {"chown" , lua_file_chown },
401
- {"dirname" , lua_file_dirname },
402
- {"basename" , lua_file_basename },
403
- {"flock" , lua_file_flock },
397
+ {"stat" , lua_stat },
398
+ {"fstat" , lua_fstat },
399
+ {"statvfs" , lua_statvfs },
400
+ {"chown" , lua_chown },
401
+ {"dirname" , lua_dirname },
402
+ {"basename" , lua_basename },
403
+ {"flock" , lua_flock },
404
404
{NULL , NULL }
405
405
};
406
406
0 commit comments