00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AEGIS_GLUE_H
00021 #define AEGIS_GLUE_H
00022
00023 #include <common/ac/stdio.h>
00024
00025 #include <common/main.h>
00026 #include <common/config.h>
00027
00028 struct stat;
00029 struct utimbuf;
00030 struct flock;
00031 struct string_list_ty;
00032 class nstring;
00033 class nstring_list;
00034
00035 int copyfile(const char *src, const char *dst);
00036 int catfile(const char *path);
00037 int read_whole_dir(const char *path, char **data, long *datalen);
00038
00053 int read_whole_dir__wl(const char *path, struct string_list_ty *wl);
00054
00067 int read_whole_dir__wl(const nstring &path, nstring_list &wl);
00068
00082 int read_whole_dir__wla(const char *path, struct string_list_ty *wl);
00083
00097 int read_whole_dir__wla(const nstring &path, nstring_list &wl);
00098
00099 int file_compare(const char *, const char *);
00100 int file_fingerprint(const char *path, char *buf, int max);
00101 int rmdir_bg(const char *path);
00102 int rmdir_tree(const char *path);
00103
00104 int glue_access(const char *path, int mode);
00105 int glue_catfile(const char *path);
00106 int glue_chmod(const char *path, int mode);
00107 int glue_chown(const char *path, int uid, int gid);
00108 int glue_close(int fd);
00109 int glue_creat(const char *path, int mode);
00110 int glue_copyfile(const char *src, const char *dst);
00111 int glue_fclose(FILE *);
00112 int glue_file_compare(const char *, const char *);
00113 int glue_file_fingerprint(const char *path, char *buf, int max);
00114 int glue_fcntl(int fd, int cmd, struct flock *);
00115 int glue_ferror(FILE *);
00116 int glue_fflush(FILE *);
00117 int glue_fgetc(FILE *);
00118 FILE *glue_fopen(const char *path, const char *mode);
00119 int glue_fputc(int, FILE *);
00120 char *glue_getcwd(char *buf, int max);
00121 int glue_link(const char *p1, const char *p2);
00122 int glue_lstat(const char *path, struct stat *st);
00123 int glue_mkdir(const char *path, int mode);
00124 int glue_open(const char *path, int mode, int perm);
00125 long glue_pathconf(const char *path, int mode);
00126 long glue_read(int fd, void *data, size_t len);
00127 int glue_readlink(const char *path, char *buf, int max);
00128 int glue_read_whole_dir(const char *path, char **data, long *datalen);
00129 int glue_rename(const char *p1, const char *p2);
00130 int glue_rmdir(const char *path);
00131
00132 int glue_rmdir_bg(const char *path);
00133
00134 int glue_rmdir_tree(const char *path);
00135
00136 int glue_stat(const char *path, struct stat *st);
00137 int glue_symlink(const char *name1, const char *name2);
00138 int glue_ungetc(int, FILE *);
00139 int glue_unlink(const char *path);
00140 int glue_utime(const char *path, struct utimbuf *);
00141 int glue_lutime(const char *path, struct utimbuf *);
00142 int glue_write(int fd, const void *data, long len);
00143 int glue_fwrite(char *, long, long, FILE *);
00144
00145
00146 #ifndef CONF_NO_seteuid
00147 #ifndef aegis_glue_disable
00148
00149
00150
00151
00152
00153
00154 #define glue_access access
00155 #define glue_catfile catfile
00156 #define glue_chmod chmod
00157 #define glue_chown chown
00158 #define glue_close ::close
00159 #define glue_creat creat
00160 #define glue_copyfile copyfile
00161 #define glue_fclose fclose
00162 #define glue_fcntl fcntl
00163 #define glue_ferror ferror
00164 #define glue_fflush fflush
00165 #define glue_fgetc getc
00166 #define glue_file_compare file_compare
00167 #define glue_file_fingerprint file_fingerprint
00168 #define glue_fopen fopen
00169 #define glue_fputc putc
00170 #define glue_getcwd getcwd
00171 #define glue_link link
00172 #define glue_lstat lstat
00173 #define glue_mkdir mkdir
00174 #define glue_open ::open
00175 #define glue_pathconf pathconf
00176 #define glue_read ::read
00177 #define glue_readlink readlink
00178 #define glue_read_whole_dir read_whole_dir
00179 #define glue_rename rename
00180 #define glue_rmdir rmdir
00181 #define glue_rmdir_bg rmdir_bg
00182 #define glue_rmdir_tree rmdir_tree
00183 #define glue_stat stat
00184 #define glue_symlink symlink
00185 #define glue_ungetc ungetc
00186 #define glue_unlink unlink
00187 #define glue_utime utime
00188 #define glue_lutime lutime
00189 #define glue_write ::write
00190 #define glue_fwrite fwrite
00191
00192 #endif // aegis_glue_disable
00193 #endif // CONF_NO_seteuid
00194
00195 #endif // AEGIS_GLUE_H