00001 #ifndef _RPMFILEUTIL_H
00002 #define _RPMFILEUTIL_H
00003
00009 #include <rpm/rpmutil.h>
00010 #include <rpm/rpmio.h>
00011 #include <rpm/rpmpgp.h>
00012 #include <rpm/argv.h>
00013
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017
00020 typedef enum rpmCompressedMagic_e {
00021 COMPRESSED_NOT = 0,
00022 COMPRESSED_OTHER = 1,
00023 COMPRESSED_BZIP2 = 2,
00024 COMPRESSED_ZIP = 3,
00025 COMPRESSED_LZMA = 4,
00026 COMPRESSED_XZ = 5
00027 } rpmCompressedMagic;
00028
00038 int rpmDoDigest(pgpHashAlgo algo, const char * fn,int asAscii,
00039 unsigned char * digest, rpm_loff_t * fsizep);
00040
00046 FD_t rpmMkTemp(char *templ);
00047
00058 FD_t rpmMkTempFile(const char * prefix, char **fn);
00059
00068 int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid);
00069
00078 int rpmMkdirs(const char *root, const char *pathstr);
00079
00085 char * rpmCleanPath (char * path);
00086
00097 char * rpmGenPath (const char * urlroot,
00098 const char * urlmdir,
00099 const char * urlfile);
00100
00106 char * rpmGetPath (const char * path, ...) RPM_GNUC_NULL_TERMINATED;
00107
00115 int rpmGlob(const char * patterns, int * argcPtr, ARGV_t * argvPtr);
00116
00122 char * rpmEscapeSpaces(const char * s);
00123
00130 int rpmFileIsCompressed (const char * file, rpmCompressedMagic * compressed);
00131
00138 int rpmFileHasSuffix(const char *path, const char *suffix);
00139
00144 char * rpmGetCwd(void);
00145
00146 #ifdef __cplusplus
00147 }
00148 #endif
00149 #endif