dtinfo subtree DtMmdb
This commit is contained in:
committed by
Jon Trulson
parent
b92cf08899
commit
8c8363f4a5
@@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
|
||||
#define LargePICTable YES
|
||||
|
||||
#define CplusplusSource YES
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
|
||||
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
|
||||
|
||||
XCOMM In DtMmdb we compile as C_API sources.
|
||||
DEFINES = -DC_API
|
||||
|
||||
@@ -400,11 +400,12 @@ io_status huff::cdrOut(buffer& buf)
|
||||
//MESSAGE(cerr, "huff::cdrOut");
|
||||
//debug(cerr, my_oid());
|
||||
static buffer v_out_buf(LBUFSIZ);
|
||||
int i;
|
||||
|
||||
if ( cts > 0 ) {
|
||||
//MESSAGE(cerr, "huff::cdrOut: dict out");
|
||||
int sz = sizeof(int);
|
||||
for ( int i=0; i<cts; i++ ) {
|
||||
for ( i=0; i<cts; i++ ) {
|
||||
sz += ( e_units[i] -> word -> size() +
|
||||
sizeof(unsigned int) +
|
||||
sizeof(char)
|
||||
|
||||
@@ -43,9 +43,13 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(__osf__) && !defined(USL)
|
||||
#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(__uxp__) && !defined(USL)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* use prototypes in function declarations */
|
||||
#define ps_USE_PROTOS
|
||||
|
||||
@@ -43,9 +43,13 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(__osf__) && !defined(USL)
|
||||
#if defined(__osf__) || defined(linux) || defined(CSRG_BASED)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#if !defined(__uxp__) && !defined(USL)
|
||||
#include <osfcn.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* use prototypes in function declarations */
|
||||
#define sgml_USE_PROTOS
|
||||
|
||||
@@ -360,9 +360,9 @@ Boolean trie::travers_to(char* str, int len,
|
||||
|
||||
|
||||
node = root;
|
||||
int j;
|
||||
int i, j;
|
||||
|
||||
for ( int i=0; i<len; i++ ) {
|
||||
for ( i=0; i<len; i++ ) {
|
||||
j = str[i];
|
||||
|
||||
//debug(cerr, str[i]);
|
||||
|
||||
@@ -61,6 +61,7 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
|
||||
// code for testing. I know it is slow.
|
||||
////////////////////////////////////////
|
||||
|
||||
int ret;
|
||||
fstream out(UNCOMPRESSED, ios::out|ios::trunc);
|
||||
|
||||
if ( !out )
|
||||
@@ -71,14 +72,14 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
|
||||
|
||||
out.close();
|
||||
|
||||
system(form("gzip -c %s > %s", UNCOMPRESSED, COMPRESSED));
|
||||
ret = system(form("gzip -c %s > %s", (char*)UNCOMPRESSED,(char*)COMPRESSED));
|
||||
|
||||
fstream in(COMPRESSED, ios::in);
|
||||
|
||||
if ( !in )
|
||||
throw(streamException(in.rdstate()));
|
||||
|
||||
int x = bytes(in);
|
||||
int x = bytes((char*)COMPRESSED);
|
||||
|
||||
compressed.expand_chunk(x);
|
||||
|
||||
@@ -94,6 +95,7 @@ void zip::compress(const buffer& uncompressed, buffer& compressed)
|
||||
|
||||
void zip::decompress(buffer& compressed, buffer& uncompressed)
|
||||
{
|
||||
int ret;
|
||||
fstream out(COMPRESSED, ios::out|ios::trunc);
|
||||
|
||||
if ( !out )
|
||||
@@ -104,14 +106,14 @@ void zip::decompress(buffer& compressed, buffer& uncompressed)
|
||||
|
||||
out.close();
|
||||
|
||||
system(form("gzip -cd %s > %s", COMPRESSED, UNCOMPRESSED));
|
||||
ret = system(form("gzip -cd %s > %s",(char*)COMPRESSED,(char*)UNCOMPRESSED));
|
||||
|
||||
fstream in(UNCOMPRESSED, ios::in);
|
||||
|
||||
if ( !in )
|
||||
throw(streamException(in.rdstate()));
|
||||
|
||||
int x = bytes(in);
|
||||
int x = bytes((char*)UNCOMPRESSED);
|
||||
|
||||
uncompressed.expand_chunk(x);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user