u32 or (newly introduced) oid_t type (object ID).
/*
* Sherlock Library -- Configuration-Dependent Definitions
*
- * (c) 1997, 1998 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ * (c) 1997--1999 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
*/
#ifndef _SHERLOCK_CONFIG_H
typedef short sword; /* exactly 16 bits, signed */
typedef unsigned short u16; /* exactly 16 bits, unsigned */
typedef short s16; /* exactly 16 bits, signed */
-typedef unsigned int ulg; /* exactly 32 bits, unsigned */
-typedef int slg; /* exactly 32 bits, signed */
typedef unsigned int u32; /* exactly 32 bits, unsigned */
typedef int s32; /* exactly 32 bits, signed */
typedef unsigned int uns; /* at least 32 bits */
#define NULL (void *)0
#endif
+typedef u32 oid_t; /* Object ID */
+
/* CPU characteristics */
#define CPU_LITTLE_ENDIAN
#endif
}
-ulg bgetl_slow(struct fastbuf *f)
+u32 bgetl_slow(struct fastbuf *f)
{
- ulg l = bgetc_slow(f);
+ u32 l = bgetc_slow(f);
#ifdef CPU_BIG_ENDIAN
l = (l << 8) | bgetc_slow(f);
l = (l << 8) | bgetc_slow(f);
#endif
}
-void bputl_slow(struct fastbuf *f, ulg l)
+void bputl_slow(struct fastbuf *f, u32 l)
{
#ifdef CPU_BIG_ENDIAN
bputc_slow(f, l >> 24);
return bgetw_slow(f);
}
-ulg bgetl_slow(struct fastbuf *f);
-extern inline ulg bgetl(struct fastbuf *f)
+u32 bgetl_slow(struct fastbuf *f);
+extern inline u32 bgetl(struct fastbuf *f)
{
- ulg l;
+ u32 l;
if (f->bptr + 4 <= f->bstop)
{
byte *p = f->bptr;
#ifdef CPU_CAN_DO_UNALIGNED_LONGS
- l = * ((ulg *) p);
+ l = * ((u32 *) p);
#else
#ifdef CPU_BIG_ENDIAN
l = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
bputw_slow(f, w);
}
-void bputl_slow(struct fastbuf *f, ulg l);
-extern inline void bputl(struct fastbuf *f, ulg l)
+void bputl_slow(struct fastbuf *f, u32 l);
+extern inline void bputl(struct fastbuf *f, u32 l)
{
if (f->bptr + 4 <= f->bufend)
{
byte *p = f->bptr;
#ifdef CPU_CAN_DO_UNALIGNED_LONGS
- * ((ulg *) p) = l;
+ * ((u32 *) p) = l;
#else
#ifdef CPU_BIG_ENDIAN
p[0] = l >> 24U;
void open_temp(struct tempfile *, byte *);
void delete_temp(struct tempfile *);
-ulg temprand(uns);
+u32 temprand(uns);
#define TF_GENERIC "t"
#define TF_QUEUE_CONTROL "c"
/* Binary log */
-int log2(ulg);
+int log2(u32);
/* obj.c */
#define OID_MIN 0x10000 /* Values less than this have special meaning */
-ulg new_oid(uns);
-void mk_obj_name(byte *, ulg, byte *);
-int dump_obj_to_file(byte *, ulg, struct odes *, int);
+oid_t new_oid(uns);
+void mk_obj_name(byte *, oid_t, byte *);
+int dump_obj_to_file(byte *, oid_t, struct odes *, int);
/* wordsplit.c */
/* objwalk.c */
-void scan_obj_tree(byte *, void (*)(ulg, byte *));
+void scan_obj_tree(byte *, void (*)(oid_t, byte *));
/* random.c */
#undef log2
int
-log2(ulg x)
+log2(u32 x)
{
- ulg l;
+ uns l;
if (!x)
return 0;
#include "lib.h"
-ulg
+u32
temprand(uns key)
{
static int seeded = 0;
- ulg rand;
+ u32 rand;
if (!seeded)
{