Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libdss/dsslib.h
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 2002-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
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#pragma prototyped
21
/*
22
* dss library/method implementation header
23
* this header is exported to the method libraries
24
*
25
* Glenn Fowler
26
* AT&T Research
27
*/
28
29
#ifndef _DSSLIB_H
30
#define _DSSLIB_H 1
31
32
#include <ast.h>
33
#include <ctype.h>
34
#include <dt.h>
35
#include <regex.h>
36
#include <swap.h>
37
#include <tag.h>
38
39
#define Dssdisc_s Cxdisc_s /* interchangeable */
40
41
struct Dssdisc_s;
42
struct Dssfile_s;
43
struct Dssrecord_s;
44
45
typedef int (*Dssread_f)(struct Dssfile_s*, struct Dssrecord_s*, struct Dssdisc_s*);
46
typedef int (*Dsswrite_f)(struct Dssfile_s*, struct Dssrecord_s*, struct Dssdisc_s*);
47
typedef Sfoff_t (*Dssseek_f)(struct Dssfile_s*, Sfoff_t, struct Dssdisc_s*);
48
49
#define _DSS_FILE_PRIVATE_ \
50
Dssrecord_t record; \
51
Dssfile_t* next; \
52
Dssread_f readf; \
53
Dsswrite_f writef; \
54
Dssseek_f seekf; \
55
size_t skip; \
56
Dssflags_t ident; \
57
void* data;
58
59
#define _DSS_FORMAT_PRIVATE_ \
60
Dssformat_t* next; \
61
void* data;
62
63
#define _DSS_METH_PRIVATE_ \
64
void* data; \
65
int reference; \
66
int flags;
67
68
#define _DSS_STATE_PRIVATE_ \
69
Sfdisc_t compress_preferred; \
70
Dssmeth_t* global; \
71
unsigned int initialized; \
72
unsigned int scanned;
73
74
#include "cxlib.h"
75
#include "dss.h"
76
77
#define DSS_TELL ((Sfoff_t)(-1))
78
79
typedef struct Dsstagdisc_s
80
{
81
Tagdisc_t tagdisc;
82
Dssdisc_t* disc;
83
Dssmeth_t* meth;
84
} Dsstagdisc_t;
85
86
/*
87
* library private globals
88
*/
89
90
#define dss_con_beg _dss_con_beg
91
#define dss_con_dat _dss_con_dat
92
93
#define dss_map_beg _dss_map_beg
94
#define dss_map_dat _dss_map_dat
95
#define dss_map_end _dss_map_end
96
97
#define dss_tags _dss_tags
98
99
extern Tags_t dss_tags[];
100
101
#if _BLD_dss && defined(__EXPORT__)
102
#define extern __EXPORT__
103
#endif
104
105
/*
106
* these are exported for the method libraries
107
*/
108
109
extern Tags_t* dss_con_beg(Tag_t*, Tagframe_t*, const char*, Tagdisc_t*);
110
extern int dss_con_dat(Tag_t*, Tagframe_t*, const char*, Tagdisc_t*);
111
extern int dss_con_end(Tag_t*, Tagframe_t*, Tagdisc_t*);
112
113
extern Tags_t* dss_map_beg(Tag_t*, Tagframe_t*, const char*, Tagdisc_t*);
114
extern int dss_map_dat(Tag_t*, Tagframe_t*, const char*, Tagdisc_t*);
115
extern int dss_map_end(Tag_t*, Tagframe_t*, Tagdisc_t*);
116
117
extern Dssrecord_t* dss_no_fread(Dssfile_t*, Dssrecord_t*, Dssdisc_t*);
118
extern int dss_no_fwrite(Dssfile_t*, Dssrecord_t*, Dssdisc_t*);
119
extern Sfoff_t dss_no_fseek(Dssfile_t*, Sfoff_t, Dssdisc_t*);
120
121
#undef extern
122
123
#endif
124
125