rpm  4.14.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
15 extern "C" {
16 #endif
17 
20 typedef enum rpmCompressedMagic_e {
33 
43 int rpmDoDigest(int algo, const char * fn,int asAscii,
44  unsigned char * digest, rpm_loff_t * fsizep);
45 
51 FD_t rpmMkTemp(char *templ);
52 
63 FD_t rpmMkTempFile(const char * prefix, char **fn);
64 
73 int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid);
74 
83 int rpmMkdirs(const char *root, const char *pathstr);
84 
90 char * rpmCleanPath (char * path);
91 
102 char * rpmGenPath (const char * urlroot,
103  const char * urlmdir,
104  const char * urlfile);
105 
111 char * rpmGetPath (const char * path, ...) RPM_GNUC_NULL_TERMINATED;
112 
119 int rpmIsGlob(const char * pattern, int quote);
120 
128 int rpmGlob(const char * patterns, int * argcPtr, ARGV_t * argvPtr);
129 
135 char * rpmEscapeSpaces(const char * s);
136 
143 int rpmFileIsCompressed (const char * file, rpmCompressedMagic * compressed);
144 
151 int rpmFileHasSuffix(const char *path, const char *suffix);
152 
157 char * rpmGetCwd(void);
158 
159 #ifdef __cplusplus
160 }
161 #endif
162 #endif /* _RPMFILEUTIL_H */
char ** ARGV_t
Definition: argv.h:17
char * rpmGetCwd(void)
Like getcwd() but the result is malloced.
#define RPM_GNUC_NULL_TERMINATED
Definition: rpmutil.h:49
int rpmDoDigest(int algo, const char *fn, int asAscii, unsigned char *digest, rpm_loff_t *fsizep)
Calculate a file digest and size.
int rpmFileIsCompressed(const char *file, rpmCompressedMagic *compressed)
Return type of compression used in file.
char * rpmCleanPath(char *path)
Canonicalize file path.
char * rpmEscapeSpaces(const char *s)
Escape isspace(3) characters in string.
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.
struct _FD_s * FD_t
RPM IO file descriptor type.
Definition: rpmtypes.h:98
char * rpmGetPath(const char *path,...) RPM_GNUC_NULL_TERMINATED
Return (malloc&#39;ed) expanded, canonicalized, file path.
int rpmGlob(const char *patterns, int *argcPtr, ARGV_t *argvPtr)
Return URL path(s) from a (URL prefixed) pattern glob.
int rpmFileHasSuffix(const char *path, const char *suffix)
Check if path (string) ends with given suffix.
enum rpmCompressedMagic_e rpmCompressedMagic
rpmCompressedMagic_e
Definition: rpmfileutil.h:20
int rpmIsGlob(const char *pattern, int quote)
Check whether pattern contains any glob metacharacters.
int rpmMkdirs(const char *root, const char *pathstr)
Create several directories (including parents if needed) in one go.
uint64_t rpm_loff_t
Definition: rpmtypes.h:51
FD_t rpmMkTemp(char *templ)
Thin wrapper for mkstemp(3).
FD_t rpmMkTempFile(const char *prefix, char **fn)
Return file handle for a temporaray file.
int rpmioMkpath(const char *path, mode_t mode, uid_t uid, gid_t gid)
Insure that directories in path exist, creating as needed.