rpm  5.4.10
rpmio.h
Go to the documentation of this file.
1 #ifndef H_RPMIO
2 #define H_RPMIO
3 
9 #include <sys/types.h>
10 #include <sys/stat.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <unistd.h>
14 
15 #include <rpmiotypes.h>
16 #include <rpmzlog.h>
17 
25 #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
26  (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
27 #define USE_COOKIE_SEEK_POINTER 1
28 typedef _IO_off64_t _libio_off_t;
29 typedef _libio_off_t * _libio_pos_t;
30 #else
31 typedef off_t _libio_off_t;
32 typedef off_t _libio_pos_t;
33 #endif
34 
38 /*@unchecked@*/
39 extern int _rpmio_debug;
40 
43 typedef /*@abstract@*/ /*@refcounted@*/ struct _FD_s * FD_t;
44 
47 typedef /*@observer@*/ struct FDIO_s * FDIO_t;
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
57 
60 typedef ssize_t (*fdio_read_function_t) (void *cookie, char *buf, size_t nbytes)
61  /*@globals errno, fileSystem @*/
62  /*@modifies *cookie, errno, fileSystem @*/
63  /*@requires maxSet(buf) >= (nbytes - 1) @*/
64  /*@ensures maxRead(buf) == result @*/ ;
65 
68 typedef ssize_t (*fdio_write_function_t) (void *cookie, const char *buf, size_t nbytes)
69  /*@globals errno, fileSystem @*/
70  /*@modifies *cookie, errno, fileSystem @*/;
71 
74 typedef int (*fdio_seek_function_t) (void *cookie, _libio_pos_t pos, int whence)
75  /*@globals errno, fileSystem @*/
76  /*@modifies *cookie, errno, fileSystem @*/;
77 
80 typedef int (*fdio_close_function_t) (void *cookie)
81  /*@globals errno, fileSystem, systemState @*/
82  /*@modifies *cookie, errno, fileSystem, systemState @*/;
83 
86 typedef FD_t (*fdio_fopen_function_t) (const char * path, const char * fmode)
87  /*@globals errno, fileSystem @*/
88  /*@modifies errno, fileSystem @*/;
89 
92 typedef FD_t (*fdio_fdopen_function_t) (void * cookie, const char * fmode)
93  /*@globals errno, fileSystem @*/
94  /*@modifies errno, fileSystem @*/;
95 
98 typedef int (*fdio_flush_function_t) (void * cookie)
99  /*@globals errno, fileSystem @*/
100  /*@modifies errno, fileSystem @*/;
101 
107 struct FDIO_s {
112 /*@null@*/
114 /*@null@*/
116 /*@null@*/
118 };
119 
120 
125 
129 /*@observer@*/ const char * Fstrerror(/*@null@*/ FD_t fd)
130  /*@*/;
131 
135 /*@-incondefs@*/
136 size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
137  /*@globals fileSystem @*/
138  /*@modifies fd, *buf, fileSystem @*/
139  /*@requires maxSet(buf) >= (nmemb - 1) @*/;
140 /*@=incondefs@*/
141 
145 /*@-incondefs@*/
146 size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
147  /*@globals fileSystem @*/
148  /*@modifies fd, fileSystem @*/
149  /*@requires maxRead(buf) >= nmemb @*/;
150 /*@=incondefs@*/
151 
155 int Fseek(FD_t fd, _libio_off_t offset, int whence)
156  /*@globals fileSystem @*/
157  /*@modifies fileSystem @*/;
158 long Ftell(FD_t fd)
159  /*@*/;
160 void Rewind(FD_t fd)
161  /*@*/;
162 int Fgetpos(FD_t fd, fpos_t *pos)
163  /*@*/;
164 int Fsetpos(FD_t fd, fpos_t *pos)
165  /*@*/;
166 
170 int Fclose( /*@killref@*/ FD_t fd)
171  /*@globals fileSystem, internalState @*/
172  /*@modifies fd, fileSystem, internalState @*/;
173 
176 /*@null@*/ FD_t Fdopen(FD_t ofd, const char * fmode)
177  /*@globals fileSystem, internalState @*/
178  /*@modifies ofd, fileSystem, internalState @*/;
179 
183 /*@null@*/ FD_t Fopen(/*@null@*/ const char * path,
184  /*@null@*/ const char * fmode)
185  /*@globals h_errno, fileSystem, internalState @*/
186  /*@modifies fileSystem, internalState @*/;
187 
188 
192 int Fflush(/*@null@*/ FD_t fd)
193  /*@globals fileSystem @*/
194  /*@modifies fd, fileSystem @*/;
195 
199 int Ferror(/*@null@*/ FD_t fd)
200  /*@*/;
201 
205 int Fileno(FD_t fd)
206  /*@globals fileSystem @*/
207  /*@modifies fileSystem@*/;
208 
212 /*@unused@*/
213 int Fcntl(FD_t fd, int op, void *lip)
214  /*@globals errno, fileSystem @*/
215  /*@modifies fd, *lip, errno, fileSystem @*/;
216 
223 
227 int Mkdir(const char * path, mode_t mode)
228  /*@globals errno, h_errno, fileSystem, internalState @*/
229  /*@modifies errno, fileSystem, internalState @*/;
230 
234 int Chdir(const char * path)
235  /*@globals errno, h_errno, fileSystem, internalState @*/
236  /*@modifies errno, fileSystem, internalState @*/;
237 
241 int Rmdir(const char * path)
242  /*@globals errno, h_errno, fileSystem, internalState @*/
243  /*@modifies errno, fileSystem, internalState @*/;
244 
245 /*@unchecked@*/ /*@observer@*/ /*@null@*/
246 extern const char * _chroot_prefix;
247 
252 int Chroot(const char * path)
253  /*@globals _chroot_prefix, errno, fileSystem, internalState @*/
254  /*@modifies _chroot_prefix, errno, fileSystem, internalState @*/;
255 
260 int Open(const char * path, int flags, mode_t mode)
261  /*@globals errno, fileSystem, internalState @*/
262  /*@modifies errno, fileSystem, internalState @*/;
263 
267 int Rename(const char * oldpath, const char * newpath)
268  /*@globals errno, h_errno, fileSystem, internalState @*/
269  /*@modifies errno, fileSystem, internalState @*/;
270 
274 int Link(const char * oldpath, const char * newpath)
275  /*@globals errno, fileSystem, internalState @*/
276  /*@modifies errno, fileSystem, internalState @*/;
277 
281 int Unlink(const char * path)
282  /*@globals errno, h_errno, fileSystem, internalState @*/
283  /*@modifies errno, fileSystem, internalState @*/;
284 
288 int Stat(const char * path, /*@out@*/ struct stat * st)
289  /*@globals errno, h_errno, fileSystem, internalState @*/
290  /*@modifies *st, errno, fileSystem, internalState @*/;
291 
295 int Lstat(const char * path, /*@out@*/ struct stat * st)
296  /*@globals errno, h_errno, fileSystem, internalState @*/
297  /*@modifies *st, errno, fileSystem, internalState @*/;
298 
302 int Fstat(FD_t fd, /*@out@*/ struct stat * st)
303  /*@globals errno, fileSystem, internalState @*/
304  /*@modifies *st, errno, fileSystem, internalState @*/;
305 
309 int Fadvise(FD_t fd, off_t offset, off_t length, int advice)
310  /*@globals fileSystem, internalState @*/
311  /*@modifies fileSystem, internalState @*/;
312 
316 int Fallocate(FD_t fd, off_t offset, off_t length)
317  /*@globals fileSystem, internalState @*/
318  /*@modifies fileSystem, internalState @*/;
319 
324 int Chown(const char * path, uid_t owner, gid_t group)
325  /*@globals errno, fileSystem, internalState @*/
326  /*@modifies errno, fileSystem, internalState @*/;
327 
332 int Fchown(FD_t fd, uid_t owner, gid_t group)
333  /*@globals errno, fileSystem, internalState @*/
334  /*@modifies errno, fileSystem, internalState @*/;
335 
340 int Lchown(const char * path, uid_t owner, gid_t group)
341  /*@globals errno, fileSystem, internalState @*/
342  /*@modifies errno, fileSystem, internalState @*/;
343 
348 int Chmod(const char * path, mode_t mode)
349  /*@globals errno, fileSystem, internalState @*/
350  /*@modifies errno, fileSystem, internalState @*/;
351 
356 int Lchmod(const char * path, mode_t mode)
357  /*@globals errno, fileSystem, internalState @*/
358  /*@modifies errno, fileSystem, internalState @*/;
359 
364 int Fchmod(FD_t fd, mode_t mode)
365  /*@globals errno, fileSystem, internalState @*/
366  /*@modifies errno, fileSystem, internalState @*/;
367 
372 int Chflags(const char * path, unsigned int flags)
373  /*@globals errno, fileSystem, internalState @*/
374  /*@modifies errno, fileSystem, internalState @*/;
375 
380 int Lchflags(const char * path, unsigned int flags)
381  /*@globals errno, fileSystem, internalState @*/
382  /*@modifies errno, fileSystem, internalState @*/;
383 
388 int Fchflags(FD_t fd, unsigned int flags)
389  /*@globals errno, fileSystem, internalState @*/
390  /*@modifies errno, fileSystem, internalState @*/;
391 
396 int Mkfifo(const char * path, mode_t mode)
397  /*@globals errno, fileSystem, internalState @*/
398  /*@modifies errno, fileSystem, internalState @*/;
399 
404 int Mknod(const char * path, mode_t mode, dev_t dev)
405  /*@globals errno, fileSystem, internalState @*/
406  /*@modifies errno, fileSystem, internalState @*/;
407 
412 struct utimbuf;
413 int Utime(const char * path, const struct utimbuf * buf)
414  /*@globals errno, fileSystem, internalState @*/
415  /*@modifies errno, fileSystem, internalState @*/;
416 
421 int Utimes(const char * path, const struct timeval * times)
422  /*@globals errno, fileSystem, internalState @*/
423  /*@modifies errno, fileSystem, internalState @*/;
424 
429 int Lutimes(const char * path, const struct timeval * times)
430  /*@globals errno, fileSystem, internalState @*/
431  /*@modifies errno, fileSystem, internalState @*/;
432 
437 int Symlink(const char * oldpath, const char * newpath)
438  /*@globals errno, fileSystem, internalState @*/
439  /*@modifies errno, fileSystem, internalState @*/;
440 
445 /*@-incondefs@*/
446 int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
447  /*@globals errno, h_errno, fileSystem, internalState @*/
448  /*@modifies *buf, errno, fileSystem, internalState @*/;
449 /*@=incondefs@*/
450 
455 int Access(const char * path, int amode)
456  /*@globals errno, fileSystem @*/
457  /*@modifies errno, fileSystem @*/;
458 
459 #if defined(__linux__)
460 
463 int Mount(const char *source, const char *target,
464  const char *filesystemtype, unsigned long mountflags,
465  const void *data)
466  /*@globals errno, fileSystem @*/
467  /*@modifies errno, fileSystem @*/;
468 
472 int Umount(const char *target)
473  /*@globals errno, fileSystem @*/
474  /*@modifies errno, fileSystem @*/;
475 
479 int Umount2(const char *target, int flags)
480  /*@globals errno, fileSystem @*/
481  /*@modifies errno, fileSystem @*/;
482 #endif
483 
487 int Glob_pattern_p (const char *pattern, int quote)
488  /*@*/;
489 
493 int Glob_error(const char * epath, int eerrno)
494  /*@*/;
495 
499 int Glob(const char * pattern, int flags,
500  int errfunc(const char * epath, int eerrno),
501  /*@out@*/ void * _pglob)
502  /*@globals fileSystem @*/
503  /*@modifies *_pglob, fileSystem @*/;
504 
508 void Globfree( /*@only@*/ void * _pglob)
509  /*@globals fileSystem @*/
510  /*@modifies *_pglob, fileSystem @*/;
511 
512 
516 /*@-globuse@*/
517 /*@null@*/
518 char * Realpath(const char * path, /*@out@*/ /*@null@*/ char * resolved_path)
519  /*@globals errno, fileSystem, internalState @*/
520  /*@modifies resolved_path, errno, fileSystem, internalState @*/;
521 /*@=globuse@*/
522 
527 off_t Lseek(int fdno, off_t offset, int whence)
528  /*@globals errno, fileSystem @*/
529  /*@modifies errno, fileSystem @*/;
530 
538 
541 /*@null@*/ FD_t fdDup(int fdno)
542  /*@globals fileSystem, internalState @*/
543  /*@modifies fileSystem, internalState @*/;
544 
545 /*@-exportlocal@*/
548 ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
549  /*@globals errno, fileSystem, internalState @*/
550  /*@modifies *cookie, *buf, errno, fileSystem, internalState @*/;
551 #define fdRead(_fd, _buf, _count) fdio->read((_fd), (_buf), (_count))
552 
555 ssize_t fdWrite(void * cookie, const char * buf, size_t count)
556  /*@globals errno, fileSystem, internalState @*/
557  /*@modifies *cookie, errno, fileSystem, internalState @*/;
558 #define fdWrite(_fd, _buf, _count) fdio->write((_fd), (_buf), (_count))
559 
562 int fdClose( /*@only@*/ void * cookie)
563  /*@globals errno, fileSystem, systemState, internalState @*/
564  /*@modifies *cookie, errno, fileSystem, systemState, internalState @*/;
565 #define fdClose(_fd) fdio->close(_fd)
566 
569 /*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode)
570  /*@globals errno, fileSystem, internalState @*/
571  /*@modifies errno, fileSystem, internalState @*/;
572 #define fdOpen(_path, _flags, _mode) fdio->_open((_path), (_flags), (_mode))
573 
576 /*@unused@*/
577 /*@newref@*/ /*@null@*/
578 FD_t fdLink (void * cookie, const char * msg)
579  /*@globals fileSystem @*/
580  /*@modifies *cookie, fileSystem @*/;
581 #define fdLink(_fd, _msg) \
582  ((FD_t)rpmioLinkPoolItem((rpmioItem)(_fd), _msg, __FILE__, __LINE__))
583 
586 /*@unused@*/ /*@null@*/
587 FD_t fdFree(/*@killref@*/ FD_t fd, const char * msg)
588  /*@globals fileSystem @*/
589  /*@modifies fd, fileSystem @*/;
590 #define fdFree(_fd, _msg) \
591  ((FD_t)rpmioFreePoolItem((rpmioItem)(_fd), _msg, __FILE__, __LINE__))
592 
595 /*@unused@*/
596 /*@newref@*/ /*@null@*/
597 FD_t fdNew (const char * msg)
598  /*@globals fileSystem @*/
599  /*@modifies fileSystem @*/;
600 /*@newref@*/ /*@null@*/
601 FD_t XfdNew (const char * msg, const char * fn, unsigned ln)
602  /*@globals fileSystem @*/
603  /*@modifies fileSystem @*/;
604 #define fdNew(_msg) XfdNew(_msg, __FILE__, __LINE__)
605 
608 int fdWritable(FD_t fd, int secs)
609  /*@globals errno, fileSystem @*/
610  /*@modifies fd, errno, fileSystem @*/;
611 
614 int fdReadable(FD_t fd, int secs)
615  /*@globals errno @*/
616  /*@modifies fd, errno @*/;
617 /*@=exportlocal@*/
618 
627 int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid)
628  /*@globals h_errno, fileSystem, internalState @*/
629  /*@modifies fileSystem, internalState @*/;
630 
638 int rpmioAccess(const char *FN, /*@null@*/ const char * path, int mode)
639  /*@globals fileSystem, internalState @*/
640  /*@modifies fileSystem, internalState @*/;
641 
647 extern char * (*Getpass) (const char * prompt)
648  /*@*/;
649 char * _GetPass (const char * prompt)
650  /*@*/;
651 char * _RequestPass (const char * prompt)
652  /*@*/;
653 
657 /*@-typeuse@*/
658 typedef enum ftperrCode_e {
681 } ftperrCode;
682 /*@=typeuse@*/
683 
686 /*@-redecl@*/
687 /*@observer@*/
688 const char * ftpStrerror(int errorNumber)
689  /*@*/;
690 /*@=redecl@*/
691 
694 /*@unused@*/
695 /*@dependent@*/ /*@null@*/
696 void * ufdGetUrlinfo(FD_t fd)
697  /*@globals fileSystem @*/
698  /*@modifies fd, fileSystem @*/;
699 
702 /*@-redecl@*/
703 /*@unused@*/
704 /*@observer@*/
705 const char * urlStrerror(const char * url)
706  /*@globals h_errno, internalState @*/
707  /*@modifies internalState @*/;
708 /*@=redecl@*/
709 
712 /*@-exportlocal@*/
713 int ufdCopy(FD_t sfd, FD_t tfd)
714  /*@globals fileSystem @*/
715  /*@modifies sfd, tfd, fileSystem @*/;
716 /*@=exportlocal@*/
717 
720 int ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd)
721  /*@globals fileSystem, internalState @*/
722  /*@modifies sfd, tfd, fileSystem, internalState @*/;
723 
724 /*@-exportlocal@*/
727 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fdio;
728 
731 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fpio;
732 
735 /*@observer@*/ /*@unchecked@*/ extern FDIO_t ufdio;
736 
739 /*@observer@*/ /*@unchecked@*/ extern FDIO_t gzdio;
740 
743 /*@observer@*/ /*@unchecked@*/ extern FDIO_t bzdio;
744 
747 /*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
748 
751 /*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio;
752 
753 /*@=exportlocal@*/
756 /*@unchecked@*/ /*@only@*/ /*@null@*/
757 extern rpmioPool _fdPool;
758 
762 void rpmioClean(void)
763  /*@globals _fdPool, fileSystem, internalState @*/
764  /*@modifies _fdPool, fileSystem, internalState @*/;
765 
771 /*@null@*/
772 rpmioPool rpmioFreePool(/*@only@*//*@null@*/ rpmioPool pool)
773  /*@globals fileSystem, internalState @*/
774  /*@modifies pool, fileSystem, internalState @*/;
775 
787 rpmioPool rpmioNewPool(/*@observer@*/ const char * name,
788  size_t size, int limit, int flags,
789  /*@null@*/ char * (*dbg) (void *item),
790  /*@null@*/ void (*init) (void *item),
791  /*@null@*/ void (*fini) (void *item))
792  /*@globals fileSystem @*/
793  /*@modifies fileSystem @*/;
794 
803 /*@null@*/
804 rpmioItem rpmioUnlinkPoolItem(/*@killref@*/ /*@null@*/ rpmioItem item,
805  const char * msg, const char * fn, unsigned ln)
806  /*@globals fileSystem @*/
807  /*@modifies item, fileSystem @*/;
808 
817 /*@newref@*/ /*@null@*/
818 rpmioItem rpmioLinkPoolItem(/*@returned@*/ /*@null@*/ rpmioItem item,
819  const char * msg, const char * fn, unsigned ln)
820  /*@globals fileSystem @*/
821  /*@modifies item, fileSystem @*/;
822 
831 /*@null@*/
832 void * rpmioFreePoolItem(/*@killref@*/ /*@null@*/ rpmioItem item,
833  const char * msg, const char * fn, unsigned ln)
834  /*@globals fileSystem @*/
835  /*@modifies item, fileSystem @*/;
836 
843 rpmioItem rpmioGetPool(/*@kept@*/ /*@null@*/ rpmioPool pool, size_t size)
844  /*@globals fileSystem @*/
845  /*@modifies pool, fileSystem @*/;
846 
852 /*@null@*/
854  /*@globals fileSystem @*/
855  /*@modifies item, fileSystem @*/;
856 
857 #ifdef __cplusplus
858 }
859 #endif
860 
861 #endif /* H_RPMIO */
const char * urlStrerror(const char *url)
Definition: rpmio.c:806
#define fdRead(_fd, _buf, _count)
Definition: rpmio.h:551
int _rpmio_debug
Definition: rpmio.c:178
int Fcntl(FD_t fd, int op, void *lip)
fcntl(2) clone.
Definition: rpmio.c:3009
int Fchflags(FD_t fd, unsigned int flags)
fchflags(2) clone.
Definition: rpmrpc.c:1927
off_t _libio_off_t
Hide libio API lossage.
Definition: rpmio.h:31
ftperrCode_e
FTP and HTTP error codes.
Definition: rpmio.h:658
int ufdCopy(FD_t sfd, FD_t tfd)
Definition: rpmio.c:1546
int Chroot(const char *path)
chroot(2) clone.
Definition: rpmrpc.c:176
int Symlink(const char *oldpath, const char *newpath)
symlink(3) clone.
Definition: rpmrpc.c:2120
int Glob_error(const char *epath, int eerrno)
glob_error(3) clone.
Definition: rpmrpc.c:2271
int Utimes(const char *path, const struct timeval *times)
utimes(2) clone.
rpmioItem rpmioLinkPoolItem(rpmioItem item, const char *msg, const char *fn, unsigned ln)
Increment a pool item refcount.
Definition: rpmmalloc.c:166
int Access(const char *path, int amode)
access(2) clone.
Definition: rpmrpc.c:2196
FD_t(* fdio_fopen_function_t)(const char *path, const char *fmode)
Definition: rpmio.h:86
size_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd)
fread(3) clone.
Definition: rpmio.c:2412
enum ftperrCode_e ftperrCode
FTP and HTTP error codes.
const char * Fstrerror(FD_t fd)
strerror(3) clone.
Definition: rpmio.c:2401
int Fileno(FD_t fd)
fileno(3) clone.
Definition: rpmio.c:2991
void rpmioClean(void)
Free all memory allocated by rpmio usage.
Definition: rpmio.c:3219
int Stat(const char *path, struct stat *st)
stat(2) clone.
Definition: rpmrpc.c:1361
void Globfree(void *_pglob)
globfree(3) clone.
Definition: rpmrpc.c:2322
int Open(const char *path, int flags, mode_t mode)
open(2) clone.
Definition: rpmrpc.c:219
int rpmioMkpath(const char *path, mode_t mode, uid_t uid, gid_t gid)
Insure that directories in path exist, creating as needed.
Definition: rpmio.c:3017
void * rpmioFreePoolItem(rpmioItem item, const char *msg, const char *fn, unsigned ln)
Free a pool item.
Definition: rpmmalloc.c:187
int Fflush(FD_t fd)
fflush(3) clone.
Definition: rpmio.c:2916
long Ftell(FD_t fd)
Definition: rpmio.c:2483
int Link(const char *oldpath, const char *newpath)
link(2) clone.
Definition: rpmrpc.c:345
fdio_fdopen_function_t _fdopen
Definition: rpmio.h:115
int Fadvise(FD_t fd, off_t offset, off_t length, int advice)
posix_fadvise(2) clone.
Definition: rpmrpc.c:1495
FDIO_t xzdio
FDIO_t fdio
Definition: rpmio.c:576
Definition: rpmio.h:107
off_t _libio_pos_t
Definition: rpmio.h:32
int Fgetpos(FD_t fd, fpos_t *pos)
Definition: rpmio.c:2506
int fdWritable(FD_t fd, int secs)
Definition: rpmio.c:578
int Utime(const char *path, const struct utimbuf *buf)
Definition: rpmrpc.c:2021
FD_t Fdopen(FD_t ofd, const char *fmode)
Definition: rpmio.c:2718
void Rewind(FD_t fd)
Definition: rpmio.c:2497
fdio_fopen_function_t _fopen
Definition: rpmio.h:113
#define fdLink(_fd, _msg)
Definition: rpmio.h:581
int Fstat(FD_t fd, struct stat *st)
fstat(2) clone.
Definition: rpmrpc.c:1441
const char * ftpStrerror(int errorNumber)
Definition: rpmio.c:751
int Chown(const char *path, uid_t owner, gid_t group)
chown(2) clone.
Definition: rpmrpc.c:1674
int(* fdio_seek_function_t)(void *cookie, _libio_pos_t pos, int whence)
Definition: rpmio.h:74
FD_t fdDup(int fdno)
Definition: rpmio.c:264
#define fdOpen(_path, _flags, _mode)
Definition: rpmio.h:572
int Fchown(FD_t fd, uid_t owner, gid_t group)
fchown(2) clone.
Definition: rpmrpc.c:1704
int fdReadable(FD_t fd, int secs)
Definition: rpmio.c:633
int Ferror(FD_t fd)
ferror(3) clone.
Definition: rpmio.c:2944
fdio_close_function_t close
Definition: rpmio.h:111
int Rmdir(const char *path)
rmdir(2) clone.
Definition: rpmrpc.c:141
struct _FD_s * FD_t
Definition: rpmio.h:43
int Lutimes(const char *path, const struct timeval *times)
lutimes(2) clone.
int Glob(const char *pattern, int flags, int errfunc(const char *epath, int eerrno), void *_pglob)
glob(3) clone.
Definition: rpmrpc.c:2277
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
Definition: rpmmalloc.c:221
ssize_t(* fdio_read_function_t)(void *cookie, char *buf, size_t nbytes)
Definition: rpmio.h:60
FD_t(* fdio_fdopen_function_t)(void *cookie, const char *fmode)
Definition: rpmio.h:92
int Rename(const char *oldpath, const char *newpath)
rename(2) clone.
Definition: rpmrpc.c:286
#define fdNew(_msg)
Definition: rpmio.h:604
FDIO_t lzdio
char * _RequestPass(const char *prompt)
Definition: rpmku.c:121
FDIO_t fpio
Definition: rpmio.c:3363
FDIO_t gzdio
int Mkdir(const char *path, mode_t mode)
mkdir(2) clone.
Definition: rpmrpc.c:73
int Lstat(const char *path, struct stat *st)
lstat(2) clone.
Definition: rpmrpc.c:1401
int(* fdio_close_function_t)(void *cookie)
Definition: rpmio.h:80
int Fsetpos(FD_t fd, fpos_t *pos)
Definition: rpmio.c:2520
FDIO_t ufdio
Definition: rpmio.c:2362
#define fdClose(_fd)
Definition: rpmio.h:565
#define fdWrite(_fd, _buf, _count)
Definition: rpmio.h:558
int Chflags(const char *path, unsigned int flags)
chflags(2) clone.
Definition: rpmrpc.c:1861
int Fallocate(FD_t fd, off_t offset, off_t length)
posix_fallocate(3)/fallocate(2) clone.
Definition: rpmrpc.c:1548
int Glob_pattern_p(const char *pattern, int quote)
glob_pattern_p(3) clone.
Definition: rpmrpc.c:2231
int Fclose(FD_t fd)
fclose(3) clone.
Definition: rpmio.c:2534
The FD_t File Handle data structure.
fdio_flush_function_t _flush
Definition: rpmio.h:117
rpmioItem rpmioPutPool(rpmioItem item)
Put unused item into pool (or free).
Definition: rpmmalloc.c:265
int Mknod(const char *path, mode_t mode, dev_t dev)
mknod(3) clone.
Definition: rpmrpc.c:1989
int Chdir(const char *path)
chdir(2) clone.
Definition: rpmrpc.c:105
int(* fdio_flush_function_t)(void *cookie)
Definition: rpmio.h:98
int ufdGetFile(FD_t sfd, FD_t tfd)
Definition: rpmio.c:1658
rpmioPool _fdPool
Definition: rpmio.c:335
int Fchmod(FD_t fd, mode_t mode)
fchmod(2) clone.
Definition: rpmrpc.c:1830
FD_t Fopen(const char *path, const char *fmode)
fopen(3) clone.
Definition: rpmio.c:2833
FDIO_t bzdio
rpmioItem rpmioUnlinkPoolItem(rpmioItem item, const char *msg, const char *fn, unsigned ln)
Decrement a pool item refcount.
Definition: rpmmalloc.c:144
int Readlink(const char *path, char *buf, size_t bufsiz)
readlink(2) clone.
Definition: rpmrpc.c:2154
int rpmioAccess(const char *FN, const char *path, int mode)
Check FN access, expanding relative paths and twiddles.
Definition: rpmio.c:3072
rpmioPool rpmioNewPool(const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item))
Create a memory pool.
Definition: rpmmalloc.c:110
int Lchown(const char *path, uid_t owner, gid_t group)
lchown(2) clone.
Definition: rpmrpc.c:1735
int Fseek(FD_t fd, _libio_off_t offset, int whence)
fseek(3) clone.
Definition: rpmio.c:2457
ssize_t(* fdio_write_function_t)(void *cookie, const char *buf, size_t nbytes)
Definition: rpmio.h:68
const char * _chroot_prefix
Definition: rpmrpc.c:174
void * ufdGetUrlinfo(FD_t fd)
Definition: rpmio.c:1927
FD_t XfdNew(const char *msg, const char *fn, unsigned ln)
Definition: rpmio.c:355
fdio_write_function_t write
Definition: rpmio.h:109
int Chmod(const char *path, mode_t mode)
chmod(2) clone.
Definition: rpmrpc.c:1765
static const char * name
fdio_read_function_t read
Definition: rpmio.h:108
struct FDIO_s * FDIO_t
Definition: rpmio.h:47
int Lchmod(const char *path, mode_t mode)
lchmod(2) clone.
Definition: rpmrpc.c:1795
fdio_seek_function_t seek
Definition: rpmio.h:110
int Lchflags(const char *path, unsigned int flags)
lchflags(2) clone.
Definition: rpmrpc.c:1893
off_t Lseek(int fdno, off_t offset, int whence)
lseek(2) clone.
Definition: rpmrpc.c:2417
size_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd)
fwrite(3) clone.
Definition: rpmio.c:2434
char * _GetPass(const char *prompt)
Definition: rpmku.c:87
char * Realpath(const char *path, char *resolved_path)
realpath(3) clone.
Definition: rpmrpc.c:2330
#define fdFree(_fd, _msg)
Definition: rpmio.h:590
rpmioPool rpmioFreePool(rpmioPool pool)
Reclaim memory pool items.
Definition: rpmmalloc.c:73
int Mkfifo(const char *path, mode_t mode)
mkfifo(3) clone.
Definition: rpmrpc.c:1959
int Unlink(const char *path)
unlink(2) clone.
Definition: rpmrpc.c:397