Qore Programming Language  0.8.11.1
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 - 2014 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 
122 // qore code flags
123 #define QC_NO_FLAGS 0
124 #define QC_NOOP (1 << 0)
125 #define QC_USES_EXTRA_ARGS (1 << 1)
126 #define QC_CONSTANT_INTERN (1 << 2)
127 #define QC_DEPRECATED (1 << 3)
128 #define QC_RET_VALUE_ONLY (1 << 4)
129 #define QC_RUNTIME_NOOP (1 << 5)
130 
131 // composite flags
132 #define QC_CONSTANT (QC_CONSTANT_INTERN | QC_RET_VALUE_ONLY)
133 
134 DLLEXPORT char *make_class_name(const char *fn);
136 
138 DLLEXPORT QoreStringNode *q_sprintf(const class QoreListNode *params, int field, int offset, class ExceptionSink *xsink);
139 
141 DLLEXPORT QoreStringNode *q_vsprintf(const class QoreListNode *params, int field, int offset, class ExceptionSink *xsink);
142 
144 DLLEXPORT struct tm *q_localtime(const time_t *clock, struct tm *tms);
145 
147 DLLEXPORT struct tm *q_gmtime(const time_t *clock, struct tm *tms);
148 
150 DLLEXPORT int64 q_epoch();
151 
153 DLLEXPORT int64 q_epoch_us(int &us);
154 
156 DLLEXPORT int64 q_epoch_ns(int &us);
157 
159 DLLEXPORT char *q_basename(const char *path);
160 
162 DLLEXPORT char *q_basenameptr(const char *path);
163 
165 DLLEXPORT char *q_dirname(const char *path);
166 
168 DLLEXPORT void *q_realloc(void *ptr, size_t size);
169 
170 #if (!defined _WIN32 && !defined __WIN32__) || defined __CYGWIN__
171 DLLEXPORT QoreHashNode *q_getpwuid(uid_t uid);
173 
175 DLLEXPORT QoreHashNode *q_getpwnam(const char *name);
176 
178 DLLEXPORT QoreHashNode *q_getgrgid(uid_t uid);
179 
181 DLLEXPORT QoreHashNode *q_getgrnam(const char *name);
182 
184 
189 int q_uname2uid(const char *name, uid_t &uid);
190 
192 
197 int q_gname2gid(const char *name, gid_t &gid);
198 #endif // ! windows
199 
201 DLLEXPORT void qore_setup_argv(int pos, int argc, char *argv[]);
202 
204 DLLEXPORT qore_license_t qore_get_license();
205 
207 DLLEXPORT void qore_exit_process(int rc);
208 
210 
212 class FeatureList : public safe_dslist<std::string> {
213 private:
215  DLLLOCAL FeatureList(const FeatureList&);
216 
218  DLLLOCAL FeatureList& operator=(const FeatureList&);
219 
220 public:
222  DLLLOCAL FeatureList();
223 
225  DLLLOCAL ~FeatureList();
226 };
227 
229 DLLEXPORT extern FeatureList qoreFeatureList;
230 
232 static inline char *strchrs(const char *str, const char *chars) {
233  while (*str) {
234  if (strchr(chars, *str))
235  return (char *)str;
236  str++;
237  }
238  return 0;
239 }
240 
242 static inline char *strnchr(const char *str, int len, char c) {
243  int i = 0;
244  while (i++ != len) {
245  if (*str == c)
246  return (char *)str;
247  ++str;
248  }
249  return 0;
250 }
251 
253 static inline void strtolower(char *str) {
254  while (*(str)) {
255  (*str) = tolower(*str);
256  str++;
257  }
258 }
259 
261 static inline char *strtoupper(char *str) {
262  char *p = str;
263  while (*(p)) {
264  *p = toupper(*p);
265  p++;
266  }
267  return str;
268 }
269 
271 DLLEXPORT int getSecZeroInt(const AbstractQoreNode *a);
272 
274 DLLEXPORT int64 getSecZeroBigInt(const AbstractQoreNode *a);
275 
277 DLLEXPORT int getSecMinusOneInt(const AbstractQoreNode *a);
278 
280 DLLEXPORT int64 getSecMinusOneBigInt(const AbstractQoreNode *a);
281 
283 DLLEXPORT int getMsZeroInt(const AbstractQoreNode *a);
284 
286 DLLEXPORT int64 getMsZeroBigInt(const AbstractQoreNode *a);
287 
289 DLLEXPORT int getMsMinusOneInt(const AbstractQoreNode *a);
290 
292 DLLEXPORT int64 getMsMinusOneBigInt(const AbstractQoreNode *a);
293 
295 DLLEXPORT int getMicroSecZeroInt(const AbstractQoreNode *a);
296 
298 DLLEXPORT int64 getMicroSecZeroInt64(const AbstractQoreNode *a);
299 
301 static inline bool is_nothing(const AbstractQoreNode *n) {
302  if (!n || n->getType() == NT_NOTHING)
303  return true;
304 
305  return false;
306 }
307 
309 static inline void discard(AbstractQoreNode *n, ExceptionSink *xsink) {
310  if (n)
311  n->deref(xsink);
312 }
313 
314 static inline const char *get_type_name(const AbstractQoreNode *n) {
315  return n ? n->getTypeName() : "NOTHING";
316 }
317 
318 static inline qore_type_t get_node_type(const AbstractQoreNode *n) {
319  return n ? n->getType() : NT_NOTHING;
320 }
321 
322 class BinaryNode;
323 class QoreStringNode;
324 class ExceptionSink;
325 
326 typedef QoreStringNode* (*qore_uncompress_to_string_t)(const BinaryNode* b, const QoreEncoding* enc, ExceptionSink* xsink);
327 
329 DLLEXPORT BinaryNode *qore_deflate(void *ptr, unsigned long len, int level, ExceptionSink *xsink);
331 DLLEXPORT QoreStringNode *qore_inflate_to_string(const BinaryNode *b, const QoreEncoding *enc, ExceptionSink *xsink);
333 DLLEXPORT BinaryNode *qore_inflate_to_binary(const BinaryNode *b, ExceptionSink *xsink);
335 DLLEXPORT BinaryNode *qore_gzip(void *ptr, unsigned long len, int level, ExceptionSink *xsink);
337 DLLEXPORT QoreStringNode *qore_gunzip_to_string(const BinaryNode *bin, const QoreEncoding *enc, ExceptionSink *xsink);
339 DLLEXPORT BinaryNode *qore_gunzip_to_binary(const BinaryNode *bin, ExceptionSink *xsink);
341 DLLEXPORT BinaryNode *qore_bzip2(void *ptr, unsigned long len, int level, ExceptionSink *xsink);
343 DLLEXPORT QoreStringNode *qore_bunzip2_to_string(const BinaryNode *bin, const QoreEncoding *enc, ExceptionSink *xsink);
345 DLLEXPORT BinaryNode *qore_bunzip2_to_binary(const BinaryNode *bin, ExceptionSink *xsink);
346 
348 DLLEXPORT BinaryNode *parseBase64(const char *buf, int len, ExceptionSink *xsink);
349 
351 DLLEXPORT BinaryNode *parseHex(const char *buf, int len, ExceptionSink *xsink);
352 
353 class AbstractQoreZoneInfo;
354 
356 DLLEXPORT const AbstractQoreZoneInfo* findCreateOffsetZone(int seconds_east);
357 
359 
364 DLLEXPORT const AbstractQoreZoneInfo* find_create_timezone(const char* name, ExceptionSink* xsink);
365 
367 DLLEXPORT int tz_get_utc_offset(const AbstractQoreZoneInfo* tz, int64 epoch_offset, bool &is_dst, const char *&zone_name);
369 DLLEXPORT bool tz_has_dst(const AbstractQoreZoneInfo* tz);
371 DLLEXPORT const char* tz_get_region_name(const AbstractQoreZoneInfo* tz);
372 
374 #define QORE_OPT_ATOMIC_OPERATIONS "atomic operations"
375 #define QORE_OPT_STACK_GUARD "stack guard"
377 #define QORE_OPT_SIGNAL_HANDLING "signal handling"
379 #define QORE_OPT_RUNTIME_STACK_TRACE "runtime stack tracing"
381 #define QORE_OPT_LIBRARY_DEBUGGING "library debugging"
383 #define QORE_OPT_SHA224 "openssl sha224"
385 #define QORE_OPT_SHA256 "openssl sha256"
387 #define QORE_OPT_SHA384 "openssl sha384"
389 #define QORE_OPT_SHA512 "openssl sha512"
391 #define QORE_OPT_MDC2 "openssl mdc2"
393 #define QORE_OPT_RC5 "openssl rc5"
395 #define QORE_OPT_MD2 "openssl md2"
397 #define QORE_OPT_TERMIOS "termios"
399 #define QORE_OPT_FILE_LOCKING "file locking"
401 #define QORE_OPT_UNIX_USERMGT "unix user management"
403 #define QORE_OPT_UNIX_FILEMGT "unix file management"
405 #define QORE_OPT_FUNC_ROUND "round()"
407 #define QORE_OPT_FUNC_TIMEGM "timegm()"
409 #define QORE_OPT_FUNC_SETEUID "seteuid()"
411 #define QORE_OPT_FUNC_SETEGID "setegid()"
413 #define QORE_OPT_FUNC_SYSTEM "system()"
415 #define QORE_OPT_FUNC_KILL "kill()"
417 #define QORE_OPT_FUNC_FORK "fork()"
419 #define QORE_OPT_FUNC_GETPPID "getppid()"
421 #define QORE_OPT_FUNC_STATVFS "statvfs()"
423 #define QORE_OPT_FUNC_SETSID "setsid()"
425 #define QORE_OPT_FUNC_IS_EXECUTABLE "is_executable()"
427 
429 #define QO_OPTION 0
430 #define QO_ALGORITHM 1
431 #define QO_FUNCTION 2
432 
435  const char* option;
436  const char* constant;
437  int type;
438  bool value;
439 };
440 
442 DLLEXPORT QoreStringNode *q_strerror(int errnum);
444 DLLEXPORT void q_strerror(QoreString &str, int errnum);
445 
447 DLLEXPORT extern const qore_option_s *qore_option_list;
449 DLLEXPORT extern size_t qore_option_list_size;
450 
452 
456 DLLEXPORT QoreStringNode *qore_reassign_signal(int sig, const char *name);
457 
459 #define QORE_MAX(a, b) ((a) > (b) ? (a) : (b))
460 
462 #define QORE_MIN(a, b) ((a) < (b) ? (a) : (b))
463 
464 #define QORE_PARAM_NO_ARG (NULL)
465 
466 // define QORE_PATH_MAX
467 #ifndef QORE_PATH_MAX
468 #ifdef _XOPEN_PATH_MAX
469 #define QORE_PATH_MAX _XOPEN_PATH_MAX
470 #else
471 #define QORE_PATH_MAX 1024
472 #endif
473 #endif
474 
476 
478 DLLEXPORT void parse_set_time_zone(const char *zone);
479 
481 DLLEXPORT int qore_usleep(int64 usecs);
482 
484 DLLEXPORT bool q_path_is_readable(const char* path);
485 
487 DLLEXPORT bool q_parse_bool(const AbstractQoreNode* n);
488 
490 DLLEXPORT bool q_parse_bool(const char* str);
491 
493 DLLEXPORT bool q_get_option_value(const char* opt);
494 
496 DLLEXPORT bool q_get_option_constant_value(const char* opt);
497 
499 DLLEXPORT const char* q_mode_to_perm(mode_t mode, QoreString& perm);
500 
501 #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 ("+01:00") ...
STL-like list containing all presently-loaded Qore features.
Definition: QoreLib.h:212
defines string encoding functions in Qore
Definition: QoreEncoding.h:80
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 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 "exit()", 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...
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 QoreStringNode * q_vsprintf(const class QoreListNode *params, int field, int offset, class ExceptionSink *xsink)
a string formatting function that works with Qore data structures
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:309
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...
bool value
the value of the option
Definition: QoreLib.h:438
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's a stri...
DLLLOCAL FeatureList()
initialized by the library, constructor not exported
DLLEXPORT struct tm * q_localtime(const time_t *clock, struct tm *tms)
thread-safe version of "localtime()"
signed short qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:67
virtual DLLEXPORT const char * getTypeName() const =0
returns the type name as a c string
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:50
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:48
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:435
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:434
static bool is_nothing(const AbstractQoreNode *n)
to check if an AbstractQoreNode object is NOTHING
Definition: QoreLib.h:301
DLLEXPORT struct tm * q_gmtime(const time_t *clock, struct tm *tms)
thread-safe version of "gmtime()"
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 QoreStringNode * q_sprintf(const class QoreListNode *params, int field, int offset, class ExceptionSink *xsink)
a string formatting function that works with Qore data structures
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:261
qore_license_t
qore library and module license type identifiers
Definition: common.h:82
const char * constant
name of the constant for this option
Definition: QoreLib.h:436
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
container for holding Qore-language exception information and also for registering a "thread_exit" 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:253
DLLEXPORT void deref(ExceptionSink *xsink)
decrements the reference count and calls derefImpl() if there_can_be_only_one is false, otherwise does nothing
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:437
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:294
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:242
DLLEXPORT int64 q_epoch()
returns the seconds from the epoch
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 const AbstractQoreZoneInfo * findCreateOffsetZone(int seconds_east)
returns a time zone for the given time zone UTC offset
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:232
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...