1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1995-2011 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                 Eclipse Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *          http://www.eclipse.org/org/documents/epl-v10.html           *
11 *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                   Phong Vo <kpv@research.att.com>                    *
18 *                                                                      *
19 ***********************************************************************/
20 #ifndef _VDELTA_H
21 #define _VDELTA_H	1
22 
23 #ifndef __KPV__
24 #define __KPV__		1
25 
26 #ifndef __STD_C
27 #ifdef __STDC__
28 #define	__STD_C		1
29 #else
30 #if __cplusplus
31 #define __STD_C		1
32 #else
33 #define __STD_C		0
34 #endif /*__cplusplus*/
35 #endif /*__STDC__*/
36 #endif /*__STD_C*/
37 
38 #ifndef _BEGIN_EXTERNS_
39 #if __cplusplus
40 #define _BEGIN_EXTERNS_	extern "C" {
41 #define _END_EXTERNS_	}
42 #else
43 #define _BEGIN_EXTERNS_
44 #define _END_EXTERNS_
45 #endif
46 #endif /*_BEGIN_EXTERNS_*/
47 
48 #ifndef _ARG_
49 #if __STD_C
50 #define _ARG_(x)	x
51 #else
52 #define _ARG_(x)	()
53 #endif
54 #endif /*_ARG_*/
55 
56 #ifndef Void_t
57 #if __STD_C
58 #define Void_t		void
59 #else
60 #define Void_t		char
61 #endif
62 #endif /*Void_t*/
63 
64 #ifndef NIL
65 #define NIL(type)	((type)0)
66 #endif /*NIL*/
67 
68 #endif /*__KPV__*/
69 
70 /* user-supplied functions to do io */
71 typedef struct _vddisc_s	Vddisc_t;
72 typedef int(*	Vdio_f)_ARG_((Void_t*, int, long, Vddisc_t*));
73 struct _vddisc_s
74 {	long	size;		/* total data size	*/
75 	Void_t*	data;		/* data array		*/
76 	Vdio_f	readf;		/* to read data		*/
77 	Vdio_f	writef;		/* to write data	*/
78 };
79 
80 /* magic header for delta output */
81 #define VD_MAGIC	"vd01"
82 
83 _BEGIN_EXTERNS_
84 extern long	_vddelta_01 _ARG_((Vddisc_t*,Vddisc_t*,Vddisc_t*,long));
85 extern long	_vdupdate_01 _ARG_((Vddisc_t*,Vddisc_t*,Vddisc_t*));
86 _END_EXTERNS_
87 
88 #endif /*_VDELTA_H*/
89