file_cb(afs_vnode * v, XFILE * X, void *refcon)
{
char *vnodepath, vnpx[30];
- u_int64 where;
+ dt_uint64 where;
XFILE OX;
int r, use = 0;
symlink_cb(afs_vnode * v, XFILE * X, void *refcon)
{
char *vnodepath, *linktarget, vnpx[30];
- u_int64 where;
+ dt_uint64 where;
int r, use = 0;
if (!dirs_done) {
dirs_done = 0;
if (!use_vnum) {
- u_int64 where;
+ dt_uint64 where;
memset(&phi, 0, sizeof(phi));
phi.p = &dp;
}
if (printflags & DSPRINT_PATH) {
- u_int64 where;
+ dt_uint64 where;
dp.print_flags = printflags & DSPRINT_DEBUG;
memset(&phi, 0, sizeof(phi));
}
if (printflags & DSPRINT_PATH) {
- u_int64 where;
+ dt_uint64 where;
dp.print_flags = printflags & DSPRINT_DEBUG;
bzero(&phi, sizeof(phi));
{
dump_parser *p = (dump_parser *) g_refcon;
backup_system_header bh;
- u_int64 where;
+ dt_uint64 where;
afs_uint32 r;
/* Which header should we try (if any)? */
afs_dir_entry de;
int pgno, i, l, n;
afs_int32 r;
- u_int64 where;
+ dt_uint64 where;
if (p->print_flags & DSPRINT_DIR) {
printf(" VNode Uniqifier Name\n");
unsigned char *part;
unsigned char *volname;
afs_uint32 volid;
- u_int64 dumplen;
+ dt_uint64 dumplen;
afs_uint32 level;
afs_uint32 magic;
afs_uint32 cksum;
#define F_DUMPHDR_FROM 0x00000004
#define F_DUMPHDR_TO 0x00000008
typedef struct {
- u_int64 offset; /* Where in the input stream is it? */
+ dt_uint64 offset; /* Where in the input stream is it? */
afs_uint32 field_mask; /* What fields are present? */
afs_uint32 magic; /* Magic number */
afs_uint32 version; /* Dump format version */
#define F_VOLHDR_DAYUSE 0x00800000
#define F_VOLHDR_DAYUSE_DATE 0x01000000
typedef struct {
- u_int64 offset; /* Where in the input stream is it? */
+ dt_uint64 offset; /* Where in the input stream is it? */
afs_uint32 field_mask; /* What fields are present? */
afs_uint32 volid; /* Volume ID */
afs_uint32 volvers; /* ?? */
#define F_VNODE_PARTIAL 0x00002000 /* Partial vnode continuation (no header) */
#define F_VNODE_LINK_TARGET 0x00004000 /* Symlink target present */
typedef struct {
- u_int64 offset; /* Where in the input stream is it? */
+ dt_uint64 offset; /* Where in the input stream is it? */
afs_uint32 field_mask; /* What fields are present? */
afs_uint32 vnode; /* Vnode number */
afs_uint32 vuniq; /* Uniquifier */
afs_uint32 client_date; /* Last modified date from client */
afs_uint32 server_date; /* Last modified date on server */
afs_uint32 size; /* Size of data */
- u_int64 d_offset; /* Where in the input stream is the data? */
+ dt_uint64 d_offset; /* Where in the input stream is the data? */
char *link_target; /* Target of symbolic link */
unsigned char acl[SIZEOF_LARGEDISKVNODE - SIZEOF_SMALLDISKVNODE];
} afs_vnode;
#define TPFLAG_SKIP 0x0001
#define TPFLAG_RSKIP 0x0002
int shift_offset;
- u_int64 shift_start;
+ dt_uint64 shift_start;
};
struct tagged_field {
char tag; /* Tag character */
struct vhash_ent *next; /* Pointer to next entry */
afs_uint32 vnode; /* VNode number */
afs_uint32 parent; /* Parent VNode number */
- u_int64 v_offset; /* Offset to start of vnode */
- u_int64 d_offset; /* Offset to data (0 if none) */
+ dt_uint64 v_offset; /* Offset to start of vnode */
+ dt_uint64 d_offset; /* Offset to data (0 if none) */
afs_uint32 d_size; /* Size of data */
} vhash_ent;
typedef struct {
#include "intNN.h"
char *
-hexify_int64(u_int64 * X, char *buf)
+hexify_int64(dt_uint64 * X, char *buf)
{
static char mybuf[17];
#ifdef NATIVE_INT64
char c, *p;
- u_int64 x = *X;
+ dt_uint64 x = *X;
if (!buf)
buf = mybuf;
#ifdef NATIVE_INT64
char *
-decimate_int64(u_int64 * X, char *buf)
+decimate_int64(dt_uint64 * X, char *buf)
{
static char mybuf[21];
char *p;
- u_int64 x = *X;
+ dt_uint64 x = *X;
if (!buf)
buf = mybuf;
}
char *
-decimate_int64(u_int64 * X, char *buf)
+decimate_int64(dt_uint64 * X, char *buf)
{
static char mybuf[21];
char *p;
void
-shift_int64(u_int64 * X, int bits)
+shift_int64(dt_uint64 * X, int bits)
{
#ifdef NATIVE_INT64
if (bits < 0)
void
test_int64_constructs(void)
{
- u_int64 x, y;
+ dt_uint64 x, y;
afs_uint32 hi, lo;
int failures = 0, pass;
char buf[17];
test_int64_compares()
{
#define NCOMPARE 9
- u_int64 control, test[NCOMPARE];
+ dt_uint64 control, test[NCOMPARE];
char cbuf[17], tbuf[17];
int i, r, result[NCOMPARE];
int pass, failures, FAILURES = 0;
#ifdef NATIVE_INT64
-typedef unsigned NATIVE_INT64 u_int64;
+typedef unsigned NATIVE_INT64 dt_uint64;
/* construct/extract/assign */
-#define mk64(X,H,L) ((X) = ( ((u_int64)(H) << 32) \
- | ((u_int64)(L) & 0xffffffff)))
+#define mk64(X,H,L) ((X) = ( ((dt_uint64)(H) << 32) \
+ | ((dt_uint64)(L) & 0xffffffff)))
#define hi64(Y) ((afs_uint32)(((Y) >> 32) & 0xffffffff))
#define lo64(Y) ((afs_uint32)((Y) & 0xffffffff))
#define ex64(Y,H,L) ((H) = hi64(Y), (L) = lo64(Y))
#define zero64(X) (!(X))
/* Arithmetic */
-#define add64_32(X,A,B) ((X) = (A) + (u_int64)(B))
+#define add64_32(X,A,B) ((X) = (A) + (dt_uint64)(B))
#define add64_64(X,A,B) ((X) = (A) + (B))
-#define sub64_32(X,A,B) ((X) = (A) - (u_int64)(B))
+#define sub64_32(X,A,B) ((X) = (A) - (dt_uint64)(B))
#define sub64_64(X,A,B) ((X) = (A) - (B))
/* Byte-order */
/** We have to provide our own 64-bit integers **/
typedef struct {
afs_uint32 hi, lo;
-} u_int64;
+} dt_uint64;
/* construct/extract/assign */
#define mk64(X,H,L) ((X).hi = (H), (X).lo = (L))
/* The following are too complex to be macros: */
-/* char *hexify_int64(u_int64 a, char *buf)
+/* char *hexify_int64(dt_uint64 a, char *buf)
* Produces an ASCII representation of a in hexadecimal, and returns
* a pointer to the resulting string. If buf is non-NULL, it is taken
* to be a pointer to the buffer to be used, which must be at least 17
* bytes long. This function is thread-safe iff buf is provided.
*/
-extern char *hexify_int64(u_int64 *, char *);
+extern char *hexify_int64(dt_uint64 *, char *);
-/* char *decimate_int64(u_int64 a, char *buf)
+/* char *decimate_int64(dt_uint64 a, char *buf)
* Produces an ASCII representation of a in decimal, and returns
* a pointer to the resulting string. If buf is non-NULL, it is taken
* to be a pointer to the buffer to be used, which must be at least 21
* bytes long. This function is thread-safe iff buf is provided.
*/
-extern char *decimate_int64(u_int64 *, char *);
+extern char *decimate_int64(dt_uint64 *, char *);
-/* void shift_int64(u_int64 a, int bits)
+/* void shift_int64(dt_uint64 a, int bits)
* Shifts the 64-bit integer in a by the specified number of bits.
* If bits is positive, the shift is to the left; if negative, the
* shift is to the right.
*/
-extern void shift_int64(u_int64 *, int);
+extern void shift_int64(dt_uint64 *, int);
#endif /* _INTNN_H_ */
/* util.c - Random utilities */
extern afs_uint32 handle_return(int, XFILE *, unsigned char, dump_parser *);
extern void prep_pi(dump_parser *, tag_parse_info *);
-extern afs_uint32 match_next_vnode(XFILE *, dump_parser *, u_int64 *,
+extern afs_uint32 match_next_vnode(XFILE *, dump_parser *, dt_uint64 *,
afs_uint32);
{
dump_parser *p = (dump_parser *) g_refcon;
afs_dump_header hdr;
- u_int64 where;
+ dt_uint64 where;
afs_uint32 r;
memset(&hdr, 0, sizeof(hdr));
* work much of the time.
*/
if (!*tag && pi->shift_offset && (pi->flags & TPFLAG_RSKIP)) {
- u_int64 where, tmp64a, tmp64b;
+ dt_uint64 where, tmp64a, tmp64b;
char buf1[21], buf2[21], buf3[21];
char *p1, *p2, *p3;
}
if (!*tag && (pi->flags & TPFLAG_SKIP)) {
int count = 0;
- u_int64 where, tmp64a;
+ dt_uint64 where, tmp64a;
if ((r = xftell(X, &where)))
return r;
static afs_uint32
resync_vnode(XFILE * X, dump_parser * p, afs_vnode * v, int start, int limit)
{
- u_int64 where, expected_where;
+ dt_uint64 where, expected_where;
afs_uint32 r;
int i;
{
dump_parser *p = (dump_parser *) g_refcon;
afs_uint32(*cb) (afs_vnode *, XFILE *, void *);
- u_int64 where, offset2k;
+ dt_uint64 where, offset2k;
afs_vnode v;
afs_uint32 r;
/* Try to resync, if requested */
if (!r && (p->repair_flags & DSFIX_VFSYNC)) {
afs_uint32 drop;
- u_int64 xwhere;
+ dt_uint64 xwhere;
if ((r = xftell(X, &where)))
return r;
} else
cb = p->cb_vnode_empty;
if (cb) {
- u_int64 where;
+ dt_uint64 where;
if ((r = xftell(X, &where)))
return r;
{
dump_parser *p = (dump_parser *) g_refcon;
afs_vol_header hdr;
- u_int64 where;
+ dt_uint64 where;
afs_uint32 r;
memset(&hdr, 0, sizeof(hdr));
{
char buf[STAGE_HDRLEN];
struct stage_header *bckhdr = (struct stage_header *)buf;
- u_int64 where;
+ dt_uint64 where;
afs_int32 r;
if ((r = xftell(X, &where)))
int
handle_return(int r, XFILE * X, unsigned char tag, dump_parser * p)
{
- u_int64 where, xwhere;
+ dt_uint64 where, xwhere;
switch (r) {
case 0:
*/
/*** THIS FUNCTION INTENDED FOR INTERNAL USE ONLY ***/
int
-match_next_vnode(XFILE * X, dump_parser * p, u_int64 * where,
+match_next_vnode(XFILE * X, dump_parser * p, dt_uint64 * where,
afs_uint32 vnode)
{
afs_uint32 r, x, y, z;
/* do_tell for stdio xfiles */
static afs_uint32
-xf_FILE_do_tell(XFILE * X, u_int64 * offset)
+xf_FILE_do_tell(XFILE * X, dt_uint64 * offset)
{
FILE *F = X->refcon;
off_t where;
/* do_seek for stdio xfiles */
static afs_uint32
-xf_FILE_do_seek(XFILE * X, u_int64 * offset)
+xf_FILE_do_seek(XFILE * X, dt_uint64 * offset)
{
FILE *F = X->refcon;
off_t where = get64(*offset);
/* do_tell for profiled xfiles */
static afs_uint32
-xf_PROFILE_do_tell(XFILE * X, u_int64 * offset)
+xf_PROFILE_do_tell(XFILE * X, dt_uint64 * offset)
{
PFILE *PF = X->refcon;
afs_uint32 err;
/* do_seek for profiled xfiles */
static afs_uint32
-xf_PROFILE_do_seek(XFILE * X, u_int64 * offset)
+xf_PROFILE_do_seek(XFILE * X, dt_uint64 * offset)
{
PFILE *PF = X->refcon;
afs_uint32 err;
xfread(XFILE * X, void *buf, afs_uint32 count)
{
afs_uint32 code;
- u_int64 tmp64;
+ dt_uint64 tmp64;
code = (X->do_read) (X, buf, count);
if (code)
xfwrite(XFILE * X, void *buf, afs_uint32 count)
{
afs_uint32 code;
- u_int64 tmp64;
+ dt_uint64 tmp64;
if (!X->is_writable)
return ERROR_XFILE_RDONLY;
afs_uint32
-xftell(XFILE * X, u_int64 * offset)
+xftell(XFILE * X, dt_uint64 * offset)
{
if (X->do_tell)
return (X->do_tell) (X, offset);
afs_uint32
-xfseek(XFILE * X, u_int64 * offset)
+xfseek(XFILE * X, dt_uint64 * offset)
{
afs_uint32 code;
xfskip(XFILE * X, afs_uint32 count)
{
afs_uint32 code;
- u_int64 tmp64;
+ dt_uint64 tmp64;
/* Use the skip method, if there is one */
if (X->do_skip && !X->passthru) {
struct XFILE {
afs_uint32(*do_read) (XFILE *, void *, afs_uint32); /* read data */
afs_uint32(*do_write) (XFILE *, void *, afs_uint32); /* write data */
- afs_uint32(*do_tell) (XFILE *, u_int64 *); /* find position */
- afs_uint32(*do_seek) (XFILE *, u_int64 *); /* set position */
+ afs_uint32(*do_tell) (XFILE *, dt_uint64 *); /* find position */
+ afs_uint32(*do_seek) (XFILE *, dt_uint64 *); /* set position */
afs_uint32(*do_skip) (XFILE *, afs_uint32); /* skip forward */
afs_uint32(*do_close) (XFILE *); /* close */
- u_int64 filepos; /* position (counted) */
+ dt_uint64 filepos; /* position (counted) */
int is_seekable; /* 1 if seek works */
int is_writable; /* 1 if write works */
XFILE *passthru; /* XFILE to pass thru to */
extern afs_uint32 xfwrite(XFILE *, void *, afs_uint32); /* write data */
extern afs_uint32 xfprintf(XFILE *, char *, ...); /* formatted */
extern afs_uint32 vxfprintf(XFILE *, char *, va_list); /* formatted VA */
-extern afs_uint32 xftell(XFILE *, u_int64 *); /* get position */
-extern afs_uint32 xfseek(XFILE *, u_int64 *); /* set position */
+extern afs_uint32 xftell(XFILE *, dt_uint64 *); /* get position */
+extern afs_uint32 xfseek(XFILE *, dt_uint64 *); /* set position */
extern afs_uint32 xfskip(XFILE *, afs_uint32); /* skip forward */
extern afs_uint32 xfpass(XFILE *, XFILE *); /* set passthru */
extern afs_uint32 xfunpass(XFILE *); /* unset passthru */