3 /* This file is part of NIT ( http://www.nitlanguage.org ).
5 * Copyright 2004-2008 Jean Privat <jean@pryen.org>
6 * Copyright 2008 Floréal Morandat <morandat@lirmm.fr>
7 * Copyright 2008 Jean-Sébastien Gélinas <calestar@gmail.com>
9 * This file is free software, which comes along with NIT. This software is
10 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
13 * is kept unaltered, and a notification of the changes is added.
14 * You are allowed to redistribute it and sell it, alone or is a part of
21 #include <sys/types.h>
23 #include <file._nitni.h>
25 Set
String_files___impl( String recv
);
27 extern int string_NativeString_NativeString_file_exists_0(char *f
);
28 extern void *string_NativeString_NativeString_file_stat_0(char *f
);
29 extern void *file_NativeFile_NativeFile_file_stat_0(FILE *f
);
30 extern int string_NativeString_NativeString_file_delete_0(char *f
);
32 #define file_NativeFile_NativeFile_io_read_2(p, b, l) fread((b), 1, (l), (FILE*)(p))
33 #define file_NativeFile_NativeFile_io_write_2(p, b, l) fwrite((b), 1, (l), (FILE*)(p))
34 #define file_NativeFile_NativeFile_io_close_0(self) fclose((FILE*)(self))
36 #define file_NativeFileCapable_NativeFileCapable_io_open_read_1(p0) fopen((p0), "r")
38 #define file_NativeFileCapable_NativeFileCapable_io_open_write_1(p0) fopen((p0), "w")
39 #define file_NativeFileCapable_NativeFileCapable_native_stdin_0() stdin
40 #define file_NativeFileCapable_NativeFileCapable_native_stdout_0() stdout
41 #define file_NativeFileCapable_NativeFileCapable_native_stderr_0() stderr
42 #define file_FileStat_FileStat_mode_0(self) (((struct stat*)self)->st_mode)
43 #define file_FileStat_FileStat_atime_0(self) (((struct stat*)self)->st_atime)
44 #define file_FileStat_FileStat_ctime_0(self) (((struct stat*)self)->st_ctime)
45 #define file_FileStat_FileStat_mtime_0(self) (((struct stat*)self)->st_mtime)
46 #define file_FileStat_FileStat_size_0(self) (((struct stat*)self)->st_size)
48 #define string_NativeString_NativeString_file_mkdir_0(p) (mkdir(p, 0777))