加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
http_hdrs.h 2.24 KB
一键复制 编辑 原始数据 按行查看 历史
zentel 提交于 2016-10-26 10:05 . surpport build for windows
/*
* http_hdrs.h -- This file contains declarations for http headers
* Created: Christopher Blizzard <blizzard@appliedtheory.com>, 3-Aug-1998
*
* Copyright (C) 1998 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef HTTP_HDRS_H
#define HTTP_HDRS_H
#include "ghttp_constants.h"
#ifdef _WIN32
#define strcasecmp strcmp
#endif
/* the list of known headers */
extern const char *http_hdr_known_list[];
/* a header list */
#define HTTP_HDRS_MAX 256
typedef struct http_hdr_list_tag
{
char *header[HTTP_HDRS_MAX];
char *value[HTTP_HDRS_MAX];
} http_hdr_list;
/* functions dealing with headers */
/* check to see if the library knows about the header */
const char *
http_hdr_is_known(const char *a_hdr);
/* create a new list */
http_hdr_list *
http_hdr_list_new(void);
/* destroy a list */
void
http_hdr_list_destroy(http_hdr_list *a_list);
/* set a value in a list */
int
http_hdr_set_value(http_hdr_list *a_list,
const char *a_name,
const char *a_val);
/* set the value in a list from a range, not a NTS */
int
http_hdr_set_value_no_nts(http_hdr_list *a_list,
const char *a_name_start,
int a_name_len,
const char *a_val_start,
int a_val_len);
/* get a copy of a value in a list */
char *
http_hdr_get_value(http_hdr_list *a_list,
const char *a_name);
/* get a copy of the headers in a list */
int
http_hdr_get_headers(http_hdr_list *a_list,
char ***a_names,
int *a_num_names);
/* clear a header in a list */
int
http_hdr_clear_value(http_hdr_list *a_list,
const char *a_name);
#endif /* HTTP_HDRS_H */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化