rpm 4.17.0
rpmfileutil.h
Go to the documentation of this file.
1#ifndef _RPMFILEUTIL_H
2#define _RPMFILEUTIL_H
3
9#include <rpm/rpmutil.h>
10#include <rpm/rpmio.h>
11#include <rpm/rpmpgp.h>
12#include <rpm/argv.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
33
42int rpmDoDigest(int algo, const char * fn,int asAscii, unsigned char * digest);
43
49FD_t rpmMkTemp(char *templ);
50
61FD_t rpmMkTempFile(const char * prefix, char **fn);
62
71int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid);
72
81int rpmMkdirs(const char *root, const char *pathstr);
82
88char * rpmCleanPath (char * path);
89
100char * rpmGenPath (const char * urlroot,
101 const char * urlmdir,
102 const char * urlfile);
103
109char * rpmGetPath (const char * path, ...) RPM_GNUC_NULL_TERMINATED;
110
117int rpmIsGlob(const char * pattern, int quote);
118
126int rpmGlob(const char * patterns, int * argcPtr, ARGV_t * argvPtr);
127
133char * rpmEscapeSpaces(const char * s);
134
141int rpmFileIsCompressed (const char * file, rpmCompressedMagic * compressed);
142
149int rpmFileHasSuffix(const char *path, const char *suffix);
150
155char * rpmGetCwd(void);
156
157#ifdef __cplusplus
158}
159#endif
160#endif /* _RPMFILEUTIL_H */
char ** ARGV_t
Definition argv.h:17
char * rpmEscapeSpaces(const char *s)
Escape isspace(3) characters in string.
int rpmIsGlob(const char *pattern, int quote)
Check whether pattern contains any glob metacharacters.
FD_t rpmMkTempFile(const char *prefix, char **fn)
Return file handle for a temporaray file.
int rpmFileIsCompressed(const char *file, rpmCompressedMagic *compressed)
Return type of compression used in file.
int rpmioMkpath(const char *path, mode_t mode, uid_t uid, gid_t gid)
Insure that directories in path exist, creating as needed.
enum rpmCompressedMagic_e rpmCompressedMagic
char * rpmCleanPath(char *path)
Canonicalize file path.
char * rpmGetPath(const char *path,...) RPM_GNUC_NULL_TERMINATED
Return (malloc'ed) expanded, canonicalized, file path.
char * rpmGetCwd(void)
Like getcwd() but the result is malloced.
int rpmGlob(const char *patterns, int *argcPtr, ARGV_t *argvPtr)
Return URL path(s) from a (URL prefixed) pattern glob.
rpmCompressedMagic_e
Definition rpmfileutil.h:20
int rpmDoDigest(int algo, const char *fn, int asAscii, unsigned char *digest)
Calculate a file digest and size.
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 rpmMkTemp(char *templ)
Thin wrapper for mkstemp(3).
int rpmMkdirs(const char *root, const char *pathstr)
Create several directories (including parents if needed) in one go.
int rpmFileHasSuffix(const char *path, const char *suffix)
Check if path (string) ends with given suffix.
@ COMPRESSED_OTHER
Definition rpmfileutil.h:22
@ COMPRESSED_ZIP
Definition rpmfileutil.h:24
@ COMPRESSED_XZ
Definition rpmfileutil.h:26
@ COMPRESSED_NOT
Definition rpmfileutil.h:21
@ COMPRESSED_ZSTD
Definition rpmfileutil.h:31
@ COMPRESSED_LZIP
Definition rpmfileutil.h:27
@ COMPRESSED_7ZIP
Definition rpmfileutil.h:29
@ COMPRESSED_LRZIP
Definition rpmfileutil.h:28
@ COMPRESSED_LZMA
Definition rpmfileutil.h:25
@ COMPRESSED_BZIP2
Definition rpmfileutil.h:23
@ COMPRESSED_GEM
Definition rpmfileutil.h:30
struct _FD_s * FD_t
RPM IO file descriptor type.
Definition rpmtypes.h:99
#define RPM_GNUC_NULL_TERMINATED
Definition rpmutil.h:49