00001 #ifndef H_MISC
00002 #define H_MISC
00003
00009 #include <string.h>
00010
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014
00022 char ** splitString(const char * str, int length, char sep)
00023 ;
00024
00029 void freeSplitString( char ** list)
00030 ;
00031
00038 static inline
00039 char * stripTrailingChar( char * s, char c)
00040
00041 {
00042 char * t;
00043 for (t = s + strlen(s) - 1; *t == c && t >= s; t--)
00044 *t = '\0';
00045 return s;
00046 }
00047
00055 int dosetenv(const char * name, const char * value, int overwrite)
00056
00057 ;
00058
00064 int doputenv(const char * str)
00065
00066 ;
00067
00081 int makeTempFile( const char * prefix,
00082 const char ** fnptr,
00083 FD_t * fdptr)
00084
00085
00086
00087 ;
00088
00093 char * currentDirectory(void)
00094
00095 ;
00096
00101 void compressFilelist(Header h)
00102 ;
00103
00108 void expandFilelist(Header h)
00109 ;
00110
00116 void buildOrigFileList(Header h, const char *** fileListPtr,
00117 int * fileCountPtr)
00118 ;
00119
00122
00123 int myGlobPatternP (const char *patternURL)
00124 ;
00125
00126
00129 int rpmGlob(const char * patterns, int * argcPtr,
00130 const char *** argvPtr)
00131
00132 ;
00133
00139 void providePackageNVR(Header h)
00140 ;
00141
00150
00151 int domd5(const char * fn, unsigned char * digest, int asAscii)
00152
00153 ;
00154
00155
00163 static inline
00164 int mdfile(const char * fn, unsigned char * digest)
00165
00166
00167 {
00168 return domd5(fn, digest, 1);
00169 }
00170
00178 static inline
00179 int mdbinfile(const char * fn, unsigned char * bindigest)
00180
00181
00182 {
00183 return domd5(fn, bindigest, 0);
00184 }
00185
00186 #ifdef __cplusplus
00187 }
00188 #endif
00189
00190 #endif