一个嵌入式TCP/IP协议栈

源代码在线查看: makehttpstrings

软件大小: 1263 K
上传用户: l991090150
关键词: TCP IP 嵌入式 协议栈
下载地址: 免注册下载 普通下载 VIP

相关代码

				#!/usr/bin/perl								open(OUTPUTC, "> http-strings.c");				open(OUTPUTH, "> http-strings.h");								open(FILE, "http-strings");								while() {				  if(/(.+) "(.+)"/) {				    $var = $1;				    $data = $2;				    				    printf(OUTPUTC "char $var\[%d] = \n", length($data) + 1);				    printf(OUTPUTC "/* $data */\n");				    printf(OUTPUTC "{");				    for($j = 0; $j < length($data); $j++) {				      printf(OUTPUTC "%#02x, ", unpack("C", substr($data, $j, 1)));				    }				    printf(OUTPUTC "};\n");								    printf(OUTPUTH "extern char $var\[%d];\n", length($data) + 1);				    				  }				}				exit 0;								printf(OUTPUT "%#02x, ", unpack("C", $data));							

相关资源