Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libvcodex/vcsfio.h
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 2003-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 <[email protected]> *
18
* *
19
***********************************************************************/
20
#ifndef _VCSFIO_H
21
#define _VCSFIO_H 1
22
23
#if _PACKAGE_ast
24
#include <vcodex.h>
25
#endif
26
27
/* FILE I/O.
28
**
29
** Written by Kiem-Phong Vo ([email protected])
30
*/
31
32
#if _SFIO_H /* let Sfio take care of I/O */
33
#define Vcsfio_t Sfio_t
34
#define vcsfread sfread
35
#define vcsfwrite sfwrite
36
#define vcsfsync sfsync
37
#define vcsfclose sfclose
38
#else /* above functions will be explicitly provided */
39
#define Vcsfio_t Void_t
40
#endif /*_SFIO_H*/
41
42
/* header processing modes */
43
#define VCSF_VCDIFF 000001 /* output RFC3284 VCDIFF header */
44
#define VCSF_PLAIN 000002 /* no header to be output */
45
#define VCSF_TRANS 000004 /* set trans on VC_DECODE */
46
#define VCSF_FREE 000010 /* free sfdt on disc pop */
47
48
/* application-defined function to process error messages */
49
typedef void (*Vcsferror_f)_ARG_((const char*));
50
51
/* data passed to vcsfio() to initialize a stream */
52
typedef struct _vcsfdata_s
53
{ int type; /* various types of processing */
54
char* trans; /* transformation specification */
55
char* window; /* window specification */
56
char* source; /* source file to delta against */
57
Vcsferror_f errorf; /* to process errors */
58
} Vcsfdata_t;
59
60
_BEGIN_EXTERNS_
61
62
#if _BLD_vcodex && defined(__EXPORT__)
63
#define extern __EXPORT__
64
#endif
65
66
extern Vcsfio_t* vcsfio _ARG_((Sfio_t*, Vcsfdata_t*, int));
67
68
#if !_SFIO_H
69
extern ssize_t vcsfread _ARG_((Vcsfio_t*, Void_t*, size_t));
70
extern ssize_t vcsfwrite _ARG_((Vcsfio_t*, Void_t*, size_t));
71
extern int vcsfsync _ARG_((Vcsfio_t*));
72
extern int vcsfclose _ARG_((Vcsfio_t*));
73
#endif
74
75
#undef extern
76
77
_END_EXTERNS_
78
79
#endif /*_VCSFIO_H*/
80
81