Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_fileutil.h

Go to the documentation of this file.
00001 /* 00002 * $Id: gi_fileutil.h,v 1.1.2.6 2004/08/21 08:13:04 jasta Exp $ 00003 * 00004 * Copyright (C) 2003 giFT project (gift.sourceforge.net) 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License as published by the 00008 * Free Software Foundation; either version 2, or (at your option) any 00009 * later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 */ 00016 00017 #ifndef __GI_FILEUTIL_H 00018 #define __GI_FILEUTIL_H 00019 00020 /*****************************************************************************/ 00021 00028 /*****************************************************************************/ 00029 00030 #include "gi_path.h" 00031 00032 /*****************************************************************************/ 00033 00034 #ifdef HAVE_LIMITS_H 00035 # include <limits.h> 00036 #endif /* HAVE_LIMITS_H */ 00037 00038 #ifndef PATH_MAX 00039 # define PATH_MAX 4096 00040 #endif 00041 00042 /*****************************************************************************/ 00043 00044 #ifndef S_ISDIR 00045 # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 00046 #endif 00047 00048 #ifndef S_ISFIFO 00049 # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) 00050 #endif 00051 00052 #ifndef S_ISCHR 00053 # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) 00054 #endif 00055 00056 #ifndef S_ISBLK 00057 # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 00058 #endif 00059 00060 #ifndef S_ISREG 00061 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 00062 #endif 00063 00064 /*****************************************************************************/ 00065 00066 /* 00067 * Fudge the real definition of HAVE_OPENDIR until we can develop a superior 00068 * autoconf test. 00069 */ 00070 #ifdef HAVE_DIRENT_H 00071 # define HAVE_OPENDIR 1 00072 # include <dirent.h> 00073 #else /* WIN32 */ 00074 # include <io.h> 00075 # include <stddef.h> 00076 00077 struct dirent 00078 { 00079 char *d_name; 00080 }; 00081 00082 typedef struct 00083 { 00084 int findh; /* TODO: Int or long? */ 00085 struct _finddata_t *finddata; 00086 struct dirent *direntry; 00087 struct dirent *dirfirst; 00088 } DIR; 00089 00090 #endif /* HAVE_DIRENT_H */ 00091 00092 /*****************************************************************************/ 00093 00094 EXTERN_C_BEGIN 00095 00096 /*****************************************************************************/ 00097 00105 LIBGIFT_EXPORT 00106 int gi_file_mv (const char *src, const char *dst); 00107 00114 LIBGIFT_EXPORT 00115 int gi_file_cp (const char *src, const char *dst); 00116 00117 /*****************************************************************************/ 00118 00129 LIBGIFT_EXPORT 00130 int gi_file_mkdir (const char *path, int mode); 00131 00148 LIBGIFT_EXPORT 00149 int gi_file_mkdirp (GiPath *path, int mode); 00150 00151 /*****************************************************************************/ 00152 00153 #ifndef HAVE_UNLINK 00154 LIBGIFT_EXPORT 00155 int unlink (const char *path); 00156 #endif /* !HAVE_UNLINK */ 00157 00158 #ifndef HAVE_RMDIR 00159 LIBGIFT_EXPORT 00160 int rmdir (const char *path); 00161 #endif /* !HAVE_RMDIR */ 00162 00172 LIBGIFT_EXPORT 00173 int gi_file_rmdirr (const char *path); 00174 00175 /*****************************************************************************/ 00176 00177 EXTERN_C_END 00178 00179 /*****************************************************************************/ 00180 00181 #endif /* __GI_FILEUTIL_H */

Generated on Sun Aug 22 07:56:40 2004 by doxygen 1.3.7