/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2003-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#ifndef _VCODEX_H
/* VCODEX = COmpression + DElta + X (encryption, etc.)
**
** Written by Kiem-Phong Vo (kpv@research.att.com)
*/
#if _PACKAGE_ast
#include <ast_std.h>
#define VCPROPRIETARY 0
#else
#include <ast_common.h>
#define VCSFIO 0
#endif
#if VCSFIO == 1
#include <sfio.h>
#else
#include <stdio.h>
#endif
#include <cdt.h> /* container data types */
#if !_SFIO_H /* emulate Sfio features */
#define sfdisc(s,d) (d)
#define sfset(f,m,t) (0)
#define sfsetbuf(f,b,n) (0)
#endif /*_SFIO_H*/
/* define 32-bit integer types */
#if !defined(Vcint32_t) && _typ_int32_t
#endif
#if !defined(Vcint32_t) && defined(_ast_int4_t)
#endif
#if !defined(Vcint32_t)
#endif
#if !defined(Vcuint32_t) && _typ_uint32_t
#endif
#if !defined(Vcuint32_t) && defined(_ast_int4_t)
#endif
#if !defined(Vcuint32_t)
#endif
typedef unsigned char Vcchar_t;
/* type of buffers allocated for transformed data */
/* Vcio_t: handle to perform IO functions on strings */
typedef struct _vcio_s
} Vcio_t;
/* Discipline structure: what application supplies */
struct _vcdisc_s
};
/* Arguments to a method */
struct _vcmtarg_s
};
struct _vcmtcode_s
};
/* Method structure: what a tranform looks like */
struct _vcmethod_s
};
/* Method writers: note that this should be first in any context type */
struct _vccontext_s
};
/* Vcodex_t handle structure: to keep states */
struct _vcodex_s
#ifdef _VCODEX_PRIVATE
#endif
};
/* flags passable to vcopen() */
/* event types passable to discipline event handlers */
/* event types to be processed by method event handlers */
/* flags defining certain method attributes */
/* separators for arguments */
/* function to initialize a discipline structure */
/* return vcodex discipline event */
#if _BLD_vcodex && defined(__EXPORT__)
#define extern extern __EXPORT__
#endif
#if !_BLD_vcodex && defined(__IMPORT__)
#define extern extern __IMPORT__
#endif
/* pointers to the default public -lvcodex methods */
#include <vcmethods.h>
#undef extern
#if _BLD_vcodex && defined(__EXPORT__)
#define extern __EXPORT__
#endif
/* public functions */
extern void vcaddalias _ARG_((char**));
#undef extern
/* macro functions to run the transformation and return amount of data left unprocessed */
/**************************************************************************
**************************************************************************/
#if _BLD_vcodex && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#undef extern
/* Compute the size of a 32-bit integer coded by vcioputu() and vcputm() */
(v)<(1<<21) ? 3 : (v)<(1<<28) ? 4 : 5 )
(v)<(1<<24) ? 3 : 4 )
/* The below bit I/O macro functions use (bt,nb) for bit accumulation. These
** are (register) variables that will be modified in place to keep states.
** The variables must be initialized by vciosetb() before starting bit coding
** and finalized by vcioendb() before restarting to byte coding.
** For convenience, the Vcio_t structure itself provides two fields (bits,nbits)
** usable as (bt,nb). In this way, applications that perform bits ops in function
** calls does not need extra (static) variables to keep states.
*/
} while(0)
} while(0)
} while(0)
} while(0)
} while(0)
if((nb) > 0) /* finish up the partial last byte */ \
} else \
{ while(((nb) -= 8) >= 0) \
} \
} while(0)
/*************************************************************************
*************************************************************************/
/* get disciplines */
/* get context and coerce to the true type */
/* allocate/deallocate buffer.
** bb: if !NULL, current buffer to resize.
** zz: new size, 0 to deallocate.
** hh: slack amount at head of buffer for certain header data
*/
#else
#endif
};
#if _BLD_vcodex && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#undef extern
/*************************************************************************
TYPES AND FUNCTIONS RELATED TO STRING, SUFFIX SORTING
*************************************************************************/
#if VCSFXINT /* may be desirable when sizeof(int) < sizeof(ssize_t) */
#define Vcsfxint_t int
#else
#define Vcsfxint_t ssize_t
#endif
typedef struct _vcsfx_s
} Vcsfx_t;
#if _BLD_vcodex && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#undef extern
/*************************************************************************
TYPES AND FUNCTIONS RELATED TO GENERALIZED LZ-PARSING
*************************************************************************/
/* (*parsef)(Vclzparse_t* vcpa, int type, Vcmatch_t* mtch, ssize_t n)
Arguments:
vcpa: structure describing source&target data and matching requirements.
type: type of match, VC_REVERSE, VCP_MAP, etc.
mtch: array of matched data.
n: number of elements in mtch.
Return values:
> 0: amount of data used up.
= 0: all given data should be considered unmatchable.
< 0: processing failed, quit and return immediately.
*/
/* tpos is monotonically increasing in an array of these */
struct _vclzmatch_s
};
struct _vclzparse_s
};
#if _BLD_vcodex && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#undef extern
/*************************************************************************
HEADER DATA FOR PERSISTENT STORAGE.
This is based on and extending IETF RFC3284,
the Vcdiff delta compression coding format.
The 4th byte can be changed for different versions.
*************************************************************************/
/* Bits in the file control byte.
** The first two bits are for windowing with respect to IETF RFC3284.
** They are no longer needed with VCDX since information about secondary
** compression, etc. are now packaged along with method encoding. However,
** we keep them for compatibility.
*/
/* Bits in the window control byte. Again, the first two bits are for
** windowing with respect to IETF RFC3284.
*/
/*************************************************************************
TYPES AND FUNCTIONS FOR VARIOUS SUBPACKAGES AND TRANSFORMS
*************************************************************************/
#include <vcwindow.h>
#if _PACKAGE_ast
#include <vcsfio.h>
#endif
/*************************************************************************
*************************************************************************/
#ifdef _BLD_vcodex
#ifdef __STDC__
#else
#endif
#else
#ifdef __STDC__
#if defined(__EXPORT__)
#define VCLIB(m) Vcmethod_t* m = &_##m; extern __EXPORT__ Vcmethod_t* vcodex_lib(const char* path) { return m; } \
unsigned long plugin_version(void) { return VCODEX_PLUGIN_VERSION; }
#else
#define VCLIB(m) Vcmethod_t* m = &_##m; extern Vcmethod_t* vcodex_lib(const char* path) { return m; } \
unsigned long plugin_version(void) { return VCODEX_PLUGIN_VERSION; }
#endif
#else
#define VCLIB(m) Vcmethod_t* m = &_/**/m; extern Vcmethod_t* vcodex_lib(path) char* path; { return m; } \
unsigned long plugin_version() { return VCODEX_PLUGIN_VERSION; }
#endif
#endif
#endif /*_VCODEX_H*/