00001 #ifndef H_MISC
00002 #define H_MISC
00003
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012
00020 char ** splitString(const char * str, int length, char sep)
00021 ;
00022
00027 void freeSplitString( char ** list)
00028 ;
00029
00036 static inline
00037 char * stripTrailingChar( char * s, char c)
00038
00039 {
00040 char * t;
00041 for (t = s + strlen(s) - 1; *t == c && t >= s; t--)
00042 *t = '\0';
00043 return s;
00044 }
00045
00053 int dosetenv(const char * name, const char * value, int overwrite)
00054
00055 ;
00056
00062 int doputenv(const char * str)
00063
00064 ;
00065
00079 int makeTempFile( const char * prefix,
00080 const char ** fnptr,
00081 FD_t * fdptr)
00082
00083
00084
00085 ;
00086
00091 char * currentDirectory(void)
00092
00093 ;
00094
00099 void compressFilelist(Header h)
00100 ;
00101
00106 void expandFilelist(Header h)
00107 ;
00108
00112 void buildOrigFileList(Header h, const char *** fileListPtr,
00113 int * fileCountPtr)
00114 ;
00115
00118
00119 int myGlobPatternP (const char *patternURL)
00120 ;
00121
00122
00125 int rpmGlob(const char * patterns, int * argcPtr,
00126 const char *** argvPtr)
00127
00128 ;
00129
00135 void providePackageNVR(Header h)
00136 ;
00137
00146
00147 int domd5(const char * fn, unsigned char * digest, int asAscii)
00148
00149 ;
00150
00151
00159 static inline
00160 int mdfile(const char * fn, unsigned char * digest)
00161
00162
00163 {
00164 return domd5(fn, digest, 1);
00165 }
00166
00174 static inline
00175 int mdbinfile(const char * fn, unsigned char * bindigest)
00176
00177
00178 {
00179 return domd5(fn, bindigest, 0);
00180 }
00181
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185
00186 #endif