1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module glib.gstdio; 7 8 import glib.gtypes; 9 import glib.gprintf; 10 11 // FIXME: not implemented module 12 13 // import core.sys.posix.sys.stat; 14 // 15 // /* Make it clear that we mean the struct with 32-bit st_size and 16 // * 32-bit st_*time fields as that is how the 32-bit GLib DLL normally 17 // * has been compiled. If you get a compiler warning when calling 18 // * g_stat(), do take it seriously and make sure that the type of 19 // * struct stat the code in GLib fills in matches the struct the type 20 // * of struct stat you pass to g_stat(). To avoid hassle, to get file 21 // * attributes just use the GIO API instead which doesn't use struct 22 // * stat. 23 // * 24 // * Sure, it would be nicer to use a struct with 64-bit st_size and 25 // * 64-bit st_*time fields, but changing that now would break ABI. And 26 // * in MinGW, a plain "struct stat" is the one with 32-bit st_size and 27 // * st_*time fields. 28 // */ 29 // 30 // typedef struct _stat32 GStatBuf; 31 // 32 // #else 33 // 34 // typedef struct stat GStatBuf; 35 // 36 // #endif 37 // 38 // #if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX) 39 // 40 // /* Just pass on to the system functions, so there's no potential for data 41 // * format mismatches, especially with large file interfaces. 42 // * A few functions can't be handled in this way, since they are not defined 43 // * in a portable system header that we could include here. 44 // */ 45 // 46 // #ifndef __GTK_DOC_IGNORE__ 47 // #define g_chmod chmod 48 // #define g_open open 49 // #define g_creat creat 50 // #define g_rename rename 51 // #define g_mkdir mkdir 52 // #define g_stat stat 53 // #define g_lstat lstat 54 // #define g_remove remove 55 // #define g_fopen fopen 56 // #define g_freopen freopen 57 // #define g_utime utime 58 // #endif 59 // 60 // GLIB_AVAILABLE_IN_ALL 61 // int g_access (const gchar *filename, 62 // int mode); 63 // 64 // GLIB_AVAILABLE_IN_ALL 65 // int g_chdir (const gchar *path); 66 // 67 // GLIB_AVAILABLE_IN_ALL 68 // int g_unlink (const gchar *filename); 69 // 70 // GLIB_AVAILABLE_IN_ALL 71 // int g_rmdir (const gchar *filename); 72 // 73 // #else /* ! G_OS_UNIX */ 74 // 75 // /* Wrappers for C library functions that take pathname arguments. On 76 // * Unix, the pathname is a file name as it literally is in the file 77 // * system. On well-maintained systems with consistent users who know 78 // * what they are doing and no exchange of files with others this would 79 // * be a well-defined encoding, preferably UTF-8. On Windows, the 80 // * pathname is always in UTF-8, even if that is not the on-disk 81 // * encoding, and not the encoding accepted by the C library or Win32 82 // * API. 83 // */ 84 // 85 // GLIB_AVAILABLE_IN_ALL 86 // int g_access (const gchar *filename, 87 // int mode); 88 // 89 // GLIB_AVAILABLE_IN_ALL 90 // int g_chmod (const gchar *filename, 91 // int mode); 92 // 93 // GLIB_AVAILABLE_IN_ALL 94 // int g_open (const gchar *filename, 95 // int flags, 96 // int mode); 97 // 98 // GLIB_AVAILABLE_IN_ALL 99 // int g_creat (const gchar *filename, 100 // int mode); 101 // 102 // GLIB_AVAILABLE_IN_ALL 103 // int g_rename (const gchar *oldfilename, 104 // const gchar *newfilename); 105 // 106 // GLIB_AVAILABLE_IN_ALL 107 // int g_mkdir (const gchar *filename, 108 // int mode); 109 // 110 // GLIB_AVAILABLE_IN_ALL 111 // int g_chdir (const gchar *path); 112 // 113 // GLIB_AVAILABLE_IN_ALL 114 // int g_stat (const gchar *filename, 115 // GStatBuf *buf); 116 // 117 // GLIB_AVAILABLE_IN_ALL 118 // int g_lstat (const gchar *filename, 119 // GStatBuf *buf); 120 // 121 // GLIB_AVAILABLE_IN_ALL 122 // int g_unlink (const gchar *filename); 123 // 124 // GLIB_AVAILABLE_IN_ALL 125 // int g_remove (const gchar *filename); 126 // 127 // GLIB_AVAILABLE_IN_ALL 128 // int g_rmdir (const gchar *filename); 129 // 130 // GLIB_AVAILABLE_IN_ALL 131 // FILE *g_fopen (const gchar *filename, 132 // const gchar *mode); 133 // 134 // GLIB_AVAILABLE_IN_ALL 135 // FILE *g_freopen (const gchar *filename, 136 // const gchar *mode, 137 // FILE *stream); 138 // 139 // struct utimbuf; /* Don't need the real definition of struct utimbuf when just 140 // * including this header. 141 // */ 142 // 143 // GLIB_AVAILABLE_IN_ALL 144 // int g_utime (const gchar *filename, 145 // struct utimbuf *utb); 146 // 147 // #endif /* G_OS_UNIX */ 148 // 149 // GLIB_AVAILABLE_IN_2_36 150 // gboolean g_close (gint fd, 151 // GError **error); 152 // 153 // G_END_DECLS 154 // 155 // #endif /* __G_STDIO_H__ */