rpm  5.4.15
rpmio.h
Go to the documentation of this file.
1 #ifndef H_RPMIO
2 #define H_RPMIO
3 
4 #ifndef _GNU_SOURCE
5 #define _GNU_SOURCE 1
6 #endif
7 
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <unistd.h>
18 
19 #include <rpmiotypes.h>
20 #include <rpmzlog.h>
21 
29 #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
30  (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
31 #define USE_COOKIE_SEEK_POINTER 1
32 typedef off64_t _libio_off_t;
33 typedef _libio_off_t * _libio_pos_t;
34 #else
35 typedef off_t _libio_off_t;
36 typedef off_t _libio_pos_t;
37 #endif
38 
42 /*@unchecked@*/
43 extern int _rpmio_debug;
44 
47 typedef /*@abstract@*/ /*@refcounted@*/ struct _FD_s * FD_t;
48 
51 typedef /*@observer@*/ struct FDIO_s * FDIO_t;
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
61 
64 typedef ssize_t (*fdio_read_function_t) (void *cookie, char *buf, size_t nbytes)
65  /*@globals errno, fileSystem @*/
66  /*@modifies *cookie, errno, fileSystem @*/
67  /*@requires maxSet(buf) >= (nbytes - 1) @*/
68  /*@ensures maxRead(buf) == result @*/ ;
69 
72 typedef ssize_t (*fdio_write_function_t) (void *cookie, const char *buf, size_t nbytes)
73  /*@globals errno, fileSystem @*/
74  /*@modifies *cookie, errno, fileSystem @*/;
75 
78 typedef int (*fdio_seek_function_t) (void *cookie, _libio_pos_t pos, int whence)
79  /*@globals errno, fileSystem @*/
80  /*@modifies *cookie, errno, fileSystem @*/;
81 
84 typedef int (*fdio_close_function_t) (void *cookie)
85  /*@globals errno, fileSystem, systemState @*/
86  /*@modifies *cookie, errno, fileSystem, systemState @*/;
87 
90 typedef FD_t (*fdio_fopen_function_t) (const char * path, const char * fmode)
91  /*@globals errno, fileSystem @*/
92  /*@modifies errno, fileSystem @*/;
93 
96 typedef FD_t (*fdio_fdopen_function_t) (void * cookie, const char * fmode)
97  /*@globals errno, fileSystem @*/
98  /*@modifies errno, fileSystem @*/;
99 
102 typedef int (*fdio_flush_function_t) (void * cookie)
103  /*@globals errno, fileSystem @*/
104  /*@modifies errno, fileSystem @*/;
105 
111 struct FDIO_s {
116 /*@null@*/
118 /*@null@*/
120 /*@null@*/
122 };
123 
124 
129 
133 /*@observer@*/ const char * Fstrerror(/*@null@*/ FD_t fd)
134  /*@*/;
135 
139 /*@-incondefs@*/
140 size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
141  /*@globals fileSystem @*/
142  /*@modifies fd, *buf, fileSystem @*/
143  /*@requires maxSet(buf) >= (nmemb - 1) @*/;
144 /*@=incondefs@*/
145 
149 /*@-incondefs@*/
150 size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
151  /*@globals fileSystem @*/
152  /*@modifies fd, fileSystem @*/
153  /*@requires maxRead(buf) >= nmemb @*/;
154 /*@=incondefs@*/
155 
159 int Fseek(FD_t fd, _libio_off_t offset, int whence)
160  /*@globals fileSystem @*/
161  /*@modifies fileSystem @*/;
162 long Ftell(FD_t fd)
163  /*@*/;
164 void Rewind(FD_t fd)
165  /*@*/;
166 int Fgetpos(FD_t fd, fpos_t *pos)
167  /*@*/;
168 int Fsetpos(FD_t fd, fpos_t *pos)
169  /*@*/;
170 
174 int Fclose( /*@killref@*/ FD_t fd)
175  /*@globals fileSystem, internalState @*/
176  /*@modifies fd, fileSystem, internalState @*/;
177 
180 /*@null@*/ FD_t Fdopen(FD_t ofd, const char * fmode)
181  /*@globals fileSystem, internalState @*/
182  /*@modifies ofd, fileSystem, internalState @*/;
183 
187 /*@null@*/ FD_t Fopen(/*@null@*/ const char * path,
188  /*@null@*/ const char * fmode)
189  /*@globals h_errno, fileSystem, internalState @*/
190  /*@modifies fileSystem, internalState @*/;
191 
192 
196 int Fflush(/*@null@*/ FD_t fd)
197  /*@globals fileSystem @*/
198  /*@modifies fd, fileSystem @*/;
199 
203 int Ferror(/*@null@*/ FD_t fd)
204  /*@*/;
205 
209 int Fileno(FD_t fd)
210  /*@globals fileSystem @*/
211  /*@modifies fileSystem@*/;
212 
216 /*@unused@*/
217 int Fcntl(FD_t fd, int op, void *lip)
218  /*@globals errno, fileSystem @*/
219  /*@modifies fd, *lip, errno, fileSystem @*/;
220 
227 
231 int Mkdir(const char * path, mode_t mode)
232  /*@globals errno, h_errno, fileSystem, internalState @*/
233  /*@modifies errno, fileSystem, internalState @*/;
234 
238 int Chdir(const char * path)
239  /*@globals errno, h_errno, fileSystem, internalState @*/
240  /*@modifies errno, fileSystem, internalState @*/;
241 
245 int Rmdir(const char * path)
246  /*@globals errno, h_errno, fileSystem, internalState @*/
247  /*@modifies errno, fileSystem, internalState @*/;
248 
249 /*@unchecked@*/ /*@observer@*/ /*@null@*/
250 extern const char * _chroot_prefix;
251 
256 int Chroot(const char * path)
257  /*@globals _chroot_prefix, errno, fileSystem, internalState @*/
258  /*@modifies _chroot_prefix, errno, fileSystem, internalState @*/;
259 
264 int Open(const char * path, int flags, mode_t mode)
265  /*@globals errno, fileSystem, internalState @*/
266  /*@modifies errno, fileSystem, internalState @*/;
267 
271 int Rename(const char * oldpath, const char * newpath)
272  /*@globals errno, h_errno, fileSystem, internalState @*/
273  /*@modifies errno, fileSystem, internalState @*/;
274 
278 int Link(const char * oldpath, const char * newpath)
279  /*@globals errno, fileSystem, internalState @*/
280  /*@modifies errno, fileSystem, internalState @*/;
281 
285 int Unlink(const char * path)
286  /*@globals errno, h_errno, fileSystem, internalState @*/
287  /*@modifies errno, fileSystem, internalState @*/;
288 
292 int Stat(const char * path, /*@out@*/ struct stat * st)
293  /*@globals errno, h_errno, fileSystem, internalState @*/
294  /*@modifies *st, errno, fileSystem, internalState @*/;
295 
299 int Lstat(const char * path, /*@out@*/ struct stat * st)
300  /*@globals errno, h_errno, fileSystem, internalState @*/
301  /*@modifies *st, errno, fileSystem, internalState @*/;
302 
306 int Fstat(FD_t fd, /*@out@*/ struct stat * st)
307  /*@globals errno, fileSystem, internalState @*/
308  /*@modifies *st, errno, fileSystem, internalState @*/;
309 
313 int Fadvise(FD_t fd, off_t offset, off_t length, int advice)
314  /*@globals fileSystem, internalState @*/
315  /*@modifies fileSystem, internalState @*/;
316 
320 int Fallocate(FD_t fd, off_t offset, off_t length)
321  /*@globals fileSystem, internalState @*/
322  /*@modifies fileSystem, internalState @*/;
323 
328 int Chown(const char * path, uid_t owner, gid_t group)
329  /*@globals errno, fileSystem, internalState @*/
330  /*@modifies errno, fileSystem, internalState @*/;
331 
336 int Fchown(FD_t fd, uid_t owner, gid_t group)
337  /*@globals errno, fileSystem, internalState @*/
338  /*@modifies errno, fileSystem, internalState @*/;
339 
344 int Lchown(const char * path, uid_t owner, gid_t group)
345  /*@globals errno, fileSystem, internalState @*/
346  /*@modifies errno, fileSystem, internalState @*/;
347 
352 int Chmod(const char * path, mode_t mode)
353  /*@globals errno, fileSystem, internalState @*/
354  /*@modifies errno, fileSystem, internalState @*/;
355 
360 int Lchmod(const char * path, mode_t mode)
361  /*@globals errno, fileSystem, internalState @*/
362  /*@modifies errno, fileSystem, internalState @*/;
363 
368 int Fchmod(FD_t fd, mode_t mode)
369  /*@globals errno, fileSystem, internalState @*/
370  /*@modifies errno, fileSystem, internalState @*/;
371 
376 int Chflags(const char * path, unsigned int flags)
377  /*@globals errno, fileSystem, internalState @*/
378  /*@modifies errno, fileSystem, internalState @*/;
379 
384 int Lchflags(const char * path, unsigned int flags)
385  /*@globals errno, fileSystem, internalState @*/
386  /*@modifies errno, fileSystem, internalState @*/;
387 
392 int Fchflags(FD_t fd, unsigned int flags)
393  /*@globals errno, fileSystem, internalState @*/
394  /*@modifies errno, fileSystem, internalState @*/;
395 
400 int Mkfifo(const char * path, mode_t mode)
401  /*@globals errno, fileSystem, internalState @*/
402  /*@modifies errno, fileSystem, internalState @*/;
403 
408 int Mknod(const char * path, mode_t mode, dev_t dev)
409  /*@globals errno, fileSystem, internalState @*/
410  /*@modifies errno, fileSystem, internalState @*/;
411 
416 struct utimbuf;
417 int Utime(const char * path, const struct utimbuf * buf)
418  /*@globals errno, fileSystem, internalState @*/
419  /*@modifies errno, fileSystem, internalState @*/;
420 
425 int Utimes(const char * path, const struct timeval * times)
426  /*@globals errno, fileSystem, internalState @*/
427  /*@modifies errno, fileSystem, internalState @*/;
428 
433 int Lutimes(const char * path, const struct timeval * times)
434  /*@globals errno, fileSystem, internalState @*/
435  /*@modifies errno, fileSystem, internalState @*/;
436 
441 int Symlink(const char * oldpath, const char * newpath)
442  /*@globals errno, fileSystem, internalState @*/
443  /*@modifies errno, fileSystem, internalState @*/;
444 
449 /*@-incondefs@*/
450 int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
451  /*@globals errno, h_errno, fileSystem, internalState @*/
452  /*@modifies *buf, errno, fileSystem, internalState @*/;
453 /*@=incondefs@*/
454 
459 int Access(const char * path, int amode)
460  /*@globals errno, fileSystem @*/
461  /*@modifies errno, fileSystem @*/;
462 
463 #if defined(__linux__)
464 
467 int Mount(const char *source, const char *target,
468  const char *filesystemtype, unsigned long mountflags,
469  const void *data)
470  /*@globals errno, fileSystem @*/
471  /*@modifies errno, fileSystem @*/;
472 
476 int Umount(const char *target)
477  /*@globals errno, fileSystem @*/
478  /*@modifies errno, fileSystem @*/;
479 
483 int Umount2(const char *target, int flags)
484  /*@globals errno, fileSystem @*/
485  /*@modifies errno, fileSystem @*/;
486 #endif
487 
491 int Glob_pattern_p (const char *pattern, int quote)
492  /*@*/;
493 
497 int Glob_error(const char * epath, int eerrno)
498  /*@*/;
499 
503 int Glob(const char * pattern, int flags,
504  int errfunc(const char * epath, int eerrno),
505  /*@out@*/ void * _pglob)
506  /*@globals fileSystem @*/
507  /*@modifies *_pglob, fileSystem @*/;
508 
512 void Globfree( /*@only@*/ void * _pglob)
513  /*@globals fileSystem @*/
514  /*@modifies *_pglob, fileSystem @*/;
515 
516 
520 /*@-globuse@*/
521 /*@null@*/
522 char * Realpath(const char * path, /*@out@*/ /*@null@*/ char * resolved_path)
523  /*@globals errno, fileSystem, internalState @*/
524  /*@modifies resolved_path, errno, fileSystem, internalState @*/;
525 /*@=globuse@*/
526 
531 off_t Lseek(int fdno, off_t offset, int whence)
532  /*@globals errno, fileSystem @*/
533  /*@modifies errno, fileSystem @*/;
534 
542 
545 /*@null@*/ FD_t fdDup(int fdno)
546  /*@globals fileSystem, internalState @*/
547  /*@modifies fileSystem, internalState @*/;
548 
549 /*@-exportlocal@*/
552 ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
553  /*@globals errno, fileSystem, internalState @*/
554  /*@modifies *cookie, *buf, errno, fileSystem, internalState @*/;
555 #define fdRead(_fd, _buf, _count) fdio->read((_fd), (_buf), (_count))
556 
559 ssize_t fdWrite(void * cookie, const char * buf, size_t count)
560  /*@globals errno, fileSystem, internalState @*/
561  /*@modifies *cookie, errno, fileSystem, internalState @*/;
562 #define fdWrite(_fd, _buf, _count) fdio->write((_fd), (_buf), (_count))
563 
566 int fdClose( /*@only@*/ void * cookie)
567  /*@globals errno, fileSystem, systemState, internalState @*/
568  /*@modifies *cookie, errno, fileSystem, systemState, internalState @*/;
569 #define fdClose(_fd) fdio->close(_fd)
570 
573 /*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode)
574  /*@globals errno, fileSystem, internalState @*/
575  /*@modifies errno, fileSystem, internalState @*/;
576 #define fdOpen(_path, _flags, _mode) fdio->_open((_path), (_flags), (_mode))
577 
580 /*@unused@*/
581 /*@newref@*/ /*@null@*/
582 FD_t fdLink (void * cookie, const char * msg)
583  /*@globals fileSystem @*/
584  /*@modifies *cookie, fileSystem @*/;
585 #define fdLink(_fd, _msg) \
586  ((FD_t)rpmioLinkPoolItem((rpmioItem)(_fd), _msg, __FILE__, __LINE__))
587 
590 /*@unused@*/ /*@null@*/
591 FD_t fdFree(/*@killref@*/ FD_t fd, const char * msg)
592  /*@globals fileSystem @*/
593  /*@modifies fd, fileSystem @*/;
594 #define fdFree(_fd, _msg) \
595  ((FD_t)rpmioFreePoolItem((rpmioItem)(_fd), _msg, __FILE__, __LINE__))
596 
599 /*@unused@*/
600 /*@newref@*/ /*@null@*/
601 FD_t fdNew (const char * msg)
602  /*@globals fileSystem @*/
603  /*@modifies fileSystem @*/;
604 /*@newref@*/ /*@null@*/
605 FD_t XfdNew (const char * msg, const char * fn, unsigned ln)
606  /*@globals fileSystem @*/
607  /*@modifies fileSystem @*/;
608 #define fdNew(_msg) XfdNew(_msg, __FILE__, __LINE__)
609 
612 int fdWritable(FD_t fd, int secs)
613  /*@globals errno, fileSystem @*/
614  /*@modifies fd, errno, fileSystem @*/;
615 
618 int fdReadable(FD_t fd, int secs)
619  /*@globals errno @*/
620  /*@modifies fd, errno @*/;
621 /*@=exportlocal@*/
622 
631 int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid)
632  /*@globals h_errno, fileSystem, internalState @*/
633  /*@modifies fileSystem, internalState @*/;
634 
642 int rpmioAccess(const char *FN, /*@null@*/ const char * path, int mode)
643  /*@globals fileSystem, internalState @*/
644  /*@modifies fileSystem, internalState @*/;
645 
651 extern char * (*Getpass) (const char * prompt)
652  /*@*/;
653 char * _GetPass (const char * prompt)
654  /*@*/;
655 char * _RequestPass (const char * prompt)
656  /*@*/;
657 
661 /*@-typeuse@*/
662 typedef enum ftperrCode_e {
685 } ftperrCode;
686 /*@=typeuse@*/
687 
690 /*@-redecl@*/
691 /*@observer@*/
692 const char * ftpStrerror(int errorNumber)
693  /*@*/;
694 /*@=redecl@*/
695 
698 /*@unused@*/
699 /*@dependent@*/ /*@null@*/
700 void * ufdGetUrlinfo(FD_t fd)
701  /*@globals fileSystem @*/
702  /*@modifies fd, fileSystem @*/;
703 
706 /*@-redecl@*/
707 /*@unused@*/
708 /*@observer@*/
709 const char * urlStrerror(const char * url)
710  /*@globals h_errno, internalState @*/
711  /*@modifies internalState @*/;
712 /*@=redecl@*/
713 
716 /*@-exportlocal@*/
717 int ufdCopy(FD_t sfd, FD_t tfd)
718  /*@globals fileSystem @*/
719  /*@modifies sfd, tfd, fileSystem @*/;
720 /*@=exportlocal@*/
721 
724 int ufdGetFile( /*@killref@*/ FD_t sfd, FD_t tfd)
725  /*@globals fileSystem, internalState @*/
726  /*@modifies sfd, tfd, fileSystem, internalState @*/;
727 
728 /*@-exportlocal@*/
731 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fdio;
732 
735 /*@observer@*/ /*@unchecked@*/ extern FDIO_t fpio;
736 
739 /*@observer@*/ /*@unchecked@*/ extern FDIO_t ufdio;
740 
743 /*@observer@*/ /*@unchecked@*/ extern FDIO_t gzdio;
744 
747 /*@observer@*/ /*@unchecked@*/ extern FDIO_t bzdio;
748 
751 /*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
752 
755 /*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio;
756 
757 /*@=exportlocal@*/
760 /*@unchecked@*/ /*@only@*/ /*@null@*/
761 extern rpmioPool _fdPool;
762 
766 void rpmioClean(void)
767  /*@globals _fdPool, fileSystem, internalState @*/
768  /*@modifies _fdPool, fileSystem, internalState @*/;
769 
775 /*@null@*/
776 rpmioPool rpmioFreePool(/*@only@*//*@null@*/ rpmioPool pool)
777  /*@globals fileSystem, internalState @*/
778  /*@modifies pool, fileSystem, internalState @*/;
779 
791 rpmioPool rpmioNewPool(/*@observer@*/ const char * name,
792  size_t size, int limit, int flags,
793  /*@null@*/ char * (*dbg) (void *item),
794  /*@null@*/ void (*init) (void *item),
795  /*@null@*/ void (*fini) (void *item))
796  /*@globals fileSystem @*/
797  /*@modifies fileSystem @*/;
798 
807 /*@null@*/
808 rpmioItem rpmioUnlinkPoolItem(/*@killref@*/ /*@null@*/ rpmioItem item,
809  const char * msg, const char * fn, unsigned ln)
810  /*@globals fileSystem @*/
811  /*@modifies item, fileSystem @*/;
812 
821 /*@newref@*/ /*@null@*/
822 rpmioItem rpmioLinkPoolItem(/*@returned@*/ /*@null@*/ rpmioItem item,
823  const char * msg, const char * fn, unsigned ln)
824  /*@globals fileSystem @*/
825  /*@modifies item, fileSystem @*/;
826 
835 /*@null@*/
836 void * rpmioFreePoolItem(/*@killref@*/ /*@null@*/ rpmioItem item,
837  const char * msg, const char * fn, unsigned ln)
838  /*@globals fileSystem @*/
839  /*@modifies item, fileSystem @*/;
840 
847 rpmioItem rpmioGetPool(/*@kept@*/ /*@null@*/ rpmioPool pool, size_t size)
848  /*@globals fileSystem @*/
849  /*@modifies pool, fileSystem @*/;
850 
856 /*@null@*/
858  /*@globals fileSystem @*/
859  /*@modifies item, fileSystem @*/;
860 
861 #ifdef __cplusplus
862 }
863 #endif
864 
865 #endif /* H_RPMIO */
const char * urlStrerror(const char *url)
Definition: rpmio.c:808
FD_t(* fdio_fopen_function_t)(const char *path, const char *fmode)
Definition: rpmio.h:90
#define fdRead(_fd, _buf, _count)
Definition: rpmio.h:555
int _rpmio_debug
Definition: rpmio.c:180
int Fcntl(FD_t fd, int op, void *lip)
fcntl(2) clone.
Definition: rpmio.c:3016
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:35
ftperrCode_e
FTP and HTTP error codes.
Definition: rpmio.h:662
int ufdCopy(FD_t sfd, FD_t tfd)
Definition: rpmio.c:1549
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:165
int Access(const char *path, int amode)
access(2) clone.
Definition: rpmrpc.c:2196
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:2998
Job queue and buffer pool management.
void rpmioClean(void)
Free all memory allocated by rpmio usage.
Definition: rpmio.c:3235
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:3024
void * rpmioFreePoolItem(rpmioItem item, const char *msg, const char *fn, unsigned ln)
Free a pool item.
Definition: rpmmalloc.c:186
int Fflush(FD_t fd)
fflush(3) clone.
Definition: rpmio.c:2923
long Ftell(FD_t fd)
Definition: rpmio.c:2483
int Link(const char *oldpath, const char *newpath)
link(2) clone.
Definition: rpmrpc.c:345
ssize_t(* fdio_write_function_t)(void *cookie, const char *buf, size_t nbytes)
Definition: rpmio.h:72
fdio_fdopen_function_t _fdopen
Definition: rpmio.h:119
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:578
Definition: rpmio.h:111
off_t _libio_pos_t
Definition: rpmio.h:36
FD_t(* fdio_fdopen_function_t)(void *cookie, const char *fmode)
Definition: rpmio.h:96
int Fgetpos(FD_t fd, fpos_t *pos)
Definition: rpmio.c:2506
int fdWritable(FD_t fd, int secs)
Definition: rpmio.c:580
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:2725
void Rewind(FD_t fd)
Definition: rpmio.c:2497
fdio_fopen_function_t _fopen
Definition: rpmio.h:117
#define fdLink(_fd, _msg)
Definition: rpmio.h:585
int Fstat(FD_t fd, struct stat *st)
fstat(2) clone.
Definition: rpmrpc.c:1441
const char * ftpStrerror(int errorNumber)
Definition: rpmio.c:753
int Chown(const char *path, uid_t owner, gid_t group)
chown(2) clone.
Definition: rpmrpc.c:1674
int(* fdio_close_function_t)(void *cookie)
Definition: rpmio.h:84
FD_t fdDup(int fdno)
Definition: rpmio.c:266
#define fdOpen(_path, _flags, _mode)
Definition: rpmio.h:576
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:635
int Ferror(FD_t fd)
ferror(3) clone.
Definition: rpmio.c:2951
fdio_close_function_t close
Definition: rpmio.h:115
int Rmdir(const char *path)
rmdir(2) clone.
Definition: rpmrpc.c:141
struct _FD_s * FD_t
Definition: rpmio.h:47
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
const char * mode
Definition: mongo.h:440
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
Definition: rpmmalloc.c:220
int Rename(const char *oldpath, const char *newpath)
rename(2) clone.
Definition: rpmrpc.c:286
#define fdNew(_msg)
Definition: rpmio.h:608
FDIO_t lzdio
char * _RequestPass(const char *prompt)
Definition: rpmku.c:119
FDIO_t fpio
Definition: rpmio.c:3395
FDIO_t gzdio
int Mkdir(const char *path, mode_t mode)
mkdir(2) clone.
Definition: rpmrpc.c:73
const char const bson * data
Definition: mongo.h:463
int Lstat(const char *path, struct stat *st)
lstat(2) clone.
Definition: rpmrpc.c:1401
int Fsetpos(FD_t fd, fpos_t *pos)
Definition: rpmio.c:2520
const char const bson const bson int limit
Definition: mongo.h:569
FDIO_t ufdio
Definition: rpmio.c:2362
#define fdClose(_fd)
Definition: rpmio.h:569
#define fdWrite(_fd, _buf, _count)
Definition: rpmio.h:562
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:121
rpmioItem rpmioPutPool(rpmioItem item)
Put unused item into pool (or free).
Definition: rpmmalloc.c:264
const char time_t secs
Definition: bson.h:1028
const char const bson const bson * op
Definition: mongo.h:505
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 ufdGetFile(FD_t sfd, FD_t tfd)
Definition: rpmio.c:1661
rpmioPool _fdPool
Definition: rpmio.c:337
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:2840
FDIO_t bzdio
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
rpmioItem rpmioUnlinkPoolItem(rpmioItem item, const char *msg, const char *fn, unsigned ln)
Decrement a pool item refcount.
Definition: rpmmalloc.c:143
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:3079
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:109
const char const char size_t size
Definition: bson.h:895
int(* fdio_flush_function_t)(void *cookie)
Definition: rpmio.h:102
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
const char * _chroot_prefix
Definition: rpmrpc.c:174
void * ufdGetUrlinfo(FD_t fd)
Definition: rpmio.c:1930
FD_t XfdNew(const char *msg, const char *fn, unsigned ln)
Definition: rpmio.c:357
fdio_write_function_t write
Definition: rpmio.h:113
int Chmod(const char *path, mode_t mode)
chmod(2) clone.
Definition: rpmrpc.c:1765
ssize_t(* fdio_read_function_t)(void *cookie, char *buf, size_t nbytes)
Definition: rpmio.h:64
static const char * name
fdio_read_function_t read
Definition: rpmio.h:112
const char const char * pattern
Definition: bson.h:971
struct FDIO_s * FDIO_t
Definition: rpmio.h:51
int Lchmod(const char *path, mode_t mode)
lchmod(2) clone.
Definition: rpmrpc.c:1795
int(* fdio_seek_function_t)(void *cookie, _libio_pos_t pos, int whence)
Definition: rpmio.h:78
fdio_seek_function_t seek
Definition: rpmio.h:114
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:85
char * Realpath(const char *path, char *resolved_path)
realpath(3) clone.
Definition: rpmrpc.c:2330
#define fdFree(_fd, _msg)
Definition: rpmio.h:594
rpmioPool rpmioFreePool(rpmioPool pool)
Reclaim memory pool items.
Definition: rpmmalloc.c:72
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