• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

rpmio/rpmio.h

Go to the documentation of this file.
00001 #ifndef H_RPMIO
00002 #define H_RPMIO
00003 
00009 #include <sys/types.h>
00010 #include <sys/stat.h>
00011 #include <dirent.h>
00012 /*@-noparams@*/
00013 #include "glob.h"
00014 /*@=noparams@*/
00015 #include <stdio.h>
00016 #include <stdlib.h>
00017 #include <unistd.h>
00018 
00026 #if !defined(__LCLINT__) && defined(__GLIBC__) && \
00027         (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
00028 #define USE_COOKIE_SEEK_POINTER 1
00029 typedef _IO_off64_t     _libio_off_t;
00030 typedef _libio_off_t *  _libio_pos_t;
00031 #else
00032 typedef off_t           _libio_off_t;
00033 typedef off_t           _libio_pos_t;
00034 #endif
00035 
00039 typedef /*@abstract@*/ /*@refcounted@*/ struct _FD_s * FD_t;
00040 
00043 typedef /*@observer@*/ struct FDIO_s * FDIO_t;
00044 
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048 
00053 
00056 typedef ssize_t (*fdio_read_function_t) (void *cookie, char *buf, size_t nbytes)
00057         /*@globals errno, fileSystem @*/
00058         /*@modifies *cookie, errno, fileSystem @*/
00059         /*@requires maxSet(buf) >= (nbytes - 1) @*/
00060         /*@ensures maxRead(buf) == result @*/ ;
00061 
00064 typedef ssize_t (*fdio_write_function_t) (void *cookie, const char *buf, size_t nbytes)
00065         /*@globals errno, fileSystem @*/
00066         /*@modifies *cookie, errno, fileSystem @*/;
00067 
00070 typedef int (*fdio_seek_function_t) (void *cookie, _libio_pos_t pos, int whence)
00071         /*@globals errno, fileSystem @*/
00072         /*@modifies *cookie, errno, fileSystem @*/;
00073 
00076 typedef int (*fdio_close_function_t) (void *cookie)
00077         /*@globals errno, fileSystem, systemState @*/
00078         /*@modifies *cookie, errno, fileSystem, systemState @*/;
00079 
00080 
00083 typedef /*@only@*/ /*@null@*/ FD_t (*fdio_ref_function_t) ( /*@only@*/ void * cookie,
00084                 const char * msg, const char * file, unsigned line)
00085         /*@globals fileSystem @*/
00086         /*@modifies fileSystem @*/;
00087 
00090 typedef /*@only@*/ /*@null@*/ FD_t (*fdio_deref_function_t) ( /*@only@*/ FD_t fd,
00091                 const char * msg, const char * file, unsigned line)
00092         /*@globals fileSystem @*/
00093         /*@modifies fd, fileSystem @*/;
00094 
00095 
00098 typedef /*@only@*/ /*@null@*/ FD_t (*fdio_new_function_t) (const char * msg,
00099                 const char * file, unsigned line)
00100         /*@globals fileSystem @*/
00101         /*@modifies fileSystem @*/;
00102 
00103 
00106 typedef int (*fdio_fileno_function_t) (void * cookie)
00107         /*@globals fileSystem @*/
00108         /*@modifies *cookie, fileSystem @*/;
00109 
00110 
00113 typedef FD_t (*fdio_open_function_t) (const char * path, int flags, mode_t mode)
00114         /*@globals errno, fileSystem @*/
00115         /*@modifies errno, fileSystem @*/;
00116 
00119 typedef FD_t (*fdio_fopen_function_t) (const char * path, const char * fmode)
00120         /*@globals fileSystem @*/
00121         /*@modifies fileSystem @*/;
00122 
00125 typedef void * (*fdio_ffileno_function_t) (FD_t fd)
00126         /*@globals fileSystem @*/
00127         /*@modifies fileSystem @*/;
00128 
00131 typedef int (*fdio_fflush_function_t) (FD_t fd)
00132         /*@globals fileSystem @*/
00133         /*@modifies fileSystem @*/;
00141 
00144 typedef int (*fdio_mkdir_function_t) (const char * path, mode_t mode)
00145         /*@globals errno, fileSystem @*/
00146         /*@modifies errno, fileSystem @*/;
00147 
00150 typedef int (*fdio_chdir_function_t) (const char * path)
00151         /*@globals errno, fileSystem @*/
00152         /*@modifies errno, fileSystem @*/;
00153 
00156 typedef int (*fdio_rmdir_function_t) (const char * path)
00157         /*@globals errno, fileSystem @*/
00158         /*@modifies errno, fileSystem @*/;
00159 
00162 typedef int (*fdio_rename_function_t) (const char * oldpath, const char * newpath)
00163         /*@globals errno, fileSystem @*/
00164         /*@modifies errno, fileSystem @*/;
00165 
00168 typedef int (*fdio_unlink_function_t) (const char * path)
00169         /*@globals errno, fileSystem @*/
00170         /*@modifies errno, fileSystem @*/;
00171 /*@-typeuse@*/
00172 
00175 typedef int (*fdio_stat_function_t) (const char * path, /*@out@*/ struct stat * st)
00176         /*@globals errno, fileSystem @*/
00177         /*@modifies *st, errno, fileSystem @*/;
00178 
00181 typedef int (*fdio_lstat_function_t) (const char * path, /*@out@*/ struct stat * st)
00182         /*@globals errno, fileSystem @*/
00183         /*@modifies *st, errno, fileSystem @*/;
00184 
00187 typedef int (*fdio_access_function_t) (const char * path, int amode)
00188         /*@globals errno, fileSystem @*/
00189         /*@modifies errno, fileSystem @*/;
00190 /*@=typeuse@*/
00196 struct FDIO_s {
00197   fdio_read_function_t          read;
00198   fdio_write_function_t         write;
00199   fdio_seek_function_t          seek;
00200   fdio_close_function_t         close;
00201 
00202   fdio_ref_function_t           _fdref;
00203   fdio_deref_function_t         _fdderef;
00204   fdio_new_function_t           _fdnew;
00205   fdio_fileno_function_t        _fileno;
00206 
00207   fdio_open_function_t          _open;
00208   fdio_fopen_function_t         _fopen;
00209   fdio_ffileno_function_t       _ffileno;
00210   fdio_fflush_function_t        _fflush;
00211 
00212   fdio_mkdir_function_t         _mkdir;
00213   fdio_chdir_function_t         _chdir;
00214   fdio_rmdir_function_t         _rmdir;
00215   fdio_rename_function_t        _rename;
00216   fdio_unlink_function_t        _unlink;
00217 };
00218 
00219 
00224 
00228 /*@observer@*/ const char * Fstrerror(/*@null@*/ FD_t fd)
00229         /*@*/;
00230 
00234 /*@-incondefs@*/
00235 size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
00236         /*@globals fileSystem @*/
00237         /*@modifies fd, *buf, fileSystem @*/
00238         /*@requires maxSet(buf) >= (nmemb - 1) @*/
00239         /*@ensures maxRead(buf) == result @*/;
00240 /*@=incondefs@*/
00241 
00245 /*@-incondefs@*/
00246 size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
00247         /*@globals fileSystem @*/
00248         /*@modifies fd, fileSystem @*/
00249         /*@requires maxRead(buf) >= nmemb @*/;
00250 /*@=incondefs@*/
00251 
00255 int Fseek(FD_t fd, _libio_off_t offset, int whence)
00256         /*@globals fileSystem @*/
00257         /*@modifies fileSystem @*/;
00258 
00262 int Fclose( /*@killref@*/ FD_t fd)
00263         /*@globals fileSystem, internalState @*/
00264         /*@modifies fd, fileSystem, internalState @*/;
00265 
00268 /*@null@*/ FD_t Fdopen(FD_t ofd, const char * fmode)
00269         /*@globals fileSystem, internalState @*/
00270         /*@modifies ofd, fileSystem, internalState @*/;
00271 
00275 /*@null@*/ FD_t Fopen(/*@null@*/ const char * path,
00276                         /*@null@*/ const char * fmode)
00277         /*@globals h_errno, fileSystem, internalState @*/
00278         /*@modifies fileSystem, internalState @*/;
00279 
00280 
00284 int Fflush(/*@null@*/ FD_t fd)
00285         /*@globals fileSystem @*/
00286         /*@modifies fd, fileSystem @*/;
00287 
00291 int Ferror(/*@null@*/ FD_t fd)
00292         /*@*/;
00293 
00297 int Fileno(FD_t fd)
00298         /*@globals fileSystem @*/
00299         /*@modifies fileSystem@*/;
00300 
00304 /*@unused@*/
00305 int Fcntl(FD_t fd, int op, void *lip)
00306         /*@globals errno, fileSystem @*/
00307         /*@modifies fd, *lip, errno, fileSystem @*/;
00308 
00315 
00319 int Mkdir(const char * path, mode_t mode)
00320         /*@globals errno, h_errno, fileSystem, internalState @*/
00321         /*@modifies errno, fileSystem, internalState @*/;
00322 
00326 int Chdir(const char * path)
00327         /*@globals errno, h_errno, fileSystem, internalState @*/
00328         /*@modifies errno, fileSystem, internalState @*/;
00329 
00333 int Rmdir(const char * path)
00334         /*@globals errno, h_errno, fileSystem, internalState @*/
00335         /*@modifies errno, fileSystem, internalState @*/;
00336 
00337 /*@unchecked@*/ /*@observer@*/ /*@null@*/
00338 extern const char * _chroot_prefix;
00339 
00344 int Chroot(const char * path)
00345         /*@globals _chroot_prefix, errno, fileSystem, internalState @*/
00346         /*@modifies _chroot_prefix, errno, fileSystem, internalState @*/;
00347 
00352 int Open(const char * path, int flags, mode_t mode)
00353         /*@globals errno, fileSystem, internalState @*/
00354         /*@modifies errno, fileSystem, internalState @*/;
00355 
00359 int Rename(const char * oldpath, const char * newpath)
00360         /*@globals errno, h_errno, fileSystem, internalState @*/
00361         /*@modifies errno, fileSystem, internalState @*/;
00362 
00366 int Link(const char * oldpath, const char * newpath)
00367         /*@globals errno, fileSystem, internalState @*/
00368         /*@modifies errno, fileSystem, internalState @*/;
00369 
00373 int Unlink(const char * path)
00374         /*@globals errno, h_errno, fileSystem, internalState @*/
00375         /*@modifies errno, fileSystem, internalState @*/;
00376 
00380 int Stat(const char * path, /*@out@*/ struct stat * st)
00381         /*@globals errno, h_errno, fileSystem, internalState @*/
00382         /*@modifies *st, errno, fileSystem, internalState @*/;
00383 
00387 int Lstat(const char * path, /*@out@*/ struct stat * st)
00388         /*@globals errno, h_errno, fileSystem, internalState @*/
00389         /*@modifies *st, errno, fileSystem, internalState @*/;
00390 
00395 int Chown(const char * path, uid_t owner, gid_t group)
00396         /*@globals errno, fileSystem, internalState @*/
00397         /*@modifies errno, fileSystem, internalState @*/;
00398 
00403 int Lchown(const char * path, uid_t owner, gid_t group)
00404         /*@globals errno, fileSystem, internalState @*/
00405         /*@modifies errno, fileSystem, internalState @*/;
00406 
00411 int Chmod(const char * path, mode_t mode)
00412         /*@globals errno, fileSystem, internalState @*/
00413         /*@modifies errno, fileSystem, internalState @*/;
00414 
00419 int Mkfifo(const char * path, mode_t mode)
00420         /*@globals errno, fileSystem, internalState @*/
00421         /*@modifies errno, fileSystem, internalState @*/;
00422 
00427 int Mknod(const char * path, mode_t mode, dev_t dev)
00428         /*@globals errno, fileSystem, internalState @*/
00429         /*@modifies errno, fileSystem, internalState @*/;
00430 
00435 struct utimbuf;
00436 int Utime(const char * path, const struct utimbuf * buf)
00437         /*@globals errno, fileSystem, internalState @*/
00438         /*@modifies errno, fileSystem, internalState @*/;
00439 
00444 int Utimes(const char * path, const struct timeval * times)
00445         /*@globals errno, fileSystem, internalState @*/
00446         /*@modifies errno, fileSystem, internalState @*/;
00447 
00452 int Symlink(const char * oldpath, const char * newpath)
00453         /*@globals errno, fileSystem, internalState @*/
00454         /*@modifies errno, fileSystem, internalState @*/;
00455 
00460 /*@-incondefs@*/
00461 int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
00462         /*@globals errno, h_errno, fileSystem, internalState @*/
00463         /*@modifies *buf, errno, fileSystem, internalState @*/
00464         /*@requires maxSet(buf) >= (bufsiz - 1) @*/
00465         /*@ensures maxRead(buf) <= bufsiz @*/;
00466 /*@=incondefs@*/
00467 
00472 int Access(const char * path, int amode)
00473         /*@globals errno, fileSystem @*/
00474         /*@modifies errno, fileSystem @*/;
00475 
00476 #if defined(__linux__)
00477 
00480 int Mount(const char *source, const char *target,
00481                 const char *filesystemtype, unsigned long mountflags,
00482                 const void *data)
00483         /*@globals errno, fileSystem @*/
00484         /*@modifies errno, fileSystem @*/;
00485 
00489 int Umount(const char *target)
00490         /*@globals errno, fileSystem @*/
00491         /*@modifies errno, fileSystem @*/;
00492 
00496 int Umount2(const char *target, int flags)
00497         /*@globals errno, fileSystem @*/
00498         /*@modifies errno, fileSystem @*/;
00499 #endif
00500 
00504 int Glob_pattern_p (const char *pattern, int quote)
00505         /*@*/;
00506 
00510 int Glob_error(const char * epath, int eerrno)
00511         /*@*/;
00512 
00516 int Glob(const char * pattern, int flags,
00517                 int errfunc(const char * epath, int eerrno),
00518                 /*@out@*/ glob_t * pglob)
00519         /*@globals fileSystem @*/
00520         /*@modifies *pglob, fileSystem @*/;
00521 
00525 void Globfree( /*@only@*/ glob_t * pglob)
00526         /*@globals fileSystem @*/
00527         /*@modifies *pglob, fileSystem @*/;
00528 
00529 
00533 /*@null@*/
00534 DIR * Opendir(const char * path)
00535         /*@globals errno, h_errno, fileSystem, internalState @*/
00536         /*@modifies errno, fileSystem, internalState @*/;
00537 
00541 /*@dependent@*/ /*@null@*/
00542 struct dirent * Readdir(DIR * dir)
00543         /*@globals errno, fileSystem @*/
00544         /*@modifies *dir, errno, fileSystem @*/;
00545 
00549 int Closedir(/*@only@*/ DIR * dir)
00550         /*@globals errno, fileSystem @*/
00551         /*@modifies *dir, errno, fileSystem @*/;
00552 
00557 off_t Lseek(int fdno, off_t offset, int whence)
00558         /*@globals errno, fileSystem @*/
00559         /*@modifies errno, fileSystem @*/;
00560 
00568 
00571 off_t   fdSize(FD_t fd)
00572         /*@globals fileSystem @*/
00573         /*@modifies fd, fileSystem@*/;
00574 
00577 /*@null@*/ FD_t fdDup(int fdno)
00578         /*@globals fileSystem, internalState @*/
00579         /*@modifies fileSystem, internalState @*/;
00580 
00581 #ifdef UNUSED
00582 /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode);
00583 #endif
00584 
00585 /* XXX Legacy interfaces needed by gnorpm, rpmfind et al */
00586 
00587 /*@-exportlocal@*/
00590 #ifndef H_RPMIO_INTERNAL        /* XXX avoid gcc warning */
00591 /*@unused@*/ int fdFileno(void * cookie)
00592         /*@*/;
00593 #define fdFileno(_fd)           fdio->_fileno(_fd)
00594 #endif
00595 
00598 /*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode)
00599         /*@globals errno, fileSystem, internalState @*/
00600         /*@modifies errno, fileSystem, internalState @*/;
00601 #define fdOpen(_path, _flags, _mode)    fdio->_open((_path), (_flags), (_mode))
00602 
00605 /*@-incondefs@*/
00606 ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
00607         /*@globals errno, fileSystem, internalState @*/
00608         /*@modifies *cookie, *buf, errno, fileSystem, internalState @*/
00609         /*@requires maxSet(buf) >= (count - 1) @*/
00610         /*@ensures maxRead(buf) == result @*/ ;
00611 #define fdRead(_fd, _buf, _count)       fdio->read((_fd), (_buf), (_count))
00612 /*@=incondefs@*/
00613 
00616 ssize_t fdWrite(void * cookie, const char * buf, size_t count)
00617         /*@globals errno, fileSystem, internalState @*/
00618         /*@modifies *cookie, errno, fileSystem, internalState @*/;
00619 #define fdWrite(_fd, _buf, _count)      fdio->write((_fd), (_buf), (_count))
00620 
00623 int fdClose( /*@only@*/ void * cookie)
00624         /*@globals errno, fileSystem, systemState, internalState @*/
00625         /*@modifies *cookie, errno, fileSystem, systemState, internalState @*/;
00626 #define fdClose(_fd)            fdio->close(_fd)
00627 
00630 /*@unused@*/
00631 /*@only@*/ /*@null@*/
00632 FD_t fdLink (/*@only@*/ void * cookie, const char * msg)
00633         /*@globals fileSystem @*/
00634         /*@modifies *cookie, fileSystem @*/;
00635 #define fdLink(_fd, _msg)       fdio->_fdref(_fd, _msg, __FILE__, __LINE__)
00636 
00639 /*@unused@*/
00640 /*@only@*/ /*@null@*/
00641 FD_t fdFree(/*@only@*/ FD_t fd, const char * msg)
00642         /*@globals fileSystem @*/
00643         /*@modifies fd, fileSystem @*/;
00644 #define fdFree(_fd, _msg)       fdio->_fdderef(_fd, _msg, __FILE__, __LINE__)
00645 
00648 /*@unused@*/
00649 /*@only@*/ /*@null@*/
00650 FD_t fdNew (const char * msg)
00651         /*@globals fileSystem @*/
00652         /*@modifies fileSystem @*/;
00653 #define fdNew(_msg)             fdio->_fdnew(_msg, __FILE__, __LINE__)
00654 
00657 int fdWritable(FD_t fd, int secs)
00658         /*@globals errno, fileSystem @*/
00659         /*@modifies fd, errno, fileSystem @*/;
00660 
00663 int fdReadable(FD_t fd, int secs)
00664         /*@globals errno @*/
00665         /*@modifies fd, errno @*/;
00666 /*@=exportlocal@*/
00667 
00676 int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid)
00677         /*@globals h_errno, fileSystem, internalState @*/
00678         /*@modifies fileSystem, internalState @*/;
00679 
00687 int rpmioAccess(const char *FN, /*@null@*/ const char * path, int mode)
00688         /*@globals fileSystem, internalState @*/
00689         /*@modifies fileSystem, internalState @*/;
00690 
00696 extern char * (*Getpass) (const char * prompt)
00697         /*@*/;
00698 char * _GetPass (const char * prompt)
00699         /*@*/;
00700 char * _RequestPass (const char * prompt)
00701         /*@*/;
00702 
00706 /*@-typeuse@*/
00707 typedef enum ftperrCode_e {
00708     FTPERR_NE_ERROR             = -1,   
00709     FTPERR_NE_LOOKUP            = -2,   
00710     FTPERR_NE_AUTH              = -3,   
00711     FTPERR_NE_PROXYAUTH         = -4,   
00712     FTPERR_NE_CONNECT           = -5,   
00713     FTPERR_NE_TIMEOUT           = -6,   
00714     FTPERR_NE_FAILED            = -7,   
00715     FTPERR_NE_RETRY             = -8,   
00716     FTPERR_NE_REDIRECT          = -9,   
00718     FTPERR_BAD_SERVER_RESPONSE  = -81,  
00719     FTPERR_SERVER_IO_ERROR      = -82,  
00720     FTPERR_SERVER_TIMEOUT       = -83,  
00721     FTPERR_BAD_HOST_ADDR        = -84,  
00722     FTPERR_BAD_HOSTNAME         = -85,  
00723     FTPERR_FAILED_CONNECT       = -86,  
00724     FTPERR_FILE_IO_ERROR        = -87,  
00725     FTPERR_PASSIVE_ERROR        = -88,  
00726     FTPERR_FAILED_DATA_CONNECT  = -89,  
00727     FTPERR_FILE_NOT_FOUND       = -90,  
00728     FTPERR_NIC_ABORT_IN_PROGRESS= -91,  
00729     FTPERR_UNKNOWN              = -100  
00730 } ftperrCode;
00731 /*@=typeuse@*/
00732 
00735 /*@-redecl@*/
00736 /*@observer@*/ const char * ftpStrerror(int errorNumber)
00737         /*@*/;
00738 /*@=redecl@*/
00739 
00742 /*@unused@*/
00743 /*@dependent@*/ /*@null@*/ void * ufdGetUrlinfo(FD_t fd)
00744         /*@modifies fd @*/;
00745 
00748 /*@-redecl@*/
00749 /*@unused@*/
00750 /*@observer@*/ const char * urlStrerror(const char * url)
00751         /*@globals h_errno, internalState @*/
00752         /*@modifies internalState @*/;
00753 /*@=redecl@*/
00754 
00757 /*@-exportlocal@*/
00758 int ufdCopy(FD_t sfd, FD_t tfd)
00759         /*@globals fileSystem @*/
00760         /*@modifies sfd, tfd, fileSystem @*/;
00761 /*@=exportlocal@*/
00762 
00765 int ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd)
00766         /*@globals fileSystem, internalState @*/
00767         /*@modifies sfd, tfd, fileSystem, internalState @*/;
00768 
00769 /*@-exportlocal@*/
00772 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fdio;
00773 
00776 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fpio;
00777 
00780 /*@observer@*/ /*@unchecked@*/ extern FDIO_t ufdio;
00781 
00784 /*@observer@*/ /*@unchecked@*/ extern FDIO_t gzdio;
00785 
00788 /*@observer@*/ /*@unchecked@*/ extern FDIO_t bzdio;
00789 
00792 /*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
00793 
00796 /*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio;
00797 
00800 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fadio;
00801 /*@=exportlocal@*/
00804 /*@unused@*/ static inline int xislower(int c) /*@*/ {
00805     return (c >= (int)'a' && c <= (int)'z');
00806 }
00807 /*@unused@*/ static inline int xisupper(int c) /*@*/ {
00808     return (c >= (int)'A' && c <= (int)'Z');
00809 }
00810 /*@unused@*/ static inline int xisalpha(int c) /*@*/ {
00811     return (xislower(c) || xisupper(c));
00812 }
00813 /*@unused@*/ static inline int xisdigit(int c) /*@*/ {
00814     return (c >= (int)'0' && c <= (int)'9');
00815 }
00816 /*@unused@*/ static inline int xisalnum(int c) /*@*/ {
00817     return (xisalpha(c) || xisdigit(c));
00818 }
00819 /*@unused@*/ static inline int xisblank(int c) /*@*/ {
00820     return (c == (int)' ' || c == (int)'\t');
00821 }
00822 /*@unused@*/ static inline int xisspace(int c) /*@*/ {
00823     return (xisblank(c) || c == (int)'\n' || c == (int)'\r' || c == (int)'\f' || c == (int)'\v');
00824 }
00825 /*@unused@*/ static inline int xiscntrl(int c) /*@*/ {
00826     return (c < (int)' ');
00827 }
00828 /*@unused@*/ static inline int xisascii(int c) /*@*/ {
00829     return ((c & 0x80) != 0x80);
00830 }
00831 /*@unused@*/ static inline int xisprint(int c) /*@*/ {
00832     return (c >= (int)' ' && xisascii(c));
00833 }
00834 /*@unused@*/ static inline int xisgraph(int c) /*@*/ {
00835     return (c > (int)' ' && xisascii(c));
00836 }
00837 /*@unused@*/ static inline int xispunct(int c) /*@*/ {
00838     return (xisgraph(c) && !xisalnum(c));
00839 }
00840 
00841 /*@unused@*/ static inline int xtolower(int c) /*@*/ {
00842     return ((xisupper(c)) ? (c | ('a' - 'A')) : c);
00843 }
00844 /*@unused@*/ static inline int xtoupper(int c) /*@*/ {
00845     return ((xislower(c)) ? (c & ~('a' - 'A')) : c);
00846 }
00847 
00851 int xstrcasecmp(const char * s1, const char * s2)               /*@*/;
00852 
00856 int xstrncasecmp(const char *s1, const char * s2, size_t n)     /*@*/;
00857 
00861 /*@only@*/ /*@null@*/
00862 const char * xstrtolocale(/*@only@*/ const char *str)
00863         /*@modifies *str @*/;
00864 
00865 #if !defined(SWIG)
00866 
00871 #if defined(WITH_DMALLOC)
00872 #define _free(p) ((p) != NULL ? free((void *)(p)) : (void)0, NULL)
00873 #else
00874 /*@unused@*/ static inline /*@null@*/
00875 void * _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p)
00876         /*@modifies p @*/
00877 {
00878     if (p != NULL)      free((void *)p);
00879     return NULL;
00880 }
00881 #endif
00882 #endif
00883 
00887 void rpmioClean(void)
00888         /*@globals internalState, fileSystem @*/
00889         /*@modifies internalState, fileSystem @*/;
00890 
00891 #ifdef __cplusplus
00892 }
00893 #endif
00894 
00895 #endif  /* H_RPMIO */

Generated on Mon Nov 29 2010 05:18:47 for rpm by  doxygen 1.7.2