nitg: Implemented polymorphic super calls for nitg-s and nitg-e
[nit.git] / c_src / standard___file._ffi.c
1 /*
2 Extern implementation of Nit module file
3 */
4 #include "standard___file._ffi.h"
5
6 struct stat * NativeString_file_lstat___impl( char * recv )
7 {
8 #line 325 "../lib/standard/file.nit"
9
10
11 struct stat* stat_element;
12 int res;
13 stat_element = malloc(sizeof(struct stat));
14 res = lstat(recv, stat_element);
15 if (res == -1) return NULL;
16 return stat_element;
17 }
18
19 int FileStat_is_reg___impl( struct stat * recv )
20 {
21 #line 345 "../lib/standard/file.nit"
22
23 return S_ISREG(recv->st_mode); }
24
25 int FileStat_is_dir___impl( struct stat * recv )
26 {
27 #line 346 "../lib/standard/file.nit"
28
29 return S_ISDIR(recv->st_mode); }
30
31 int FileStat_is_chr___impl( struct stat * recv )
32 {
33 #line 347 "../lib/standard/file.nit"
34
35 return S_ISCHR(recv->st_mode); }
36
37 int FileStat_is_blk___impl( struct stat * recv )
38 {
39 #line 348 "../lib/standard/file.nit"
40
41 return S_ISBLK(recv->st_mode); }
42
43 int FileStat_is_fifo___impl( struct stat * recv )
44 {
45 #line 349 "../lib/standard/file.nit"
46
47 return S_ISFIFO(recv->st_mode); }
48
49 int FileStat_is_lnk___impl( struct stat * recv )
50 {
51 #line 350 "../lib/standard/file.nit"
52
53 return S_ISLNK(recv->st_mode); }
54
55 int FileStat_is_sock___impl( struct stat * recv )
56 {
57 #line 351 "../lib/standard/file.nit"
58
59 return S_ISSOCK(recv->st_mode); }