Chapter 4. System Namespaces and Class Library

Table 4.1. Qore Class List

Name

Description

File

For reading and writing files.

Dir

For handling of directories, listing files, and creating/removing subdirectories.

FtpClient

For communicating with FTP servers.

GetOpt

For processing command-line options.

Program

For parsing and executing application-embedded or user-supplied logic.

Socket

For communication with IPv4 sockets with and without TSL/SSL encryption.

TermIOS

Used when getting or setting terminal settings.

HTTPClient

For communication with HTTP servers with and without TSL/SSL encryption.

SSLCertificate

For working with X.509 certificates.

SSLPrivateKey

For working with private key data.

SQL::Datasource

For working with databases; provides the user interface to qore DBI drivers.

SQL::DatasourcePool

Provides transparent per-thread, per-transaction Datasource connection pooling.

SQL::SQLStatement

The class providing the most flexibilty for executing SQL on a database server.

Thread::AbstractSmartLock

The abstract base class for locks that support the internal API for use with the Condition class.

Thread::AutoGate

A helper class for the Gate class for exception-safe Gate handling.

Thread::AutoLock

A helper class for the Mutex class for exception-safe Mutex handling.

Thread::AutoReadLock

A helper class for the RWLock class for exception-safe read lock handling.

Thread::AutoWriteLock

A helper class for the RWLock class for exception-safe write lock handling.

Thread::Condition

For blocking a thread until a condition becomes true.

Thread::Counter

For blocking a thread until a counter becomes zero.

Thread::Gate

A reentrant thread lock.

Thread::Mutex

A simple thread lock.

Thread::Queue

A blocking, thread-safe queue class, useful for message passing (can also be used as a stack).

Thread::RMutex

DEPRECATED: A reentrant thread lock; use Gate instead.

Thread::RWLock

A read-write thread lock.

Thread::Sequence

A thread-safe integral counter.


4.1. Qore Constants

The following constants are defined in the Qore namespace.

Table 4.2. Build and Version Constants

Key

Type

Description

PlatformOS

string

The operating system used to build the Qore library.

PlatformCPU

string

The CPU used as a target for the Qore library build.

VersionString

string

The full version string for this version of the Qore library.

VersionMajor

int

An integer giving the Qore library's major version number.

VersionMinor

int

An integer giving the Qore library's minor version number.

VersionSub

int

An integer giving the Qore library's release version number.

Build

int

An integer giving the Qore library's subversion revision number.

BuildHost

string

A string giving information about the host used to compile the Qore library.

Compiler

string

The compiler used to build the Qore library.

CFLAGS

string

The compiler flags used to compile the Qore library.

LDFLAGS

string

The linker flags used to link the Qore library.


Table 4.3. Machine Constants

Key

Type

Description

MACHINE_MSB

bool

If True the machine stores memory with MSB byte order, False if it uses LSB byte order.


Table 4.4. Library Options

Name

Type

Description

HAVE_ATOMIC_OPERATIONS

bool

Indicates if the Qore library supports fast atomic reference counting. Note that if this constant is False, atomic operations are supported by mutexes and are therefore slower than with native atomic reference counting operations.

HAVE_FILE_LOCKING

bool

Indicates if the Qore library supports file locking; currently this depends on UNIX-style file locking with the fnctl() function.

HAVE_FORK

bool

Indicates if the fork() function is available. This constant is always False on native Windows ports.

HAVE_GETPPID

bool

Indicates if the getppid() function is available. This constant is always False on native Windows ports.

HAVE_IS_EXECUTABLE

bool

Indicates if the Qore library supports the is_executable() function; currently this function is only available when running on UNIX or UNIX-like platforms.

HAVE_KILL

bool

Indicates if the kill() function is available. This constant is always False on native Windows ports.

HAVE_MDC2

bool

Indicates if the openssl library used to build the qore library supported the MDC2 algorithm and therefore if the MDC2() and MDC2_bin() functions are available.

HAVE_MD2

bool

Indicates if the openssl library used to build the qore library supported the MD2 algorithm and therefore if the MD2() and MD2_bin() functions are available.

HAVE_RC5

bool

Indicates if the openssl library used to build the qore library supported the RC5 encryption algorithm and therefore if the rc5_encrypt_cbc(), rc5_decrypt_cbc() and rc5_encrypt_cbc_to_string() functions are available.

HAVE_ROUND

bool

Indicates if the round() function is available; the availability of this function depends on the presence of the C-library's round() function.

HAVE_RUNTIME_THREAD_STACK_TRACE

bool

Indicates if active thread stack tracing has been enabled as a debugging option and if the getAllThreadCallStacks() function is available.

HAVE_SETEUID

bool

Indicates if the seteuid() function is available; the availabilty of this function depends on the system's underlying C-library. This constant is always False on native Windows ports.

HAVE_SETEGID

bool

Indicates if the setegid() function is available. This constant is always False on native Windows ports.

HAVE_SETSID

bool

Indicates if the setsid() function is available on the current platform. This constant is always False on native Windows ports.

HAVE_SHA224

bool

Indicates if the openssl library used to build the qore library supported the SHA224 algorithm and therefore if the SHA224() and SHA224_bin() functions are available.

HAVE_SHA256

bool

Indicates if the openssl library used to build the qore library supported the SHA256 algorithm and therefore if the SHA256() and SHA256_bin() functions are available.

HAVE_SHA384

bool

Indicates if the openssl library used to build the qore library supported the SHA384 algorithm and therefore if the SHA384() and SHA384_bin() functions are available.

HAVE_SHA512

bool

Indicates if the openssl library used to build the qore library supported the SHA512 algorithm and therefore if the SHA512() and SHA512_bin() functions are available.

HAVE_STACK_GUARD

bool

Indicates if protection against stack overruns is provided

HAVE_STATVFS

bool

Indicates if the statvfs() function is available. This constant is always False on native Windows ports.

HAVE_SYSTEM

bool

Indicates if the system() function is available.

HAVE_TERMIOS

bool

Indicates if the TermIOS class is available. This constant is always False on native Windows ports.

HAVE_TIMEGM

bool

Always True (as of qore 0.8.0+): indicates that the timegm() function is available.

HAVE_UNIX_FILEMGT

bool

Indicates if UNIX-style file management functionality is available (ex: chown(), Dir::chgrp(), etc). This constant is always False on native Windows ports.

HAVE_UNIX_USERMGT

bool

Indicates if UNIX-style user management functionality is available (ex: getuid(), setuid(), getgid(), setgid(), etc). This constant is always False on native Windows ports.


Table 4.5. Boolean Constants in the Qore Namespace

Name

Type

Description

True

bool

True

False

bool

False


Table 4.6. I/O Constants in the Qore Namespace

Name

Type

Description

stdin

File Object

Standard input File object.

stdout

File Object

Standard output File object.

stderr

File Object

Standard error File object.


Table 4.7. Warning Constants

Name

Type

Description

WARN_ALL

int

Enables all warnings

WARN_CALL_WITH_TYPE_ERRORS

int

Enables warnings when the parser determines that the argument types of a function or method call are such that the operation is guaranteed to produce a constant value. See also call-with-type-errors.

WARN_DEFAULT

int

The default warning mask made up of: QP_WARN_UNKNOWN_WARNING | QP_WARN_UNREACHABLE_CODE | QP_WARN_NONEXISTENT_METHOD_CALL | QP_WARN_INVALID_OPERATION | QP_WARN_CALL_WITH_TYPE_ERRORS | QP_WARN_RETURN_VALUE_IGNORED | QP_WARN_DEPRECATED | QP_WARN_DUPLICATE_HASH_KEY | QP_WARN_DUPLICATE_BLOCK_VARS.

WARN_DEPRECATED

int

Enables a warning when deprecated code is used. See also deprecated.

WARN_DUPLICATE_BLOCK_VARS

int

Enables a warning when a program declares a local variable more than once in the same block; note that this is not a warning but rather an error when %assume-local or %new-style parse options are set. See also duplicate-block-vars.

WARN_DUPLICATE_GLOBAL_VARS

int

Indicates that the embedded code has declared the same global variable more than once. See also duplicate-global-vars.

WARN_DUPLICATE_HASH_KEY

int

Enables a warning when an immediate hash is declared and at least one of the keys is repeated. See also duplicate-hash-key.

WARN_DUPLICATE_LOCAL_VARS

int

Enables a warning when a local variable with the same name is declared in a subblock (ie another local variable with the same name is reachable in the same lexical scope); note that this warning can raise false positives if the programmer is used to redeclaring the same variable names in subblocks. See also WARN_DUPLICATE_BLOCK_VARS and duplicate-local-vars.

WARN_EXCESS_ARGS

int

Enables a warning when a function or method call is made with more arguments than are used by the function or method. See also excess-args.

WARN_INVALID_OPERATION

int

Indicates that the embedded code performs some operation that is guaranteed to produce no result (for example, using the [] operator on an integer value). See also invalid-operation.

WARN_NONE

int

No warnings are enabled with this constant.

WARN_NONEXISTENT_METHOD_CALL

int

Indicates that the embedded code is calling an unknown method in a class; this may be vaild if the calling method is only called from a derived class that actually implements the method. See also non-existent-method-call.

WARN_RETURN_VALUE_IGNORED

int

Enables a warning when a function or method call is made with no side effects and the return value is ignored. See also return-value-ignored.

WARN_UNDECLARED_VAR

int

Indicates that the embedded code referenced an undeclared variable that will be assumed to be a global variable. See also undeclared-var.

WARN_UNKNOWN_WARNING

int

Indicates that the embedded code tried to enable or disable an unknown warning. See also unknown-warning.

WARN_UNREACHABLE_CODE

int

Indicates that code cannot be reached (for example; code in the same local block after an unconditional return or thread_exit statement). See also unreachable-code.

WARN_WARNING_MASK_UNCHANGED

int

This warning means that the embedded code tried to change the warning mask, but it was locked, so the warning mask was actually unchanged. See also warning-mask-unchanged.


Table 4.8. Event Constants

Name

Value

Description

EVENT_PACKET_READ

1

Raised when a network packet is received.

EVENT_PACKET_SENT

2

Raised when a network packet is sent.

EVENT_HTTP_CONTENT_LENGTH

3

Raised when the HTTP "Content-Length" header is received.

EVENT_HTTP_CHUNKED_START

4

Raised when HTTP chunked data is about to be received.

EVENT_HTTP_CHUNKED_END

5

Raised when all HTTP chunked data has been received.

EVENT_HTTP_REDIRECT

6

Raised when an HTTP redirect message is received.

EVENT_CHANNEL_CLOSED

7

Raised when a socket is closed.

EVENT_DELETED

8

Raised when the object being monitored is deleted.

EVENT_FTP_SEND_MESSAGE

9

Raised immediately before an FTP control message is sent.

EVENT_FTP_MESSAGE_RECEIVED

10

Raised when an FTP reply is received on the control channel.

EVENT_HOSTNAME_LOOKUP

11

Raised when a hostname lookup is attempted.

EVENT_HOSTNAME_RESOLVED

12

Raised when a hostname lookup is resolved.

EVENT_HTTP_SEND_MESSAGE

13

Raised when an HTTP message is sent.

EVENT_HTTP_MESSAGE_RECEIVED

14

Raised when an HTTP message is received.

EVENT_HTTP_FOOTERS_RECEIVED

15

Raised when HTTP footers are received.

EVENT_HTTP_CHUNKED_DATA_RECEIVED

16

Raised when a block of HTTP chunked data is received.

EVENT_HTTP_CHUNK_SIZE

17

Raised when the next chunk size for HTTP chunked data is known.

EVENT_CONNECTING

18

Raised right before a socket connection attempt is made.

EVENT_CONNECTED

19

Raised when the socket connection has been established.

EVENT_START_SSL

20

Raised when socket SSL negotiation starts.

EVENT_SSL_ESTABLISHED

21

Raised when SSL communication has been negotiated and established.

EVENT_OPEN_FILE

22

Raised right before a file is opened.

EVENT_FILE_OPENED

23

Raised when a file has been successfully opened.

EVENT_DATA_READ

24

Raised when data has been read from a file.

EVENT_DATA_WRITTEN

25

Raised when data has been written to a file.

EVENT_MAP

Event Map Hash

This constant is a hash that maps event numbers to string descriptions as described in this table.


Table 4.9. Event Map Hash Constant

Key

String Value

EVENT_PACKET_READ ("1")

"PACKET_READ"

EVENT_PACKET_SENT ("2")

"PACKET_SENT"

EVENT_HTTP_CONTENT_LENGTH ("3")

"HTTP_CONTENT_LENGTH"

EVENT_HTTP_CHUNKED_START ("4")

"HTTP_CHUNKED_START"

EVENT_HTTP_CHUNKED_END ("5")

"HTTP_CHUNKED_END"

EVENT_HTTP_REDIRECT ("6")

"HTTP_REDIRECT"

EVENT_CHANNEL_CLOSED ("7")

"CHANNEL_CLOSED"

EVENT_DELETED ("8")

"DELETED"

EVENT_FTP_SEND_MESSAGE ("9")

"FTP_SEND_MESSAGE"

EVENT_FTP_MESSAGE_RECEIVED ("10")

"FTP_MESSAGE_RECEIVED"

EVENT_HOSTNAME_LOOKUP ("11")

"HOSTNAME_LOOKUP"

EVENT_HOSTNAME_RESOLVED ("12")

"HOSTNAME_RESOLVED"

EVENT_HTTP_SEND_MESSAGE ("13")

"HTTP_SEND_MESSAGE"

EVENT_HTTP_MESSAGE_RECEIVED ("14")

"HTTP_MESSAGE_RECEIVED"

EVENT_HTTP_FOOTERS_RECEIVED ("15")

"HTTP_FOOTERS_RECEIVED"

EVENT_HTTP_CHUNKED_DATA_RECEIVED ("16")

"HTTP_CHUNKED_DATA_RECEIVED"

EVENT_HTTP_CHUNK_SIZE ("17")

"HTTP_CHUNK_SIZE"

EVENT_CONNECTING ("18")

"CONNECTING"

EVENT_CONNECTED ("19")

"CONNECTED"

EVENT_START_SSL ("20")

"START_SSL"

EVENT_SSL_ESTABLISHED ("21")

"SSL_ESTABLISHED"

EVENT_OPEN_FILE ("22")

"OPEN_FILE"

EVENT_FILE_OPENED ("23")

"FILE_OPENED"

EVENT_DATA_READ ("24")

"DATA_READ"

EVENT_DATA_WRITTEN ("25")

"DATA_WRITTEN"


Table 4.10. Event Source Constants

Name

Description

SOURCE_SOCKET

For events raised from the Socket class.

SOURCE_HTTPCLIENT

For events raised from the HTTPClient class.

SOURCE_FTPCLIENT

For events raised from the FtpClient class.

SOURCE_FILE

For events raised from the File class.


Table 4.11. Network Address Family Constants

Name

Description

AF_INET

Designates an IPv4 network addresses.

AF_INET6

Designates an IPv6 network addresses.

AF_UNIX

Designates a local socket file name (interchangeable with AF_LOCAL).

AF_LOCAL

POSIX synonym for AF_UNIX; designates a local socket file name.

AF_UNSPEC

Designates an unspecified address family.


Table 4.12. Socket Type Constants

Name

Description

SOCK_STREAM

TCP sockets: sequenced, reliable, two-way connection based byte streams.

SOCK_DGRAM

UDP Sockets: connectionless, unreliable messages of a fixed maximum length.

SOCK_RAW

Raw sockets, provide access to networking internals, only available to the superuser.


Table 4.13. Network Address Information Constants

Name

Description

AI_ADDRCONFIG

If the AI_ADDRCONFIG bit is set, IPv4 addresses shall be returned only if an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system.

AI_ALL

If the AI_ALL bit is set with the AI_V4MAPPED bit, then getaddrinfo() shall return all matching IPv6 and IPv4 addresses. The AI_ALL bit without the AI_V4MAPPED bit is ignored.

AI_CANONNAME

If the AI_CANONNAME bit is set, a successful call to getaddrinfo() will return a string containing the canonical name of the specified hostname in the "canonname" element of the first addrinfo hash returned.

AI_NUMERICHOST

If the AI_NUMERICHOST bit is set, it indicates that hostname should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.

AI_NUMERICSERV

If the AI_NUMERICSERV bit is set, then a non-null servname string supplied shall be a numeric port string. Otherwise, a QOREADDRINFO-GETINFO-ERROR exception will be thrown due to the EAI_NONAME error raised internally. This bit shall prevent any type of name resolution service (for example, NIS+) from being invoked (this constant is operating system dependent; it is not available on all operating systems; for example, it is not available on Solaris 8).

AI_PASSIVE

If the AI_PASSIVE bit is set it indicates that the returned socket address structure is intended for use in a call to Socket::bind(). In this case, if the hostname argument is NOTHING, then the IP address portion of the socket address structure will be internally set to INADDR_ANY for an IPv4 address or IN6ADDR_ANY_INIT for an IPv6 address. If the AI_PASSIVE bit is not set, the returned socket address structure will be ready for use in a call to Socket::connect(). The IP address portion of the socket address structure will be set to the loopback address if hostname is NOTHING and AI_PASSIVE is not set.

AI_V4MAPPED

If the AI_V4MAPPED flag is specified along with an ai_family of AF_INET6, then getaddrinfo() shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses. The AI_V4MAPPED flag shall be ignored unless ai_family equals AF_INET6.


Table 4.14. Terminal Attributes Local Mode Constants

Name

Description

ECHOKE

visual erase for line kill

ECHOE

visually erase chars

ECHO

enable echoing

ECHONL

echo NL even if ECHO is off

ECHOPRT

visual erase mode for hardcopy

ISIG

enable signals INTR, QUIT, [D]SUSP

ICANON

canonicalize input lines

IEXTEN

enable DISCARD and LNEXT

TOSTOP

stop background jobs from output

FLUSHO

output being flushed (state)

PENDIN

retype pending input (state)

NOFLSH

don't flush after interrupt

ALTWERASE

use alternate WERASE algorithm (this constant is only available on some systems; do not use in portable programs)

EXTPROC

external processing (this constant is only available on some systems; do not use in portable programs)

NOKERNINFO

no kernel output from VSTATUS (this constant is only available on some systems; do not use in portable programs)


Table 4.15. Terminal Attributes Control Mode Constants

Name

Description

CSIZE

character size mask

CS5

5 bits (pseudo)

CS6

6 bits

CS7

7 bits

CS8

8 bits

CSTOPB

send 2 stop bits

CREAD

enable receiver

PARENB

parity enable

PARODD

odd parity, else even

HUPCL

hang up on last close

CLOCAL

ignore modem status lines

CCTS_OFLOW

CTS flow control of output (this constant is only available on some systems; do not use in portable programs)

CRTSCTS

same as CCTS_OFLOW (this constant is only available on some systems; do not use in portable programs)

CRTS_IFLOW

RTS flow control of input (this constant is only available on some systems; do not use in portable programs)

MDMBUF

flow control output via Carrier (this constant is only available on some systems; do not use in portable programs)


Table 4.16. Terminal Attributes Output Mode Constants

Name

Description

OPOST

enable following output processing

ONLCR

map NL to CR-NL (ala CRMOD)

OCRNL

map CR to NL

ONOCR

No CR output at column 0

ONLRET

NL performs CR function

OXTABS

expand tabs to spaces (this constant is only available on some systems; do not use in portable programs)

ONOEOT

discard EOT's ctrl-D on output (this constant is only available on some systems; do not use in portable programs)

OLCUC

translate lower case to upper case (this constant is only available on some systems; do not use in portable programs)


Table 4.17. Terminal Attributes Input Mode Constants

Name

Description

IGNBRK

ignore BREAK condition

BRKINT

map BREAK to SIGINTR

IGNPAR

ignore (discard) parity errors

PARMRK

mark parity and framing errors

INPCK

enable checking of parity errors

ISTRIP

strip 8th bit off chars

INLCR

map NL into CR

IGNCR

ignore CR

ICRNL

map CR to NL (ala CRMOD)

IXON

enable output flow control

IXOFF

enable input flow control

IXANY

any char will restart after stop

IMAXBEL

ring bell on input queue full

IUCLC

translate upper case to lower case (this constant is only available on some systems; do not use in portable programs)


Table 4.18. Terminal Attributes Control Character Constants

Name

Special Character

Default Value

VEOF

EOF

^D

VEOL

EOL

_POSIX_VDISABLE

VEOL2

EOL2

_POSIX_VDISABLE

VERASE

ERASE

^? `177'

VWERASE

WERASE

^W

VKILL

KILL

^U

VINTR

INTR

^C

VQUIT

QUIT

^\ `34'

VSUSP

SUSP

^Z

VSTART

START

^Q

VSTOP

STOP

^S

VLNEXT

LNEXT

^V

VMIN

n/a

1

VTIME

n/a

0

VREPRINT

REPRINT

^R (this constant is only available on some systems; do not use in portable programs)

VDSUSP

DSUSP

^Y (this constant is only available on some systems; do not use in portable programs)

VDISCARD

DISCARD

^O (this constant is only available on some systems; do not use in portable programs)

VSTATUS

n/a

^T (this constant is only available on some systems; do not use in portable programs)


The X509_VerificationReasons_Hash is a constant in the Qore namespace that maps verfication code strings (as returned from FtpClient::verifyPeerCertificate() and Socket::verifyPeerCertificate()) to textual descriptions.

Table 4.19. X506_VerificationReasons Hash

Key

Value

X509_V_OK

"OK"

X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT

"Unable to get issuer certificate"

X509_V_ERR_UNABLE_TO_GET_CRL

"Unable to get certificate CRL"

X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE

"Unable to decrypt certificate's signature. This means that the actual signature value could not be determined rather than it not matching the expected value; this is only meaningful for RSA"

X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE

"Unable to decrypt CRL's signature"

X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY

"Unable to decode issuer public key (SubjectPublicKeyInfo)"

X509_V_ERR_CERT_SIGNATURE_FAILURE

"Certificate signature failure; the signature of the certificate is invalid"

X509_V_ERR_CRL_SIGNATURE_FAILURE

"CRL signature failure; the signature of the certificate is invalid"

X509_V_ERR_CERT_NOT_YET_VALID

"Certificate is not yet valid"

X509_V_ERR_CERT_HAS_EXPIRED

"Certificate has expired"

X509_V_ERR_CRL_NOT_YET_VALID

"CRL is not yet valid"

X509_V_ERR_CRL_HAS_EXPIRED

"CRL has expired"

X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD

"Format error in certificate's notBefore field (invalid time)"

X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD

"Format error in certificate's notAfter field (invalid time)"

X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD

"Format error in CRL's lastUpdate field (invalid time)"

X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD

"Format error in CRL's nextUpdate field (invalid time)"

X509_V_ERR_OUT_OF_MEM

"Out of memory error"

X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT

"Certificate is self-signed and cannot be found in the trusted list"

X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN

"Self signed certificate in certificate chain"

X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY

"Unable to get local issuer certificate. This normally means the list of trusted certificates is not complete"

X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE

"Unable to verify the first certificate"

X509_V_ERR_CERT_CHAIN_TOO_LONG

"Certificate chain too long"

X509_V_ERR_CERT_REVOKED

"Certificate has been revoked"

X509_V_ERR_INVALID_CA

"Invalid CA certificate"

X509_V_ERR_PATH_LENGTH_EXCEEDED

"The basicConstraints pathlength parameter has been exceeded"

X509_V_ERR_INVALID_PURPOSE

"The certificate cannot be used for the specified purpose"

X509_V_ERR_CERT_UNTRUSTED

"Root CA is not marked as trusted for the specified purpose"

X509_V_ERR_CERT_REJECTED

"Root CA is marked to reject the specified purpose"

X509_V_ERR_SUBJECT_ISSUER_MISMATCH

"The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate"

X509_V_ERR_AKID_SKID_MISMATCH

"The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier of the current certificate"

X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH

"Issuer name and serial number of candidate certificate do not match the authority key identifier of the current certificate"

X509_V_ERR_KEYUSAGE_NO_CERTSIGN

"The keyUsage extension does not permit certificate signing"

X509_V_ERR_APPLICATION_VERIFICATION

"Verification failure"


The following gives a list of signal constants that may be present in Qore. Signal constants and their values are system-dependent; only signals that the host system defines will be present in Qore, therefore not all of the signals in the following list will be present in any given version of Qore. All signal constants are integers.

Table 4.20. Signal Constants in the Qore Namespace

Name

Description

SIGHUP

Hangup signal.

SIGINT

Interrupt signal.

SIGQUIT

Quit signal.

SIGILL

Illegal instruction signal.

SIGTRAP

Trace trap signal.

SIGABRT

Abort signal.

SIGPOLL

Pollable event signal.

SIGIOT

Synonym for SIBABRT

SIGEMT

EMT instruction signal.

SIGFPE

Floating-point exception signal.

SIGKILL

Kill signal (cannot be caught)

SIGBUS

Bus error signal.

SIGSEGV

Segmentation violation signal.

SIGSYS

Bad argument to a system call.

SIGPIPE

Write on pipe with no reader (this signal is always ignored in Qore).

SIGALRM

Alarm clock signal.

SIGTERM

Software termination signal.

SIGURG

Urgent condition on I/O channel.

SIGSTOP

Sendable stop signal (not from tty).

SIGTSTP

Stop signal from tty.

SIGCONT

Continue a stopped process.

SIGCHLD

To parent on child stop or exit.

SIGTTIN

To reader's process group on background tty read.

SIGTTOU

To writer's process group on background tty write.

SIGIO

Input/Output possible signal.

SIGXCPU

Exceeded CPU time limit.

SIGXFSZ

Exceeded file size limit.

SIGVTALRM

Virtual time alarm signal.

SIGPROF

Profiling time alarm signal.

SIGWINCH

Window size changes signal.

SIGINFO

Information request signal.

SIGUSR1

User-defined signal 1.

SIGUSR2

User-defined signal 2.

SIGSTKFLT

Stack fault on coprocessor.

SIGCLD

Synonym for SIGCHLD on some systems.

SIGPWR

Power failure signal.

SIGLOST

Resource (ex: file lock) lost signal.

SIGWAITING

(Solaris) Waiting signal.

SIGLWP

(Solaris) Light-weight process (thread) signal.

SIGFREEZE

(Solaris) Checkpoint freeze signal.

SIGTHAW

(Solaris) Checkpoint freeze thaw signal.

SIGCANCEL

(Solaris) Cancel signal.

SIGXRES

(Solaris) Resource control exceeded.

SIGJVM1

(Solaris) Java virtual machine 1 signal.

SIGJVM2

(Solaris) Java virtual machine 2 signal.


There are two special system-specific constants mapping signal names to signal number and vice-versa as given in the following table.

Table 4.21. Signal Mapping Hash Constants in the Qore Namespace

Name

Description

SignalToName

A hash mapping signal numbers to signal names (ex: SignalToName."1" gives the signal name corresponding to signal number 1).

NameToSignal

A hash mapping signal names to signal numbers (ex: NameToSignal."SIGINT" gives the signal number corresponding to "SIGINT").


The Err namespace contains error constants, returned by the errno() function.

Table 4.22. Error Constants in the Err Namespace

Name

Type

Description

Err::*

int

System-dependent integer ERRNO constants (ex: ENOMEM, etc)


Table 4.23. Exception Constants in the Qore Namespace

Name

Type

Description

ET_System

string

Exception Type System: used for system exceptions.

ET_User

string

Exception Type User: used for user exceptions (thrown using the throw statement.

CT_User

int

Call Type User: used for user function/method calls in a call stack.

CT_Builtin

int

Call Type Builtin: used for builtin function/method calls in a call stack.

CT_NewThread

int

Call Type New Thread: used in a call stack when a new thread is started with the background expression.

CT_Rethrow

int

Call Type Rethrow: a marker for a rethrown exception in a call stack.


Table 4.24. Regular Expression Option Constants in the Qore Namespace

Name

Type and Value

Description

RE_Caseless

int: 1

Ignores case when matching regular expressions, equivalent to /i

RE_MultiLine

int: 2

makes start-of-line (^) or end-of-line ($) match after or before any newline in the subject string, equivalent to /m

RE_DotAll

int: 4

makes a dot (.) match a newline character, equivalent to /s

RE_Extended

int: 8

ignores whitespace characters and enables comments prefixed by #, equivalent to /x

RE_Global

int: 0x100000000LL

replace all matches globally in the string, equivalent to /g


4.1. static File::hlstat()

Synopsis

Returns a hash of file status values for the path passed; symbolic links are not followed; information is returned about symbolic links (see File::hstat() for a version of this method that follows symbolic links).

If any errors occur, a FILE-HLSTAT-ERROR exception is thrown.

See also hlstat() for a normal function returns NOTHING instead of throwing an exception when errors occur.

Prototype

static hash File::hlstat(string $path)

Example
my string $type = File::hlstat("/bin/sh").type; # returns "REGULAR"
Restrictions

Not available with PO_NO_FILESYSTEM

Table 4.138. Arguments and Return Values for File::hlstat()

Argument Type

Return Type

Description

string $path

hash

Returns a hash of file status values for the file passed or NOTHING if the stat() call fails; symbolic links are not followed (information is returned about symbolic links). See also hlstat(). See Stat Hash below for a description of the hash returned by this method.


Table 4.139. Exceptions Thrown by File::hlstat()

err

desc

FILE-HLSTAT-ERROR

lstat() call failed.


4.2. static File::hstat()

Synopsis

Returns a hash of file status values for the file passed; symbolic links are followed; see File::hlstat() to retrieve information about a symbolic link.

If any errors occur, a FILE-HSTAT-ERROR exception is thrown.

See also hstat() for a normal function returns NOTHING instead of throwing an exception when errors occur.

Prototype

static hash File::hstat(string $path)

Example
my hash $h = File::hstat("/bin/sh");
Restrictions

Not available with PO_NO_FILESYSTEM

Table 4.140. Arguments and Return Values for File::hstat()

Argument Type

Return Type

Description

string $path

hash

Returns a hash of file status values for the file passed; symbolic links are followed; if any errors occur, an exception is thrown. See also hstat(). See Stat Hash for a description of the hash returned by this method.


Table 4.141. Exceptions Thrown by File::hstat()

err

desc

FILE-HSTAT-ERROR

stat() call failed.


4.3. static File::lstat()

Synopsis

Returns a list of file status values for the file or symbolic link passed. Does not follow symbolic links, but rather returns filesystem information for symbolic links.

If any errors occur, a FILE-LSTAT-ERROR exception is thrown.

See also lstat() for a normal function returns NOTHING instead of throwing an exception when errors occur.

Prototype

static list File::lstat(string $path)

Example
my list $list = File::lstat("/bin/sh");
Restrictions

Not available with PO_NO_FILESYSTEM

Table 4.142. Arguments and Return Values for File::lstat()

Argument Type

Return Type

Description

string $path

list

Returns a list of file status values for the file passed. See Stat List for a description of the list returned by this function.


Table 4.143. Exceptions Thrown by File::lstat()

err

desc

FILE-LSTAT-ERROR

lstat() call failed.


4.4. static File::stat()

Synopsis

Returns a list of file status values for the path passed, following any symbolic links.

If any errors occur, a FILE-STAT-ERROR exception is thrown.

See also stat() for a normal function returns NOTHING instead of throwing an exception when errors occur.

Prototype

static list File::stat(string $path)

Example
my int $mode = File::stat($filepath)[2];
Restrictions

Not available with PO_NO_FILESYSTEM

Table 4.144. Arguments and Return Values for File::stat()

Argument Type

Return Type

Description

string $path

list

Returns a list of file status values for the file passed, following symbolic links; an exception is thrown if any errors occur. See Stat List below for a description of the list returned by this method.


Table 4.145. Exceptions Thrown by File::stat()

err

desc

FILE-STAT-ERROR

stat() call failed.


4.5. static File::statvfs()

Synopsis

Returns a hash of filesystem status values for the path passed.

If any errors occur, a FILE-STATVFS-ERROR exception is thrown.

See also statvfs() for a normal function returns NOTHING instead of throwing an exception when errors occur.

Prototype

static hash File::statvfs(string $path)

Example
my hash $h = File::statvfs("/tmp")
Platform Availability

HAVE_STATVFS

Restrictions

Not available with PO_NO_FILESYSTEM

Table 4.146. Arguments and Return Values for File::statvfs()

Argument Type

Return Type

Description

string $path

hash

Returns a hash of filesystem status values for the file or directory name passed; an exception is thrown if any errors occur. See also statvfs(). See Filesystem Status Hash for a description of the hash returned by this function.


Table 4.147. Exceptions Thrown by File::statvfs()

err

desc

FILE-STATVFS-ERROR

statvfs() call failed.

MISSING-FEATURE-ERROR

This exception is thrown when the method is not available on the runtime platform; for maximum portability, check the constant HAVE_STATVFS before calling this function.