1 #ifndef H_RPMIO_INTERNAL
2 #define H_RPMIO_INTERNAL
12 #if USE_INTERNAL_BEECRYPT
13 #if HAVE_BEECRYPT_API_H
16 #include <beecrypt.api.h>
19 #if HAVE_BEECRYPT_API_H
20 #include <beecrypt/api.h>
22 #include <beecrypt/beecrypt.api.h>
30 #if USE_INTERNAL_BEECRYPT
34 #include <endianness.h>
40 #if HAVE_BEECRYPT_API_H
46 #include <beecrypt/beecrypt.h>
47 #include <beecrypt/base64.h>
48 #include <beecrypt/dsa.h>
49 #include <beecrypt/endianness.h>
50 #include <beecrypt/md5.h>
51 #include <beecrypt/mp.h>
52 #include <beecrypt/rsa.h>
53 #include <beecrypt/rsapk.h>
54 #include <beecrypt/sha1.h>
55 #if HAVE_BEECRYPT_API_H
56 #include <beecrypt/sha256.h>
57 #include <beecrypt/sha384.h>
58 #include <beecrypt/sha512.h>
83 #define PGPDIG_SAVED_TIME (1 << 0)
84 #define PGPDIG_SAVED_ID (1 << 1)
174 #define RPMIO_DEBUG_IO 0x40000000
175 #define RPMIO_DEBUG_REFS 0x20000000
177 #define FDMAGIC 0x04463138
204 #define FDDIGEST_MAX 32
212 #define FDSANE(fd) assert(fd && fd->magic == FDMAGIC)
234 #define DBG(_f, _m, _x) \
236 if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x \
239 #if defined(__LCLINT__XXX)
240 #define DBGIO(_f, _x)
241 #define DBGREFS(_f, _x)
243 #define DBGIO(_f, _x) DBG((_f), RPMIO_DEBUG_IO, _x)
244 #define DBGREFS(_f, _x) DBG((_f), RPMIO_DEBUG_REFS, _x)
277 int ftpCmd(
const char * cmd,
const char * url,
const char * arg2)
294 if (fd->
opath != NULL) {
295 free((
void *)fd->
opath);
444 if (fd->
nfps >= (
sizeof(fd->
fps)/
sizeof(fd->
fps[0]) - 1))
459 if (fd->
nfps < 0)
return;
476 op = fd->
stats->ops + opx;
488 if (fd == NULL)
return;
489 if (fd->
stats != NULL)
500 if (fd == NULL)
return;
512 if (fd->
stats != NULL)
524 static int usec_scale = (1000*1000);
527 if (fd == NULL || fd->
stats == NULL)
return;
528 for (opx = 0; opx < 4; opx++) {
530 if (op->
count <= 0)
continue;
533 if (msg) fprintf(fp,
"%s:", msg);
534 fprintf(fp,
"%8d reads, %8lu total bytes in %d.%06d secs\n",
536 (
int)(op->
usecs/usec_scale), (
int)(op->
usecs%usec_scale));
539 if (msg) fprintf(fp,
"%s:", msg);
540 fprintf(fp,
"%8d writes, %8lu total bytes in %d.%06d secs\n",
542 (
int)(op->
usecs/usec_scale), (
int)(op->
usecs%usec_scale));
637 if (buf != NULL && buflen > 0)
638 for (i = fd->
ndigests - 1; i >= 0; i--) {
661 for (i = fd->
ndigests - 1; i >= 0; i--) {
665 if (i > imax) imax = i;
676 if (datap) *(
void **)datap = NULL;
694 if (cookie == NULL)
return -2;
710 const unsigned char ** bp, ssize_t * blenp)