32 #ifndef _QORE_COMMON_H
34 #define _QORE_COMMON_H
56 #define Q_AF_UNSPEC -1
65 #define Q_SOCK_STREAM -1
89 #if defined _MSC_VER || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
93 #define _Q_WINDOWS64 1
99 #define DLLEXPORT __declspec(dllexport)
101 #define DLLEXPORT __declspec(dllimport)
107 #define QLLDx(a) "%" #a "I64d"
108 #define QORE_DIR_SEP '\\'
109 #define QORE_DIR_SEP_STR "\\"
111 #ifdef HAVE_GCC_VISIBILITY
112 #define DLLEXPORT __attribute__ ((visibility("default")))
113 #define DLLLOCAL __attribute__ ((visibility("hidden")))
120 #define QLLDx(a) "%" #a "lld"
121 #define QORE_DIR_SEP '/'
122 #define QORE_DIR_SEP_STR "/"
125 #define _Q_MAKE_STRING(x) #x
126 #define MAKE_STRING_FROM_SYMBOL(x) _Q_MAKE_STRING(x)
134 class QoreBuiltinMethod;
141 template <
typename T>
struct free_ptr : std::unary_function <T*, void> {
142 DLLLOCAL
void operator()(T* ptr) {
149 DLLLOCAL
void operator()(T* ptr) {
156 DLLLOCAL
void operator()(T* ptr) {
167 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
168 return strcmp(s1, s2) < 0;
175 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
176 return strcasecmp(s1, s2) < 0;
183 DLLLOCAL
bool operator()(std::string s1, std::string s2)
const {
184 return strcasecmp(s1.c_str(), s2.c_str()) < 0;
190 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
191 return !strcmp(s1, s2);
197 DLLLOCAL
bool operator()(
const char* s1,
const char* s2)
const {
198 return !strcasecmp(s1, s2);
205 DLLLOCAL
bool operator()(
const char s1,
const char s2)
const {
484 DLLEXPORT
long long q_atoll(
const char* str);
486 #endif // _QORE_COMMON_H
int64(* q_method_int64_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures, returns int64
Definition: common.h:286
the base class for all data to be used as private data of Qore objects
Definition: AbstractPrivateData.h:44
void(* q_destructor_t)(QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures
Definition: common.h:420
void(* q_copy2_t)(const QoreClass &thisclass, QoreObject *self, QoreObject *old, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass copy signatures with the new generic calling convention ...
Definition: common.h:458
QoreValue(* q_method_n_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreValueList *args, q_rt_flags_t flags, ExceptionSink *xsink)
the new type used for builtin QoreClass method signatures
Definition: common.h:266
void(* q_constructor_n_t)(QoreObject *self, const QoreValueList *args, q_rt_flags_t rtflags, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:367
void(* q_system_constructor_t)(QoreObject *self, int code, va_list args)
the type used for builtin QoreClass system constructor method signatures
Definition: common.h:402
void(* q_system_constructor2_t)(const QoreClass &thisclass, QoreObject *self, int code, va_list args)
the type used for builtin QoreClass system constructor method signatures using the new generic callin...
Definition: common.h:412
void(* q_destructor2_t)(const QoreClass &thisclass, QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures with the new generic calling convention ...
Definition: common.h:429
non-thread-safe vector for storing "char*" that you want to delete
Definition: common.h:211
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreValueList.h:45
int64(* q_func_int64_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures returning an integer value
Definition: common.h:250
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:55
void(* q_constructor3_t)(const QoreClass &thisclass, const type_vec_t &typeList, const void *ptr, QoreObject *self, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures using the even newer generic callin...
Definition: common.h:392
code to be used under the LGPL license
Definition: common.h:85
size_t qore_size_t
used for sizes (same range as a pointer)
Definition: common.h:71
for char less-than comparisons
Definition: common.h:203
for simple c-string less-than comparisons
Definition: common.h:165
uint64_t q_rt_flags_t
runtime code execution flags
Definition: common.h:231
for simple c-string case-insensitive less-than comparisons
Definition: common.h:173
void(* q_constructor_t)(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:374
code to be used under the MIT license
Definition: common.h:86
std::vector< AbstractQoreNode * > arg_vec_t
vector of value information for default argument lists
Definition: common.h:222
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
QoreValue(* q_func_n_t)(const QoreValueList *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:239
defines a Qore-language class
Definition: QoreClass.h:195
bool(* q_delete_blocker_t)(QoreObject *self, AbstractPrivateData *private_data)
the typed used for QoreClass deleteBlocker signatures
Definition: common.h:477
void(* q_copy3_t)(const QoreClass &thisclass, const void *ptr, QoreObject *self, QoreObject *old, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass copy signatures with the new generic calling convention ...
Definition: common.h:469
functor template for deleting elements
Definition: common.h:148
unsigned q_trid_t
type for thread resource IDs (unique within a single running qore library process) ...
Definition: common.h:482
qore_license_t
qore library and module license type identifiers
Definition: common.h:83
the implementation of Qore's object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:64
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:77
for std::string case-insensitive less-than comparisons
Definition: common.h:181
bool(* q_method_bool_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the even newer generic calling...
Definition: common.h:306
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:43
double(* q_method_double_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the even newer generic calling...
Definition: common.h:316
std::vector< std::string > name_vec_t
vector of parameter names for parameter lists
Definition: common.h:225
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:228
intptr_t qore_offset_t
used for offsets that could be negative
Definition: common.h:74
code to be used under the GPL license
Definition: common.h:84
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:68
std::set< int > int_set_t
set of integers
Definition: common.h:80
double(* q_func_double_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures returning an double value
Definition: common.h:256
void(* q_copy_t)(QoreObject *self, QoreObject *old, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass copy signatures
Definition: common.h:448
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:219
a method in a QoreClass
Definition: QoreClass.h:91
void(* q_destructor3_t)(const QoreClass &thisclass, const void *ptr, QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures with the new generic calling convention and...
Definition: common.h:439
int(* q_method_int_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the even newer generic calling...
Definition: common.h:296
functor template for dereferencing elements
Definition: common.h:155
void(* q_constructor2_t)(const QoreClass &thisclass, QoreObject *self, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures using the new generic calling conve...
Definition: common.h:382
functor template for calling free() on pointers
Definition: common.h:141
bool(* q_func_bool_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures returning a boolean value
Definition: common.h:253