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 } rpmCompressedMagic;
00027
00037 int rpmDoDigest(pgpHashAlgo algo, const char * fn,int asAscii,
00038 unsigned char * digest, rpm_loff_t * fsizep);
00039
00045 FD_t rpmMkTemp(char *templ);
00046
00057 FD_t rpmMkTempFile(const char * prefix, char **fn);
00058
00067 int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid);
00068
00077 int rpmMkdirs(const char *root, const char *pathstr);
00078
00084 char * rpmCleanPath (char * path);
00085
00096 char * rpmGenPath (const char * urlroot,
00097 const char * urlmdir,
00098 const char * urlfile);
00099
00105 char * rpmGetPath (const char * path, ...) RPM_GNUC_NULL_TERMINATED;
00106
00114 int rpmGlob(const char * patterns, int * argcPtr, ARGV_t * argvPtr);
00115
00121 char * rpmEscapeSpaces(const char * s);
00122
00129 int rpmFileIsCompressed (const char * file, rpmCompressedMagic * compressed);
00130
00137 int rpmFileHasSuffix(const char *path, const char *suffix);
00138
00143 char * rpmGetCwd(void);
00144
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148 #endif