Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libcodex/codexlib.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
* Glenn Fowler <[email protected]> *
18
* David Korn <[email protected]> *
19
* Phong Vo <[email protected]> *
20
* *
21
***********************************************************************/
22
#pragma prototyped
23
24
/*
25
* codex private interface
26
* included by <codex.h>
27
*/
28
29
#ifndef _CODEXLIB_H
30
#define _CODEXLIB_H
31
32
#include <debug.h>
33
34
#ifndef SFDCEVENT
35
#define SFDCEVENT(a,b,n) ((((a)-'A'+1)<<11)^(((b)-'A'+1)<<6)^(n))
36
#endif
37
38
#define CODEX_DATA SFDCEVENT('C','X','d') /* get data */
39
#define CODEX_GETPOS SFDCEVENT('C','X','g') /* get position */
40
#define CODEX_SETPOS SFDCEVENT('C','X','s') /* set position */
41
#define CODEX_SIZE SFDCEVENT('C','X','z') /* set size */
42
43
typedef struct Codexcache_s
44
{
45
Codex_t* code;
46
Codexnum_t flags;
47
Codexnum_t cached;
48
char name[CODEX_NAME];
49
} Codexcache_t;
50
51
typedef struct Codexstate_s
52
{
53
const char* id;
54
Codexmeth_t* first;
55
Codexdisc_t disc;
56
Codex_t error;
57
Codex_t* last;
58
char* trace;
59
char* verbose;
60
Codexnum_t index;
61
int serial;
62
unsigned int initialized;
63
unsigned int scanned;
64
unsigned int cached;
65
Codexcache_t cache[16];
66
} Codexstate_t;
67
68
#define CODEXERROR (&codexstate.error)
69
70
#define codex_first (&codex_uu)
71
#define codex_uu_next (&codex_qp)
72
#define codex_qp_next (&codex_rot13)
73
#define codex_rot13_next (&codex_iconv)
74
#define codex_iconv_next 0
75
76
extern Codexmeth_t codex_iconv;
77
extern Codexmeth_t codex_qp;
78
extern Codexmeth_t codex_rot13;
79
extern Codexmeth_t codex_uu;
80
81
extern Codexstate_t codexstate;
82
83
#endif
84
85