00001 #ifndef H_MISC
00002 #define H_MISC
00003
00009 #include <unistd.h>
00010 #include <sys/types.h>
00011
00012 #include "header.h"
00013 #include "ugid.h"
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018
00021 char ** splitString(const char * str, int length, char sep);
00022
00025 void freeSplitString( char ** list);
00026
00033 static inline char * stripTrailingChar(char * s, char c)
00034
00035 {
00036 char * t;
00037 for (t = s + strlen(s) - 1; *t == c && t >= s; t--)
00038 *t = '\0';
00039 return s;
00040 }
00041
00044 int rpmfileexists(const char * filespec) ;
00045
00048 int rpmvercmp(const char * one, const char * two);
00049
00050
00051
00052
00055 int dosetenv(const char *name, const char *value, int overwrite);
00056
00059 int doputenv(const char * str);
00060
00063 int makeTempFile(const char * prefix, const char ** fnptr,
00064 FD_t * fdptr);
00065
00069 char * currentDirectory(void);
00070
00073 void compressFilelist(Header h);
00074
00077 void expandFilelist(Header h);
00078
00081 void buildOrigFileList(Header h, const char *** fileListPtr,
00082 int * fileCountPtr);
00083
00086 int myGlobPatternP (const char *patternURL) ;
00087
00090 int rpmGlob(const char * patterns, int * argcPtr,
00091 const char *** argvPtr)
00092 ;
00093
00096 void providePackageNVR(Header h);
00097
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101
00102 #endif