dtsr, DtSearch: finish removing need for BYTE_SWAP define
This commit is contained in:
@@ -9,34 +9,16 @@ CLEANFILES = boolyac.h boolyac.c
|
||||
AM_YFLAGS = -d
|
||||
|
||||
libDtSearch_la_CFLAGS = -DI18N_MSG -DMULTIBYTE -I./raima \
|
||||
@DT_INCDIR@
|
||||
$(DT_INCDIR)
|
||||
|
||||
|
||||
libDtSearch_la_LDFLAGS = -version-info 3:0:1
|
||||
libDtSearch_la_LIBADD = raima/libraima.la
|
||||
|
||||
if LINUX
|
||||
libDtSearch_la_CFLAGS += -DBYTE_SWAP
|
||||
libDtSearch_la_LIBADD += -lm
|
||||
endif
|
||||
|
||||
if BSD
|
||||
libDtSearch_la_CFLAGS += -DBYTE_SWAP
|
||||
endif
|
||||
|
||||
if SOLARIS
|
||||
libDtSearch_la_CFLAGS += -DBYTE_SWAP
|
||||
libDtSearch_la_LIBADD += -lm -lc
|
||||
endif
|
||||
|
||||
if AIX
|
||||
libDtSearch_la_LIBADD += -lisode
|
||||
endif
|
||||
|
||||
if HPUX
|
||||
libDtSearch_la_LIBADD += -lm
|
||||
endif
|
||||
|
||||
libDtSearch_la_SOURCES = apndext.c ausdopen.c ausexit.c \
|
||||
bmstrstr.c boolpars.c boolsrch.c \
|
||||
boolyac.y cuslang.c dbchange.c \
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
*
|
||||
* $Log$
|
||||
*/
|
||||
#include "SearchP.h"
|
||||
#include <autotools_config.h>
|
||||
#include <Dt/SearchP.h>
|
||||
|
||||
/********************************/
|
||||
/* */
|
||||
@@ -61,7 +62,7 @@
|
||||
/********************************/
|
||||
void swab_objrec (struct or_objrec *rec, SWABDIR direction)
|
||||
{
|
||||
#ifndef BYTE_SWAP
|
||||
#if defined(WORDS_BIGENDIAN)
|
||||
return;
|
||||
#else
|
||||
if (direction == NTOH) {
|
||||
@@ -91,7 +92,7 @@ void swab_objrec (struct or_objrec *rec, SWABDIR direction)
|
||||
HTONS (rec->or_objeureka);
|
||||
}
|
||||
return;
|
||||
#endif /* BYTE_SWAP */
|
||||
#endif /* WORDS_BIGENDIAN */
|
||||
} /* swab_objrec() */
|
||||
|
||||
|
||||
@@ -102,7 +103,7 @@ void swab_objrec (struct or_objrec *rec, SWABDIR direction)
|
||||
/********************************/
|
||||
void swab_dbrec (struct or_dbrec *rec, SWABDIR direction)
|
||||
{
|
||||
#ifndef BYTE_SWAP
|
||||
#if defined(WORDS_BIGENDIAN)
|
||||
return;
|
||||
#else
|
||||
if (direction == NTOH) {
|
||||
@@ -147,7 +148,7 @@ void swab_dbrec (struct or_dbrec *rec, SWABDIR direction)
|
||||
HTONS (rec->or_language);
|
||||
}
|
||||
return;
|
||||
#endif /* BYTE_SWAP */
|
||||
#endif /* WORDS_BIGENDIAN */
|
||||
} /* swab_dbrec() */
|
||||
|
||||
/********************* DTSRSWAB.C **********************************/
|
||||
|
||||
@@ -137,7 +137,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction)
|
||||
|
||||
/* dba, or delete chain ptr */
|
||||
memcpy (&align_LONG, slotptr + sizeof(INT), sizeof(LONG));
|
||||
align_LONG = HTONL (align_LONG);
|
||||
HTONL (align_LONG);
|
||||
memcpy (slotptr + sizeof(INT), &align_LONG, sizeof(LONG));
|
||||
|
||||
/* If this is a deleted record, we're done */
|
||||
@@ -151,7 +151,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction)
|
||||
curr_offset < data_offset;
|
||||
curr_offset += sizeof(LONG)) {
|
||||
memcpy (&align_LONG, slotptr + curr_offset, sizeof(LONG));
|
||||
align_LONG = HTONL (align_LONG);
|
||||
HTONL (align_LONG);
|
||||
memcpy (slotptr + curr_offset, &align_LONG, sizeof(LONG));
|
||||
}
|
||||
} /* end loop on each slot */
|
||||
@@ -183,7 +183,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction)
|
||||
|
||||
/* 'orphan' ptr or 'delete chain' ptr */
|
||||
memcpy (&align_LONG, pgbuf + 6, sizeof(LONG));
|
||||
align_LONG = HTONL (align_LONG);
|
||||
HTONL (align_LONG);
|
||||
memcpy (pgbuf + 6, &align_LONG, sizeof(LONG));
|
||||
|
||||
#ifdef DEBUG_DBSWAB
|
||||
@@ -234,7 +234,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction)
|
||||
cptr = slotptr + slsize - 8;
|
||||
|
||||
memcpy (&align_LONG, cptr, sizeof(LONG));
|
||||
align_LONG = HTONL (align_LONG);
|
||||
HTONL (align_LONG);
|
||||
memcpy (cptr, &align_LONG, sizeof(LONG));
|
||||
|
||||
#ifdef DEBUG_DBSWAB
|
||||
@@ -249,7 +249,7 @@ void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction)
|
||||
/* 'child ptr'. after dba, 4 bytes before end of slot. */
|
||||
cptr += 4;
|
||||
memcpy (&align_LONG, cptr, sizeof(LONG));
|
||||
align_LONG = HTONL (align_LONG);
|
||||
HTONL (align_LONG);
|
||||
memcpy (cptr, &align_LONG, sizeof(LONG));
|
||||
|
||||
} /* end loop on each slot */
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <autotools_config.h>
|
||||
|
||||
/* Record number for OR_MISCREC DtSearch record */
|
||||
#define MISCREC_RECNO 3
|
||||
@@ -81,22 +80,11 @@ typedef enum {HTON=1, NTOH} SWABDIR;
|
||||
|
||||
extern void swab_page (char *pgbuf, FILE_ENTRY *file_ptr, SWABDIR direction);
|
||||
|
||||
#if !defined(WORDS_BIGENDIAN) /* ie (BYTE_ORDER != BIG_ENDIAN) */
|
||||
|
||||
#define HTONL(x) x = htonl(x)
|
||||
#define HTONS(x) x = htons(x)
|
||||
#define NTOHL(x) x = ntohl(x)
|
||||
#define NTOHS(x) x = ntohs(x)
|
||||
|
||||
#else /* !BYTE_SWAP, ie (BYTE_ORDER == BIG_ENDIAN) */
|
||||
|
||||
#define HTONL(x)
|
||||
#define HTONS(x)
|
||||
#define NTOHL(x)
|
||||
#define NTOHS(x)
|
||||
|
||||
#endif /* BYTE_SWAP */
|
||||
|
||||
/******** debug stuff *******/
|
||||
extern char *debug_keyslot_ptr;
|
||||
extern void snap_dump (char *label, void *ptr, int len);
|
||||
|
||||
Reference in New Issue
Block a user