00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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
00068
00069
00070
#ifdef HAVE_DIRENT_H
00071
# define HAVE_OPENDIR 1
00072
# include <dirent.h>
00073
#else
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;
00085
struct _finddata_t *finddata;
00086
struct dirent *direntry;
00087
struct dirent *dirfirst;
00088 } DIR;
00089
00090
#endif
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
00157
00158
#ifndef HAVE_RMDIR
00159
LIBGIFT_EXPORT
00160
int rmdir (
const char *path);
00161
#endif
00162
00172 LIBGIFT_EXPORT
00173
int gi_file_rmdirr (
const char *path);
00174
00175
00176
00177 EXTERN_C_END
00178
00179
00180
00181
#endif