32 #ifndef _QORE_QORELIBINTERN_H
34 #define _QORE_QORELIBINTERN_H
36 #include "qore/intern/config.h"
40 #include <sys/types.h>
42 #include <openssl/crypto.h>
44 #if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
45 #define OPENSSL_3_PLUS
48 #ifdef HAVE_SYS_STATVFS_H
49 #define Q_HAVE_STATVFS
50 #include <sys/statvfs.h>
54 #ifdef HAVE_EXECINFO_H
57 #ifdef HAVE_ARPA_INET_H
58 #include <arpa/inet.h>
60 #ifdef HAVE_SYS_SOCKET_H
61 #include <sys/socket.h>
66 #ifdef HAVE_NETINET_IN_H
67 #include <netinet/in.h>
69 #ifdef HAVE_ARPA_INET_H
70 #include <arpa/inet.h>
72 #ifdef HAVE_SYS_SOCKET_H
73 #include <sys/socket.h>
78 #ifdef HAVE_ARPA_INET_H
79 #include <arpa/inet.h>
81 #ifdef HAVE_WINSOCK2_H
84 #ifdef HAVE_WS2TCPIP_H
90 #ifdef HAVE_NETINET_TCP_H
91 #include <netinet/tcp.h>
97 #ifdef HAVE_INTTYPES_H
101 #ifndef HAVE_STRCASESTR
102 extern char* strcasestr(
const char* s1,
const char* s2);
106 #define MPFR_USE_INTMAX_T 1
112 #if TARGET_BITS == 64
123 static bool isoctaldigit(
const char x) {
124 return x >=
'0' && x <=
'7';
131 #define NT_SOFTINT -4
132 #define NT_SOFTFLOAT -5
133 #define NT_SOFTNUMBER -6
134 #define NT_SOFTBOOLEAN -7
135 #define NT_SOFTSTRING -8
136 #define NT_SOFTDATE -9
137 #define NT_SOFTLIST -10
138 #define NT_TIMEOUT -11
139 #define NT_INTORFLOAT -12
140 #define NT_INTFLOATORNUMBER -13
141 #define NT_FLOATORNUMBER -14
142 #define NT_SOFTBINARY -15
143 #define NT_HEXBINARY -16
144 #define NT_BASE64BINARY -17
146 #define NT_SOMETHING -101
149 typedef std::set<QoreObject*> obj_set_t;
152 DLLLOCAL
extern int qore_ssl_data_index;
155 enum q_setpub_t :
unsigned char {
161 hashdecl QoreParseContext {
163 LocalVar* oflag =
nullptr;
166 const QoreTypeInfo* typeInfo =
nullptr;
171 DLLLOCAL QoreParseContext(LocalVar* oflag,
QoreProgram* pgm =
getProgram()) : pgm(pgm), oflag(oflag) {
174 DLLLOCAL
int unsetFlags(
int flags) {
180 DLLLOCAL
int setFlags(
int flags) {
187 class QoreParseContextFlagHelper {
189 DLLLOCAL QoreParseContextFlagHelper(QoreParseContext& parse_context) : parse_context(parse_context),
190 pflag(parse_context.pflag) {
193 DLLLOCAL ~QoreParseContextFlagHelper() {
194 if (parse_context.pflag != pflag) {
195 parse_context.pflag = pflag;
199 DLLLOCAL
void unsetFlags(
int flags) {
200 parse_context.pflag &= ~flags;
203 DLLLOCAL
void setFlags(
int flags) {
204 parse_context.pflag |= flags;
208 QoreParseContext& parse_context;
212 class QoreParseContextLvarHelper {
214 DLLLOCAL QoreParseContextLvarHelper(QoreParseContext& parse_context, LVList*& lvars)
215 : parse_context(parse_context), lvars(lvars), lvids(parse_context.lvids) {
216 parse_context.lvids = 0;
219 DLLLOCAL ~QoreParseContextLvarHelper();
222 QoreParseContext& parse_context;
228 DLLLOCAL
int parse_init_value(
QoreValue& val, QoreParseContext& parse_context);
236 DLLLOCAL
bool needs_scan(
const QoreValue& v);
242 hashdecl ParseWarnOptions {
243 int64 parse_options = 0;
246 DLLLOCAL ParseWarnOptions() {
249 DLLLOCAL ParseWarnOptions(
int64 n_parse_options,
int n_warn_mask = 0)
250 : parse_options(n_parse_options), warn_mask(n_warn_mask) {
253 DLLLOCAL
void operator=(
const ParseWarnOptions& pwo) {
254 parse_options = pwo.parse_options;
255 warn_mask = pwo.warn_mask;
258 DLLLOCAL
bool operator==(
const ParseWarnOptions& pwo)
const {
259 return parse_options == pwo.parse_options && warn_mask == pwo.warn_mask;
263 hashdecl QoreProgramLineLocation {
264 int16_t start_line = -1,
268 DLLLOCAL QoreProgramLineLocation(
int sline,
int eline) : start_line(sline ? sline : (eline ? 1 : 0)), end_line(eline) {
269 assert(sline <= 0xffff);
270 assert(eline <= 0xffff);
273 DLLLOCAL QoreProgramLineLocation() {
276 DLLLOCAL QoreProgramLineLocation(
const QoreProgramLineLocation& old) =
default;
278 DLLLOCAL QoreProgramLineLocation(QoreProgramLineLocation&& old) =
default;
281 hashdecl QoreProgramLocation :
public QoreProgramLineLocation {
284 DLLLOCAL QoreProgramLocation() {
287 DLLLOCAL
explicit QoreProgramLocation(
const char* f,
int sline,
int eline,
const char* source,
int offset,
288 const char* lang =
"Qore") :
289 QoreProgramLineLocation(sline, eline), file(f), source(source), lang(lang), offset(offset) {
290 assert(offset <= 0xffff);
293 DLLLOCAL
explicit QoreProgramLocation(
const char* f,
int sline = 0,
int eline = 0) :
294 QoreProgramLineLocation(sline, eline), file(f) {
298 DLLLOCAL QoreProgramLocation(
int sline,
int eline);
300 DLLLOCAL QoreProgramLocation(
const QoreProgramLocation& old) =
default;
302 DLLLOCAL QoreProgramLocation(QoreProgramLocation&& old) =
default;
304 DLLLOCAL
void clear() {
305 start_line = end_line = -1;
311 DLLLOCAL
void toString(
QoreString& str)
const;
313 DLLLOCAL
const char* getFile()
const {
317 DLLLOCAL
const char* getFileValue()
const {
318 return file ? file :
"";
321 DLLLOCAL
const char* getSource()
const {
325 DLLLOCAL
const char* getSourceValue()
const {
326 return source ? source :
"";
329 DLLLOCAL
const char* getLanguage()
const {
333 DLLLOCAL
const char* getLanguageValue()
const {
334 return lang ? lang :
"";
337 DLLLOCAL
void setFile(
const char* f) {
341 DLLLOCAL
void setSource(
const char* s) {
345 DLLLOCAL
void setLanguage(
const char* l) {
349 DLLLOCAL
bool operator<(
const QoreProgramLocation& loc)
const {
350 return start_line < loc.start_line
351 || end_line < loc.end_line
353 || source < loc.source
354 || offset < loc.offset
358 DLLLOCAL
bool operator==(
const QoreProgramLocation& loc)
const {
359 return start_line == loc.start_line
360 && end_line == loc.end_line
362 && source == loc.source
363 && offset == loc.offset
367 DLLLOCAL
bool operator!=(
const QoreProgramLocation& loc)
const {
368 return !(*
this == loc);
372 const char* file =
nullptr;
373 const char* source =
nullptr;
374 const char* lang =
"Qore";
380 DLLLOCAL
extern const QoreProgramLocation loc_builtin;
382 hashdecl QoreCommandLineLocation :
public QoreProgramLocation {
383 DLLLOCAL QoreCommandLineLocation() : QoreProgramLocation(
"<command-line>", 1, 1) {
388 DLLLOCAL
extern QoreCommandLineLocation qoreCommandLineLocation;
391 DLLLOCAL
void parse_error(
const QoreProgramLocation& loc,
const char* fmt, ...);
392 DLLLOCAL
void parseException(
const QoreProgramLocation& loc,
const char* err,
const char* fmt, ...);
393 DLLLOCAL
void parseException(
const QoreProgramLocation& loc,
const char* err,
QoreStringNode* desc);
395 DLLLOCAL
QoreString* findFileInPath(
const char* file,
const char* path);
396 DLLLOCAL
QoreString* findFileInEnvPath(
const char* file,
const char* varname);
397 DLLLOCAL
int qore_find_file_in_path(
QoreString& str,
const char* file,
const char* path);
399 DLLLOCAL
const QoreTypeInfo* getBuiltinUserTypeInfo(
const char* str);
400 DLLLOCAL
const QoreTypeInfo* getBuiltinUserOrNothingTypeInfo(
const char* str);
402 DLLLOCAL
const char* getBuiltinTypeName(
qore_type_t type);
413 #ifdef HAVE_STRTOIMAX
414 static inline long long atoll(
const char* str) {
415 return strtoimax(str, 0, 10);
418 static inline long long atoll(
const char* str) {
420 sscanf(str,
"%lld", &i);
426 #if !defined(HAVE_STRTOLL) && defined(HAVE_STRTOIMAX)
428 #define strtoll strtoimax
436 #ifdef HAVE_OPENSSL_CONST
437 #define OPENSSL_CONST const
439 #define OPENSSL_CONST
442 #ifdef HAVE_X509_GET0_SIGNATURE_CONST
443 #define OPENSSL_X509_GET0_SIGNATURE_CONST const
445 #define OPENSSL_X509_GET0_SIGNATURE_CONST
448 typedef std::set<const AbstractQoreNode*> const_node_set_t;
449 typedef std::set<LocalVar*> lvar_set_t;
451 class LVarSet :
public lvar_set_t {
458 DLLLOCAL LVarSet() : needs_scan(false) {
462 DLLLOCAL
void add(LocalVar* var);
465 DLLLOCAL
bool needsScan()
const {
470 enum obe_type_e { OBE_Unconditional, OBE_Success, OBE_Error };
472 class StatementBlock;
473 typedef std::pair<enum obe_type_e, StatementBlock*> qore_conditional_block_exit_statement_t;
475 typedef std::list<qore_conditional_block_exit_statement_t> block_list_t;
478 typedef std::map<QoreCondition*, int> cond_map_t;
480 #if defined(HAVE_CHECK_STACK_POS)
481 #define QORE_MANAGE_STACK
485 #define DAH_NOCHANGE 0
486 #define DAH_ACQUIRE 1
487 #define DAH_RELEASE 2
490 #define DAH_TEXT(d) (d == DAH_RELEASE ? "RELEASE" : (d == DAH_ACQUIRE ? "ACQUIRE" : "NOCHANGE"))
492 DLLLOCAL
int check_lvalue(
QoreValue n,
bool assign =
true);
494 DLLLOCAL
int check_lvalue_int(
const QoreProgramLocation* loc,
const QoreTypeInfo*& typeInfo,
const char* name);
495 DLLLOCAL
int check_lvalue_float(
const QoreProgramLocation* loc,
const QoreTypeInfo*& typeInfo,
const char* name);
496 DLLLOCAL
int check_lvalue_int_float_number(
const QoreProgramLocation* loc,
const QoreTypeInfo*& typeInfo,
const char* name);
497 DLLLOCAL
int check_lvalue_number(
const QoreProgramLocation* loc,
const QoreTypeInfo*& typeInfo,
const char* name);
499 DLLLOCAL
extern QoreClass* QC_PSEUDOVALUE;
500 DLLLOCAL
extern QoreClass* QC_PSEUDONOTHING;
509 #define Q_SVF_BSIZE 4096
510 #define Q_HAVE_STATVFS
512 unsigned long f_bsize;
513 unsigned long f_frsize;
514 unsigned int f_blocks;
515 unsigned int f_bfree;
516 unsigned int f_bavail;
517 unsigned int f_files;
518 unsigned int f_ffree;
519 unsigned int f_favail;
520 unsigned long f_fsid;
521 unsigned long f_flag;
522 unsigned long f_namemax;
525 f_frsize = f_bsize = Q_SVF_BSIZE;
526 f_blocks = total / Q_SVF_BSIZE;
527 f_bfree = free / Q_SVF_BSIZE;
528 f_bavail = avail / Q_SVF_BSIZE;
530 f_files = f_blocks / 8;
531 f_ffree = f_bfree / 8;
532 f_favail = f_bavail / 8;
538 DLLLOCAL
int statvfs(
const char* path,
struct statvfs* buf);
539 DLLLOCAL
int q_fstatvfs(
const char* filepath,
struct statvfs* buf);
551 for (
auto& i : *value_list) {
572 value_list->push_back(v);
580 class QoreParseListNode;
582 #include "qore/intern/NamedScope.h"
583 #include "qore/intern/QoreTypeInfo.h"
584 #include "qore/intern/ParseNode.h"
585 #include "qore/intern/QoreThreadList.h"
586 #include "qore/intern/lvalue_ref.h"
587 #include "qore/intern/qore_thread_intern.h"
588 #include "qore/intern/Function.h"
589 #include "qore/intern/CallReferenceCallNode.h"
590 #include "qore/intern/CallReferenceNode.h"
591 #include "qore/intern/BuiltinFunction.h"
592 #include "qore/intern/AbstractStatement.h"
593 #include "qore/intern/Variable.h"
594 #include "qore/intern/LocalVar.h"
595 #include "qore/intern/ScopedObjectCallNode.h"
596 #include "qore/intern/NewComplexTypeNode.h"
597 #include "qore/intern/ScopedRefNode.h"
598 #include "qore/intern/ClassRefNode.h"
599 #include "qore/intern/Context.h"
600 #include "qore/intern/BarewordNode.h"
601 #include "qore/intern/SelfVarrefNode.h"
602 #include "qore/intern/StaticClassVarRefNode.h"
603 #include "qore/intern/BackquoteNode.h"
604 #include "qore/intern/ContextrefNode.h"
605 #include "qore/intern/ContextRowNode.h"
606 #include "qore/intern/ComplexContextrefNode.h"
607 #include "qore/intern/FindNode.h"
608 #include "qore/intern/VRMutex.h"
609 #include "qore/intern/VLock.h"
610 #include "qore/intern/QoreException.h"
611 #include "qore/intern/StatementBlock.h"
612 #include "qore/intern/VarRefNode.h"
613 #include "qore/intern/QoreRegexSubst.h"
614 #include "qore/intern/QoreRegex.h"
615 #include "qore/intern/QoreTransliteration.h"
616 #include "qore/intern/ObjectMethodReferenceNode.h"
617 #include "qore/intern/QoreClosureParseNode.h"
618 #include "qore/intern/QoreClosureNode.h"
619 #include "qore/intern/QoreImplicitArgumentNode.h"
620 #include "qore/intern/QoreImplicitElementNode.h"
621 #include "qore/intern/QoreOperatorNode.h"
622 #include "qore/intern/QoreTimeZoneManager.h"
623 #include "qore/intern/ContextStatement.h"
624 #include "qore/intern/SwitchStatement.h"
625 #include "qore/intern/QorePseudoMethods.h"
626 #include "qore/intern/ParseReferenceNode.h"
627 #include "qore/intern/WeakReferenceNode.h"
629 DLLLOCAL
extern std::atomic<bool> qore_initialized;
630 DLLLOCAL
extern std::atomic<bool> qore_shutdown;
631 DLLLOCAL
extern std::atomic<bool> qore_exiting;
633 DLLLOCAL
extern int qore_library_options;
635 #ifndef HAVE_GETHOSTBYADDR_R
642 #define NET_BUFSIZE 1024
645 #ifndef HOSTNAMEBUFSIZE
646 #define HOSTNAMEBUFSIZE 512
649 #ifndef HAVE_LOCALTIME_R
653 #ifndef HAVE_GMTIME_R
657 DLLLOCAL
extern char table64[64];
660 DLLLOCAL
BinaryNode*
parseHex(
const QoreProgramLocation* loc,
const char* buf,
int len);
661 DLLLOCAL
void print_node(FILE* fp,
const QoreValue qv);
662 DLLLOCAL
void delete_global_variables();
663 DLLLOCAL
void init_lib_intern(
char* env[]);
664 DLLLOCAL QoreParseListNode* make_args(
const QoreProgramLocation* loc,
QoreValue arg);
668 DLLLOCAL
void init_qore_types();
669 DLLLOCAL
void delete_qore_types();
671 DLLLOCAL
QoreListNode* stat_to_list(
const struct stat& sbuf);
673 DLLLOCAL
QoreHashNode* statvfs_to_hash(
const struct statvfs& statvfs);
683 DLLLOCAL StaticSystemNamespace();
685 DLLLOCAL ~StaticSystemNamespace();
689 DLLLOCAL
extern StaticSystemNamespace* staticSystemNamespace;
691 class QoreParseListNodeParseInitHelper {
693 DLLLOCAL QoreParseListNodeParseInitHelper(QoreParseListNode* l) : l(l) {
696 DLLLOCAL
QoreValue parseInit(QoreParseContext& parse_context) {
700 parse_context.typeInfo =
nullptr;
702 int pflag = parse_context.setFlags(PF_FOR_ASSIGNMENT);
703 bool err = (bool)parse_init_value(n, parse_context);
704 parse_context.pflag = pflag;
711 DLLLOCAL
bool next() {
713 if (pos == (
int)l->size()) {
720 DLLLOCAL
int index() {
724 DLLLOCAL
bool hasError()
const {
729 QoreParseListNode* l;
734 class QorePossibleListNodeParseInitHelper {
736 DLLLOCAL QorePossibleListNodeParseInitHelper(
QoreValue& n, QoreParseContext& parse_context) {
739 parse_context.typeInfo =
nullptr;
740 error = parse_init_value(n, parse_context);
747 pl = n.get<QoreParseListNode>();
754 if (!QoreTypeInfo::parseAccepts(listTypeInfo, parse_context.typeInfo)) {
755 singleTypeInfo = parse_context.typeInfo;
760 DLLLOCAL
bool noArgument()
const {
764 DLLLOCAL
bool next() {
769 if (++pos == sizeIntern()) {
776 DLLLOCAL
size_t size()
const {
777 return finished ? 1 : sizeIntern();
780 DLLLOCAL
void parseInit(QoreParseContext& parse_context);
782 DLLLOCAL
bool hasError()
const {
788 QoreParseListNode* pl =
nullptr;
789 bool finished =
true;
791 const QoreTypeInfo* singleTypeInfo =
nullptr;
794 DLLLOCAL
size_t sizeIntern()
const {
795 return l ? l->
size() : pl->size();
799 DLLLOCAL
void raise_nonexistent_method_call_warning(
const QoreProgramLocation* loc,
const QoreClass* qc,
810 class qore_hash_private;
811 class qore_object_private;
814 class hash_assignment_priv {
816 qore_hash_private& h;
818 qore_object_private* o =
nullptr;
820 DLLLOCAL hash_assignment_priv(qore_hash_private& n_h, HashMember* n_om) : h(n_h), om(n_om) {
823 DLLLOCAL hash_assignment_priv(qore_hash_private& n_h,
const char* key,
bool must_already_exist =
false, qore_object_private* obj =
nullptr);
825 DLLLOCAL hash_assignment_priv(
QoreHashNode& n_h,
const char* key,
bool must_already_exist =
false);
827 DLLLOCAL hash_assignment_priv(
QoreHashNode& n_h,
const std::string &key,
bool must_already_exist =
false);
833 DLLLOCAL
void reassign(
const char* key,
bool must_already_exist =
false);
843 DLLLOCAL
bool exists()
const {
860 DLLLOCAL
void qore_machine_backtrace();
862 #ifndef QORE_THREAD_STACK_BLOCK
863 #define QORE_THREAD_STACK_BLOCK 64
866 template <
typename T,
int S1 = QORE_THREAD_STACK_BLOCK>
869 DLLLOCAL ThreadBlock(
const ThreadBlock&);
874 ThreadBlock<T, S1>* prev, * next =
nullptr;
876 DLLLOCAL ThreadBlock(ThreadBlock* prev =
nullptr) : prev(prev) { }
877 DLLLOCAL ~ThreadBlock() { }
878 DLLLOCAL T& get(
int p) {
882 DLLLOCAL
bool frameBoundary(
int p);
885 template <
typename T,
int S1 = QORE_THREAD_STACK_BLOCK>
886 class ThreadLocalDataIterator {
887 typedef ThreadLocalDataIterator<T, S1> self_t;
890 typedef ThreadBlock<T, S1> Block;
893 Block* orig =
nullptr, * curr =
nullptr;
897 DLLLOCAL ThreadLocalDataIterator(Block* n_orig)
898 : orig(n_orig && n_orig->pos ? n_orig : nullptr) {
901 DLLLOCAL ThreadLocalDataIterator() {
904 DLLLOCAL
bool next() {
926 }
while (curr->frameBoundary(pos));
933 return curr->get(pos);
937 template <
typename T,
int S1 = QORE_THREAD_STACK_BLOCK>
938 class ThreadLocalData {
940 typedef ThreadBlock<T, S1> Block;
941 typedef ThreadLocalDataIterator<T, S1> iterator;
945 DLLLOCAL ThreadLocalData() {
950 DLLLOCAL ~ThreadLocalData() {
962 DLLLOCAL
bool empty()
const {
963 return (!curr->pos && !curr->prev);
967 DLLLOCAL
int getFrameCount()
const {
972 int frame_count = -1;
975 DLLLOCAL ThreadLocalData(
const ThreadLocalData&);
979 DLLLOCAL
int q_get_af(
int type);
981 DLLLOCAL
int q_get_raf(
int type);
983 DLLLOCAL
int q_get_sock_type(
int t);
985 class OptHashRefHelper {
995 DLLLOCAL ~OptHashRefHelper() {
1016 class VariableBlockHelper {
1018 DLLLOCAL VariableBlockHelper();
1019 DLLLOCAL ~VariableBlockHelper();
1022 class ParseOptionMaps {
1024 DLLLOCAL
void doMap(
int64 code,
const char* desc,
const char* dom =
nullptr);
1027 typedef std::map<int64, const char*> pomap_t;
1028 typedef std::map<const char*, int64, ltstr> pormap_t;
1030 pomap_t pomap, dommap;
1031 pormap_t pormap, domrmap;
1033 DLLLOCAL ParseOptionMaps();
1042 DLLLOCAL
extern ParseOptionMaps pomaps;
1046 DLLLOCAL
extern bool q_disable_gc;
1048 DLLLOCAL
QoreValue qore_parse_get_define_value(
const QoreProgramLocation* loc,
const char* str,
QoreString& arg,
1051 #ifndef HAVE_INET_NTOP
1052 DLLLOCAL
const char* inet_ntop(
int af,
const void* src,
char* dst,
size_t size);
1054 #ifndef HAVE_INET_PTON
1055 DLLLOCAL
int inet_pton(
int af,
const char* src,
void* dst);
1063 DLLLOCAL
int check_self_assignment(
const QoreProgramLocation* loc,
QoreValue n, LocalVar* selfid);
1065 DLLLOCAL
void ignore_return_value(QoreSimpleValue& n);
1067 DLLLOCAL
void qore_string_init();
1070 bool with_separator =
false);
1071 DLLLOCAL
QoreListNode* split_intern(
const char* pattern,
size_t pl,
const char* str,
size_t sl,
1076 const QoreString* quote,
bool trim_unquoted, AbstractIteratorHelper* h =
nullptr,
1085 DLLLOCAL
void init_charmaps();
1091 DLLLOCAL
int64 q_clock_getmillis();
1092 DLLLOCAL
int64 q_clock_getmicros();
1093 DLLLOCAL
int64 q_clock_getnanos();
1095 DLLLOCAL
void qore_init_random_salt();
1096 DLLLOCAL
int qore_get_ptr_hash(
QoreString& str,
const void* ptr);
1099 DLLLOCAL
const char* q_find_first_path_sep(
const char* path);
1101 DLLLOCAL
const char* q_find_last_path_sep(
const char* path);
1104 DLLLOCAL
int q_get_mode(
const QoreString& path);
1106 DLLLOCAL
qore_offset_t q_UTF8_get_char_len(
const char* p,
size_t valid_len);
1109 DLLLOCAL
qore_offset_t q_UTF16BE_get_char_len(
const char* p,
size_t valid_len);
1110 DLLLOCAL
qore_offset_t q_UTF16LE_get_char_len(
const char* p,
size_t len);
1118 DLLLOCAL
void* qore_get_in_addr(
struct sockaddr *sa);
1120 DLLLOCAL
size_t qore_get_in_len(
struct sockaddr *sa);
1122 DLLLOCAL
QoreHashNode* get_source_location(
const QoreProgramLocation* loc);
1124 DLLLOCAL
void qore_delete_module_options();
1126 DLLLOCAL
const QoreTypeInfo* qore_get_type_from_string_intern(
const char* str);
DLLEXPORT BinaryNode * parseHex(const char *buf, int len, ExceptionSink *xsink)
parses a string of hex characters and returns a BinaryNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:57
holds arbitrary binary data
Definition: BinaryNode.h:41
Holds absolute and relative date/time values in Qore with precision to the microsecond.
Definition: DateTime.h:93
Qore's parse tree/value type for date-time values, reference-counted, dynamically-allocated only.
Definition: DateTimeNode.h:45
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT void assimilate(ExceptionSink *xs)
assimilates all entries of the "xs" argument by appending them to the internal list and deletes the "...
use this class to make assignments to hash keys from a pointer to the key value
Definition: QoreHashNode.h:685
class hash_assignment_priv * priv
private implementation
Definition: QoreHashNode.h:778
defines a Qore-language class
Definition: QoreClass.h:249
defines string encoding functions in Qore
Definition: QoreEncoding.h:83
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition: QoreHashNode.h:50
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
DLLEXPORT size_t size() const
returns the number of elements in the list
the implementation of Qore's object data type, reference counted, dynamically-allocated only
Definition: QoreObject.h:60
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only
Definition: QoreProgram.h:127
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
provides a mutually-exclusive thread lock
Definition: QoreThreadLock.h:49
helper class to manage variable references passed to functions and class methods, stack only,...
Definition: QoreTypeSafeReferenceHelper.h:57
DLLLOCAL T * release()
releases the pointer to the caller
Definition: ReferenceHolder.h:83
parse type: reference to a lvalue expression
Definition: ReferenceNode.h:45
the root namespace of a QoreProgram object
Definition: QoreNamespace.h:397
Helps dereference values outside of locks.
Definition: QoreLibIntern.h:543
DLLLOCAL void add(QoreValue v)
adds a value for dereferencing on exit
Definition: QoreLibIntern.h:568
DLLLOCAL ~SafeDerefHelper()
must be destroyed outside of any locks
Definition: QoreLibIntern.h:549
DLLLOCAL void deref(QoreValue v)
dereferences the value immediately if it cannot throw an exception, or adds it to the list for derefe...
Definition: QoreLibIntern.h:559
typed hash declaration
Definition: TypedHashDecl.h:44
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode)
Definition: common.h:70
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:251
qore_license_t
qore library and module license type identifiers
Definition: common.h:85
std::vector< std::string > name_vec_t
vector of parameter names for parameter lists
Definition: common.h:257
intptr_t qore_offset_t
used for offsets that could be negative
Definition: common.h:76
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:260
std::vector< QoreValue > arg_vec_t
vector of value information for default argument lists
Definition: common.h:254
const qore_type_t NT_LIST
type value for QoreListNode
Definition: node_types.h:50
const qore_type_t NT_PARSE_LIST
type value for QoreParseListNode
Definition: node_types.h:84
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:54
static const ReferenceNode * test_reference_param(const QoreListNode *n, size_t i)
returns a ReferenceNode pointer for the argument position given or 0 if there is no argument there or...
Definition: params.h:65
DLLEXPORT QoreProgram * getProgram()
returns the current QoreProgram
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275
DLLEXPORT void discard(ExceptionSink *xsink)
dereferences any contained AbstractQoreNode pointer and sets to 0; does not modify other values
DLLEXPORT bool derefCanThrowException() const
returns true if a dereference could theoretically throw an exception (an object is reachable from thi...