Restrictions.h
Go to the documentation of this file.
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
Restrictions.h
QORE programming language
Copyright (C) 2003 - 2021 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#ifndef _QORE_RESTRICTIONS_H
#define _QORE_RESTRICTIONS_H
#define PO_NO_GLOBAL_VARS (1 << 0)
#define PO_NO_SUBROUTINE_DEFS (1 << 1)
#define PO_NO_THREAD_CONTROL (1 << 2)
#define PO_NO_THREAD_CLASSES (1 << 3)
#define PO_NO_TOP_LEVEL_STATEMENTS (1 << 4)
#define PO_NO_CLASS_DEFS (1 << 5)
#define PO_NO_NAMESPACE_DEFS (1 << 6)
#define PO_NO_CONSTANT_DEFS (1 << 7)
#define PO_NO_NEW (1 << 8)
#define PO_NO_INHERIT_SYSTEM_CLASSES (1 << 9)
#define PO_NO_INHERIT_USER_CLASSES (1 << 10)
#define PO_NO_CHILD_PO_RESTRICTIONS (1 << 11)
#define PO_NO_EXTERNAL_PROCESS (1 << 12)
#define PO_REQUIRE_OUR (1 << 13)
#define PO_NO_PROCESS_CONTROL (1 << 14)
#define PO_NO_NETWORK (1 << 15)
#define PO_NO_FILESYSTEM (1 << 16)
#define PO_LOCK_WARNINGS (1 << 17)
#define PO_NO_DATABASE (1 << 18)
#define PO_NO_GUI (1 << 19)
#define PO_NO_TERMINAL_IO (1 << 20)
#define PO_REQUIRE_TYPES (1 << 21)
#define PO_NO_EXTERNAL_INFO (1 << 22)
#define PO_NO_THREAD_INFO (1 << 23)
#define PO_NO_LOCALE_CONTROL (1 << 24)
#define PO_REQUIRE_PROTOTYPES (1 << 25)
#define PO_STRICT_ARGS (1 << 26)
#define PO_REQUIRE_BARE_REFS (1 << 27)
#define PO_ASSUME_LOCAL (1 << 28)
#define PO_NO_MODULES (1 << 29)
#define PO_NO_INHERIT_USER_FUNC_VARIANTS (1 << 30)
#define PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS (1LL << 31)
#define PO_NO_INHERIT_GLOBAL_VARS (1LL << 32)
#define PO_IN_MODULE (1LL << 33)
#define PO_NO_EMBEDDED_LOGIC (1LL << 34)
#define PO_STRICT_BOOLEAN_EVAL (1LL << 35)
#define PO_ALLOW_INJECTION (1LL << 36)
#define PO_NO_INHERIT_USER_CONSTANTS (1LL << 37)
#define PO_NO_INHERIT_SYSTEM_CONSTANTS (1LL << 38)
#define PO_BROKEN_LIST_PARSING (1LL << 39)
#define PO_BROKEN_LOGIC_PRECEDENCE (1LL << 40)
#define PO_BROKEN_INT_ASSIGNMENTS (1LL << 41)
#define PO_BROKEN_OPERATORS (1LL << 42)
#define PO_BROKEN_LOOP_STATEMENT (1LL << 43)
#define PO_STRONG_ENCAPSULATION (1LL << 44)
#define PO_NO_UNCONTROLLED_APIS (1LL << 45)
#define PO_NO_DEBUGGING (1LL << 46)
#define PO_BROKEN_REFERENCES (1LL << 47)
#define PO_NO_INHERIT_USER_HASHDECLS (1LL << 48)
#define PO_NO_INHERIT_SYSTEM_HASHDECLS (1LL << 49)
#define PO_ALLOW_WEAK_REFERENCES (1LL << 50)
#define PO_ALLOW_DEBUGGER (1LL << 51)
#define PO_ALLOW_STATEMENT_NO_EFFECT (1LL << 52)
#define PO_NO_REFLECTION (1LL << 53)
#define PO_NO_TRANSIENT (1LL << 54)
#define PO_BROKEN_SPRINTF (1LL << 55)
#define PO_BROKEN_CAST (1LL << 56)
#define PO_ALLOW_RETURNS (1LL << 57)
#define PO_STRICT_TYPES (1LL << 58)
#define PO_BROKEN_RANGE (1LL << 59)
#define PO_NO_INHERIT_PROGRAM_DATA (1LL << 60)
// aliases for old defines
#define PO_NO_SYSTEM_FUNC_VARIANTS PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS
#define PO_NO_SYSTEM_CLASSES PO_NO_INHERIT_SYSTEM_CLASSES
#define PO_NO_USER_CLASSES PO_NO_INHERIT_USER_CLASSES
#define PO_DEFAULT 0
#define PO_SYSTEM_OPS (PO_IN_MODULE)
#define PO_ALLOW_BARE_REFS PO_REQUIRE_BARE_REFS
// combination options
#define PO_NO_THREADS (PO_NO_THREAD_CONTROL|PO_NO_THREAD_CLASSES|PO_NO_THREAD_INFO)
#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|PO_NO_UNCONTROLLED_APIS)
#define PO_NO_IO (PO_NO_GUI|PO_NO_TERMINAL_IO|PO_NO_FILESYSTEM|PO_NO_NETWORK|PO_NO_DATABASE|PO_NO_UNCONTROLLED_APIS)
#define PO_LOCKDOWN (PO_NO_EXTERNAL_ACCESS|PO_NO_THREADS|PO_NO_IO|PO_NO_REFLECTION)
#define PO_NEW_STYLE (PO_ALLOW_BARE_REFS|PO_ASSUME_LOCAL)
#define PO_POSITIVE_OPTIONS (PO_NO_CHILD_PO_RESTRICTIONS|PO_ALLOW_INJECTION|PO_ALLOW_WEAK_REFERENCES|PO_ALLOW_DEBUGGER)
#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|PO_BROKEN_OPERATORS \
|PO_BROKEN_LOOP_STATEMENT|PO_BROKEN_REFERENCES|PO_BROKEN_SPRINTF|PO_BROKEN_RANGE)
#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|PO_NO_INHERIT_USER_HASHDECLS)
#define PO_SYSTEM_INHERITANCE_OPTIONS (PO_NO_INHERIT_SYSTEM_CLASSES|PO_NO_INHERIT_SYSTEM_FUNC_VARIANTS|PO_NO_INHERIT_SYSTEM_CONSTANTS \
|PO_NO_INHERIT_SYSTEM_HASHDECLS|PO_NO_INHERIT_PROGRAM_DATA)
#define PO_INHERITANCE_OPTIONS (PO_USER_INHERITANCE_OPTIONS|PO_SYSTEM_INHERITANCE_OPTIONS)
#define PO_NO_USER_API PO_USER_INHERITANCE_OPTIONS
#define PO_NO_SYSTEM_API PO_SYSTEM_INHERITANCE_OPTIONS
#define PO_NO_API PO_INHERITANCE_OPTIONS
#define QDOM_DEFAULT 0
#define QDOM_PROCESS PO_NO_PROCESS_CONTROL
#define QDOM_NETWORK PO_NO_NETWORK
#define QDOM_EXTERNAL_PROCESS PO_NO_EXTERNAL_PROCESS
#define QDOM_FILESYSTEM PO_NO_FILESYSTEM
#define QDOM_THREAD_CLASS PO_NO_THREAD_CLASSES
#define QDOM_THREAD_CONTROL PO_NO_THREAD_CONTROL
#define QDOM_DATABASE PO_NO_DATABASE
#define QDOM_GUI PO_NO_GUI
#define QDOM_TERMINAL_IO PO_NO_TERMINAL_IO
#define QDOM_EXTERNAL_INFO PO_NO_EXTERNAL_INFO
#define QDOM_THREAD_INFO PO_NO_THREAD_INFO
#define QDOM_LOCALE_CONTROL PO_NO_LOCALE_CONTROL
#define QDOM_MODULES PO_NO_MODULES
#define QDOM_IN_MODULE PO_IN_MODULE
#define QDOM_EMBEDDED_LOGIC PO_NO_EMBEDDED_LOGIC
#define QDOM_INJECTION PO_ALLOW_INJECTION
#define QDOM_UNCONTROLLED_API PO_NO_UNCONTROLLED_APIS
#define QDOM_DEBUGGER PO_ALLOW_DEBUGGER
#define QDOM_REFLECTION PO_NO_REFLECTION
#endif //_QORE_DOMAIN_H