home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / misc / src / rpm / lib / misc.h < prev    next >
C/C++ Source or Header  |  1997-09-17  |  856b  |  31 lines

  1. #ifndef H_MISC
  2. #define H_MISC
  3.  
  4. #include <unistd.h>
  5.  
  6. char ** splitString(char * str, int length, char sep);
  7. void freeSplitString(char ** list);
  8. void stripTrailingSlashes(char * str);
  9.  
  10. int exists(char * filespec);
  11.  
  12. int rpmvercmp(char * one, char * two);
  13.  
  14. /* these are like the normal functions, but they malloc() the space which
  15.    is needed */
  16. int dosetenv(const char *name, const char *value, int overwrite);
  17. int doputenv(const char * str);
  18.  
  19. /* These may be called w/ a NULL argument to flush the cache -- they return
  20.    -1 if the user can't be found */
  21. int unameToUid(char * thisUname, uid_t * uid);
  22. int gnameToGid(char * thisGname, gid_t * gid);
  23.  
  24. /* Call w/ -1 to flush the cache, returns NULL if the user can't be found */
  25. char * uidToUname(uid_t uid);
  26. char * gidToGname(gid_t gid);
  27.  
  28. int makeTempFile(char * prefix, char ** fnptr, int * fdptr);
  29.  
  30. #endif
  31.