text:
<?php

// Start of imap v.

/**
 * (PHP 4, PHP 5)

 * Open an IMAP stream to a mailbox
 * @link http://php.net/manual/en/function.imap-open.php
 * @param string $mailbox

 * A mailbox name consists of a server and a mailbox path on this server.
 * The special name INBOX stands for the current users
 * personal mailbox. Mailbox names that contain international characters
 * besides those in the printable ASCII space have to be encoded width
 * imap_utf7_encode.
 *

 *

 * The server part, which is enclosed in '{' and '}', consists of the servers
 * name or ip address, an optional port (prefixed by ':'), and an optional
 * protocol specification (prefixed by '/').
 *

 *

 * The server part is mandatory in all mailbox
 * parameters.
 *

 *

 * All names which start with { are remote names, and are
 * in the form "{" remote_system_name [":" port] [flags] "}"
 * [mailbox_name] where:
 * remote_system_name - Internet domain name or
 * bracketed IP address of server.
 * @param string $username

 * The user name
 *

 * @param string $password

 * The password associated with the username
 *

 * @param int $options [optional]

 * The options are a bit mask with one or more of
 * the following:
 * OP_READONLY - Open mailbox read-only
 * @param int $n_retries [optional]

 * Number of maximum connect attempts
 *

 * @param array $params [optional]

 * Connection parameters, the following (string) keys maybe used
 * to set one or more connection parameters:
 * DISABLE_AUTHENTICATOR - Disable authentication properties
 * @return resource an IMAP stream on success or FALSE on error.
 * @jms-builtin
 */
function imap_open ($mailbox, $username, $password, $options = 'NIL', $n_retries = 0, array $params = null) {}

/**
 * (PHP 4, PHP 5)

 * Reopen IMAP stream to new mailbox
 * @link http://php.net/manual/en/function.imap-reopen.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param int $options [optional]

 * The options are a bit mask with one or more of
 * the following:
 * OP_READONLY - Open mailbox read-only
 * @param int $n_retries [optional]

 * Number of maximum connect attempts
 *

 * @return bool TRUE if the stream is reopened, FALSE otherwise.
 * @jms-builtin
 */
function imap_reopen ($imap_stream, $mailbox, $options = 0, $n_retries = 0) {}

/**
 * (PHP 4, PHP 5)

 * Close an IMAP stream
 * @link http://php.net/manual/en/function.imap-close.php
 * @param resource $imap_stream
 * @param int $flag [optional]

 * If set to CL_EXPUNGE, the function will silently
 * expunge the mailbox before closing, removing all messages marked for
 * deletion. You can achieve the same thing by using
 * imap_expunge
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_close ($imap_stream, $flag = 0) {}

/**
 * (PHP 4, PHP 5)

 * Gets the number of messages in the current mailbox
 * @link http://php.net/manual/en/function.imap-num-msg.php
 * @param resource $imap_stream
 * @return int Return the number of messages in the current mailbox, as an integer.
 * @jms-builtin
 */
function imap_num_msg ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Gets the number of recent messages in current mailbox
 * @link http://php.net/manual/en/function.imap-num-recent.php
 * @param resource $imap_stream
 * @return int the number of recent messages in the current mailbox, as an
 * integer.
 * @jms-builtin
 */
function imap_num_recent ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Returns headers for all messages in a mailbox
 * @link http://php.net/manual/en/function.imap-headers.php
 * @param resource $imap_stream
 * @return array an array of string formatted with header info. One
 * element per mail message.
 * @jms-builtin
 */
function imap_headers ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Read the header of the message
 * @link http://php.net/manual/en/function.imap-headerinfo.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param int $fromlength [optional]

 * Number of characters for the fetchfrom property.
 * Must be greater than or equal to zero.
 *

 * @param int $subjectlength [optional]

 * Number of characters for the fetchsubject property
 * Must be greater than or equal to zero.
 *

 * @param string $defaulthost [optional]
 * @return object the information in an object with following properties:
 * toaddress - full to: line, up to 1024 characters
 * to - an array of objects from the To: line, with the following
 * properties: personal, adl,
 * mailbox, and host
 * fromaddress - full from: line, up to 1024 characters
 * from - an array of objects from the From: line, with the following
 * properties: personal, adl,
 * mailbox, and host
 * ccaddress - full cc: line, up to 1024 characters
 * cc - an array of objects from the Cc: line, with the following
 * properties: personal, adl,
 * mailbox, and host
 * bccaddress - full bcc: line, up to 1024 characters
 * bcc - an array of objects from the Bcc: line, with the following
 * properties: personal, adl,
 * mailbox, and host
 * reply_toaddress - full Reply-To: line, up to 1024 characters
 * reply_to - an array of objects from the Reply-To: line, with the following
 * properties: personal, adl,
 * mailbox, and host
 * senderaddress - full sender: line, up to 1024 characters
 * sender - an array of objects from the Sender: line, with the following
 * properties: personal, adl,
 * mailbox, and host
 * return_pathaddress - full Return-Path: line, up to 1024 characters
 * return_path - an array of objects from the Return-Path: line, with the
 * following properties: personal,
 * adl, mailbox, and
 * host
 * remail -
 * date - The message date as found in its headers
 * Date - Same as date
 * subject - The message subject
 * Subject - Same a subject
 * in_reply_to -
 * message_id -
 * newsgroups -
 * followup_to -
 * references -
 * Recent - R if recent and seen, N
 * if recent and not seen, ' ' if not recent.
 * Unseen - U if not seen AND not recent, ' ' if seen
 * OR not seen and recent
 * Flagged - F if flagged, ' ' if not flagged
 * Answered - A if answered, ' ' if unanswered
 * Deleted - D if deleted, ' ' if not deleted
 * Draft - X if draft, ' ' if not draft
 * Msgno - The message number
 * MailDate -
 * Size - The message size
 * udate - mail message date in Unix time
 * fetchfrom - from line formatted to fit fromlength
 * characters
 * fetchsubject - subject line formatted to fit
 * subjectlength characters
 * @jms-builtin
 */
function imap_headerinfo ($imap_stream, $msg_number, $fromlength = 0, $subjectlength = 0, $defaulthost = null) {}

/**
 * (PHP 4, PHP 5)

 * Parse mail headers from a string
 * @link http://php.net/manual/en/function.imap-rfc822-parse-headers.php
 * @param string $headers

 * The parsed headers data
 *

 * @param string $defaulthost [optional]

 * The default host name
 *

 * @return object an object similar to the one returned by
 * imap_header, except for the flags and other
 * properties that come from the IMAP server.
 * @jms-builtin
 */
function imap_rfc822_parse_headers ($headers, $defaulthost = "UNKNOWN") {}

/**
 * (PHP 4, PHP 5)

 * Returns a properly formatted email address given the mailbox, host, and personal info
 * @link http://php.net/manual/en/function.imap-rfc822-write-address.php
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param string $host

 * The email host part
 *

 * @param string $personal

 * The name of the account owner
 *

 * @return string a string properly formatted email address as defined in RFC2822.
 * @jms-builtin
 */
function imap_rfc822_write_address ($mailbox, $host, $personal) {}

/**
 * (PHP 4, PHP 5)

 * Parses an address string
 * @link http://php.net/manual/en/function.imap-rfc822-parse-adrlist.php
 * @param string $address

 * A string containing addresses
 *

 * @param string $default_host

 * The default host name
 *

 * @return array an array of objects. The objects properties are:
 *

 *

 * mailbox - the mailbox name (username)
 * host - the host name
 * personal - the personal name
 * adl - at domain source route
 * @jms-builtin
 */
function imap_rfc822_parse_adrlist ($address, $default_host) {}

/**
 * (PHP 4, PHP 5)

 * Read the message body
 * @link http://php.net/manual/en/function.imap-body.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param int $options [optional]

 * The optional options are a bit mask
 * with one or more of the following:
 * FT_UID - The msg_number is a UID
 * @return string the body of the specified message, as a string.
 * @jms-builtin
 */
function imap_body ($imap_stream, $msg_number, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Read the structure of a specified body section of a specific message
 * @link http://php.net/manual/en/function.imap-bodystruct.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param string $section

 * The body section to read
 *

 * @return object the information in an object, for a detailed description
 * of the object structure and properties see
 * imap_fetchstructure.
 * @jms-builtin
 */
function imap_bodystruct ($imap_stream, $msg_number, $section) {}

/**
 * (PHP 4, PHP 5)

 * Fetch a particular section of the body of the message
 * @link http://php.net/manual/en/function.imap-fetchbody.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param string $section

 * The part number. It is a string of integers delimited by period which
 * index into a body part list as per the IMAP4 specification
 *

 * @param int $options [optional]

 * A bitmask with one or more of the following:
 * FT_UID - The msg_number is a UID
 * @return string a particular section of the body of the specified messages as a
 * text string.
 * @jms-builtin
 */
function imap_fetchbody ($imap_stream, $msg_number, $section, $options = 0) {}

/**
 * (PHP 5 >= 5.3.6)

 * Fetch MIME headers for a particular section of the message
 * @link http://php.net/manual/en/function.imap-fetchmime.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param string $section

 * The part number. It is a string of integers delimited by period which
 * index into a body part list as per the IMAP4 specification
 *

 * @param int $options [optional]

 * A bitmask with one or more of the following:
 * FT_UID - The msg_number is a UID
 * @return string the MIME headers of a particular section of the body of the specified messages as a
 * text string.
 * @jms-builtin
 */
function imap_fetchmime ($imap_stream, $msg_number, $section, $options = 0) {}

/**
 * (PHP 5 >= 5.1.3)

 * Save a specific body section to a file
 * @link http://php.net/manual/en/function.imap-savebody.php
 * @param resource $imap_stream
 * @param mixed $file

 * The path to the saved file as a string, or a valid file descriptor
 * returned by fopen.
 *

 * @param int $msg_number

 * The message number
 *

 * @param string $part_number [optional]

 * The part number. It is a string of integers delimited by period which
 * index into a body part list as per the IMAP4 specification
 *

 * @param int $options [optional]

 * A bitmask with one or more of the following:
 * FT_UID - The msg_number is a UID
 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_savebody ($imap_stream, $file, $msg_number, $part_number = "", $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Returns header for a message
 * @link http://php.net/manual/en/function.imap-fetchheader.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param int $options [optional]

 * The possible options are:
 * FT_UID - The msgno
 * argument is a UID
 * @return string the header of the specified message as a text string.
 * @jms-builtin
 */
function imap_fetchheader ($imap_stream, $msg_number, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Read the structure of a particular message
 * @link http://php.net/manual/en/function.imap-fetchstructure.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param int $options [optional]

 * This optional parameter only has a single option,
 * FT_UID, which tells the function to treat the
 * msg_number argument as a
 * UID.
 *

 * @return object an object includes the envelope, internal date, size, flags and
 * body structure along with a similar object for each mime attachment. The
 * structure of the returned objects is as follows:
 *

 *

 *

 * Returned Objects for imap_fetchstructure
 *

 * type
 * Primary body type
 *

 *

 * encoding
 * Body transfer encoding
 *

 *

 * ifsubtype
 * TRUE if there is a subtype string
 *

 *

 * subtype
 * MIME subtype
 *

 *

 * ifdescription
 * TRUE if there is a description string
 *

 *

 * description
 * Content description string
 *

 *

 * ifid
 * TRUE if there is an identification string
 *

 *

 * id
 * Identification string
 *

 *

 * lines
 * Number of lines
 *

 *

 * bytes
 * Number of bytes
 *

 *

 * ifdisposition
 * TRUE if there is a disposition string
 *

 *

 * disposition
 * Disposition string
 *

 *

 * ifdparameters
 * TRUE if the dparameters array exists
 *

 *

 * dparameters
 * An array of objects where each object has an
 * "attribute" and a "value"
 * property corresponding to the parameters on the
 * Content-disposition MIME
 * header.
 *

 *

 * ifparameters
 * TRUE if the parameters array exists
 *

 *

 * parameters
 * An array of objects where each object has an
 * "attribute" and a "value"
 * property.
 *

 *

 * parts
 * An array of objects identical in structure to the top-level
 * object, each of which corresponds to a MIME body
 * part.
 *

 *

 *

 *

 *

 * Primary body type (may vary with used library)
 *
0	text

 *
1	multipart

 *
2	message

 *
3	application

 *
4	audio

 *
5	image

 *
6	video

 *
7	other

 *

 *

 *

 *

 * Transfer encodings (may vary with used library)
 *
0	7BIT

 *
1	8BIT

 *
2	BINARY

 *
3	BASE64

 *
4	QUOTED-PRINTABLE

 *
5	OTHER

 *

 * @jms-builtin
 */
function imap_fetchstructure ($imap_stream, $msg_number, $options = 0) {}

/**
 * (PHP 5 >= 5.3.0)

 * Clears IMAP cache
 * @link http://php.net/manual/en/function.imap-gc.php
 * @param resource $imap_stream
 * @param int $caches

 * Specifies the cache to purge. It may one or a combination
 * of the following constants:
 * IMAP_GC_ELT (message cache elements),
 * IMAP_GC_ENV (enveloppe and bodies),
 * IMAP_GC_TEXTS (texts).
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_gc ($imap_stream, $caches) {}

/**
 * (PHP 4, PHP 5)

 * Delete all messages marked for deletion
 * @link http://php.net/manual/en/function.imap-expunge.php
 * @param resource $imap_stream
 * @return bool TRUE.
 * @jms-builtin
 */
function imap_expunge ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Mark a message for deletion from current mailbox
 * @link http://php.net/manual/en/function.imap-delete.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param int $options [optional]

 * You can set the FT_UID which tells the function
 * to treat the msg_number argument as an
 * UID.
 *

 * @return bool TRUE.
 * @jms-builtin
 */
function imap_delete ($imap_stream, $msg_number, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Unmark the message which is marked deleted
 * @link http://php.net/manual/en/function.imap-undelete.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number
 *

 * @param int $flags [optional]
 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_undelete ($imap_stream, $msg_number, $flags = 0) {}

/**
 * (PHP 4, PHP 5)

 * Check current mailbox
 * @link http://php.net/manual/en/function.imap-check.php
 * @param resource $imap_stream
 * @return object the information in an object with following properties:
 * Date - current system time formatted according to RFC2822
 * Driver - protocol used to access this mailbox:
 * POP3, IMAP, NNTP
 * Mailbox - the mailbox name
 * Nmsgs - number of messages in the mailbox
 * Recent - number of recent messages in the mailbox
 *

 *

 * Returns FALSE on failure.
 * @jms-builtin
 */
function imap_check ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Returns the list of mailboxes that matches the given text
 * @link http://php.net/manual/en/function.imap-listscan.php
 * @param resource $imap_stream
 * @param string $ref

 * ref should normally be just the server
 * specification as described in imap_open
 *

 * @param string $pattern Specifies where in the mailbox hierarchy
 * to start searching.
There are two special characters you can
 * pass as part of the pattern:
 * '*' and '%'.
 * '*' means to return all mailboxes. If you pass
 * pattern as '*', you will
 * get a list of the entire mailbox hierarchy.
 * '%'
 * means to return the current level only.
 * '%' as the pattern
 * parameter will return only the top level
 * mailboxes; '~/mail/%' on UW_IMAPD will return every mailbox in the ~/mail directory, but none in subfolders of that directory.

 * @param string $content

 * The searched string
 *

 * @return array an array containing the names of the mailboxes that have
 * content in the text of the mailbox.
 * @jms-builtin
 */
function imap_listscan ($imap_stream, $ref, $pattern, $content) {}

/**
 * (PHP 4, PHP 5)

 * Copy specified messages to a mailbox
 * @link http://php.net/manual/en/function.imap-mail-copy.php
 * @param resource $imap_stream
 * @param string $msglist

 * msglist is a range not just message
 * numbers (as described in RFC2060).
 *

 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param int $options [optional]

 * options is a bitmask of one or more of
 * CP_UID - the sequence numbers contain UIDS
 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_mail_copy ($imap_stream, $msglist, $mailbox, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Move specified messages to a mailbox
 * @link http://php.net/manual/en/function.imap-mail-move.php
 * @param resource $imap_stream
 * @param string $msglist

 * msglist is a range not just message numbers
 * (as described in RFC2060).
 *

 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param int $options [optional]

 * options is a bitmask and may contain the single option:
 * CP_UID - the sequence numbers contain UIDS
 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_mail_move ($imap_stream, $msglist, $mailbox, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Create a MIME message based on given envelope and body sections
 * @link http://php.net/manual/en/function.imap-mail-compose.php
 * @param array $envelope

 * An associative array of headers fields. Valid keys are: "remail",
 * "return_path", "date", "from", "reply_to", "in_reply_to", "subject",
 * "to", "cc", "bcc", "message_id" and "custom_headers" (which contains
 * associative array of other headers).
 *

 * @param array $body

 * An indexed array of bodies
 *

 *

 * A body is an associative array which can consist of the following keys:
 * "type", "encoding", "charset", "type.parameters", "subtype", "id",
 * "description", "disposition.type", "disposition", "contents.data",
 * "lines", "bytes" and "md5".
 *

 * @return string the MIME message.
 * @jms-builtin
 */
function imap_mail_compose (array $envelope, array $body) {}

/**
 * (PHP 4, PHP 5)

 * Create a new mailbox
 * @link http://php.net/manual/en/function.imap-createmailbox.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information. Names containing international characters should be
 * encoded by imap_utf7_encode
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_createmailbox ($imap_stream, $mailbox) {}

/**
 * (PHP 4, PHP 5)

 * Rename an old mailbox to new mailbox
 * @link http://php.net/manual/en/function.imap-renamemailbox.php
 * @param resource $imap_stream
 * @param string $old_mbox

 * The old mailbox name, see imap_open for more
 * information
 *

 * @param string $new_mbox

 * The new mailbox name, see imap_open for more
 * information
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_renamemailbox ($imap_stream, $old_mbox, $new_mbox) {}

/**
 * (PHP 4, PHP 5)

 * Delete a mailbox
 * @link http://php.net/manual/en/function.imap-deletemailbox.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_deletemailbox ($imap_stream, $mailbox) {}

/**
 * (PHP 4, PHP 5)

 * Subscribe to a mailbox
 * @link http://php.net/manual/en/function.imap-subscribe.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_subscribe ($imap_stream, $mailbox) {}

/**
 * (PHP 4, PHP 5)

 * Unsubscribe from a mailbox
 * @link http://php.net/manual/en/function.imap-unsubscribe.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_unsubscribe ($imap_stream, $mailbox) {}

/**
 * (PHP 4, PHP 5)

 * Append a string message to a specified mailbox
 * @link http://php.net/manual/en/function.imap-append.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param string $message

 * The message to be append, as a string
 *

 *

 * When talking to the Cyrus IMAP server, you must use "\r\n" as
 * your end-of-line terminator instead of "\n" or the operation will
 * fail
 *

 * @param string $options [optional]

 * If provided, the options will also be written
 * to the mailbox
 *

 * @param string $internal_date [optional]

 * If this parameter is set, it will set the INTERNALDATE on the appended message. The parameter should be a date string that conforms to the rfc2060 specifications for a date_time value.
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_append ($imap_stream, $mailbox, $message, $options = null, $internal_date = null) {}

/**
 * (PHP 4, PHP 5)

 * Check if the IMAP stream is still active
 * @link http://php.net/manual/en/function.imap-ping.php
 * @param resource $imap_stream
 * @return bool TRUE if the stream is still alive, FALSE otherwise.
 * @jms-builtin
 */
function imap_ping ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Decode BASE64 encoded text
 * @link http://php.net/manual/en/function.imap-base64.php
 * @param string $text

 * The encoded text
 *

 * @return string the decoded message as a string.
 * @jms-builtin
 */
function imap_base64 ($text) {}

/**
 * (PHP 4, PHP 5)

 * Convert a quoted-printable string to an 8 bit string
 * @link http://php.net/manual/en/function.imap-qprint.php
 * @param string $string

 * A quoted-printable string
 *

 * @return string an 8 bits string.
 * @jms-builtin
 */
function imap_qprint ($string) {}

/**
 * (PHP 4, PHP 5)

 * Convert an 8bit string to a quoted-printable string
 * @link http://php.net/manual/en/function.imap-8bit.php
 * @param string $string

 * The 8bit string to convert
 *

 * @return string a quoted-printable string.
 * @jms-builtin
 */
function imap_8bit ($string) {}

/**
 * (PHP 4, PHP 5)

 * Convert an 8bit string to a base64 string
 * @link http://php.net/manual/en/function.imap-binary.php
 * @param string $string

 * The 8bit string
 *

 * @return string a base64 encoded string.
 * @jms-builtin
 */
function imap_binary ($string) {}

/**
 * (PHP 4, PHP 5)

 * Converts MIME-encoded text to UTF-8
 * @link http://php.net/manual/en/function.imap-utf8.php
 * @param string $mime_encoded_text

 * A MIME encoded string. MIME encoding method and the UTF-8
 * specification are described in RFC2047 and RFC2044 respectively.
 *

 * @return string an UTF-8 encoded string.
 * @jms-builtin
 */
function imap_utf8 ($mime_encoded_text) {}

/**
 * (PHP 4, PHP 5)

 * Returns status information on a mailbox
 * @link http://php.net/manual/en/function.imap-status.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param int $options

 * Valid flags are:
 * SA_MESSAGES - set $status->messages to the
 * number of messages in the mailbox
 * @return object This function returns an object containing status information.
 * The object has the following properties: messages,
 * recent, unseen,
 * uidnext, and uidvalidity.
 *

 *

 * flags is also set, which contains a bitmask which can
 * be checked against any of the above constants.
 * @jms-builtin
 */
function imap_status ($imap_stream, $mailbox, $options) {}

/**
 * (PHP 4, PHP 5)

 * Get information about the current mailbox
 * @link http://php.net/manual/en/function.imap-mailboxmsginfo.php
 * @param resource $imap_stream
 * @return object the information in an object with following properties:
 *

 * Mailbox properties
 *

 * Date
 * date of last change (current datetime)
 *

 *

 * Driver
 * driver
 *

 *

 * Mailbox
 * name of the mailbox
 *

 *

 * Nmsgs
 * number of messages
 *

 *

 * Recent
 * number of recent messages
 *

 *

 * Unread
 * number of unread messages
 *

 *

 * Deleted
 * number of deleted messages
 *

 *

 * Size
 * mailbox size
 *

 *

 *

 *

 * Returns FALSE on failure.
 * @jms-builtin
 */
function imap_mailboxmsginfo ($imap_stream) {}

/**
 * (PHP 4, PHP 5)

 * Sets flags on messages
 * @link http://php.net/manual/en/function.imap-setflag-full.php
 * @param resource $imap_stream
 * @param string $sequence

 * A sequence of message numbers. You can enumerate desired messages
 * with the X,Y syntax, or retrieve all messages
 * within an interval with the X:Y syntax
 *

 * @param string $flag

 * The flags which you can set are \Seen,
 * \Answered, \Flagged,
 * \Deleted, and \Draft as
 * defined by RFC2060.
 *

 * @param int $options [optional]

 * A bit mask that may contain the single option:
 * ST_UID - The sequence argument contains UIDs
 * instead of sequence numbers
 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_setflag_full ($imap_stream, $sequence, $flag, $options = 'NIL') {}

/**
 * (PHP 4, PHP 5)

 * Clears flags on messages
 * @link http://php.net/manual/en/function.imap-clearflag-full.php
 * @param resource $imap_stream
 * @param string $sequence

 * A sequence of message numbers. You can enumerate desired messages
 * with the X,Y syntax, or retrieve all messages
 * within an interval with the X:Y syntax
 *

 * @param string $flag

 * The flags which you can unset are "\\Seen", "\\Answered", "\\Flagged",
 * "\\Deleted", and "\\Draft" (as defined by RFC2060)
 *

 * @param int $options [optional]

 * options are a bit mask and may contain
 * the single option:
 * ST_UID - The sequence argument contains UIDs
 * instead of sequence numbers
 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_clearflag_full ($imap_stream, $sequence, $flag, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Gets and sort messages
 * @link http://php.net/manual/en/function.imap-sort.php
 * @param resource $imap_stream
 * @param int $criteria

 * Criteria can be one (and only one) of the following:
 * SORTDATE - message Date
 * @param int $reverse

 * Set this to 1 for reverse sorting
 *

 * @param int $options [optional]

 * The options are a bitmask of one or more of the
 * following:
 * SE_UID - Return UIDs instead of sequence numbers
 * @param string $search_criteria [optional]
 * @param string $charset [optional]
 * @return array an array of message numbers sorted by the given
 * parameters.
 * @jms-builtin
 */
function imap_sort ($imap_stream, $criteria, $reverse, $options = 0, $search_criteria = null, $charset = 'NIL') {}

/**
 * (PHP 4, PHP 5)

 * This function returns the UID for the given message sequence number
 * @link http://php.net/manual/en/function.imap-uid.php
 * @param resource $imap_stream
 * @param int $msg_number

 * The message number.
 *

 * @return int The UID of the given message.
 * @jms-builtin
 */
function imap_uid ($imap_stream, $msg_number) {}

/**
 * (PHP 4, PHP 5)

 * Gets the message sequence number for the given UID
 * @link http://php.net/manual/en/function.imap-msgno.php
 * @param resource $imap_stream
 * @param int $uid

 * The message UID
 *

 * @return int the message sequence number for the given
 * uid.
 * @jms-builtin
 */
function imap_msgno ($imap_stream, $uid) {}

/**
 * (PHP 4, PHP 5)

 * Read the list of mailboxes
 * @link http://php.net/manual/en/function.imap-list.php
 * @param resource $imap_stream
 * @param string $ref

 * ref should normally be just the server
 * specification as described in imap_open.
 *

 * @param string $pattern Specifies where in the mailbox hierarchy
 * to start searching.
There are two special characters you can
 * pass as part of the pattern:
 * '*' and '%'.
 * '*' means to return all mailboxes. If you pass
 * pattern as '*', you will
 * get a list of the entire mailbox hierarchy.
 * '%'
 * means to return the current level only.
 * '%' as the pattern
 * parameter will return only the top level
 * mailboxes; '~/mail/%' on UW_IMAPD will return every mailbox in the ~/mail directory, but none in subfolders of that directory.

 * @return array an array containing the names of the mailboxes.
 * @jms-builtin
 */
function imap_list ($imap_stream, $ref, $pattern) {}

/**
 * (PHP 4, PHP 5)

 * List all the subscribed mailboxes
 * @link http://php.net/manual/en/function.imap-lsub.php
 * @param resource $imap_stream
 * @param string $ref

 * ref should normally be just the server
 * specification as described in imap_open
 *

 * @param string $pattern Specifies where in the mailbox hierarchy
 * to start searching.
There are two special characters you can
 * pass as part of the pattern:
 * '*' and '%'.
 * '*' means to return all mailboxes. If you pass
 * pattern as '*', you will
 * get a list of the entire mailbox hierarchy.
 * '%'
 * means to return the current level only.
 * '%' as the pattern
 * parameter will return only the top level
 * mailboxes; '~/mail/%' on UW_IMAPD will return every mailbox in the ~/mail directory, but none in subfolders of that directory.

 * @return array an array of all the subscribed mailboxes.
 * @jms-builtin
 */
function imap_lsub ($imap_stream, $ref, $pattern) {}

/**
 * (PHP 4, PHP 5)

 * Read an overview of the information in the headers of the given message
 * @link http://php.net/manual/en/function.imap-fetch-overview.php
 * @param resource $imap_stream
 * @param string $sequence

 * A message sequence description. You can enumerate desired messages
 * with the X,Y syntax, or retrieve all messages
 * within an interval with the X:Y syntax
 *

 * @param int $options [optional]

 * sequence will contain a sequence of message
 * indices or UIDs, if this parameter is set to
 * FT_UID.
 *

 * @return array an array of objects describing one message header each.
 * The object will only define a property if it exists. The possible
 * properties are:
 * subject - the messages subject
 * from - who sent it
 * to - recipient
 * date - when was it sent
 * message_id - Message-ID
 * references - is a reference to this message id
 * in_reply_to - is a reply to this message id
 * size - size in bytes
 * uid - UID the message has in the mailbox
 * msgno - message sequence number in the mailbox
 * recent - this message is flagged as recent
 * flagged - this message is flagged
 * answered - this message is flagged as answered
 * deleted - this message is flagged for deletion
 * seen - this message is flagged as already read
 * draft - this message is flagged as being a draft
 * @jms-builtin
 */
function imap_fetch_overview ($imap_stream, $sequence, $options = 0) {}

/**
 * (PHP 4, PHP 5)

 * Returns all IMAP alert messages that have occurred
 * @link http://php.net/manual/en/function.imap-alerts.php
 * @return array an array of all of the IMAP alert messages generated or FALSE if
 * no alert messages are available.
 * @jms-builtin
 */
function imap_alerts () {}

/**
 * (PHP 4, PHP 5)

 * Returns all of the IMAP errors that have occured
 * @link http://php.net/manual/en/function.imap-errors.php
 * @return array This function returns an array of all of the IMAP error messages
 * generated since the last imap_errors call,
 * or the beginning of the page. Returns FALSE if no error messages are
 * available.
 * @jms-builtin
 */
function imap_errors () {}

/**
 * (PHP 4, PHP 5)

 * Gets the last IMAP error that occurred during this page request
 * @link http://php.net/manual/en/function.imap-last-error.php
 * @return string the full text of the last IMAP error message that occurred on the
 * current page. Returns FALSE if no error messages are available.
 * @jms-builtin
 */
function imap_last_error () {}

/**
 * (PHP 4, PHP 5)

 * This function returns an array of messages matching the given search criteria
 * @link http://php.net/manual/en/function.imap-search.php
 * @param resource $imap_stream
 * @param string $criteria

 * A string, delimited by spaces, in which the following keywords are
 * allowed. Any multi-word arguments (e.g.
 * FROM "joey smith") must be quoted. Results will match
 * all criteria entries.
 * ALL - return all messages matching the rest of the criteria
 * @param int $options [optional]

 * Valid values for options are
 * SE_UID, which causes the returned array to
 * contain UIDs instead of messages sequence numbers.
 *

 * @param string $charset [optional]
 * @return array an array of message numbers or UIDs.
 *

 *

 * Return FALSE if it does not understand the search
 * criteria or no messages have been found.
 * @jms-builtin
 */
function imap_search ($imap_stream, $criteria, $options = 'SE_FREE', $charset = 'NIL') {}

/**
 * (PHP 4, PHP 5)

 * Decodes a modified UTF-7 encoded string
 * @link http://php.net/manual/en/function.imap-utf7-decode.php
 * @param string $text

 * A modified UTF-7 encoding string, as defined in RFC 2060, section 5.1.3 (original UTF-7
 * was defined in RFC1642).
 *

 * @return string a string that is encoded in ISO-8859-1 and consists of the same
 * sequence of characters in text, or FALSE
 * if text contains invalid modified UTF-7 sequence
 * or text contains a character that is not part of
 * ISO-8859-1 character set.
 * @jms-builtin
 */
function imap_utf7_decode ($text) {}

/**
 * (PHP 4, PHP 5)

 * Converts ISO-8859-1 string to modified UTF-7 text
 * @link http://php.net/manual/en/function.imap-utf7-encode.php
 * @param string $data

 * An ISO-8859-1 string.
 *

 * @return string data encoded with the modified UTF-7
 * encoding as defined in RFC 2060,
 * section 5.1.3 (original UTF-7 was defined in RFC1642).
 * @jms-builtin
 */
function imap_utf7_encode ($data) {}

/**
 * (PHP 4, PHP 5)

 * Decode MIME header elements
 * @link http://php.net/manual/en/function.imap-mime-header-decode.php
 * @param string $text

 * The MIME text
 *

 * @return array The decoded elements are returned in an array of objects, where each
 * object has two properties, charset and
 * text.
 *

 *

 * If the element hasn't been encoded, and in other words is in
 * plain US-ASCII, the charset property of that element is
 * set to default.
 * @jms-builtin
 */
function imap_mime_header_decode ($text) {}

/**
 * (PHP 4 >= 4.0.7, PHP 5)

 * Returns a tree of threaded message
 * @link http://php.net/manual/en/function.imap-thread.php
 * @param resource $imap_stream
 * @param int $options [optional]
 * @return array imap_thread returns an associative array containing
 * a tree of messages threaded by REFERENCES, or FALSE
 * on error.
 *

 *

 * Every message in the current mailbox will be represented by three entries
 * in the resulting array:
 *

 * $thread["XX.num"] - current message number
 *

 *

 * $thread["XX.next"]
 *

 *

 * $thread["XX.branch"]
 *

 * @jms-builtin
 */
function imap_thread ($imap_stream, $options = 'SE_FREE') {}

/**
 * (PHP 4 >= 4.3.3, PHP 5)

 * Set or fetch imap timeout
 * @link http://php.net/manual/en/function.imap-timeout.php
 * @param int $timeout_type

 * One of the following:
 * IMAP_OPENTIMEOUT,
 * IMAP_READTIMEOUT,
 * IMAP_WRITETIMEOUT, or
 * IMAP_CLOSETIMEOUT.
 *

 * @param int $timeout [optional]

 * The timeout, in seconds.
 *

 * @return mixed If the timeout parameter is set, this function
 * returns TRUE on success and FALSE on failure.
 *

 *

 * If timeout is not provided or evaluates to -1,
 * the current timeout value of timeout_type is
 * returned as an integer.
 * @jms-builtin
 */
function imap_timeout ($timeout_type, $timeout = -1) {}

/**
 * (PHP 4 >= 4.0.5, PHP 5)

 * Retrieve the quota level settings, and usage statics per mailbox
 * @link http://php.net/manual/en/function.imap-get-quota.php
 * @param resource $imap_stream
 * @param string $quota_root

 * quota_root should normally be in the form of
 * user.name where name is the mailbox you wish to
 * retrieve information about.
 *

 * @return array an array with integer values limit and usage for the given
 * mailbox. The value of limit represents the total amount of space
 * allowed for this mailbox. The usage value represents the mailboxes
 * current level of capacity. Will return FALSE in the case of failure.
 *

 *

 * As of PHP 4.3, the function more properly reflects the
 * functionality as dictated by the RFC2087.
 * The array return value has changed to support an unlimited number of returned
 * resources (i.e. messages, or sub-folders) with each named resource receiving
 * an individual array key. Each key value then contains an another array with
 * the usage and limit values within it.
 *

 *

 * For backwards compatibility reasons, the original access methods are
 * still available for use, although it is suggested to update.
 * @jms-builtin
 */
function imap_get_quota ($imap_stream, $quota_root) {}

/**
 * (PHP 4 >= 4.3.0, PHP 5)

 * Retrieve the quota settings per user
 * @link http://php.net/manual/en/function.imap-get-quotaroot.php
 * @param resource $imap_stream
 * @param string $quota_root

 * quota_root should normally be in the form of
 * which mailbox (i.e. INBOX).
 *

 * @return array an array of integer values pertaining to the specified user
 * mailbox. All values contain a key based upon the resource name, and a
 * corresponding array with the usage and limit values within.
 *

 *

 * This function will return FALSE in the case of call failure, and an
 * array of information about the connection upon an un-parsable response
 * from the server.
 * @jms-builtin
 */
function imap_get_quotaroot ($imap_stream, $quota_root) {}

/**
 * (PHP 4 >= 4.0.5, PHP 5)

 * Sets a quota for a given mailbox
 * @link http://php.net/manual/en/function.imap-set-quota.php
 * @param resource $imap_stream
 * @param string $quota_root

 * The mailbox to have a quota set. This should follow the IMAP standard
 * format for a mailbox: user.name.
 *

 * @param int $quota_limit

 * The maximum size (in KB) for the quota_root
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_set_quota ($imap_stream, $quota_root, $quota_limit) {}

/**
 * (PHP 4 >= 4.0.7, PHP 5)

 * Sets the ACL for a giving mailbox
 * @link http://php.net/manual/en/function.imap-setacl.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @param string $id

 * The user to give the rights to.
 *

 * @param string $rights

 * The rights to give to the user. Passing an empty string will delete
 * acl.
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_setacl ($imap_stream, $mailbox, $id, $rights) {}

/**
 * (PHP 5)

 * Gets the ACL for a given mailbox
 * @link http://php.net/manual/en/function.imap-getacl.php
 * @param resource $imap_stream
 * @param string $mailbox

 * The mailbox name, see imap_open for more
 * information
 *

 * @return array an associative array of "folder" => "acl" pairs.
 * @jms-builtin
 */
function imap_getacl ($imap_stream, $mailbox) {}

/**
 * (PHP 4, PHP 5)

 * Send an email message
 * @link http://php.net/manual/en/function.imap-mail.php
 * @param string $to

 * The receiver
 *

 * @param string $subject

 * The mail subject
 *

 * @param string $message

 * The mail body
 *

 * @param string $additional_headers [optional]

 * As string with additional headers to be set on the mail
 *

 * @param string $cc [optional]
 * @param string $bcc [optional]

 * The receivers specified in bcc will get the
 * mail, but are excluded from the headers.
 *

 * @param string $rpath [optional]

 * Use this parameter to specify return path upon mail delivery failure.
 * This is useful when using PHP as a mail client for multiple users.
 *

 * @return bool TRUE on success or FALSE on failure.
 * @jms-builtin
 */
function imap_mail ($to, $subject, $message, $additional_headers = null, $cc = null, $bcc = null, $rpath = null) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_headerinfo
 * @link http://php.net/manual/en/function.imap-header.php
 * @param $stream_id
 * @param $msg_no
 * @param $from_length [optional]
 * @param $subject_length [optional]
 * @param $default_host [optional]
 * @jms-builtin
 */
function imap_header ($stream_id, $msg_no, $from_length, $subject_length, $default_host) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_list
 * @link http://php.net/manual/en/function.imap-listmailbox.php
 * @param $stream_id
 * @param $ref
 * @param $pattern
 * @jms-builtin
 */
function imap_listmailbox ($stream_id, $ref, $pattern) {}

/**
 * (PHP 4, PHP 5)

 * Read the list of mailboxes, returning detailed information on each one
 * @link http://php.net/manual/en/function.imap-getmailboxes.php
 * @param resource $imap_stream
 * @param string $ref

 * ref should normally be just the server
 * specification as described in imap_open
 *

 * @param string $pattern Specifies where in the mailbox hierarchy
 * to start searching.
There are two special characters you can
 * pass as part of the pattern:
 * '*' and '%'.
 * '*' means to return all mailboxes. If you pass
 * pattern as '*', you will
 * get a list of the entire mailbox hierarchy.
 * '%'
 * means to return the current level only.
 * '%' as the pattern
 * parameter will return only the top level
 * mailboxes; '~/mail/%' on UW_IMAPD will return every mailbox in the ~/mail directory, but none in subfolders of that directory.

 * @return array an array of objects containing mailbox information. Each
 * object has the attributes name, specifying
 * the full name of the mailbox; delimiter,
 * which is the hierarchy delimiter for the part of the hierarchy
 * this mailbox is in; and
 * attributes. Attributes
 * is a bitmask that can be tested against:
 *

 * LATT_NOINFERIORS - This mailbox contains, and may not contain any
 * "children" (there are no mailboxes below this one). Calling
 * imap_createmailbox will not work on this mailbox.
 *

 *

 * LATT_NOSELECT - This is only a container,
 * not a mailbox - you cannot open it.
 *

 *

 * LATT_MARKED - This mailbox is marked. This means that it may
 * contain new messages since the last time it was checked. Not provided by all IMAP
 * servers.
 *

 *

 * LATT_UNMARKED - This mailbox is not marked, does not contain new
 * messages. If either MARKED or UNMARKED is
 * provided, you can assume the IMAP server supports this feature for this mailbox.
 *

 * @jms-builtin
 */
function imap_getmailboxes ($imap_stream, $ref, $pattern) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_listscan
 * @link http://php.net/manual/en/function.imap-scanmailbox.php
 * @param $stream_id
 * @param $ref
 * @param $pattern
 * @param $content
 * @jms-builtin
 */
function imap_scanmailbox ($stream_id, $ref, $pattern, $content) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_lsub
 * @link http://php.net/manual/en/function.imap-listsubscribed.php
 * @param $stream_id
 * @param $ref
 * @param $pattern
 * @jms-builtin
 */
function imap_listsubscribed ($stream_id, $ref, $pattern) {}

/**
 * (PHP 4, PHP 5)

 * List all the subscribed mailboxes
 * @link http://php.net/manual/en/function.imap-getsubscribed.php
 * @param resource $imap_stream
 * @param string $ref

 * ref should normally be just the server
 * specification as described in imap_open
 *

 * @param string $pattern Specifies where in the mailbox hierarchy
 * to start searching.
There are two special characters you can
 * pass as part of the pattern:
 * '*' and '%'.
 * '*' means to return all mailboxes. If you pass
 * pattern as '*', you will
 * get a list of the entire mailbox hierarchy.
 * '%'
 * means to return the current level only.
 * '%' as the pattern
 * parameter will return only the top level
 * mailboxes; '~/mail/%' on UW_IMAPD will return every mailbox in the ~/mail directory, but none in subfolders of that directory.

 * @return array an array of objects containing mailbox information. Each
 * object has the attributes name, specifying
 * the full name of the mailbox; delimiter,
 * which is the hierarchy delimiter for the part of the hierarchy
 * this mailbox is in; and
 * attributes. Attributes
 * is a bitmask that can be tested against:
 * LATT_NOINFERIORS - This mailbox has no
 * "children" (there are no mailboxes below this one).
 * LATT_NOSELECT - This is only a container,
 * not a mailbox - you cannot open it.
 * LATT_MARKED - This mailbox is marked.
 * Only used by UW-IMAPD.
 * LATT_UNMARKED - This mailbox is not marked.
 * Only used by UW-IMAPD.
 * @jms-builtin
 */
function imap_getsubscribed ($imap_stream, $ref, $pattern) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_body
 * @link http://php.net/manual/en/function.imap-fetchtext.php
 * @param $stream_id
 * @param $msg_no
 * @param $options [optional]
 * @jms-builtin
 */
function imap_fetchtext ($stream_id, $msg_no, $options) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_listscan
 * @link http://php.net/manual/en/function.imap-scan.php
 * @param $stream_id
 * @param $ref
 * @param $pattern
 * @param $content
 * @jms-builtin
 */
function imap_scan ($stream_id, $ref, $pattern, $content) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_createmailbox
 * @link http://php.net/manual/en/function.imap-create.php
 * @param $stream_id
 * @param $mailbox
 * @jms-builtin
 */
function imap_create ($stream_id, $mailbox) {}

/**
 * (PHP 4, PHP 5)

 * Alias of imap_renamemailbox
 * @link http://php.net/manual/en/function.imap-rename.php
 * @param $stream_id
 * @param $old_name
 * @param $new_name
 * @jms-builtin
 */
function imap_rename ($stream_id, $old_name, $new_name) {}

define ('NIL', 0);
define ('IMAP_OPENTIMEOUT', 1);
define ('IMAP_READTIMEOUT', 2);
define ('IMAP_WRITETIMEOUT', 3);
define ('IMAP_CLOSETIMEOUT', 4);
define ('OP_DEBUG', 1);

/**
 * Open mailbox read-only
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('OP_READONLY', 2);

/**
 * Don't use or update a .newsrc for news
 * (NNTP only)
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('OP_ANONYMOUS', 4);
define ('OP_SHORTCACHE', 8);
define ('OP_SILENT', 16);
define ('OP_PROTOTYPE', 32);

/**
 * For IMAP and NNTP
 * names, open a connection but don't open a mailbox.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('OP_HALFOPEN', 64);
define ('OP_EXPUNGE', 128);
define ('OP_SECURE', 256);

/**
 * silently expunge the mailbox before closing when
 * calling imap_close
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('CL_EXPUNGE', 32768);

/**
 * The parameter is a UID
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('FT_UID', 1);

/**
 * Do not set the \Seen flag if not already set
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('FT_PEEK', 2);
define ('FT_NOT', 4);

/**
 * The return string is in internal format, will not canonicalize to CRLF.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('FT_INTERNAL', 8);
define ('FT_PREFETCHTEXT', 32);

/**
 * The sequence argument contains UIDs instead of sequence numbers
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('ST_UID', 1);
define ('ST_SILENT', 2);
define ('ST_SET', 4);

/**
 * the sequence numbers contain UIDS
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('CP_UID', 1);

/**
 * Delete the messages from the current mailbox after copying
 * with imap_mail_copy
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('CP_MOVE', 2);

/**
 * Return UIDs instead of sequence numbers
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SE_UID', 1);
define ('SE_FREE', 2);

/**
 * Don't prefetch searched messages
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SE_NOPREFETCH', 4);
define ('SO_FREE', 8);
define ('SO_NOSERVER', 16);
define ('SA_MESSAGES', 1);
define ('SA_RECENT', 2);
define ('SA_UNSEEN', 4);
define ('SA_UIDNEXT', 8);
define ('SA_UIDVALIDITY', 16);
define ('SA_ALL', 31);

/**
 * This mailbox has no "children" (there are no
 * mailboxes below this one).
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('LATT_NOINFERIORS', 1);

/**
 * This is only a container, not a mailbox - you
 * cannot open it.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('LATT_NOSELECT', 2);

/**
 * This mailbox is marked. Only used by UW-IMAPD.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('LATT_MARKED', 4);

/**
 * This mailbox is not marked. Only used by
 * UW-IMAPD.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('LATT_UNMARKED', 8);
define ('LATT_REFERRAL', 16);
define ('LATT_HASCHILDREN', 32);
define ('LATT_HASNOCHILDREN', 64);

/**
 * Sort criteria for imap_sort:
 * message Date
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTDATE', 0);

/**
 * Sort criteria for imap_sort:
 * arrival date
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTARRIVAL', 1);

/**
 * Sort criteria for imap_sort:
 * mailbox in first From address
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTFROM', 2);

/**
 * Sort criteria for imap_sort:
 * message subject
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTSUBJECT', 3);

/**
 * Sort criteria for imap_sort:
 * mailbox in first To address
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTTO', 4);

/**
 * Sort criteria for imap_sort:
 * mailbox in first cc address
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTCC', 5);

/**
 * Sort criteria for imap_sort:
 * size of message in octets
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('SORTSIZE', 6);
define ('TYPETEXT', 0);
define ('TYPEMULTIPART', 1);
define ('TYPEMESSAGE', 2);
define ('TYPEAPPLICATION', 3);
define ('TYPEAUDIO', 4);
define ('TYPEIMAGE', 5);
define ('TYPEVIDEO', 6);
define ('TYPEMODEL', 7);
define ('TYPEOTHER', 8);
define ('ENC7BIT', 0);
define ('ENC8BIT', 1);
define ('ENCBINARY', 2);
define ('ENCBASE64', 3);
define ('ENCQUOTEDPRINTABLE', 4);
define ('ENCOTHER', 5);

/**
 * Garbage collector, clear message cache elements.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('IMAP_GC_ELT', 1);

/**
 * Garbage collector, clear envelopes and bodies.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('IMAP_GC_ENV', 2);

/**
 * Garbage collector, clear texts.
 * @link http://php.net/manual/en/imap.constants.php
 */
define ('IMAP_GC_TEXTS', 4);

// End of imap v.
?>


text:
package org.jasig.portlet.newsreader.spring;

import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
import org.springframework.beans.factory.xml.XmlReaderContext;
import org.w3c.dom.Element;

/**
 * Extends the Spring DefaultBeanDefinitionDocumentReader to set the {@link BeanDefinitionParserDelegate#DEFAULT_LAZY_INIT_ATTRIBUTE}
 * to true, usefull when loading a context during testing or with command line tools.
 *
 * @author Eric Dalquist
 * @version $Revision$
 */
public class LazyInitByDefaultBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader {
    @Override
    protected BeanDefinitionParserDelegate createDelegate(XmlReaderContext readerContext, Element root, BeanDefinitionParserDelegate parentDelegate) {
        root.setAttribute(BeanDefinitionParserDelegate.DEFAULT_LAZY_INIT_ATTRIBUTE, "true");
        return super.createDelegate(readerContext, root, parentDelegate);
    }
}

redpajama_set_name: RedPajamaGithub


text:
#include "DXTypes.h"
#include <stdexcept>
#include <string>

namespace LLGL
{

namespace DXTypes
{

[[noreturn]]
void MapFailed(const char* typeName, const char* dxTypeName)
{
    throw std::invalid_argument(
        "failed to map <LLGL::" + std::string(typeName) + "> to <" + std::string(dxTypeName) + "> Direct3D parameter"
    );
}

[[noreturn]]
void UnmapFailed(const char* typeName, const char* dxTypeName)
{
    throw std::invalid_argument(
        "failed to unmap <LLGL::" + std::string(typeName) + "> from <" + std::string(dxTypeName) + "> Direct3D parameter"
    );
}

[[noreturn]]
void ParamNotSupported(const char* paramName, const char* requirement)
{
    throw std::runtime_error(
        "parameter '" + std::string(paramName) + "' requires " + std::string(requirement)
    );
}

DXGI_FORMAT Map(const DataType dataType)
{
    switch (dataType)
    {
        case DataType::Undefined:   break;//return DXGI_FORMAT_UNKNOWN;
        case DataType::Int8:        return DXGI_FORMAT_R8_SINT;
        case DataType::UInt8:       return DXGI_FORMAT_R8_UINT;
        case DataType::Int16:       return DXGI_FORMAT_R16_SINT;
        case DataType::UInt16:      return DXGI_FORMAT_R16_UINT;
        case DataType::Int32:       return DXGI_FORMAT_R32_SINT;
        case DataType::UInt32:      return DXGI_FORMAT_R32_UINT;
        case DataType::Float16:     return DXGI_FORMAT_R16_FLOAT;
        case DataType::Float32:     return DXGI_FORMAT_R32_FLOAT;
        case DataType::Float64:     break;
    }
    MapFailed("DataType", "DXGI_FORMAT");
}

DXGI_FORMAT Map(const Format format)
{
    switch (format)
    {
        case Format::Undefined:         return DXGI_FORMAT_UNKNOWN;

        /* --- Alpha channel color formats --- */
        case Format::A8UNorm:           return DXGI_FORMAT_A8_UNORM;

        /* --- Red channel color formats --- */
        case Format::R8UNorm:           return DXGI_FORMAT_R8_UNORM;
        case Format::R8SNorm:           return DXGI_FORMAT_R8_SNORM;
        case Format::R8UInt:            return DXGI_FORMAT_R8_UINT;
        case Format::R8SInt:            return DXGI_FORMAT_R8_SINT;

        case Format::R16UNorm:          return DXGI_FORMAT_R16_UNORM;
        case Format::R16SNorm:          return DXGI_FORMAT_R16_SNORM;
        case Format::R16UInt:           return DXGI_FORMAT_R16_UINT;
        case Format::R16SInt:           return DXGI_FORMAT_R16_SINT;
        case Format::R16Float:          return DXGI_FORMAT_R16_FLOAT;

        case Format::R32UInt:           return DXGI_FORMAT_R32_UINT;
        case Format::R32SInt:           return DXGI_FORMAT_R32_SINT;
        case Format::R32Float:          return DXGI_FORMAT_R32_FLOAT;

        case Format::R64Float:          break;

        /* --- RG color formats --- */
        case Format::RG8UNorm:          return DXGI_FORMAT_R8G8_UNORM;
        case Format::RG8SNorm:          return DXGI_FORMAT_R8G8_SNORM;
        case Format::RG8UInt:           return DXGI_FORMAT_R8G8_UINT;
        case Format::RG8SInt:           return DXGI_FORMAT_R8G8_SINT;

        case Format::RG16UNorm:         return DXGI_FORMAT_R16G16_UNORM;
        case Format::RG16SNorm:         return DXGI_FORMAT_R16G16_SNORM;
        case Format::RG16UInt:          return DXGI_FORMAT_R16G16_UINT;
        case Format::RG16SInt:          return DXGI_FORMAT_R16G16_SINT;
        case Format::RG16Float:         return DXGI_FORMAT_R16G16_FLOAT;

        case Format::RG32UInt:          return DXGI_FORMAT_R32G32_UINT;
        case Format::RG32SInt:          return DXGI_FORMAT_R32G32_SINT;
        case Format::RG32Float:         return DXGI_FORMAT_R32G32_FLOAT;

        case Format::RG64Float:         break;

        /* --- RGB color formats --- */
        case Format::RGB8UNorm:         break;
        case Format::RGB8UNorm_sRGB:    break;
        case Format::RGB8SNorm:         break;
        case Format::RGB8UInt:          break;
        case Format::RGB8SInt:          break;

        case Format::RGB16UNorm:        break;
        case Format::RGB16SNorm:        break;
        case Format::RGB16UInt:         break;
        case Format::RGB16SInt:         break;
        case Format::RGB16Float:        break;

        case Format::RGB32UInt:         return DXGI_FORMAT_R32G32B32_UINT;
        case Format::RGB32SInt:         return DXGI_FORMAT_R32G32B32_SINT;
        case Format::RGB32Float:        return DXGI_FORMAT_R32G32B32_FLOAT;

        case Format::RGB64Float:        break;

        /* --- RGBA color formats --- */
        case Format::RGBA8UNorm:        return DXGI_FORMAT_R8G8B8A8_UNORM;
        case Format::RGBA8UNorm_sRGB:   return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
        case Format::RGBA8SNorm:        return DXGI_FORMAT_R8G8B8A8_SNORM;
        case Format::RGBA8UInt:         return DXGI_FORMAT_R8G8B8A8_UINT;
        case Format::RGBA8SInt:         return DXGI_FORMAT_R8G8B8A8_SINT;

        case Format::RGBA16UNorm:       return DXGI_FORMAT_R16G16B16A16_UNORM;
        case Format::RGBA16SNorm:       return DXGI_FORMAT_R16G16B16A16_SNORM;
        case Format::RGBA16UInt:        return DXGI_FORMAT_R16G16B16A16_UINT;
        case Format::RGBA16SInt:        return DXGI_FORMAT_R16G16B16A16_SINT;
        case Format::RGBA16Float:       return DXGI_FORMAT_R16G16B16A16_FLOAT;

        case Format::RGBA32UInt:        return DXGI_FORMAT_R32G32B32A32_UINT;
        case Format::RGBA32SInt:        return DXGI_FORMAT_R32G32B32A32_SINT;
        case Format::RGBA32Float:       return DXGI_FORMAT_R32G32B32A32_FLOAT;

        case Format::RGBA64Float:       break;

        /* --- BGRA color formats --- */
        case Format::BGRA8UNorm:        return DXGI_FORMAT_B8G8R8A8_UNORM;
        case Format::BGRA8UNorm_sRGB:   return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
        case Format::BGRA8SNorm:        break;
        case Format::BGRA8UInt:         break;
        case Format::BGRA8SInt:         break;

        /* --- Packed formats --- */
        case Format::RGB10A2UNorm:      return DXGI_FORMAT_R10G10B10A2_UNORM;
        case Format::RGB10A2UInt:       return DXGI_FORMAT_R10G10B10A2_UINT;
        case Format::RG11B10Float:      return DXGI_FORMAT_R11G11B10_FLOAT;
        case Format::RGB9E5Float:       return DXGI_FORMAT_R9G9B9E5_SHAREDEXP;

        /* --- Depth-stencil formats --- */
        case Format::D16UNorm:          return DXGI_FORMAT_R16_TYPELESS;
        case Format::D32Float:          return DXGI_FORMAT_R32_TYPELESS;
        case Format::D24UNormS8UInt:    return DXGI_FORMAT_R24G8_TYPELESS;
        case Format::D32FloatS8X24UInt: return DXGI_FORMAT_R32G8X24_TYPELESS;

        /* --- Block compression (BC) formats --- */
        case Format::BC1UNorm:          return DXGI_FORMAT_BC1_UNORM;
        case Format::BC1UNorm_sRGB:     return DXGI_FORMAT_BC1_UNORM_SRGB;
        case Format::BC2UNorm:          return DXGI_FORMAT_BC2_UNORM;
        case Format::BC2UNorm_sRGB:     return DXGI_FORMAT_BC2_UNORM_SRGB;
        case Format::BC3UNorm:          return DXGI_FORMAT_BC3_UNORM;
        case Format::BC3UNorm_sRGB:     return DXGI_FORMAT_BC3_UNORM_SRGB;
        case Format::BC4UNorm:          return DXGI_FORMAT_BC4_UNORM;
        case Format::BC4SNorm:          return DXGI_FORMAT_BC4_SNORM;
        case Format::BC5UNorm:          return DXGI_FORMAT_BC5_UNORM;
        case Format::BC5SNorm:          return DXGI_FORMAT_BC5_SNORM;
    }
    MapFailed("Format", "DXGI_FORMAT");
}

D3D_PRIMITIVE_TOPOLOGY Map(const PrimitiveTopology topology)
{
    switch (topology)
    {
        case PrimitiveTopology::PointList:              return D3D_PRIMITIVE_TOPOLOGY_POINTLIST;
        case PrimitiveTopology::LineList:               return D3D_PRIMITIVE_TOPOLOGY_LINELIST;
        case PrimitiveTopology::LineStrip:              return D3D_PRIMITIVE_TOPOLOGY_LINESTRIP;
        case PrimitiveTopology::LineListAdjacency:      return D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ;
        case PrimitiveTopology::LineStripAdjacency:     return D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ;
        case PrimitiveTopology::TriangleList:           return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
        case PrimitiveTopology::TriangleStrip:          return D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
        case PrimitiveTopology::TriangleListAdjacency:  return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ;
        case PrimitiveTopology::TriangleStripAdjacency: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ;
        case PrimitiveTopology::Patches1:               return D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches2:               return D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches3:               return D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches4:               return D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches5:               return D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches6:               return D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches7:               return D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches8:               return D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches9:               return D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches10:              return D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches11:              return D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches12:              return D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches13:              return D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches14:              return D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches15:              return D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches16:              return D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches17:              return D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches18:              return D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches19:              return D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches20:              return D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches21:              return D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches22:              return D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches23:              return D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches24:              return D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches25:              return D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches26:              return D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches27:              return D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches28:              return D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches29:              return D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches30:              return D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches31:              return D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST;
        case PrimitiveTopology::Patches32:              return D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST;
    }
    MapFailed("PrimitiveTopology", "D3D_PRIMITIVE_TOPOLOGY");
}

Format Unmap(const DXGI_FORMAT format)
{
    switch (format)
    {
        /* --- Alpha channel color formats --- */
        case DXGI_FORMAT_A8_UNORM:                  return Format::A8UNorm;

        /* --- Red channel color formats --- */
        case DXGI_FORMAT_R8_UNORM:                  return Format::R8UNorm;
        case DXGI_FORMAT_R8_SNORM:                  return Format::R8SNorm;
        case DXGI_FORMAT_R8_UINT:                   return Format::R8UInt;
        case DXGI_FORMAT_R8_SINT:                   return Format::R8SInt;

        case DXGI_FORMAT_R16_UNORM:                 return Format::R16UNorm;
        case DXGI_FORMAT_R16_SNORM:                 return Format::R16SNorm;
        case DXGI_FORMAT_R16_UINT:                  return Format::R16UInt;
        case DXGI_FORMAT_R16_SINT:                  return Format::R16SInt;
        case DXGI_FORMAT_R16_FLOAT:                 return Format::R16Float;

        case DXGI_FORMAT_R32_UINT:                  return Format::R32UInt;
        case DXGI_FORMAT_R32_SINT:                  return Format::R32SInt;
        case DXGI_FORMAT_R32_FLOAT:                 return Format::R32Float;

        /* --- RG color formats --- */
        case DXGI_FORMAT_R8G8_UNORM:                return Format::RG8UNorm;
        case DXGI_FORMAT_R8G8_SNORM:                return Format::RG8SNorm;
        case DXGI_FORMAT_R8G8_UINT:                 return Format::RG8UInt;
        case DXGI_FORMAT_R8G8_SINT:                 return Format::RG8SInt;

        case DXGI_FORMAT_R16G16_UNORM:              return Format::RG16UNorm;
        case DXGI_FORMAT_R16G16_SNORM:              return Format::RG16SNorm;
        case DXGI_FORMAT_R16G16_UINT:               return Format::RG16UInt;
        case DXGI_FORMAT_R16G16_SINT:               return Format::RG16SInt;
        case DXGI_FORMAT_R16G16_FLOAT:              return Format::RG16Float;

        case DXGI_FORMAT_R32G32_UINT:               return Format::RG32UInt;
        case DXGI_FORMAT_R32G32_SINT:               return Format::RG32SInt;
        case DXGI_FORMAT_R32G32_FLOAT:              return Format::RG32Float;

        /* --- RGB color formats --- */
        case DXGI_FORMAT_R32G32B32_UINT:            return Format::RGB32UInt;
        case DXGI_FORMAT_R32G32B32_SINT:            return Format::RGB32SInt;
        case DXGI_FORMAT_R32G32B32_FLOAT:           return Format::RGB32Float;

        /* --- RGBA color formats --- */
        case DXGI_FORMAT_R8G8B8A8_UNORM:            return Format::RGBA8UNorm;
        case DXGI_FORMAT_R8G8B8A8_SNORM:            return Format::RGBA8SNorm;
        case DXGI_FORMAT_R8G8B8A8_UINT:             return Format::RGBA8UInt;
        case DXGI_FORMAT_R8G8B8A8_SINT:             return Format::RGBA8SInt;

        case DXGI_FORMAT_R16G16B16A16_UNORM:        return Format::RGBA16UNorm;
        case DXGI_FORMAT_R16G16B16A16_SNORM:        return Format::RGBA16SNorm;
        case DXGI_FORMAT_R16G16B16A16_UINT:         return Format::RGBA16UInt;
        case DXGI_FORMAT_R16G16B16A16_SINT:         return Format::RGBA16SInt;
        case DXGI_FORMAT_R16G16B16A16_FLOAT:        return Format::RGBA16Float;

        case DXGI_FORMAT_R32G32B32A32_UINT:         return Format::RGBA32UInt;
        case DXGI_FORMAT_R32G32B32A32_SINT:         return Format::RGBA32SInt;
        case DXGI_FORMAT_R32G32B32A32_FLOAT:        return Format::RGBA32Float;

        /* --- BGRA color formats --- */
        case DXGI_FORMAT_B8G8R8A8_UNORM:            return Format::BGRA8UNorm;
        case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:       return Format::BGRA8UNorm_sRGB;

        /* --- Packed formats --- */
        case DXGI_FORMAT_R10G10B10A2_UNORM:         return Format::RGB10A2UNorm;
        case DXGI_FORMAT_R10G10B10A2_UINT:          return Format::RGB10A2UInt;
        case DXGI_FORMAT_R11G11B10_FLOAT:           return Format::RG11B10Float;
        case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:        return Format::RGB9E5Float;

        /* --- Depth-stencil formats --- */
        case DXGI_FORMAT_R16_TYPELESS:              /* pass */
        case DXGI_FORMAT_D16_UNORM:                 return Format::D16UNorm;
        case DXGI_FORMAT_R32_TYPELESS:              /* pass */
        case DXGI_FORMAT_D32_FLOAT:                 return Format::D32Float;
        case DXGI_FORMAT_R24G8_TYPELESS:            /* pass */
        case DXGI_FORMAT_D24_UNORM_S8_UINT:         return Format::D24UNormS8UInt;
        case DXGI_FORMAT_R32G8X24_TYPELESS:         /* pass */
        case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:      return Format::D32FloatS8X24UInt;

        /* --- Block compression (BC) formats --- */
        case DXGI_FORMAT_BC1_UNORM:                 return Format::BC1UNorm;
        case DXGI_FORMAT_BC1_UNORM_SRGB:            return Format::BC1UNorm_sRGB;
        case DXGI_FORMAT_BC2_UNORM:                 return Format::BC2UNorm;
        case DXGI_FORMAT_BC2_UNORM_SRGB:            return Format::BC2UNorm_sRGB;
        case DXGI_FORMAT_BC3_UNORM:                 return Format::BC3UNorm;
        case DXGI_FORMAT_BC3_UNORM_SRGB:            return Format::BC3UNorm_sRGB;
        case DXGI_FORMAT_BC4_UNORM:                 return Format::BC4UNorm;
        case DXGI_FORMAT_BC4_SNORM:                 return Format::BC4SNorm;
        case DXGI_FORMAT_BC5_UNORM:                 return Format::BC5UNorm;
        case DXGI_FORMAT_BC5_SNORM:                 return Format::BC5SNorm;

        default:                                    return Format::Undefined;
    }
}

StorageBufferType Unmap(const D3D_SHADER_INPUT_TYPE inputType)
{
    switch (inputType)
    {
        case D3D_SIT_UAV_RWTYPED:                   return StorageBufferType::RWTypedBuffer;
        case D3D_SIT_STRUCTURED:                    return StorageBufferType::StructuredBuffer;
        case D3D_SIT_UAV_RWSTRUCTURED:              return StorageBufferType::RWStructuredBuffer;
        case D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER: return StorageBufferType::RWStructuredBuffer;
        case D3D_SIT_BYTEADDRESS:                   return StorageBufferType::ByteAddressBuffer;
        case D3D_SIT_UAV_RWBYTEADDRESS:             return StorageBufferType::RWByteAddressBuffer;
        case D3D_SIT_UAV_APPEND_STRUCTURED:         return StorageBufferType::AppendStructuredBuffer;
        case D3D_SIT_UAV_CONSUME_STRUCTURED:        return StorageBufferType::ConsumeStructuredBuffer;
        default:                                    return StorageBufferType::Undefined;
    }
}

SystemValue Unmap(const D3D_NAME name)
{
    switch (name)
    {
        case D3D_NAME_CLIP_DISTANCE:                return SystemValue::ClipDistance;
        case D3D_NAME_TARGET:                       return SystemValue::Color;
        case D3D_NAME_CULL_DISTANCE:                return SystemValue::CullDistance;
        case D3D_NAME_DEPTH:                        return SystemValue::Depth;
        case D3D_NAME_DEPTH_GREATER_EQUAL:          return SystemValue::DepthGreater;
        case D3D_NAME_DEPTH_LESS_EQUAL:             return SystemValue::DepthLess;
        case D3D_NAME_IS_FRONT_FACE:                return SystemValue::FrontFacing;
        case D3D_NAME_INSTANCE_ID:                  return SystemValue::InstanceID;
        case D3D_NAME_POSITION:                     return SystemValue::Position;
        case D3D_NAME_PRIMITIVE_ID:                 return SystemValue::PrimitiveID;
        case D3D_NAME_RENDER_TARGET_ARRAY_INDEX:    return SystemValue::RenderTargetIndex;
        case D3D_NAME_COVERAGE:                     return SystemValue::SampleMask;
        case D3D_NAME_SAMPLE_INDEX:                 return SystemValue::SampleID;
        #if defined LLGL_DX_ENABLE_D3D12 || LLGL_D3D11_ENABLE_FEATURELEVEL >= 3
        case D3D_NAME_STENCIL_REF:                  return SystemValue::Stencil;
        #endif
        case D3D_NAME_VERTEX_ID:                    return SystemValue::VertexID;
        case D3D_NAME_VIEWPORT_ARRAY_INDEX:         return SystemValue::ViewportIndex;
        default:                                    return SystemValue::Undefined;
    }
}

ResourceType Unmap(const D3D_SRV_DIMENSION dimension)
{
    switch (dimension)
    {
        case D3D_SRV_DIMENSION_BUFFER:
        case D3D_SRV_DIMENSION_BUFFEREX:
            return ResourceType::Buffer;
        case D3D_SRV_DIMENSION_TEXTURE1D:
        case D3D_SRV_DIMENSION_TEXTURE1DARRAY:
        case D3D_SRV_DIMENSION_TEXTURE2D:
        case D3D_SRV_DIMENSION_TEXTURE2DARRAY:
        case D3D_SRV_DIMENSION_TEXTURE2DMS:
        case D3D_SRV_DIMENSION_TEXTURE2DMSARRAY:
        case D3D_SRV_DIMENSION_TEXTURE3D:
        case D3D_SRV_DIMENSION_TEXTURECUBE:
        case D3D_SRV_DIMENSION_TEXTURECUBEARRAY:
            return ResourceType::Texture;
        default:
            return ResourceType::Undefined;
    }
}

DXGI_FORMAT ToDXGIFormatDSV(const DXGI_FORMAT format)
{
    switch (format)
    {
        case DXGI_FORMAT_R16_TYPELESS:      return DXGI_FORMAT_D16_UNORM;
        case DXGI_FORMAT_R32_TYPELESS:      return DXGI_FORMAT_D32_FLOAT;
        case DXGI_FORMAT_R24G8_TYPELESS:    return DXGI_FORMAT_D24_UNORM_S8_UINT;
        case DXGI_FORMAT_R32G8X24_TYPELESS: return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
        default:                            return format;
    }
}

DXGI_FORMAT ToDXGIFormatSRV(const DXGI_FORMAT format)
{
    switch (format)
    {
        case DXGI_FORMAT_R16_TYPELESS:      return DXGI_FORMAT_R16_UNORM;
        case DXGI_FORMAT_R32_TYPELESS:      return DXGI_FORMAT_R32_FLOAT;
        case DXGI_FORMAT_R24G8_TYPELESS:    return DXGI_FORMAT_UNKNOWN;
        case DXGI_FORMAT_R32G8X24_TYPELESS: return DXGI_FORMAT_UNKNOWN;
        default:                            return format;
    }
}

DXGI_FORMAT ToDXGIFormatUAV(const DXGI_FORMAT format)
{
    switch (format)
    {
        case DXGI_FORMAT_R16_TYPELESS:          return DXGI_FORMAT_R16_UNORM;
        case DXGI_FORMAT_R32_TYPELESS:          return DXGI_FORMAT_R32_FLOAT;
        case DXGI_FORMAT_R24G8_TYPELESS:        return DXGI_FORMAT_UNKNOWN;
        case DXGI_FORMAT_R32G8X24_TYPELESS:     return DXGI_FORMAT_UNKNOWN;
        case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:   return DXGI_FORMAT_R8G8B8A8_UNORM; // UAVs cannot have typed sRGB format
        case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:   return DXGI_FORMAT_B8G8R8A8_UNORM; // UAVs cannot have typed sRGB format
        default:                                return format;
    }
}

DXGI_FORMAT ToDXGIFormatUInt(const DXGI_FORMAT format)
{
    switch (format)
    {
        /* --- Alpha channel color formats --- */
        case DXGI_FORMAT_A8_UNORM:                  break; // not supported

        /* --- Red channel color formats --- */
        case DXGI_FORMAT_R8_UNORM:                  /* pass */
        case DXGI_FORMAT_R8_SNORM:                  /* pass */
        case DXGI_FORMAT_R8_UINT:                   /* pass */
        case DXGI_FORMAT_R8_SINT:                   return DXGI_FORMAT_R8_UINT;

        case DXGI_FORMAT_R16_UNORM:                 /* pass */
        case DXGI_FORMAT_R16_SNORM:                 /* pass */
        case DXGI_FORMAT_R16_UINT:                  /* pass */
        case DXGI_FORMAT_R16_SINT:                  /* pass */
        case DXGI_FORMAT_R16_FLOAT:                 return DXGI_FORMAT_R16_UINT;

        case DXGI_FORMAT_R32_UINT:                  /* pass */
        case DXGI_FORMAT_R32_SINT:                  /* pass */
        case DXGI_FORMAT_R32_FLOAT:                 return DXGI_FORMAT_R32_UINT;

        /* --- RG color formats --- */
        case DXGI_FORMAT_R8G8_UNORM:                /* pass */
        case DXGI_FORMAT_R8G8_SNORM:                /* pass */
        case DXGI_FORMAT_R8G8_UINT:                 /* pass */
        case DXGI_FORMAT_R8G8_SINT:                 return DXGI_FORMAT_R8G8_UINT;

        case DXGI_FORMAT_R16G16_UNORM:              /* pass */
        case DXGI_FORMAT_R16G16_SNORM:              /* pass */
        case DXGI_FORMAT_R16G16_UINT:               /* pass */
        case DXGI_FORMAT_R16G16_SINT:               /* pass */
        case DXGI_FORMAT_R16G16_FLOAT:              return DXGI_FORMAT_R16G16_UINT;

        case DXGI_FORMAT_R32G32_UINT:               /* pass */
        case DXGI_FORMAT_R32G32_SINT:               /* pass */
        case DXGI_FORMAT_R32G32_FLOAT:              return DXGI_FORMAT_R32G32_UINT;

        /* --- RGB color formats --- */
        case DXGI_FORMAT_R32G32B32_UINT:            /* pass */
        case DXGI_FORMAT_R32G32B32_SINT:            /* pass */
        case DXGI_FORMAT_R32G32B32_FLOAT:           return DXGI_FORMAT_R32G32B32_UINT;

        /* --- RGBA color formats --- */
        case DXGI_FORMAT_R8G8B8A8_UNORM:            /* pass */
        case DXGI_FORMAT_R8G8B8A8_SNORM:            /* pass */
        case DXGI_FORMAT_R8G8B8A8_UINT:             /* pass */
        case DXGI_FORMAT_R8G8B8A8_SINT:             return DXGI_FORMAT_R8G8B8A8_UINT;

        case DXGI_FORMAT_R16G16B16A16_UNORM:        /* pass */
        case DXGI_FORMAT_R16G16B16A16_SNORM:        /* pass */
        case DXGI_FORMAT_R16G16B16A16_UINT:         /* pass */
        case DXGI_FORMAT_R16G16B16A16_SINT:         /* pass */
        case DXGI_FORMAT_R16G16B16A16_FLOAT:        return DXGI_FORMAT_R16G16B16A16_UINT;

        case DXGI_FORMAT_R32G32B32A32_UINT:         /* pass */
        case DXGI_FORMAT_R32G32B32A32_SINT:         /* pass */
        case DXGI_FORMAT_R32G32B32A32_FLOAT:        return DXGI_FORMAT_R32G32B32A32_UINT;

        /* --- BGRA color formats --- */
        case DXGI_FORMAT_B8G8R8A8_UNORM:            return DXGI_FORMAT_R8G8B8A8_UINT;
        case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:       return DXGI_FORMAT_R8G8B8A8_UINT;

        /* --- Packed formats --- */
        case DXGI_FORMAT_R10G10B10A2_UNORM:         return DXGI_FORMAT_R10G10B10A2_UINT;
        case DXGI_FORMAT_R10G10B10A2_UINT:          return DXGI_FORMAT_R10G10B10A2_UINT;
        case DXGI_FORMAT_R11G11B10_FLOAT:           break; // not supported
        case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:        break; // not supported

        default:                                    break;
    }
    throw std::invalid_argument("failed to map DXGI_FORMAT to compatible format for logic operations");
}

bool HasStencilComponent(const DXGI_FORMAT format)
{
    return (format == DXGI_FORMAT_D24_UNORM_S8_UINT || format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT);
}

bool IsDXGIFormatSRGB(const DXGI_FORMAT format)
{
    switch (format)
    {
        case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
        case DXGI_FORMAT_BC1_UNORM_SRGB:
        case DXGI_FORMAT_BC2_UNORM_SRGB:
        case DXGI_FORMAT_BC3_UNORM_SRGB:
        case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
        case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
        case DXGI_FORMAT_BC7_UNORM_SRGB:
            return true;
        default:
            return false;
    }
}

/*
Fills the 4D vector for the specified DXGI_FORMAT in order to fill a buffer with a fixed 32-bit value.
For formats that don't have 32-bit components such as DXGI_FORMAT_R16G16_UINT,
the value must be distributed over the components to work with "ID3D11DeviceContext::ClearUnorderedAccessViewUint".
see https://docs.microsoft.com/en-us/windows/win32/api/d3d11/nf-d3d11-id3d11devicecontext-clearunorderedaccessviewuint
*/
bool MakeUAVClearVector(const DXGI_FORMAT format, UINT (&valuesVec4)[4], UINT value)
{
    switch (format)
    {
        case DXGI_FORMAT_R32G32B32A32_FLOAT:
        case DXGI_FORMAT_R32G32B32A32_UINT:
        case DXGI_FORMAT_R32G32B32A32_SINT:
        case DXGI_FORMAT_R32G32_FLOAT:
        case DXGI_FORMAT_R32G32_UINT:
        case DXGI_FORMAT_R32G32_SINT:
        case DXGI_FORMAT_R32_FLOAT:
        case DXGI_FORMAT_R32_UINT:
        case DXGI_FORMAT_R32_SINT:
        {
            valuesVec4[3] = value;
            valuesVec4[2] = value;
            valuesVec4[1] = value;
            valuesVec4[0] = value;
        }
        return true;

        case DXGI_FORMAT_R16G16B16A16_FLOAT:
        case DXGI_FORMAT_R16G16B16A16_UNORM:
        case DXGI_FORMAT_R16G16B16A16_UINT:
        case DXGI_FORMAT_R16G16B16A16_SNORM:
        case DXGI_FORMAT_R16G16B16A16_SINT:
        case DXGI_FORMAT_R16G16_FLOAT:
        case DXGI_FORMAT_R16G16_UNORM:
        case DXGI_FORMAT_R16G16_UINT:
        case DXGI_FORMAT_R16G16_SNORM:
        case DXGI_FORMAT_R16G16_SINT:
        {
            valuesVec4[3] = (value >> 16) & 0x0000FFFF;
            valuesVec4[2] = (value      ) & 0x0000FFFF;
            valuesVec4[1] = (value >> 16) & 0x0000FFFF;
            valuesVec4[0] = (value      ) & 0x0000FFFF;
        }
        return true;

        case DXGI_FORMAT_R8G8B8A8_UNORM:
        case DXGI_FORMAT_R8G8B8A8_UINT:
        case DXGI_FORMAT_R8G8B8A8_SNORM:
        case DXGI_FORMAT_R8G8B8A8_SINT:
        {
            valuesVec4[3] = (value >> 24) & 0x000000FF;
            valuesVec4[2] = (value >> 16) & 0x000000FF;
            valuesVec4[1] = (value >>  8) & 0x000000FF;
            valuesVec4[0] = (value      ) & 0x000000FF;
        }
        return true;

        case DXGI_FORMAT_R10G10B10A2_UNORM:
        case DXGI_FORMAT_R10G10B10A2_UINT:
        {
            valuesVec4[3] = (value >> 22) & 0x000003FF;
            valuesVec4[2] = (value >> 12) & 0x000003FF;
            valuesVec4[1] = (value >>  2) & 0x000003FF;
            valuesVec4[0] = (value      ) & 0x00000003;
        }
        return true;

        case DXGI_FORMAT_R11G11B10_FLOAT:
        {
            valuesVec4[3] = (value >> 21) & 0x000007FF;
            valuesVec4[2] = (value >> 10) & 0x000007FF;
            valuesVec4[1] = (value      ) & 0x000003FF;
            valuesVec4[0] = 0;
        }
        return true;

        case DXGI_FORMAT_R8G8_UNORM:
        case DXGI_FORMAT_R8G8_UINT:
        case DXGI_FORMAT_R8G8_SNORM:
        case DXGI_FORMAT_R8G8_SINT:
        {
            /* Only supported if lower and upper 16-bit halfs are equal */
            if (((value >> 16) & 0x0000FFFF) == (value & 0x0000FFFF))
            {
                const UINT v0 = (value >> 8) & 0x000000FF;
                const UINT v1 = (value     ) & 0x000000FF;
                valuesVec4[3] = v0;
                valuesVec4[2] = v1;
                valuesVec4[1] = v0;
                valuesVec4[0] = v1;
                return true;
            }
        }
        break;

        case DXGI_FORMAT_R16_FLOAT:
        case DXGI_FORMAT_R16_UNORM:
        case DXGI_FORMAT_R16_UINT:
        case DXGI_FORMAT_R16_SNORM:
        case DXGI_FORMAT_R16_SINT:
        {
            /* Only supported if lower and upper 16-bit halfs are equal */
            if (((value >> 16) & 0x0000FFFF) == (value & 0x0000FFFF))
            {
                const UINT v0 = value & 0x0000FFFF;
                valuesVec4[3] = v0;
                valuesVec4[2] = v0;
                valuesVec4[1] = v0;
                valuesVec4[0] = v0;
                return true;
            }
        }
        break;

        case DXGI_FORMAT_R8_UNORM:
        case DXGI_FORMAT_R8_UINT:
        case DXGI_FORMAT_R8_SNORM:
        case DXGI_FORMAT_R8_SINT:
        case DXGI_FORMAT_A8_UNORM:
        {
            /* Only supported if all 8 bits are equal */
            if (((value >> 24) & 0x000000FF) == (value & 0x000000FF) &&
                ((value >> 16) & 0x000000FF) == (value & 0x000000FF) &&
                ((value >>  8) & 0x000000FF) == (value & 0x000000FF))
            {
                const UINT v0 = value & 0x000000FF;
                valuesVec4[3] = v0;
                valuesVec4[2] = v0;
                valuesVec4[1] = v0;
                valuesVec4[0] = v0;
                return true;
            }
        }
        break;

        default:
        break;
    }
    return false;
}

} // /namespace DXTypes

} // /namespace LLGL

// ================================================================================


text:
package consumer.kafka.client;

import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.spark.storage.StorageLevel;
import org.apache.spark.streaming.receiver.Receiver;

import consumer.kafka.KafkaConfig;
import consumer.kafka.KafkaConsumer;
import consumer.kafka.MessageAndMetadata;
import consumer.kafka.ZkState;

public class KafkaRangeReceiver extends Receiver<MessageAndMetadata> {

	private static final long serialVersionUID = -4434734456026616121L;
	private final Properties _props;
	private Set<Integer> _partitionSet ;
	private KafkaConsumer _kConsumer;
	private transient Thread _consumerThread;
	private transient ExecutorService _executorService;

	public KafkaRangeReceiver(Properties props, Set<Integer> partitionSet) {
		super(StorageLevel.MEMORY_ONLY());
		this._props = props;
		_partitionSet = partitionSet;
	}

	@Override
	public void onStart() {

		start();

	}

	public void start() {

		// Start the thread that receives data over a connection
		_executorService = Executors.newFixedThreadPool(_partitionSet.size());

		for(Integer partitionId : _partitionSet){

			KafkaConfig kafkaConfig = new KafkaConfig(_props);
			ZkState zkState = new ZkState(kafkaConfig);
			_kConsumer = new KafkaConsumer(kafkaConfig, zkState, this);
			_kConsumer.open(partitionId);

			Thread.UncaughtExceptionHandler eh = new Thread.UncaughtExceptionHandler() {
			    public void uncaughtException(Thread th, Throwable ex) {
			    	restart("Restarting Range Receiver " , ex, 5000);
			    }
			};

			_consumerThread = new Thread(_kConsumer);
			_consumerThread.setDaemon(true);
			_consumerThread.setUncaughtExceptionHandler(eh);
			_executorService.submit(_consumerThread);
		}
	}

	@Override
	public void onStop() {

		_executorService.shutdown();
	}
}


text:
@interface BZRAddJianhurenViewController : UIViewController

@property (nonatomic, strong) BZRJianhurenModel *jianhurenInfo;

@end


text:
<!DOCTYPE html>
<meta charset="utf-8">
<title>Named access on the window object - Nested browsing context</title>
<link rel="author" title="Matthew Phillips" href="mailto:matthew@matthewphillips.info">
<link rel="help" href="https://html.spec.whatwg.org/#named-access-on-the-window-object">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<body>

<script>
"use strict";

test(() => {
  const iframe = document.createElement("iframe");
  iframe.setAttribute("name", "foo");
  document.body.appendChild(iframe);

  assert_true(Boolean(iframe.contentWindow), "test prerequisite");
  assert_equals(window.foo, iframe.contentWindow);
}, "A named property that matches any element that contains a nested " +
  "browsing context, should return the WindowProxy of that context");

test(() => {
  const iframe = document.createElement("iframe");
  iframe.setAttribute("id", "bar");
  document.body.appendChild(iframe);

  assert_equals(window.bar, iframe);
}, "A named property that matches an element that contains a nested " +
  "browsing context should return the element if using id");
</script>
</body>


text:
CGSize CGAddSizeToSize(CGSize size1, CGSize size2);
CGSize CGSubSizeFromSize(CGSize size1, CGSize size2);

CGPoint CGAddPointToPoint(CGPoint point1, CGPoint point2);
CGPoint CGSubPointFromPoint(CGPoint point1, CGPoint point2);

CGRect CGRectSetWidth(CGRect rect, CGFloat width);
CGRect CGRectAddWidth(CGRect rect, CGFloat width);

CGRect CGRectSetHeight(CGRect rect, CGFloat height);
CGRect CGRectAddHeight(CGRect rect, CGFloat height);

CGRect CGRectSetSize(CGRect rect, CGSize size);
CGRect CGRectAddSize(CGRect rect, CGSize size);
CGRect CGRectSubSize(CGRect rect, CGSize size);

CGRect CGRectSetX(CGRect rect, CGFloat x);
CGRect CGRectAddX(CGRect rect, CGFloat x);

CGRect CGRectSetY(CGRect rect, CGFloat y);
CGRect CGRectAddY(CGRect rect, CGFloat y);

CGRect CGRectSetOrigin(CGRect rect, CGPoint origin);
CGRect CGRectAddOrigin(CGRect rect, CGPoint origin);
CGRect CGRectSubOrigin(CGRect rect, CGPoint origin);

CGFloat CGRectRightX(CGRect rect);
CGFloat CGRectBottomY(CGRect rect);


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.rankingexpression.evaluation.gbdtoptimization;

import com.yahoo.searchlib.rankingexpression.Reference;
import com.yahoo.searchlib.rankingexpression.evaluation.Context;
import com.yahoo.searchlib.rankingexpression.evaluation.DoubleValue;
import com.yahoo.searchlib.rankingexpression.evaluation.Value;
import com.yahoo.searchlib.rankingexpression.rule.CompositeNode;
import com.yahoo.searchlib.rankingexpression.rule.ExpressionNode;
import com.yahoo.searchlib.rankingexpression.rule.SerializationContext;
import com.yahoo.tensor.TensorType;
import com.yahoo.tensor.evaluation.TypeContext;

import java.util.Arrays;
import java.util.Deque;
import java.util.Objects;

/**
 * An optimized version of a decision tree.
 *
 * @author bratseth
 */
public final class GBDTNode extends ExpressionNode {

    // The GBDT node vm works by reading doubles one at a time and interpreting them
    // as either constant data or a mangling of opcode and variable reference:
    // The value space is as follows:
    // n=[0,MAX_LEAF_VALUE>                                             : n is data (tree leaf constant value)
    // n=[MAX_LEAF_VALUE+MAX_VARIABLES*0,MAX_LEAF_VALUE+MAX_VARIABLES*1>: < than var at index n
    // n=[MAX_LEAF_VALUE+MAX_VARIABLES*1,MAX_LEAF_VALUE+MAX_VARIABLES*2>: = to var at index n-MAX_VARIABLES
    // n=[MAX_LEAF_VALUE+MAX_VARIABLES*2,MAX_LEAF_VALUE+MAX_VARIABLES*3>: n-MAX_VARIABLES*2 is IN the following set
    // n=[MAX_LEAF_VALUE+MAX_VARIABLES*3,MAX_LEAF_VALUE+MAX_VARIABLES*4]: !( >= ) than var at index n-MAX_VARIABLES*3 (if-inversion)

    // The full layout of an IF instruction is
    // COMPARISON,TRUE_BRANCH_LENGTH,TRUE_BRANCH,FALSE_BRANCH
    // where COMPARISON is VARIABLE_AND_OPCODE,COMPARE_CONSTANT if the opcode is < or = or !( >= ),
    // and                 VARIABLE_AND_OPCODE,COMPARE_CONSTANTS_LENGTH,COMPARE_CONSTANTS if the opcode is IN

    // If any change is made to this encoding, this change must also be reflected in GBDTOptimizer

    /** The max (absolute) supported value an optimized leaf may have */
    public final static int MAX_LEAF_VALUE=2*1000*1000*1000;

    /** The max number of variables (features) supported in the context */
    public final static int MAX_VARIABLES=1*1000*1000;

    private final double[] values;

    public GBDTNode(double[] values) {
        this.values=values;
    }

    /** Returns a direct reference to the values of this. The returned array must not be modified. */
    public final double[] values() { return values; }

    @Override
    public final TensorType type(TypeContext<Reference> context) { return TensorType.empty; }

    @Override
    public final Value evaluate(Context context) {
        return new DoubleValue(evaluate(values,0,context));
    }

    public static double evaluate(double[] values, int startOffset, Context context) {
        int pc = startOffset;
        while (true) {
            double nextValue = values[pc++];
            if (nextValue >= MAX_LEAF_VALUE) { // a condition node
                int offset = (int)nextValue - MAX_LEAF_VALUE;
                boolean comparisonIsTrue = false;
                if (offset < MAX_VARIABLES) {
                    comparisonIsTrue = context.getDouble(offset)<values[pc++];
                }
                else if (offset < MAX_VARIABLES*2) {
                    comparisonIsTrue = context.getDouble(offset-MAX_VARIABLES)==values[pc++];
                }
                else if (offset<MAX_VARIABLES*3) {
                    double testValue = context.getDouble(offset-MAX_VARIABLES*2);
                    int setValuesLeft = (int)values[pc++];
                    while (setValuesLeft > 0) { // test each value in the set
                        setValuesLeft--;
                        if (testValue == values[pc++]) {
                            comparisonIsTrue=true;
                            break;
                        }
                    }
                    pc += setValuesLeft; // jump to after the set
                }
                else { // offset<MAX_VARIABLES*4
                    comparisonIsTrue = ! (context.getDouble(offset-MAX_VARIABLES*3)>=values[pc++]);
                }

                if (comparisonIsTrue)
                    pc++; // true branch - skip the jump value
                else
                    pc += values[pc]; // false branch - jump
            }
            else { // a leaf
                return nextValue;
            }
        }
    }

    /** Returns "(optimized condition tree)" */
    @Override
    public StringBuilder toString(StringBuilder string, SerializationContext context, Deque<String> path, CompositeNode parent) {
        return string.append("(optimized condition tree)");
    }

    @Override
    public int hashCode() { return Objects.hash("gbdtNode", Arrays.hashCode(values)); }

}


text:
package logger

import (
	"os"
	"strings"
	"sync"

	log "github.com/cihub/seelog"
)

const (
	LOGLEVEL_ENV_VAR = "ECS_LOGLEVEL"
	LOGFILE_ENV_VAR  = "ECS_LOGFILE"

	DEFAULT_LOGLEVEL = "info"
)

var logfile string
var level string
var levels map[string]string
var logger OldLogger

// Initialize this logger once
var once sync.Once

func init() {
	once.Do(initLogger)
}

func initLogger() {
	levels = map[string]string{
		"debug": "debug",
		"info":  "info",
		"warn":  "warn",
		"error": "error",
		"crit":  "critical",
		"none":  "off",
	}
	level = DEFAULT_LOGLEVEL

	logger = &Shim{}

	envLevel := os.Getenv(LOGLEVEL_ENV_VAR)

	logfile = os.Getenv(LOGFILE_ENV_VAR)
	SetLevel(envLevel)
	reloadConfig()
}

func reloadConfig() {
	logger, err := log.LoggerFromConfigAsString(loggerConfig())
	if err == nil {
		log.ReplaceLogger(logger)
	} else {
		log.Error(err)
	}
}

// SetLevel sets the log level for logging
func SetLevel(logLevel string) {
	parsedLevel, ok := levels[strings.ToLower(logLevel)]
	if ok {
		level = parsedLevel
		reloadConfig()
	}
}

// ForModule returns an OldLogger instance.  OldLogger is deprecated and kept
// for compatibility reasons.  Prefer using Seelog directly.
func ForModule(module string) OldLogger {
	once.Do(initLogger)
	return logger.New("module", module)
}