曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 6194|回复: 0
打印 上一主题 下一主题

[Curl] curl_slist_append() -- 新增 slist 链表节点

[复制链接]

4917

主题

5879

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34382
跳转到指定楼层
楼主
发表于 2011-7-4 17:22:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
curl_slist_append() 函数声明如下:
[C++] 纯文本查看 复制代码
#include <curl/curl.h>
struct curl_slist *curl_slist_append(struct curl_slist * list, const char * string );

该函数将一个字符串追加到 slist 链表中。第 1 个参数是 struct_slist 类型链表;第 2 个参数是要增加到链表节点结构中的字符串。函数完成后,返回指向该链表的指针。

struct curl_slist 的类型定义在 curl.h 中:
[C++] 纯文本查看 复制代码
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
  char *data;
  struct curl_slist *next;
};


使用了该函数,在工作完成后应该使用 curl_slist_free_all() 对其链表进行释放。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2024-5-9 23:15 , Processed in 0.077126 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表