⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 url.docs

📁 this is simple sip stack.
💻 DOCS
字号:
/**@mainpage Sofia URL Module@section url_meta Module Meta InformationThe Sofia @b url module contains macros and functions for using URLdatatype, parsing and printing URLs. @CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>@STATUS Core library@LICENSE LGPL@section url_syntax Using URL LibraryThe URL library provides URL datatype and helper functions related to it. There is URL parser, which separates the URL components to the url_tstructure.@note Please note that we use terms URL and URI interchangeable.The formal URI syntax is defined in the <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC2396</a>.The URLs consist of a subset of printable ASCII (ECMA-5) characters. Thesubset excludes space and characters commonly used as @e delimiters intext-based protocols, such as <b> < > # \% </b>and<b> " </b> (doublequote), and so called @e unwise characters whose positions are reserved fornational extensions in ECMA-5. In US-ASCII, those characters are:<code><b>{ } | \ ^ [ ] `</b></code>There are also nine characters that can have special syntactic meaning insome parts of the URI. These @e reserved characters are used to separatesyntactical parts of the URLs from each other. The reserved characters areas follows: <b> : @ / ; ? & = + </b>and<b> $</b>.The URL library understands two alternative URL syntaxes. First, thebasic syntax used by, e.g., @b ftp:, @b http: and @b rtsp: URLs:<i>scheme</i> ":" ["//" [ <i>user</i> [":" <i>password</i> ] "@"] <i>host</i> [":" <i>port</i> ] ]       ["/" <i>path</i> ] ["?" <i>query</i> ] ["#" <i>fragment</i> ]Alternatively, the syntax used by @b mailto:, @b sip:, @b im:, @b tel,and @b pres: URLs:<i>scheme</i> ":" [ [ <i>user</i> [":" <i>password</i> ] "@"] <i>host</i> [":" <i>port</i> ] ] [";" <i>params</i> ] ["?" <i>query</i> ]["#" <i>fragment</i> ]Note that also "*" is considered to be a valid URL (with type #url_any).For example: \n@codehttp://example.org:7100/cgi-bin/query?key=90786ftp://user:pass\@ftp.example.com/pub/sip:user:pass\@example.com;user=iptel:+358718008000@endcode@subsection url_parsing Converting a String to url_tThe decoding function url_d() takes a string and splits it into parts asshown above. The substrings are stored into the #url_t structure. Whendecoding, the hex encoding using \% is removed if the encoded character cansyntactically be part of the field. For instance, "%41" is decoded as"A" in the user part, but "%40" (@) is left as is. (This is calledcanonization of the URL fields.)For example, when we parse the url below@codesip:joe%2Euser@example%2Ecom;method=%4D%45%53%53%41%47%45?body=CANNED%20MSG@endcodethe components are NUL-terminated, canonized and assigned to the structureas follows:@code url_type = url_sip url_root = 0  url_scheme = "sip" url_user = "joe.user" url_password = NULL url_host = "example.com" url_port = NULL url_path = NULL url_params = "method=MESSAGE" url_headers = "body=CANNED%20MSG" url_fragment = NULL@endcodeOther functions parsing URLs are as follows:- url_hdup() (it takes a string as @a url parameter)@subsection url_parsing Converting a url_t structure to stringThe url_e() encodes the url, in other words, it joins the substrings in#url_t to the provided buffer.@subsection url_reference Functions and Macros in URL ModuleThe @b url parsing, printing, copying and access functions are defined inthe url.h include file:- url_d()- url_len()- url_e()- url_xtra()- url_dup()- url_hdup()- url_as_string()- url_reserved_p()- url_esclen()- url_escape()- url_unescape()- url_param()- url_param_add()- url_cmp()- url_strip_transport()- url_have_transport()- url_port()- url_sanitize()- url_update()- url_digest()In addition to the basic URL structure, url_t, the library interfaceprovides an union type #url_string_t for passing unparsed strings insteadof parsed URLs as function arguments:- url_string_p()- URL_STRING_P()- URL_STRING_MAKE()For printf()-style formatting, macros #URL_PRINT_FORMAT andURL_PRINT_ARGS() are provided. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -