rpmfileutil.h
Go to the documentation of this file.
#ifndef _RPMFILEUTIL_H
#define _RPMFILEUTIL_H
#include <rpm/rpmutil.h>
#include <rpm/rpmio.h>
#include <rpm/rpmpgp.h>
#include <rpm/argv.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum rpmCompressedMagic_e {
COMPRESSED_NOT = 0,
COMPRESSED_OTHER = 1,
COMPRESSED_BZIP2 = 2,
COMPRESSED_ZIP = 3,
COMPRESSED_LZMA = 4,
COMPRESSED_XZ = 5,
COMPRESSED_LZIP = 6,
COMPRESSED_LRZIP = 7,
COMPRESSED_7ZIP = 8,
COMPRESSED_GEM = 9,
COMPRESSED_ZSTD = 10
} rpmCompressedMagic;
int rpmDoDigest(int algo, const char * fn,int asAscii,
unsigned char * digest, rpm_loff_t * fsizep);
FD_t rpmMkTemp(char *templ);
FD_t rpmMkTempFile(const char * prefix, char **fn);
int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid);
int rpmMkdirs(const char *root, const char *pathstr);
char * rpmCleanPath (char * path);
char * rpmGenPath (const char * urlroot,
const char * urlmdir,
const char * urlfile);
char * rpmGetPath (const char * path, ...) RPM_GNUC_NULL_TERMINATED;
int rpmIsGlob(const char * pattern, int quote);
int rpmGlob(const char * patterns, int * argcPtr, ARGV_t * argvPtr);
char * rpmEscapeSpaces(const char * s);
int rpmFileIsCompressed (const char * file, rpmCompressedMagic * compressed);
int rpmFileHasSuffix(const char *path, const char *suffix);
char * rpmGetCwd(void);
#ifdef __cplusplus
}
#endif
#endif /* _RPMFILEUTIL_H */
ARGV_t
char ** ARGV_t
Definition: argv.h:17
COMPRESSED_LZIP
Definition: rpmfileutil.h:27
COMPRESSED_XZ
Definition: rpmfileutil.h:26
rpmGetCwd
char * rpmGetCwd(void)
Like getcwd() but the result is malloced.
RPM_GNUC_NULL_TERMINATED
#define RPM_GNUC_NULL_TERMINATED
Definition: rpmutil.h:49
rpmDoDigest
int rpmDoDigest(int algo, const char *fn, int asAscii, unsigned char *digest, rpm_loff_t *fsizep)
Calculate a file digest and size.
rpmFileIsCompressed
int rpmFileIsCompressed(const char *file, rpmCompressedMagic *compressed)
Return type of compression used in file.
COMPRESSED_BZIP2
Definition: rpmfileutil.h:23
rpmCleanPath
char * rpmCleanPath(char *path)
Canonicalize file path.
COMPRESSED_NOT
Definition: rpmfileutil.h:21
rpmEscapeSpaces
char * rpmEscapeSpaces(const char *s)
Escape isspace(3) characters in string.
rpmGenPath
char * rpmGenPath(const char *urlroot, const char *urlmdir, const char *urlfile)
Merge 3 args into path, any or all of which may be a url.
FD_t
struct _FD_s * FD_t
RPM IO file descriptor type.
Definition: rpmtypes.h:98
COMPRESSED_GEM
Definition: rpmfileutil.h:30
rpmGetPath
char * rpmGetPath(const char *path,...) RPM_GNUC_NULL_TERMINATED
Return (malloc&#39;ed) expanded, canonicalized, file path.
rpmGlob
int rpmGlob(const char *patterns, int *argcPtr, ARGV_t *argvPtr)
Return URL path(s) from a (URL prefixed) pattern glob.
rpmFileHasSuffix
int rpmFileHasSuffix(const char *path, const char *suffix)
Check if path (string) ends with given suffix.
rpmCompressedMagic
enum rpmCompressedMagic_e rpmCompressedMagic
COMPRESSED_LZMA
Definition: rpmfileutil.h:25
COMPRESSED_LRZIP
Definition: rpmfileutil.h:28
rpmCompressedMagic_e
rpmCompressedMagic_e
Definition: rpmfileutil.h:20
COMPRESSED_OTHER
Definition: rpmfileutil.h:22
COMPRESSED_7ZIP
Definition: rpmfileutil.h:29
COMPRESSED_ZIP
Definition: rpmfileutil.h:24
rpmIsGlob
int rpmIsGlob(const char *pattern, int quote)
Check whether pattern contains any glob metacharacters.
rpmMkdirs
int rpmMkdirs(const char *root, const char *pathstr)
Create several directories (including parents if needed) in one go.
COMPRESSED_ZSTD
Definition: rpmfileutil.h:31
rpm_loff_t
uint64_t rpm_loff_t
Definition: rpmtypes.h:51
rpmMkTemp
FD_t rpmMkTemp(char *templ)
Thin wrapper for mkstemp(3).
rpmMkTempFile
FD_t rpmMkTempFile(const char *prefix, char **fn)
Return file handle for a temporaray file.
rpmioMkpath
int rpmioMkpath(const char *path, mode_t mode, uid_t uid, gid_t gid)
Insure that directories in path exist, creating as needed.