Qore Programming Language - C/C++ Library  0.8.12.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreLib.h
Go to the documentation of this file.
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreLib.h
4 
5  Qore Programming Language
6 
7  Copyright (C) 2003 - 2015 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_QORELIB_H
33 
34 #define _QORE_QORELIB_H
35 
36 #include <qore/common.h>
37 #include <qore/QoreThreadLock.h>
38 #include <qore/qore_bitopts.h>
39 #include <qore/safe_dslist>
40 
41 #include <time.h>
42 #include <string.h>
43 #include <strings.h>
44 #include <stdlib.h>
45 #include <stdio.h>
46 #include <ctype.h>
47 #include <sys/types.h>
48 
53 #undef _QORE_HAS_QORE_XMLNODE_CLASS
55 
57 #undef _QORE_HAS_QORE_XMLREADER_CLASS
58 
60 #undef _QORE_HAS_QORE_XMLDOC_CLASS
61 
63 #define _QORE_HAS_HARD_TYPING 1
64 
66 #define _QORE_HAS_DBI_EXECRAW 1
67 
69 #define _QORE_HAS_TIME_ZONES 1
70 
72 #define _QORE_HAS_THREAD_RESOURCE_IDS 1
73 
75 #define _QORE_HAS_PREPARED_STATMENT_API 1
76 
78 #define _QORE_HAS_DATASOURCE_ACTIVETRANSACTION 1
79 
81 #define _QORE_HAS_DBI_SELECT_ROW 1
82 
84 #define _QORE_HAS_NUMBER_TYPE 1
85 
87 #define _QORE_HAS_PATH_IS_READABLE 1
88 
90 #define _QORE_HAS_DBI_OPTIONS 1
91 
93 #define _QORE_HAS_FIND_CREATE_TIMEZONE 1
94 
96 #define _QORE_HAS_NUMBER_CONS_WITH_PREC 1
97 
99 #define _QORE_HAS_FILE_OBJECT_HELPER 1
100 
102 #define _QORE_HAS_QUEUE_OBJECT_HELPER 1
103 
105 #define _QORE_HAS_QOREHTTPCLIENTOBJECT 1
106 
108 #define _QORE_HAS_DBI_DESCRIBE 1
109 
111 #define _QORE_HAS_DBI_EVENTS 1
112 
114 #define _QORE_HAS_QUEUE_OBJECT 1
115 
117 #define _QORE_HAS_SOCKET_PERF_API 1
118 
120 #define _QORE_HAS_QL_MIT 1
121 
123 #define _QORE_HAS_DATETIME_ADD_SECONDS_TO 1
124 
125 // qore code flags
126 #define QC_NO_FLAGS 0
127 #define QC_NOOP (1 << 0)
128 #define QC_USES_EXTRA_ARGS (1 << 1)
129 #define QC_CONSTANT_INTERN (1 << 2)
130 #define QC_DEPRECATED (1 << 3)
131 #define QC_RET_VALUE_ONLY (1 << 4)
132 #define QC_RUNTIME_NOOP (1 << 5)
133 
134 // composite flags
135 #define QC_CONSTANT (QC_CONSTANT_INTERN | QC_RET_VALUE_ONLY)
136 
137 class BinaryNode;
138 class QoreStringNode;
139 class ExceptionSink;
140 
142 DLLEXPORT char* make_class_name(const char* fn);
143 
145 DLLEXPORT QoreStringNode* q_sprintf(const QoreListNode* params, int field, int offset, ExceptionSink* xsink);
146 
148 DLLEXPORT QoreStringNode* q_vsprintf(const QoreListNode* params, int field, int offset, ExceptionSink* xsink);
149 
151 DLLEXPORT QoreStringNode* q_sprintf(const QoreValueList* params, int field, int offset, ExceptionSink* xsink);
152 
154 DLLEXPORT QoreStringNode* q_vsprintf(const QoreValueList* params, int field, int offset, ExceptionSink* xsink);
155 
157 DLLEXPORT struct tm* q_localtime(const time_t* clock, struct tm* tms);
158 
160 DLLEXPORT struct tm* q_gmtime(const time_t* clock, struct tm* tms);
161 
163 DLLEXPORT int64 q_epoch();
164 
166 DLLEXPORT int64 q_epoch_us(int &us);
167 
169 DLLEXPORT int64 q_epoch_ns(int &us);
170 
172 DLLEXPORT char* q_basename(const char* path);
173 
175 DLLEXPORT char* q_basenameptr(const char* path);
176 
178 DLLEXPORT char* q_dirname(const char* path);
179 
181 DLLEXPORT void* q_realloc(void* ptr, size_t size);
182 
183 #ifndef _Q_WINDOWS
184 DLLEXPORT QoreHashNode* q_getpwuid(uid_t uid);
186 
188 DLLEXPORT QoreHashNode* q_getpwnam(const char* name);
189 
191 DLLEXPORT QoreHashNode* q_getgrgid(uid_t uid);
192 
194 DLLEXPORT QoreHashNode* q_getgrnam(const char* name);
195 
197 
202 int q_uname2uid(const char* name, uid_t &uid);
203 
205 
210 int q_gname2gid(const char* name, gid_t &gid);
211 #endif // ! windows
212 
214 DLLEXPORT void qore_setup_argv(int pos, int argc, char* argv[]);
215 
217 DLLEXPORT qore_license_t qore_get_license();
218 
220 DLLEXPORT void qore_exit_process(int rc);
221 
223 
225 class FeatureList : public safe_dslist<std::string> {
226 private:
228  DLLLOCAL FeatureList(const FeatureList&);
229 
231  DLLLOCAL FeatureList& operator=(const FeatureList&);
232 
233 public:
235  DLLLOCAL FeatureList();
236 
238  DLLLOCAL ~FeatureList();
239 };
240 
242 DLLEXPORT extern FeatureList qoreFeatureList;
243 
245 static inline char* strchrs(const char* str, const char* chars) {
246  while (*str) {
247  if (strchr(chars, *str))
248  return (char* )str;
249  str++;
250  }
251  return 0;
252 }
253 
255 static inline char* strnchr(const char* str, int len, char c) {
256  int i = 0;
257  while (i++ != len) {
258  if (*str == c)
259  return (char* )str;
260  ++str;
261  }
262  return 0;
263 }
264 
266 static inline void strtolower(char* str) {
267  while (*(str)) {
268  (*str) = tolower(*str);
269  str++;
270  }
271 }
272 
274 static inline char* strtoupper(char* str) {
275  char* p = str;
276  while (*(p)) {
277  *p = toupper(*p);
278  p++;
279  }
280  return str;
281 }
282 
284 DLLEXPORT int getSecZeroInt(const AbstractQoreNode* a);
285 
287 DLLEXPORT int64 getSecZeroBigInt(const AbstractQoreNode* a);
288 
290 DLLEXPORT int getSecMinusOneInt(const AbstractQoreNode* a);
291 
293 DLLEXPORT int64 getSecMinusOneBigInt(const AbstractQoreNode* a);
294 
296 DLLEXPORT int getMsZeroInt(const AbstractQoreNode* a);
297 
299 DLLEXPORT int64 getMsZeroBigInt(const AbstractQoreNode* a);
300 
302 DLLEXPORT int getMsMinusOneInt(const AbstractQoreNode* a);
303 
305 DLLEXPORT int64 getMsMinusOneBigInt(const AbstractQoreNode* a);
306 
308 DLLEXPORT int getMicroSecZeroInt(const AbstractQoreNode* a);
309 
311 DLLEXPORT int64 getMicroSecZeroInt64(const AbstractQoreNode* a);
312 
314 static inline bool is_nothing(const AbstractQoreNode* n) {
315  if (!n || n->getType() == NT_NOTHING)
316  return true;
317 
318  return false;
319 }
320 
322 static inline void discard(AbstractQoreNode* n, ExceptionSink* xsink) {
323  if (n)
324  n->deref(xsink);
325 }
326 
327 static inline const char* get_type_name(const AbstractQoreNode* n) {
328  return n ? n->getTypeName() : "nothing";
329 }
330 
331 static inline qore_type_t get_node_type(const AbstractQoreNode* n) {
332  return n ? n->getType() : NT_NOTHING;
333 }
334 
335 typedef QoreStringNode* (*qore_uncompress_to_string_t)(const BinaryNode* b, const QoreEncoding* enc, ExceptionSink* xsink);
336 
338 DLLEXPORT BinaryNode* qore_deflate(void* ptr, unsigned long len, int level, ExceptionSink* xsink);
340 DLLEXPORT QoreStringNode* qore_inflate_to_string(const BinaryNode* b, const QoreEncoding* enc, ExceptionSink* xsink);
342 DLLEXPORT BinaryNode* qore_inflate_to_binary(const BinaryNode* b, ExceptionSink* xsink);
344 DLLEXPORT BinaryNode* qore_gzip(void* ptr, unsigned long len, int level, ExceptionSink* xsink);
346 DLLEXPORT QoreStringNode* qore_gunzip_to_string(const BinaryNode* bin, const QoreEncoding* enc, ExceptionSink* xsink);
348 DLLEXPORT BinaryNode* qore_gunzip_to_binary(const BinaryNode* bin, ExceptionSink* xsink);
350 DLLEXPORT BinaryNode* qore_bzip2(void* ptr, unsigned long len, int level, ExceptionSink* xsink);
352 DLLEXPORT QoreStringNode* qore_bunzip2_to_string(const BinaryNode* bin, const QoreEncoding* enc, ExceptionSink* xsink);
354 DLLEXPORT BinaryNode* qore_bunzip2_to_binary(const BinaryNode* bin, ExceptionSink* xsink);
355 
357 DLLEXPORT BinaryNode* parseBase64(const char* buf, int len, ExceptionSink* xsink);
358 
360 DLLEXPORT BinaryNode* parseHex(const char* buf, int len, ExceptionSink* xsink);
361 
362 class AbstractQoreZoneInfo;
363 
365 DLLEXPORT const AbstractQoreZoneInfo* findCreateOffsetZone(int seconds_east);
366 
368 
373 DLLEXPORT const AbstractQoreZoneInfo* find_create_timezone(const char* name, ExceptionSink* xsink);
374 
376 DLLEXPORT int tz_get_utc_offset(const AbstractQoreZoneInfo* tz, int64 epoch_offset, bool &is_dst, const char* &zone_name);
378 DLLEXPORT bool tz_has_dst(const AbstractQoreZoneInfo* tz);
380 DLLEXPORT const char* tz_get_region_name(const AbstractQoreZoneInfo* tz);
381 
383 #define QORE_OPT_ATOMIC_OPERATIONS "atomic operations"
384 #define QORE_OPT_STACK_GUARD "stack guard"
386 #define QORE_OPT_SIGNAL_HANDLING "signal handling"
388 #define QORE_OPT_RUNTIME_STACK_TRACE "runtime stack tracing"
390 #define QORE_OPT_LIBRARY_DEBUGGING "library debugging"
392 #define QORE_OPT_SHA "openssl sha"
394 #define QORE_OPT_SHA224 "openssl sha224"
396 #define QORE_OPT_SHA256 "openssl sha256"
398 #define QORE_OPT_SHA384 "openssl sha384"
400 #define QORE_OPT_SHA512 "openssl sha512"
402 #define QORE_OPT_MDC2 "openssl mdc2"
404 #define QORE_OPT_RC5 "openssl rc5"
406 #define QORE_OPT_MD2 "openssl md2"
408 #define QORE_OPT_TERMIOS "termios"
410 #define QORE_OPT_FILE_LOCKING "file locking"
412 #define QORE_OPT_UNIX_USERMGT "unix user management"
414 #define QORE_OPT_UNIX_FILEMGT "unix file management"
416 #define QORE_OPT_DETERMINISTIC_GC "deterministic GC"
418 #define QORE_OPT_FUNC_ROUND "round()"
420 #define QORE_OPT_FUNC_TIMEGM "timegm()"
422 #define QORE_OPT_FUNC_SETEUID "seteuid()"
424 #define QORE_OPT_FUNC_SETEGID "setegid()"
426 #define QORE_OPT_FUNC_SYSTEM "system()"
428 #define QORE_OPT_FUNC_KILL "kill()"
430 #define QORE_OPT_FUNC_FORK "fork()"
432 #define QORE_OPT_FUNC_GETPPID "getppid()"
434 #define QORE_OPT_FUNC_STATVFS "statvfs()"
436 #define QORE_OPT_FUNC_SETSID "setsid()"
438 #define QORE_OPT_FUNC_IS_EXECUTABLE "is_executable()"
440 
442 #define QO_OPTION 0
443 #define QO_ALGORITHM 1
444 #define QO_FUNCTION 2
445 
448  const char* option;
449  const char* constant;
450  int type;
451  bool value;
452 };
453 
455 DLLEXPORT QoreStringNode* q_strerror(int errnum);
457 DLLEXPORT void q_strerror(QoreString &str, int errnum);
458 
460 DLLEXPORT extern const qore_option_s* qore_option_list;
462 DLLEXPORT extern size_t qore_option_list_size;
463 
465 
469 DLLEXPORT QoreStringNode* qore_reassign_signal(int sig, const char* name);
470 
472 #define QORE_MAX(a, b) ((a) > (b) ? (a) : (b))
473 
475 #define QORE_MIN(a, b) ((a) < (b) ? (a) : (b))
476 
477 #define QORE_PARAM_NO_ARG (NULL)
478 
479 // define QORE_PATH_MAX
480 #ifndef QORE_PATH_MAX
481 #ifdef _XOPEN_PATH_MAX
482 #define QORE_PATH_MAX _XOPEN_PATH_MAX
483 #else
484 #define QORE_PATH_MAX 1024
485 #endif
486 #endif
487 
489 
491 DLLEXPORT void parse_set_time_zone(const char* zone);
492 
494 DLLEXPORT int qore_usleep(int64 usecs);
495 
497 DLLEXPORT void qore_disable_gc();
498 
500 DLLEXPORT bool qore_is_gc_enabled();
501 
503 DLLEXPORT bool q_path_is_readable(const char* path);
504 
506 DLLEXPORT bool q_parse_bool(const AbstractQoreNode* n);
507 
509 DLLEXPORT bool q_parse_bool(const char* str);
510 
512 DLLEXPORT bool q_get_option_value(const char* opt);
513 
515 DLLEXPORT bool q_get_option_constant_value(const char* opt);
516 
518 DLLEXPORT const char* q_mode_to_perm(mode_t mode, QoreString& perm);
519 
521 int q_getcwd(QoreString& cwd);
522 
524 DLLEXPORT bool q_absolute_path_unix(const char* path);
525 
527 DLLEXPORT bool q_absolute_path_windows(const char* path);
528 
530 DLLEXPORT bool q_absolute_path(const char* path);
531 
533 DLLEXPORT void q_normalize_path(QoreString& path, const char* cwd = 0);
534 
536 DLLEXPORT int q_realpath(const QoreString& path, QoreString& rv, ExceptionSink* xsink = 0);
537 
539 DLLEXPORT void* q_memmem(const void* big, size_t big_len, const void* little, size_t little_len);
540 
541 #endif // _QORE_QORELIB_H
DLLEXPORT const qore_option_s * qore_option_list
list of qore options
DLLEXPORT int64 q_epoch_us(int &us)
returns the seconds and microseconds from the epoch
DLLEXPORT const AbstractQoreZoneInfo * find_create_timezone(const char *name, ExceptionSink *xsink)
returns a time zone for the given region name or UTC offset given as a string (&quot;+01:00&quot;) ...
STL-like list containing all presently-loaded Qore features.
Definition: QoreLib.h:225
int q_getcwd(QoreString &cwd)
returns the current working directory in the given string; -1 is returned if an error occurred...
defines string encoding functions in Qore
Definition: QoreEncoding.h:85
templated class for a double-ended singly-linked list that can be safely read from multiple threads w...
Definition: safe_dslist:137
DLLEXPORT BinaryNode * qore_deflate(void *ptr, unsigned long len, int level, ExceptionSink *xsink)
compresses data with the DEFLATE algorithm
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:49
DLLEXPORT bool q_absolute_path_unix(const char *path)
returns true if the given string is an absolute path on UNIX systems
DLLEXPORT void qore_setup_argv(int pos, int argc, char *argv[])
sets up the Qore ARGV and QORE_ARGV values
DLLEXPORT bool tz_has_dst(const AbstractQoreZoneInfo *tz)
returns true if the zone has daylight savings time ever
DLLEXPORT void qore_exit_process(int rc)
instead of calling &quot;exit()&quot;, call qore_exit_process() to exit without risking a crash if other thread...
DLLEXPORT char * make_class_name(const char *fn)
function to try and make a class name out of a file path, returns a new string that must be free()ed ...
DLLEXPORT int getSecMinusOneInt(const AbstractQoreNode *a)
for getting an integer number of seconds, with -1 as the default, from either a relative time value o...
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreValueList.h:45
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:55
const qore_type_t NT_NOTHING
type value for QoreNothingNode
Definition: node_types.h:42
DLLEXPORT QoreStringNode * qore_gunzip_to_string(const BinaryNode *bin, const QoreEncoding *enc, ExceptionSink *xsink)
gunzips compressed data to a string
DLLEXPORT QoreHashNode * q_getgrnam(const char *name)
thread-safe version of getgrnam(): returns a Qore hash of the group information from the group name i...
DLLEXPORT BinaryNode * qore_bunzip2_to_binary(const BinaryNode *bin, ExceptionSink *xsink)
decompresses bzip2 data to a binary
DLLEXPORT int getMicroSecZeroInt(const AbstractQoreNode *a)
for getting an integer number of microseconds, with 0 as the default, from either a relative time val...
static void discard(AbstractQoreNode *n, ExceptionSink *xsink)
to deref an AbstractQoreNode (when the pointer may be 0)
Definition: QoreLib.h:322
DLLEXPORT int64 getSecZeroBigInt(const AbstractQoreNode *a)
for getting an integer number of seconds, with 0 as the default, from either a relative time value or...
DLLEXPORT QoreStringNode * q_vsprintf(const QoreListNode *params, int field, int offset, ExceptionSink *xsink)
a string formatting function that works with Qore data structures
bool value
the value of the option
Definition: QoreLib.h:451
DLLEXPORT BinaryNode * parseBase64(const char *buf, int len, ExceptionSink *xsink)
parses a string of base64-encoded data and returns a BinaryNode
DLLEXPORT const char * tz_get_region_name(const AbstractQoreZoneInfo *tz)
returns the reion name for the given time zone
DLLEXPORT QoreStringNode * qore_bunzip2_to_string(const BinaryNode *bin, const QoreEncoding *enc, ExceptionSink *xsink)
decompresses bzip2 data to a string
DLLEXPORT int64 q_epoch_ns(int &us)
returns the seconds and nanoseconds from the epoch
DLLEXPORT BinaryNode * qore_gzip(void *ptr, unsigned long len, int level, ExceptionSink *xsink)
gzips data
DLLEXPORT bool q_parse_bool(const AbstractQoreNode *n)
tries to parse a boolean value - standard conversion or uses q_parse_bool(const char*) if it&#39;s a stri...
DLLLOCAL FeatureList()
initialized by the library, constructor not exported
DLLEXPORT int q_realpath(const QoreString &path, QoreString &rv, ExceptionSink *xsink=0)
normalizes the given path and resolves any symlinks
DLLEXPORT struct tm * q_localtime(const time_t *clock, struct tm *tms)
thread-safe version of &quot;localtime()&quot;
DLLEXPORT void qore_disable_gc()
this function will cause garbage collection to be disabled
virtual DLLEXPORT const char * getTypeName() const =0
returns the type name as a c string
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:82
Qore&#39;s string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
DLLEXPORT int getMsZeroInt(const AbstractQoreNode *a)
for getting an integer number of milliseconds, with 0 as the default, from either a relative time val...
const char * option
name of the option
Definition: QoreLib.h:448
DLLEXPORT int qore_usleep(int64 usecs)
use this function instead of usleep(), as usleep() is not signal-safe on some platforms (ex: Solaris ...
definition of the elements in the qore_option_list
Definition: QoreLib.h:447
static bool is_nothing(const AbstractQoreNode *n)
to check if an AbstractQoreNode object is NOTHING
Definition: QoreLib.h:314
DLLEXPORT struct tm * q_gmtime(const time_t *clock, struct tm *tms)
thread-safe version of &quot;gmtime()&quot;
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
DLLEXPORT char * q_basename(const char *path)
thread-safe basename function (resulting pointer must be free()ed)
DLLEXPORT QoreHashNode * q_getpwuid(uid_t uid)
thread-safe version of getpwuid(): returns a Qore hash of the passwd information from the uid if poss...
DLLEXPORT QoreStringNode * qore_reassign_signal(int sig, const char *name)
allows a module to take over ownership of a signal
DLLEXPORT QoreHashNode * q_getgrgid(uid_t uid)
thread-safe version of getgrgid(): returns a Qore hash of the group information from the gid if possi...
DLLEXPORT char * q_dirname(const char *path)
thread-safe dirname function (resulting pointer must be free()ed)
DLLEXPORT int getSecZeroInt(const AbstractQoreNode *a)
for getting an integer number of seconds, with 0 as the default, from either a relative time value or...
DLLEXPORT int64 getMsZeroBigInt(const AbstractQoreNode *a)
for getting an integer number of milliseconds, with 0 as the default, from either a relative time val...
static char * strtoupper(char *str)
convert a string to upper-case in place
Definition: QoreLib.h:274
qore_license_t
qore library and module license type identifiers
Definition: common.h:83
const char * constant
name of the constant for this option
Definition: QoreLib.h:449
DLLEXPORT bool q_get_option_value(const char *opt)
returns the boolean value of qore library the given option name; false if the option is unknown ...
DLLEXPORT int64 getMicroSecZeroInt64(const AbstractQoreNode *a)
for getting an integer number of microseconds, with 0 as the default, from either a relative time val...
DLLEXPORT BinaryNode * qore_bzip2(void *ptr, unsigned long len, int level, ExceptionSink *xsink)
compresses data with bzip2
DLLEXPORT QoreStringNode * q_sprintf(const QoreListNode *params, int field, int offset, ExceptionSink *xsink)
a string formatting function that works with Qore data structures
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:43
DLLEXPORT bool q_path_is_readable(const char *path)
platform-independent API that tells if the given path is readable by the current user ...
DLLEXPORT QoreStringNode * q_strerror(int errnum)
returns the error string as a QoreStringNode
DLLEXPORT const char * q_mode_to_perm(mode_t mode, QoreString &perm)
concatenates UNIX-style permissions to perm and from mode and returns a string giving the file type ...
DLLEXPORT BinaryNode * qore_gunzip_to_binary(const BinaryNode *bin, ExceptionSink *xsink)
gunzips compressed data to a binary
static void strtolower(char *str)
convert a string to lower-case in place
Definition: QoreLib.h:266
DLLEXPORT void deref(ExceptionSink *xsink)
decrements the reference count and calls derefImpl() if there_can_be_only_one is false, otherwise does nothing
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
DLLEXPORT qore_license_t qore_get_license()
returns the license type that the library has been initialized under
DLLEXPORT int64 getMsMinusOneBigInt(const AbstractQoreNode *a)
for getting an integer number of milliseconds, with -1 as the default, from either a relative time va...
DLLEXPORT int64 getSecMinusOneBigInt(const AbstractQoreNode *a)
for getting an integer number of seconds, with -1 as the default, from either a relative time value o...
int q_uname2uid(const char *name, uid_t &uid)
thread-safe way to lookup a uid from a username
DLLEXPORT void parse_set_time_zone(const char *zone)
to set the time zone from the command line
int type
the type of the option
Definition: QoreLib.h:450
DLLEXPORT QoreStringNode * qore_inflate_to_string(const BinaryNode *b, const QoreEncoding *enc, ExceptionSink *xsink)
decompresses data compressed with the DEFLATE algorithm to a string
DLLLOCAL qore_type_t getType() const
returns the data type
Definition: AbstractQoreNode.h:297
DLLEXPORT void * q_memmem(const void *big, size_t big_len, const void *little, size_t little_len)
finds a memory sequence in a larger memory sequence
DLLEXPORT int getMsMinusOneInt(const AbstractQoreNode *a)
for getting an integer number of milliseconds, with -1 as the default, from either a relative time va...
static char * strnchr(const char *str, int len, char c)
find a character in a string up to len
Definition: QoreLib.h:255
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:68
DLLEXPORT int64 q_epoch()
returns the seconds from the epoch
DLLEXPORT bool q_absolute_path_windows(const char *path)
returns true if the given string is an absolute path on Windows systems
int q_gname2gid(const char *name, gid_t &gid)
thread-safe way to lookup a gid from a group name
DLLLOCAL ~FeatureList()
destructor not exported
DLLEXPORT bool q_absolute_path(const char *path)
returns true if the given string is an absolute path on the current platform
DLLEXPORT const AbstractQoreZoneInfo * findCreateOffsetZone(int seconds_east)
returns a time zone for the given time zone UTC offset
DLLEXPORT void q_normalize_path(QoreString &path, const char *cwd=0)
normalizes the given path for the current platform in place (makes absolute, removes &quot;...
DLLEXPORT bool qore_is_gc_enabled()
returns true if garbage collection is enabled, false if not
DLLEXPORT char * q_basenameptr(const char *path)
returns a pointer within the same string
DLLEXPORT bool q_get_option_constant_value(const char *opt)
returns the boolean value of qore library the given name of the constant for the option; false if the...
DLLEXPORT BinaryNode * parseHex(const char *buf, int len, ExceptionSink *xsink)
parses a string of hex characters and returns a BinaryNode
DLLEXPORT void * q_realloc(void *ptr, size_t size)
frees memory if there is an allocation error
DLLEXPORT QoreHashNode * q_getpwnam(const char *name)
thread-safe version of getpwnam(): returns a Qore hash of the passwd information from the username if...
static char * strchrs(const char *str, const char *chars)
find one of any characters in a string
Definition: QoreLib.h:245
DLLEXPORT BinaryNode * qore_inflate_to_binary(const BinaryNode *b, ExceptionSink *xsink)
decompresses data compressed with the DEFLATE algorithm to a binary
DLLEXPORT size_t qore_option_list_size
number of elements in the option list
DLLEXPORT FeatureList qoreFeatureList
list of qore features
holds arbitrary binary data
Definition: BinaryNode.h:41
DLLEXPORT int tz_get_utc_offset(const AbstractQoreZoneInfo *tz, int64 epoch_offset, bool &is_dst, const char *&zone_name)
returns the UTC offset and local time zone name for the given time given as seconds from the epoch (1...