summaryrefslogtreecommitdiff
path: root/rpmio/rpmio.h
diff options
context:
space:
mode:
Diffstat (limited to 'rpmio/rpmio.h')
-rw-r--r--rpmio/rpmio.h156
1 files changed, 128 insertions, 28 deletions
diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h
index de9748d5f..84e683e33 100644
--- a/rpmio/rpmio.h
+++ b/rpmio/rpmio.h
@@ -57,58 +57,82 @@ extern "C" {
/**
*/
-typedef ssize_t fdio_read_function_t (void *cookie, char *buf, size_t nbytes);
+typedef ssize_t fdio_read_function_t (void *cookie, char *buf, size_t nbytes)
+ /*@globals fileSystem @*/
+ /*@modifies *cookie, fileSystem @*/;
/**
*/
-typedef ssize_t fdio_write_function_t (void *cookie, const char *buf, size_t nbytes);
+typedef ssize_t fdio_write_function_t (void *cookie, const char *buf, size_t nbytes)
+ /*@globals fileSystem @*/
+ /*@modifies *cookie, fileSystem @*/;
/**
*/
-typedef int fdio_seek_function_t (void *cookie, _libio_pos_t pos, int whence);
+typedef int fdio_seek_function_t (void *cookie, _libio_pos_t pos, int whence)
+ /*@globals fileSystem @*/
+ /*@modifies *cookie, fileSystem @*/;
/**
*/
-typedef int fdio_close_function_t (void *cookie);
+typedef int fdio_close_function_t (void *cookie)
+ /*@globals fileSystem @*/
+ /*@modifies *cookie, fileSystem @*/;
/**
*/
typedef /*@only@*/ /*@null@*/ FD_t fdio_ref_function_t ( /*@only@*/ void * cookie,
- const char * msg, const char * file, unsigned line);
+ const char * msg, const char * file, unsigned line)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/**
*/
typedef /*@only@*/ /*@null@*/ FD_t fdio_deref_function_t ( /*@only@*/ FD_t fd,
- const char * msg, const char * file, unsigned line);
+ const char * msg, const char * file, unsigned line)
+ /*@globals fileSystem @*/
+ /*@modifies fd, fileSystem @*/;
/**
*/
typedef /*@only@*/ /*@null@*/ FD_t fdio_new_function_t (const char * msg,
- const char * file, unsigned line);
+ const char * file, unsigned line)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/**
*/
-typedef int fdio_fileno_function_t (void * cookie);
+typedef int fdio_fileno_function_t (void * cookie)
+ /*@globals fileSystem @*/
+ /*@modifies *cookie, fileSystem @*/;
/**
*/
-typedef FD_t fdio_open_function_t (const char * path, int flags, mode_t mode);
+typedef FD_t fdio_open_function_t (const char * path, int flags, mode_t mode)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/**
*/
-typedef FD_t fdio_fopen_function_t (const char * path, const char * fmode);
+typedef FD_t fdio_fopen_function_t (const char * path, const char * fmode)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/**
*/
-typedef void * fdio_ffileno_function_t (FD_t fd);
+typedef void * fdio_ffileno_function_t (FD_t fd)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/**
*/
-typedef int fdio_fflush_function_t (FD_t fd);
+typedef int fdio_fflush_function_t (FD_t fd)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/*@}*/
@@ -116,15 +140,55 @@ typedef int fdio_fflush_function_t (FD_t fd);
* \name RPMRPC Vectors.
*/
/*@{*/
-typedef int fdio_mkdir_function_t (const char * path, mode_t mode);
-typedef int fdio_chdir_function_t (const char * path);
-typedef int fdio_rmdir_function_t (const char * path);
-typedef int fdio_rename_function_t (const char * oldpath, const char * newpath);
-typedef int fdio_unlink_function_t (const char * path);
+
+/**
+ */
+typedef int fdio_mkdir_function_t (const char * path, mode_t mode)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
+
+/**
+ */
+typedef int fdio_chdir_function_t (const char * path)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
+
+/**
+ */
+typedef int fdio_rmdir_function_t (const char * path)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
+
+/**
+ */
+typedef int fdio_rename_function_t (const char * oldpath, const char * newpath)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
+
+/**
+ */
+typedef int fdio_unlink_function_t (const char * path)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/*@-typeuse@*/
-typedef int fdio_stat_function_t (const char * path, struct stat * st);
-typedef int fdio_lstat_function_t (const char * path, struct stat * st);
-typedef int fdio_access_function_t (const char * path, int amode);
+
+/**
+ */
+typedef int fdio_stat_function_t (const char * path, /*@out@*/ struct stat * st)
+ /*@globals fileSystem @*/
+ /*@modifies *st, fileSystem @*/;
+
+/**
+ */
+typedef int fdio_lstat_function_t (const char * path, /*@out@*/ struct stat * st)
+ /*@globals fileSystem @*/
+ /*@modifies *st, fileSystem @*/;
+
+/**
+ */
+typedef int fdio_access_function_t (const char * path, int amode)
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem @*/;
/*@=typeuse@*/
/*@}*/
@@ -172,29 +236,34 @@ struct FDIO_s {
* fread(3) clone.
*/
size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
+ /*@globals fileSystem @*/
/*@modifies fd, *buf, fileSystem @*/;
/**
* fwrite(3) clone.
*/
size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
+ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/**
* fseek(3) clone.
*/
int Fseek(FD_t fd, _libio_off_t offset, int whence)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* fclose(3) clone.
*/
int Fclose( /*@killref@*/ FD_t fd)
+ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/**
*/
/*@null@*/ FD_t Fdopen(FD_t fd, const char * fmode)
+ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/**
@@ -202,6 +271,7 @@ int Fclose( /*@killref@*/ FD_t fd)
*/
/*@null@*/ FD_t Fopen(/*@null@*/ const char * path,
/*@null@*/ const char * fmode)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
@@ -209,6 +279,7 @@ int Fclose( /*@killref@*/ FD_t fd)
* fflush(3) clone.
*/
int Fflush(/*@null@*/ FD_t fd)
+ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/**
@@ -221,24 +292,28 @@ int Ferror(/*@null@*/ FD_t fd)
* fileno(3) clone.
*/
int Fileno(FD_t fd)
- /*@*/;
+ /*@globals fileSystem @*/
+ /*@modifies fileSystem@*/;
/**
* fcntl(2) clone.
*/
int Fcntl(FD_t fd, int op, void *lip)
+ /*@globals fileSystem @*/
/*@modifies fd, *lip, fileSystem @*/;
/**
* pread(2) clone.
*/
ssize_t Pread(FD_t fd, void * buf, size_t count, _libio_off_t offset)
+ /*@globals fileSystem @*/
/*@modifies fd, *buf, fileSystem @*/;
/**
* pwrite(2) clone.
*/
ssize_t Pwrite(FD_t fd, const void * buf, size_t count, _libio_off_t offset)
+ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/*@}*/
@@ -252,60 +327,70 @@ ssize_t Pwrite(FD_t fd, const void * buf, size_t count, _libio_off_t offset)
* mkdir(2) clone.
*/
int Mkdir(const char * path, mode_t mode)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* chdir(2) clone.
*/
int Chdir(const char * path)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* rmdir(2) clone.
*/
int Rmdir(const char * path)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* rename(2) clone.
*/
int Rename(const char * oldpath, const char * newpath)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* link(2) clone.
*/
int Link(const char * oldpath, const char * newpath)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* unlink(2) clone.
*/
int Unlink(const char * path)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* readlink(2) clone.
*/
int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
+ /*@globals fileSystem @*/
/*@modifies *buf, fileSystem @*/;
/**
* stat(2) clone.
*/
int Stat(const char * path, /*@out@*/ struct stat * st)
+ /*@globals fileSystem @*/
/*@modifies *st, fileSystem @*/;
/**
* lstat(2) clone.
*/
int Lstat(const char * path, /*@out@*/ struct stat * st)
+ /*@globals fileSystem @*/
/*@modifies *st, fileSystem @*/;
/**
* access(2) clone.
*/
int Access(const char * path, int amode)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
@@ -315,12 +400,14 @@ int Access(const char * path, int amode)
int Glob(const char * pattern, int flags,
int errfunc(const char * epath, int eerrno),
/*@out@*/ glob_t * pglob)
+ /*@globals fileSystem @*/
/*@modifies *pglob, fileSystem @*/;
/**
* globfree(3) clone.
*/
void Globfree( /*@only@*/ glob_t * pglob)
+ /*@globals fileSystem @*/
/*@modifies *pglob, fileSystem @*/;
@@ -328,18 +415,21 @@ void Globfree( /*@only@*/ glob_t * pglob)
* opendir(3) clone.
*/
/*@null@*/ DIR * Opendir(const char * name)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/**
* readdir(3) clone.
*/
/*@null@*/ struct dirent * Readdir(DIR * dir)
+ /*@globals fileSystem @*/
/*@modifies *dir, fileSystem @*/;
/**
* closedir(3) clone.
*/
int Closedir(/*@only@*/ DIR * dir)
+ /*@globals fileSystem @*/
/*@modifies *dir, fileSystem @*/;
/*@}*/
@@ -353,11 +443,13 @@ int Closedir(/*@only@*/ DIR * dir)
/**
*/
off_t fdSize(FD_t fd)
+ /*@globals fileSystem @*/
/*@modifies fd, fileSystem@*/;
/**
*/
/*@null@*/ FD_t fdDup(int fdno)
+ /*@globals fileSystem @*/
/*@modifies fileSystem@*/;
#ifdef UNUSED
@@ -378,24 +470,28 @@ off_t fdSize(FD_t fd)
/**
*/
/*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode)
+ /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
#define fdOpen(_path, _flags, _mode) fdio->_open((_path), (_flags), (_mode))
/**
*/
ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
+ /*@globals fileSystem @*/
/*@modifies *cookie, *buf, fileSystem @*/;
#define fdRead(_fd, _buf, _count) fdio->read((_fd), (_buf), (_count))
/**
*/
ssize_t fdWrite(void * cookie, const char * buf, size_t count)
+ /*@globals fileSystem @*/
/*@modifies *cookie, fileSystem @*/;
#define fdWrite(_fd, _buf, _count) fdio->write((_fd), (_buf), (_count))
/**
*/
int fdClose( /*@only@*/ void * cookie)
+ /*@globals fileSystem @*/
/*@modifies *cookie, fileSystem @*/;
#define fdCLose(_fd) fdio->close(_fd)
@@ -410,7 +506,8 @@ int fdClose( /*@only@*/ void * cookie)
/**
*/
int fdWritable(FD_t fd, int secs)
- /*@modifies fd @*/;
+ /*@globals fileSystem @*/
+ /*@modifies fd, fileSystem @*/;
/**
*/
@@ -461,17 +558,20 @@ typedef enum ftperrCode_e {
*/
/*@-exportlocal@*/
int ufdCopy(FD_t sfd, FD_t tfd)
+ /*@globals fileSystem @*/
/*@modifies sfd, tfd, fileSystem @*/;
/*@=exportlocal@*/
/**
*/
int ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd)
+ /*@globals fileSystem @*/
/*@modifies sfd, tfd, fileSystem @*/;
/**
*/
/*@unused@*/ int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length)
+ /*@globals fileSystem @*/
/*@modifies fd, *bufptr, fileSystem @*/;
#define timedRead ufdio->read
@@ -479,27 +579,27 @@ int ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd)
/*@-exportlocal@*/
/**
*/
-/*@observer@*/ extern FDIO_t fdio;
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t fdio;
/**
*/
-/*@observer@*/ extern FDIO_t fpio;
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t fpio;
/**
*/
-/*@observer@*/ extern FDIO_t ufdio;
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t ufdio;
/**
*/
-/*@observer@*/ extern FDIO_t gzdio;
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t gzdio;
/**
*/
-/*@observer@*/ extern FDIO_t bzdio;
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t bzdio;
/**
*/
-/*@observer@*/ extern FDIO_t fadio;
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t fadio;
/*@=exportlocal@*/
/*@}*/