Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

bnf.h File Reference


Detailed Description

Defined when <sofia-sip/bnf.h> has been included.

Parsing macros and prototypes for HTTP-like protocols.

Author:
Pekka Pessi <Pekka.Pessi@nokia.com>
Date:
Created: Tue Jun 06 10:59:34 2000 ppessi

Definition in file bnf.h.

#include <sofia-sip/su_types.h>
#include <string.h>

Go to the source code of this file.

Defines

#define ALPHA   LOALPHA UPALPHA
#define ALPHANUM   DIGIT ALPHA
#define CR   "\r"
#define CRLF   CR LF
#define CTL
#define DIGIT   "0123456789"
#define HEX   DIGIT "ABCDEF" "abcdef"
#define HT   "\t"
#define IS_ALPHA(c)   (c && ((_bnf_table[(unsigned char)c] & bnf_alpha)))
#define IS_ALPHANUM(c)   (c && (IS_DIGIT(c) || IS_ALPHA(c)))
#define IS_CRLF(c)   ((c) == '\r' || (c) == '\n')
#define IS_DIGIT(c)   ((c) >= '0' && (c) <= '9')
#define IS_HEX(c)   (((c) >= '0' && (c) <= '9') || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
#define IS_LWS(c)   ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n')
#define IS_NON_LWS(c)   (c && !IS_LWS(c))
#define IS_NON_WS(c)   (c && !IS_WS(c))
#define IS_PARAM(c)   ((_bnf_table[(unsigned char)c] & (bnf_token|bnf_param)))
#define IS_RESERVED(c)   (c && !(_bnf_table[(unsigned char)c] & bnf_unreserved))
#define IS_TOKEN(c)   ((_bnf_table[(unsigned char)c] & bnf_token))
#define IS_TOKENLWS(c)   ((_bnf_table[(unsigned char)c] & (bnf_token|bn_lws)))
#define IS_UNRESERVED(c)   ((_bnf_table[(unsigned char)c] & bnf_unreserved))
#define IS_WS(c)   ((c) == ' ' || (c) == '\t')
#define LF   "\n"
#define LOALPHA   "abcdefghijklmnopqrstuvwxyz"
#define LWS   SP HT CR LF
#define SAFE   "$-_."
#define SIP_SEPARATOR   "()<>@,;:\\\"/[]?={}" SP HT
#define SIP_TOKEN   ALPHANUM "-.!%*_+`'~"
#define SIP_WORD   "()<>:\\\"/[]?{}"
#define skip_alpha(ss)   (*(ss) += span_alpha(*(ss)))
#define skip_alpha_digit_safe(ss)   (*(ss) += span_alpha_digit_safe(*(ss)))
#define skip_digit(ss)   (*(ss) += span_digit(*(ss)))
#define skip_lws(ss)   (*(ss) += span_lws(*(ss)))
#define skip_param(ss)   (*(ss) += span_param(*(ss)))
#define skip_token(ss)   (*(ss) += span_token(*(ss)))
#define skip_word(ss)   (*(ss) += span_word(*(ss)))
#define skip_ws(ss)   (*(ss) += span_ws(*(ss)))
#define SP   " "
#define span_non_crlf(s)   strcspn(s, CR LF)
#define span_non_lws(s)   strcspn(s, LWS)
#define span_non_ws(s)   strcspn(s, WS)
#define span_url_scheme(s)   strspn(s, URL_SCHEME)
#define span_ws(s)   strspn(s, WS)
#define UPALPHA   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define URL_DELIMS   "<>#%\""
#define URL_ESCAPED   "%"
#define URL_MARK   "-_.!~*'()"
#define URL_RESERVED   ";/?:=+$,"
#define URL_SCHEME   ALPHANUM "+-."
#define URL_UNRESERVED   ALPHANUM URL_MARK
#define URL_UNWISE   "{}|\\^[]`"
#define WS   SP HT

Enumerations

enum  {
  bnf_ws = 1, bnf_crlf = 2, bnf_lws = 3, bnf_alpha = 4,
  bnf_safe = 8, bnf_mark = 16, bnf_unreserved = bnf_alpha | bnf_mark, bnf_separator = 32,
  bnf_token0 = 64 | bnf_safe, bnf_token = bnf_token0 | bnf_alpha, bnf_param0 = 128, bnf_param = bnf_token | bnf_param0
}

Functions

SOFIAPUBFUN issize_t scan_domain (char **inout_host)
SOFIAPUBFUN issize_t scan_host (char **inout_host)
SOFIAPUBFUN int scan_ip4_address (char **inout_host)
SOFIAPUBFUN int scan_ip6_address (char **inout_host)
SOFIAPUBFUN int scan_ip6_reference (char **inout_host)
SOFIAPUBFUN int scan_ip_address (char **inout_host)
static isize_t span_alpha (char const *s)
static isize_t span_alpha_digit_safe (char const *s)
static isize_t span_digit (char const *s)
SOFIAPUBFUN isize_t span_domain (char const *host)
static isize_t span_hexdigit (char const *s)
SOFIAPUBFUN isize_t span_host (char const *host)
SOFIAPUBFUN int span_ip4_address (char const *host)
SOFIAPUBFUN int span_ip6_address (char const *host)
SOFIAPUBFUN int span_ip6_reference (char const *host)
SOFIAPUBFUN int span_ip_address (char const *host)
static isize_t span_lws (char const *s)
static isize_t span_param (char const *s)
static isize_t span_quoted (char const *s)
static isize_t span_token (char const *s)
static isize_t span_token_lws (char const *s)
static isize_t span_unreserved (char const *s)
static isize_t span_word (char const *s)

Variables

SOFIAPUBVAR unsigned char const _bnf_table [256]


Generated by  Doxygen 1.6.0   Back to index