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

📄 parsetst.c

📁 一个很有名的浏览器
💻 C
字号:
/* Tool for testing of cookies string parser *//* $Id: parsetst.c,v 1.9 2004/07/15 00:49:26 jonas Exp $ */#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <stdio.h>#include <stdlib.h>#include <string.h>#include "cookies/parser.h"intmain(int argc, char *argv[]){	struct cookie_str cstr;	unsigned char name[1024], value[1024], string[1024];	printf("This thing is for testing of cookies name-value pair parser.\n"	       "You probably do not want to mess with it :).\n");	while (1) {		printf("Enter string (empty==quit): "); fflush(stdout);		fgets(string, 1024, stdin);		string[strlen(string) - 1] = '\0'; /* Strip newline. */		if (!*string) return 0;		if (!parse_cookie_str(&cstr, string)) {			printf("ERROR while parsing '%s'!\n", string);			continue;		}		memcpy(name, cstr.str, cstr.nam_end - cstr.str);		name[cstr.nam_end - cstr.str] = '\0';		memcpy(value, cstr.val_start, cstr.val_end - cstr.val_start);		value[cstr.val_end - cstr.val_start] = '\0';		printf("'%s' -> '%s' :: '%s'\n", string, name, value);	}}

⌨️ 快捷键说明

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