Qore Programming Language - C/C++ Library  0.8.12.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Restrictions.h
Go to the documentation of this file.
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  Restrictions.h
4 
5  QORE programming language
6 
7  Copyright (C) 2003 - 2016 David Nichols
8 
9  Permission is hereby granted, free of charge, to any person obtaining a
10  copy of this software and associated documentation files (the "Software"),
11  to deal in the Software without restriction, including without limitation
12  the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  and/or sell copies of the Software, and to permit persons to whom the
14  Software is furnished to do so, subject to the following conditions:
15 
16  The above copyright notice and this permission notice shall be included in
17  all copies or substantial portions of the Software.
18 
19  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25  DEALINGS IN THE SOFTWARE.
26 
27  Note that the Qore library is released under a choice of three open-source
28  licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
29  information.
30 */
31 
32 #ifndef _QORE_RESTRICTIONS_H
33 
34 #define _QORE_RESTRICTIONS_H
35 
40 #define PO_NO_GLOBAL_VARS (1 << 0)
41 #define PO_NO_SUBROUTINE_DEFS (1 << 1)
42 #define PO_NO_THREAD_CONTROL (1 << 2)
43 #define PO_NO_THREAD_CLASSES (1 << 3)
44 #define PO_NO_TOP_LEVEL_STATEMENTS (1 << 4)
45 #define PO_NO_CLASS_DEFS (1 << 5)
46 #define PO_NO_NAMESPACE_DEFS (1 << 6)
47 #define PO_NO_CONSTANT_DEFS (1 << 7)
48 #define PO_NO_NEW (1 << 8)
49 #define PO_NO_INHERIT_SYSTEM_CLASSES (1 << 9)
50 #define PO_NO_INHERIT_USER_CLASSES (1 << 10)
51 #define PO_NO_CHILD_PO_RESTRICTIONS (1 << 11)
52 #define PO_NO_EXTERNAL_PROCESS (1 << 12)
53 #define PO_REQUIRE_OUR (1 << 13)
54 #define PO_NO_PROCESS_CONTROL (1 << 14)
55 #define PO_NO_NETWORK (1 << 15)
56 #define PO_NO_FILESYSTEM (1 << 16)
57 #define PO_LOCK_WARNINGS (1 << 17)
58 #define PO_NO_DATABASE (1 << 18)
59 #define PO_NO_GUI (1 << 19)
60 #define PO_NO_TERMINAL_IO (1 << 20)
61 #define PO_REQUIRE_TYPES (1 << 21)
62 #define PO_NO_EXTERNAL_INFO (1 << 22)
63 #define PO_NO_THREAD_INFO (1 << 23)
64 #define PO_NO_LOCALE_CONTROL (1 << 24)
65 #define PO_REQUIRE_PROTOTYPES (1 << 25)
66 #define PO_STRICT_ARGS (1 << 26)
67 #define PO_REQUIRE_BARE_REFS (1 << 27)
68 #define PO_ASSUME_LOCAL (1 << 28)
69 #define PO_NO_MODULES (1 << 29)
70 #define PO_NO_INHERIT_USER_FUNC_VARIANTS (1 << 30)
71 #define PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS (1LL << 31)
72 #define PO_NO_INHERIT_GLOBAL_VARS (1LL << 32)
73 #define PO_IN_MODULE (1LL << 33)
74 #define PO_NO_EMBEDDED_LOGIC (1LL << 34)
75 #define PO_STRICT_BOOLEAN_EVAL (1LL << 35)
76 #define PO_ALLOW_INJECTION (1LL << 36)
77 #define PO_NO_INHERIT_USER_CONSTANTS (1LL << 37)
78 #define PO_NO_INHERIT_SYSTEM_CONSTANTS (1LL << 38)
79 #define PO_BROKEN_LIST_PARSING (1LL << 39)
80 #define PO_BROKEN_LOGIC_PRECEDENCE (1LL << 40)
81 #define PO_BROKEN_INT_ASSIGNMENTS (1LL << 41)
82 #define PO_BROKEN_OPERATORS (1LL << 42)
83 
84 // aliases for old defines
85 #define PO_NO_SYSTEM_FUNC_VARIANTS PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS
86 #define PO_NO_SYSTEM_CLASSES PO_NO_INHERIT_SYSTEM_CLASSES
87 #define PO_NO_USER_CLASSES PO_NO_INHERIT_USER_CLASSES
88 
89 #define PO_DEFAULT 0
90 
91 #define PO_SYSTEM_OPS (PO_IN_MODULE)
93 
95 #define PO_ALLOW_BARE_REFS PO_REQUIRE_BARE_REFS
96 
97 // combination options
99 #define PO_NO_THREADS (PO_NO_THREAD_CONTROL|PO_NO_THREAD_CLASSES|PO_NO_THREAD_INFO)
100 
102 #define PO_NO_EXTERNAL_ACCESS (PO_NO_PROCESS_CONTROL|PO_NO_NETWORK|PO_NO_FILESYSTEM|PO_NO_DATABASE|PO_NO_EXTERNAL_INFO|PO_NO_EXTERNAL_PROCESS|PO_NO_MODULES)
103 
105 #define PO_NO_IO (PO_NO_GUI|PO_NO_TERMINAL_IO|PO_NO_FILESYSTEM|PO_NO_NETWORK|PO_NO_DATABASE)
106 
108 #define PO_LOCKDOWN (PO_NO_EXTERNAL_ACCESS|PO_NO_THREADS|PO_NO_IO)
109 
111 #define PO_NEW_STYLE (PO_ALLOW_BARE_REFS|PO_ASSUME_LOCAL)
112 
114 #define PO_POSITIVE_OPTIONS (PO_NO_CHILD_PO_RESTRICTIONS|PO_ALLOW_INJECTION)
115 
117 #define PO_FREE_OPTIONS (PO_ALLOW_BARE_REFS|PO_ASSUME_LOCAL|PO_STRICT_BOOLEAN_EVAL|PO_BROKEN_LIST_PARSING|PO_BROKEN_LOGIC_PRECEDENCE|PO_BROKEN_INT_ASSIGNMENTS)
118 
120 #define PO_USER_INHERITANCE_OPTIONS (PO_NO_INHERIT_USER_CLASSES|PO_NO_INHERIT_USER_FUNC_VARIANTS|PO_NO_INHERIT_GLOBAL_VARS|PO_NO_INHERIT_USER_CONSTANTS)
121 
123 #define PO_SYSTEM_INHERITANCE_OPTIONS (PO_NO_INHERIT_SYSTEM_CLASSES|PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS|PO_NO_INHERIT_SYSTEM_CONSTANTS)
124 
126 #define PO_INHERITANCE_OPTIONS (PO_USER_INHERITANCE_OPTIONS|PO_SYSTEM_INHERITANCE_OPTIONS)
127 
129 #define PO_NO_USER_API PO_USER_INHERITANCE_OPTIONS
130 
132 #define PO_NO_SYSTEM_API PO_SYSTEM_INHERITANCE_OPTIONS
133 
135 #define PO_NO_API PO_INHERITANCE_OPTIONS
136 
137 #define QDOM_DEFAULT 0
138 #define QDOM_PROCESS PO_NO_PROCESS_CONTROL
139 #define QDOM_NETWORK PO_NO_NETWORK
140 #define QDOM_EXTERNAL_PROCESS PO_NO_EXTERNAL_PROCESS
141 #define QDOM_FILESYSTEM PO_NO_FILESYSTEM
142 #define QDOM_THREAD_CLASS PO_NO_THREAD_CLASSES
143 #define QDOM_THREAD_CONTROL PO_NO_THREAD_CONTROL
144 #define QDOM_DATABASE PO_NO_DATABASE
145 #define QDOM_GUI PO_NO_GUI
146 #define QDOM_TERMINAL_IO PO_NO_TERMINAL_IO
147 #define QDOM_EXTERNAL_INFO PO_NO_EXTERNAL_INFO
148 #define QDOM_THREAD_INFO PO_NO_THREAD_INFO
149 #define QDOM_LOCALE_CONTROL PO_NO_LOCALE_CONTROL
150 #define QDOM_MODULES PO_NO_MODULES
151 #define QDOM_IN_MODULE PO_IN_MODULE
152 #define QDOM_EMBEDDED_LOGIC PO_NO_EMBEDDED_LOGIC
153 #define QDOM_INJECTION PO_ALLOW_INJECTION
154 
155 #endif //_QORE_DOMAIN_H