Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/misc.h

Go to the documentation of this file.
00001 #ifndef H_MISC
00002 #define H_MISC
00003 
00009 #include <string.h>
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014 
00022 /*@only@*/ char ** splitString(const char * str, int length, char sep)
00023         /*@*/;
00024 
00029 void freeSplitString( /*@only@*/ char ** list)
00030         /*@modifies list @*/;
00031 
00038 /*@unused@*/ static inline
00039 /*@only@*/ char * stripTrailingChar(/*@only@*/ char * s, char c)
00040         /*@modifies *s */
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         /*@globals environ@*/
00057         /*@modifies *environ @*/;
00058 
00064 int doputenv(const char * str)
00065         /*@globals environ@*/
00066         /*@modifies *environ @*/;
00067 
00081 int makeTempFile(/*@null@*/ const char * prefix,
00082                 /*@null@*/ /*@out@*/ const char ** fnptr,
00083                 /*@out@*/ FD_t * fdptr)
00084         /*@globals rpmGlobalMacroContext,
00085                 fileSystem, internalState @*/
00086         /*@modifies *fnptr, *fdptr, rpmGlobalMacroContext,
00087                 fileSystem, internalState @*/;
00088  
00093 /*@only@*/ char * currentDirectory(void)
00094         /*@globals fileSystem @*/
00095         /*@modifies fileSystem @*/;
00096 
00101 void compressFilelist(Header h)
00102         /*@modifies h @*/;
00103 
00108 void expandFilelist(Header h)
00109         /*@modifies h @*/;
00110 
00116 void buildOrigFileList(Header h, /*@out@*/ const char *** fileListPtr, 
00117                         /*@out@*/ int * fileCountPtr)
00118         /*@modifies *fileListPtr, *fileCountPtr @*/;
00119 
00122 /*@-exportlocal@*/
00123 int myGlobPatternP (const char *patternURL)
00124         /*@*/;
00125 /*@=exportlocal@*/
00126 
00129 int rpmGlob(const char * patterns, /*@out@*/ int * argcPtr,
00130                 /*@out@*/ const char *** argvPtr)
00131         /*@globals fileSystem @*/
00132         /*@modifies *argcPtr, *argvPtr, fileSystem @*/;
00133 
00139 void providePackageNVR(Header h)
00140         /*@modifies h @*/;
00141 
00150 /*@-exportlocal@*/
00151 int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii)
00152         /*@globals fileSystem@*/
00153         /*@modifies digest, fileSystem @*/;
00154 /*@=exportlocal@*/
00155 
00163 /*@unused@*/ static inline
00164 int mdfile(const char * fn, /*@out@*/ unsigned char * digest)
00165         /*@globals fileSystem@*/
00166         /*@modifies digest, fileSystem @*/
00167 {
00168     return domd5(fn, digest, 1);
00169 }
00170 
00178 /*@unused@*/ static inline
00179 int mdbinfile(const char * fn, /*@out@*/ unsigned char * bindigest)
00180         /*@globals fileSystem@*/
00181         /*@modifies bindigest, fileSystem @*/
00182 {
00183     return domd5(fn, bindigest, 0);
00184 }
00185 
00186 #ifdef __cplusplus
00187 }
00188 #endif
00189 
00190 #endif  /* H_MISC */

Generated on Sun Feb 2 23:32:01 2003 for rpm by doxygen1.2.18