1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | #ifndef _WLC_H |
10 | #define _WLC_H |
11 | |
12 | #include "gdk.h" |
13 | #include <time.h> |
14 | #include "mal_exception.h" |
15 | #include "mal_interpreter.h" |
16 | |
17 | /* #define _WLC_DEBUG_ */ |
18 | |
19 | #define WLC_QUERY 1 |
20 | #define WLC_UPDATE 2 |
21 | #define WLC_CATALOG 3 |
22 | #define WLC_IGNORE 4 |
23 | |
24 | /* WLC modes */ |
25 | #define WLC_STARTUP 0 // wlc not yet initialized |
26 | #define WLC_RUN 1 // started for the current snapshot |
27 | #define WLC_STOP 2 // finished last log file for this snapsho |
28 | #define WLC_CLONE 3 // logs used in replica construction |
29 | |
30 | /* |
31 | * returns 1 if the file exists |
32 | */ |
33 | #ifndef F_OK |
34 | #define F_OK 0 |
35 | #endif |
36 | #ifdef _MSC_VER |
37 | #define access(f, m) _access(f, m) |
38 | #endif |
39 | |
40 | mal_export MT_Lock wlc_lock; |
41 | mal_export char wlc_dir[FILENAME_MAX]; |
42 | mal_export lng wlc_id; |
43 | mal_export int wlc_batches; |
44 | mal_export int wlc_state; |
45 | mal_export lng wlc_tag; |
46 | mal_export int wlc_beat; |
47 | mal_export char wlc_write[26]; |
48 | |
49 | mal_export str WLCinit(void); |
50 | mal_export int WLCused(void); |
51 | mal_export void WLCreset(void); |
52 | mal_export str WLCgetConfig(void); |
53 | mal_export str WLCreadConfig(FILE *fd); |
54 | mal_export str WLCflush(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
55 | mal_export str WLCinitCmd(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
56 | mal_export str WLCmaster(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
57 | mal_export str WLCstop(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
58 | mal_export str WLCsetbeat(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
59 | mal_export str WLCgetbeat(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
60 | mal_export str WLCgetclock(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
61 | mal_export str WLCgettick(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
62 | mal_export str WLCtransaction(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
63 | mal_export str WLCquery(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
64 | mal_export str WLCcatalog(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
65 | mal_export str WLCaction(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
66 | mal_export str WLCfinish(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
67 | mal_export str WLCgeneric(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
68 | mal_export str WLCappend(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
69 | mal_export str WLCdelete(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
70 | mal_export str WLCupdate(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
71 | mal_export str WLCclear_table(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
72 | mal_export str WLCcommit(int clientid); |
73 | mal_export str WLCcommitCmd(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
74 | mal_export str WLCrollback(int clientid); |
75 | mal_export str WLCrollbackCmd(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
76 | #endif /* _WLC_H */ |
77 | |