1 | /* |
2 | * PROGRAM: JRD Access Method |
3 | * MODULE: evl_proto.h |
4 | * DESCRIPTION: Prototype header file for evl.cpp |
5 | * |
6 | * The contents of this file are subject to the Interbase Public |
7 | * License Version 1.0 (the "License"); you may not use this file |
8 | * except in compliance with the License. You may obtain a copy |
9 | * of the License at http://www.Inprise.com/IPL.html |
10 | * |
11 | * Software distributed under the License is distributed on an |
12 | * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express |
13 | * or implied. See the License for the specific language governing |
14 | * rights and limitations under the License. |
15 | * |
16 | * The Original Code was created by Inprise Corporation |
17 | * and its predecessors. Portions created by Inprise Corporation are |
18 | * Copyright (C) Inprise Corporation. |
19 | * |
20 | * All Rights Reserved. |
21 | * Contributor(s): ______________________________________. |
22 | */ |
23 | |
24 | #ifndef JRD_EVL_PROTO_H |
25 | #define JRD_EVL_PROTO_H |
26 | |
27 | #include "../jrd/intl_classes.h" |
28 | #include "../jrd/req.h" |
29 | |
30 | namespace Jrd |
31 | { |
32 | class InversionNode; |
33 | struct Item; |
34 | struct ItemInfo; |
35 | } |
36 | |
37 | dsc* EVL_assign_to(Jrd::thread_db* tdbb, const Jrd::ValueExprNode*); |
38 | Jrd::RecordBitmap** EVL_bitmap(Jrd::thread_db* tdbb, const Jrd::InversionNode*, Jrd::RecordBitmap*); |
39 | bool EVL_field(Jrd::jrd_rel*, Jrd::Record*, USHORT, dsc*); |
40 | void EVL_make_value(Jrd::thread_db* tdbb, const dsc*, Jrd::impure_value*, MemoryPool* pool = NULL); |
41 | void EVL_validate(Jrd::thread_db*, const Jrd::Item&, const Jrd::ItemInfo*, dsc*, bool); |
42 | |
43 | namespace Jrd |
44 | { |
45 | // Evaluate a value expression. |
46 | inline dsc* EVL_expr(thread_db* tdbb, jrd_req* request, const ValueExprNode* node) |
47 | { |
48 | if (!node) |
49 | BUGCHECK(303); // msg 303 Invalid expression for evaluation |
50 | |
51 | SET_TDBB(tdbb); |
52 | |
53 | if (--tdbb->tdbb_quantum < 0) |
54 | JRD_reschedule(tdbb, 0, true); |
55 | |
56 | request->req_flags &= ~req_null; |
57 | |
58 | dsc* desc = node->execute(tdbb, request); |
59 | |
60 | if (desc) |
61 | request->req_flags &= ~req_null; |
62 | else |
63 | request->req_flags |= req_null; |
64 | |
65 | return desc; |
66 | } |
67 | } |
68 | |
69 | #endif // JRD_EVL_PROTO_H |
70 | |