xrtHttpLinkCursorInit
初始化单个 Link 字段值游标。
void xrtHttpLinkCursorInit(xhttplinkcursor* pCursor);
| 参数 | 说明 |
|---|---|
| xhttplinkcursor* pCursor | 游标 |
返回:初始化单个 Link 字段值游标。
示例已编译验证
httplinkcursorinit obj; xrtHttpLinkCursorInit(&obj, pCursor);
xrtHttpLinkFieldCursorInit
初始化重复 Link 字段行游标。
void xrtHttpLinkFieldCursorInit( xhttplinkfieldcursor* pCursor );
| 参数 | 说明 |
|---|---|
| xhttplinkfieldcursor* pCursor | 游标 |
返回:初始化重复 Link 字段行游标。
示例已编译验证
httplinkfieldcursorinit obj; xrtHttpLinkFieldCursorInit(&obj, pCursor);
xrtHttpLinkElementParse
严格解析一个 link-value;rel 必须存在,结果借用 Element。
bool xrtHttpLinkElementParse( xstrview Element, xhttplink* pLink );
| 参数 | 说明 |
|---|---|
| xstrview Element | 元素 |
| xhttplink* pLink | Link 对象 |
返回:严格解析一个 link-value;rel 必须存在,结果借用 Element。
示例已编译验证
/* 严格解析一个 link-value;rel 必须存在,结果借用 Element。 */ result = xrtHttpLinkElementParse(Element, pLink);
xrtHttpLinkValid
严格验证完整 Link 字段值;空列表符合 RFC 的列表语法。
bool xrtHttpLinkValid(xstrview Value);
| 参数 | 说明 |
|---|---|
| xstrview Value | 值 |
返回:严格验证完整 Link 字段值;空列表符合 RFC 的列表语法。
示例已编译验证
/* 严格验证完整 Link 字段值;空列表符合 RFC 的列表语法。 */ result = xrtHttpLinkValid(Value);
xrtHttpLinkNext
按线路顺序迭代一个完整 Link 字段值。
xhttpnext xrtHttpLinkNext( xstrview Value, xhttplinkcursor* pCursor, xhttplink* pLink );
| 参数 | 说明 |
|---|---|
| xstrview Value | 值 |
| xhttplinkcursor* pCursor | 游标 |
| xhttplink* pLink | Link 对象 |
返回:按线路顺序迭代一个完整 Link 字段值。
示例已编译验证
/* 按线路顺序迭代一个完整 Link 字段值。 */ result = xrtHttpLinkNext(Value, pCursor, pLink);
xrtHttpLinkFieldNext
跨重复 Link 字段行按线路顺序迭代链接。
xhttpnext xrtHttpLinkFieldNext( const xhttpfield* pFields, size_t iCount, xhttplinkfieldcursor* pCursor, xhttplink* pLink );
| 参数 | 说明 |
|---|---|
| const xhttpfield* pFields | 字段数组 |
| size_t iCount | 数量 |
| xhttplinkfieldcursor* pCursor | 游标 |
| xhttplink* pLink | Link 对象 |
返回:跨重复 Link 字段行按线路顺序迭代链接。
示例已编译验证
/* 跨重复 Link 字段行按线路顺序迭代链接。 */ result = xrtHttpLinkFieldNext(pFields, iCount, pCursor, pLink);
xrtHttpLinkParam
严格查找第一个参数;未命中返回 END,结果借用 Link 字段。
xhttpnext xrtHttpLinkParam( const xhttplink* pLink, xstrview Name, xhttpparam* pParam );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| xstrview Name | 名称(xstrview) |
| xhttpparam* pParam | 参数 |
返回:严格查找第一个参数;未命中返回 END,结果借用 Link 字段。
示例已编译验证
/* 严格查找第一个参数;未命中返回 END,结果借用 Link 字段。 */ result = xrtHttpLinkParam(pLink, Name, pParam);
xrtHttpLinkRelationFind
按 RFC 8288 的大小写不敏感规则查找关系类型。
xhttpnext xrtHttpLinkRelationFind( const xhttplink* pLink, xstrview Relation );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| xstrview Relation | Relaton 参数 |
返回:按 RFC 8288 的大小写不敏感规则查找关系类型。
示例已编译验证
/* 按 RFC 8288 的大小写不敏感规则查找关系类型。 */ result = xrtHttpLinkRelationFind(pLink, Relation);
xrtHttpLinkAnchorWrite
解码 anchor 参数;不存在时返回 VALUE 错误,不执行 URI 解析。
bool xrtHttpLinkAnchorWrite( const xhttplink* pLink, void* pOutput, size_t iCapacity, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
返回:解码 anchor 参数;不存在时返回 VALUE 错误,不执行 URI 解析。
示例已编译验证
/* 解码 anchor 参数;不存在时返回 VALUE 错误,不执行 URI 解析。 */ result = xrtHttpLinkAnchorWrite(pLink, pOutput, iCapacity, pSize);
xrtHttpLinkAnchorBuild
构建零结尾 anchor,返回值由 xrtFree 释放。
str xrtHttpLinkAnchorBuild( const xhttplink* pLink, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| size_t* pSize | 出:大小 |
返回:构建零结尾 anchor,返回值由 xrtFree 释放。
示例已编译验证
/* 构建零结尾 anchor,返回值由 xrtFree 释放。 */ result = xrtHttpLinkAnchorBuild(pLink, pSize);
xrtHttpLinkTitleWrite
读取 UTF-8 标题;优先 title*,不支持的字符集回退 title。
bool xrtHttpLinkTitleWrite( const xhttplink* pLink, void* pOutput, size_t iCapacity, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
返回:读取 UTF-8 标题;优先 title*,不支持的字符集回退 title。
示例已编译验证
/* 读取 UTF-8 标题;优先 title*,不支持的字符集回退 title。 */ result = xrtHttpLinkTitleWrite(pLink, pOutput, iCapacity, pSize);
xrtHttpLinkTitleBuild
构建零结尾 UTF-8 标题,返回值由 xrtFree 释放。
str xrtHttpLinkTitleBuild( const xhttplink* pLink, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| size_t* pSize | 出:大小 |
返回:构建零结尾 UTF-8 标题,返回值由 xrtFree 释放。
示例已编译验证
/* 构建零结尾 UTF-8 标题,返回值由 xrtFree 释放。 */ result = xrtHttpLinkTitleBuild(pLink, pSize);
xrtHttpLinkTargetResolve
零分配使用 RFC 3986 Base 解析链接目标;输出不带零结尾。
bool xrtHttpLinkTargetResolve( const xhttplink* pLink, const xurl* pBase, void* pOutput, size_t iCapacity, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| const xurl* pBase | 基准 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
返回:零分配使用 RFC 3986 Base 解析链接目标;输出不带零结尾。
示例已编译验证
/* 零分配使用 RFC 3986 Base 解析链接目标;输出不带零结尾。 */ result = xrtHttpLinkTargetResolve(pLink, pBase, pOutput, iCapacity, pSize);
xrtHttpLinkTargetResolveBuild
分配并解析链接目标,返回值由 xrtFree 释放。
str xrtHttpLinkTargetResolveBuild( const xhttplink* pLink, const xurl* pBase, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplink* pLink | Link 对象 |
| const xurl* pBase | 基准 |
| size_t* pSize | 出:大小 |
返回:分配并解析链接目标,返回值由 xrtFree 释放。
示例已编译验证
/* 分配并解析链接目标,返回值由 xrtFree 释放。 */ result = xrtHttpLinkTargetResolveBuild(pLink, pBase, pSize);
xrtHttpLinkElementWrite
规范写出一个 link-value,不附加字段名称或 CRLF。
bool xrtHttpLinkElementWrite( const xhttplinkvalue* pLink, void* pOutput, size_t iCapacity, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplinkvalue* pLink | Link 对象 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
返回:规范写出一个 link-value,不附加字段名称或 CRLF。
示例已编译验证
/* 规范写出一个 link-value,不附加字段名称或 CRLF。 */ result = xrtHttpLinkElementWrite(pLink, pOutput, iCapacity, pSize);
xrtHttpLinkWrite
规范写出逗号分隔的 Link 元素数组。
bool xrtHttpLinkWrite( const xhttplinkvalue* pLinks, size_t iCount, void* pOutput, size_t iCapacity, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplinkvalue* pLinks | Lnks 参数 |
| size_t iCount | 数量 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
返回:规范写出逗号分隔的 Link 元素数组。
示例已编译验证
/* 规范写出逗号分隔的 Link 元素数组。 */ result = xrtHttpLinkWrite(pLinks, iCount, pOutput, iCapacity, pSize);
xrtHttpLinkBuild
构建零结尾 Link 字段值,返回值由 xrtFree 释放。
str xrtHttpLinkBuild( const xhttplinkvalue* pLinks, size_t iCount, size_t* pSize );
| 参数 | 说明 |
|---|---|
| const xhttplinkvalue* pLinks | Lnks 参数 |
| size_t iCount | 数量 |
| size_t* pSize | 出:大小 |
返回:构建零结尾 Link 字段值,返回值由 xrtFree 释放。
示例已编译验证
/* 构建零结尾 Link 字段值,返回值由 xrtFree 释放。 */ result = xrtHttpLinkBuild(pLinks, iCount, pSize);