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

📄 ctype.c

📁 WSP is an HTTP to WSP proxy that can be used to forward HTTP requests to WSP, which is used in WAP 1
💻 C
字号:
#include <stdlib.h>#include <stdio.h>#include <string.h>#include "wspp.h"char *contentt(int type_code) {	switch(type_code) {		case 0x00: return "*/*";		case 0x01: return "text/*";		case 0x02: return "text/html";		case 0x03: return "text/plain";		case 0x04: return "text/x-hdml";		case 0x05: return "text/x-ttml";		case 0x06: return "text/x-vCalendar";		case 0x07: return "text/x-vCard";		case 0x08: return "text/vnd.wap.wml";		case 0x09: return "text/vnd.wap.wmlscript";		case 0x0A: return "text/vnd.wap.channel";		case 0x0B: return "Multipart/*";		case 0x0C: return "Multipart/mixed";		case 0x0D: return "Multipart/form-data";		case 0x0E: return "Multipart/byteranges";		case 0x0F: return "Multipart/alternative";		case 0x10: return "application/*";		case 0x11: return "application/java-vm";		case 0x12: return "application/x-www-form-urlencoded";		case 0x13: return "application/x-hdmlc";		case 0x14: return "application/vnd.wap.wmlc";		case 0x15: return "application/vnd.wap.wmlscriptc";		case 0x16: return "application/vnd.wap.channelc";		case 0x17: return "application/vnd.wap.uaprof";		case 0x18: return "application/vnd.wap.wtls-ca-certificate";		case 0x19: return "application/vnd.wap.wtls-user-certificate";		case 0x1A: return "application/x-x509-ca-cert";		case 0x1B: return "application/x-x509-user-cert";		case 0x1C: return "image/*";		case 0x1D: return "image/gif";		case 0x1E: return "image/jpeg";		case 0x1F: return "image/tiff";		case 0x20: return "image/png";		case 0x21: return "image/vnd.wap.wbmp";		case 0x22: return "application/vnd.wap.multipart.*";		case 0x23: return "application/vnd.wap.multipart.mixed";		case 0x24: return "application/vnd.wap.multipart.form-data";		case 0x25: return "application/vnd.wap.multipart.byteranges";		case 0x26: return "application/vnd.wap.multipart.alternative";		case 0x27: return "application/xml";		case 0x28: return "text/xml";		case 0x29: return "application/vnd.wap.wbxml";		case 0x2A: return "application/x-x968-cross-cert";		case 0x2B: return "application/x-x968-ca-cert";		case 0x2C: return "application/x-x968-user-cert";		case 0x2D: return "text/vnd.wap.si";		case 0x2E: return "application/vnd.wap.sic";		case 0x2F: return "text/vnd.wap.sl";		case 0x30: return "application/vnd.wap.slc";		case 0x31: return "text/vnd.wap.co";		case 0x32: return "application/vnd.wap.coc";		case 0x33: return "application/vnd.wap.multipart.related";		case 0x34: return "application/vnd.wap.sia";		case 0x35: return "text/vnd.wap.connectivity-xml";		case 0x36: return "application/vnd.wap.connectivity-wbxml";		case 0x37: return "application/pkcs7-mime";		case 0x38: return "application/vnd.wap.hashed-certificate";		case 0x39: return "application/vnd.wap.signed-certificate";		case 0x3A: return "application/vnd.wap.cert-response";		case 0x3B: return "application/xhtml+xml";		case 0x3C: return "application/wml+xml";		case 0x3D: return "text/css";		case 0x3E: return "application/vnd.wap.mms-message";		case 0x3F: return "application/vnd.wap.rollover-certificate";		case 0x201: return "application/vnd.uplanet.cachop-wbxml";		case 0x202: return "application/vnd.uplanet.signal";		case 0x203: return "application/vnd.uplanet.alert-wbxml";		case 0x204: return "application/vnd.uplanet.list-wbxml";		case 0x205: return "application/vnd.uplanet.listcmd-wbxml";		case 0x206: return "application/vnd.uplanet.channel-wbxml";		case 0x207: return "application/vnd.uplanet.provisioning-status-uri";		case 0x208: return "x-wap.multipart/vnd.uplanet.header-set";		case 0x209: return "application/vnd.uplanet.bearer-choice-wbxml";		case 0x20A: return "application/vnd.phonecom.mmc-wbxml";		case 0x20B: return "application/vnd.nokia.syncset+wbxml";		default:  return "application/octet-stream";	}}char from_ctype(char *type) {	if(!strncasecmp(type, "*/*", 3)) return 0x01;  /* FIXME */	if(!strncasecmp(type, "text/*", 6)) return 0x01;	if(!strncasecmp(type, "text/html", 10)) return 0x02;	if(!strncasecmp(type, "text/plain", 11)) return 0x03;	if(!strncasecmp(type, "text/x-hdml", 12)) return 0x04;	if(!strncasecmp(type, "text/x-ttml", 12)) return 0x05;	if(!strncasecmp(type, "text/x-vCalendar", 17)) return 0x06;	if(!strncasecmp(type, "text/x-vCard", 13)) return 0x07;	if(!strncasecmp(type, "text/vnd.wap.wml", 17)) return 0x08;	if(!strncasecmp(type, "text/vnd.wap.wmlscript", 23)) return 0x09;	if(!strncasecmp(type, "text/vnd.wap.channel", 21)) return 0x0A;	if(!strncasecmp(type, "Multipart/*", 11)) return 0x0B;	if(!strncasecmp(type, "Multipart/mixed", 15)) return 0x0C;	if(!strncasecmp(type, "Multipart/form-data", 19)) return 0x0D;	if(!strncasecmp(type, "Multipart/byteranges", 20)) return 0x0E;	if(!strncasecmp(type, "Multipart/alternative", 21)) return 0x0F;	if(!strncasecmp(type, "application/*", 13)) return 0x10;	if(!strncasecmp(type, "application/java-vm", 19)) return 0x11;	if(!strncasecmp(type, "application/x-www-form-urlencoded", 33)) return 0x12;	if(!strncasecmp(type, "application/x-hdmlc", 19)) return 0x13;	if(!strncasecmp(type, "application/vnd.wap.wmlc", 24)) return 0x14;	if(!strncasecmp(type, "application/vnd.wap.wmlscriptc", 30)) return 0x15;	if(!strncasecmp(type, "application/vnd.wap.channelc", 28)) return 0x16;	if(!strncasecmp(type, "application/vnd.wap.uaprof", 26)) return 0x17;	if(!strncasecmp(type, "application/vnd.wap.wtls-ca-certificate", 39)) return 0x18;	if(!strncasecmp(type, "application/vnd.wap.wtls-user-certificate", 41)) return 0x19;	if(!strncasecmp(type, "application/x-x509-ca-cert", 26)) return 0x1A;	if(!strncasecmp(type, "application/x-x509-user-cert", 28)) return 0x1B;	if(!strncasecmp(type, "image/*", 7)) return 0x1C;	if(!strncasecmp(type, "image/gif", 9)) return 0x1D;	if(!strncasecmp(type, "image/jpeg", 10)) return 0x1E;	if(!strncasecmp(type, "image/tiff", 10)) return 0x1F;	if(!strncasecmp(type, "image/png", 9)) return 0x20;	if(!strncasecmp(type, "image/vnd.wap.wbmp", 18)) return 0x21;	if(!strncasecmp(type, "application/vnd.wap.multipart.*", 31)) return 0x22;	if(!strncasecmp(type, "application/vnd.wap.multipart.mixed", 35)) return 0x23;	if(!strncasecmp(type, "application/vnd.wap.multipart.form-data", 39)) return 0x24;	if(!strncasecmp(type, "application/vnd.wap.multipart.byteranges", 40)) return 0x25;	if(!strncasecmp(type, "application/vnd.wap.multipart.alternative", 41)) return 0x26;	if(!strncasecmp(type, "application/xml", 15)) return 0x27;	if(!strncasecmp(type, "text/xml", 8)) return 0x28;	if(!strncasecmp(type, "application/vnd.wap.wbxml", 25)) return 0x29;	if(!strncasecmp(type, "application/x-x968-cross-cert", 29)) return 0x2A;	if(!strncasecmp(type, "application/x-x968-ca-cert", 26)) return 0x2B;	if(!strncasecmp(type, "application/x-x968-user-cert", 28)) return 0x2C;	if(!strncasecmp(type, "text/vnd.wap.si", 15)) return 0x2D;	if(!strncasecmp(type, "application/vnd.wap.sic", 23)) return 0x2E;	if(!strncasecmp(type, "text/vnd.wap.sl", 15)) return 0x2F;	if(!strncasecmp(type, "application/vnd.wap.slc", 23)) return 0x30;	if(!strncasecmp(type, "text/vnd.wap.co", 15)) return 0x31;	if(!strncasecmp(type, "application/vnd.wap.coc", 23)) return 0x32;	if(!strncasecmp(type, "application/vnd.wap.multipart.related", 37)) return 0x33;	if(!strncasecmp(type, "application/vnd.wap.sia", 23)) return 0x34;	if(!strncasecmp(type, "text/vnd.wap.connectivity-xml", 29)) return 0x35;	if(!strncasecmp(type, "application/vnd.wap.connectivity-wbxml", 38)) return 0x36;	if(!strncasecmp(type, "application/pkcs7-mime", 23)) return 0x37;	if(!strncasecmp(type, "application/vnd.wap.hashed-certificate", 38)) return 0x38;	if(!strncasecmp(type, "application/vnd.wap.signed-certificate", 38)) return 0x39;	if(!strncasecmp(type, "application/vnd.wap.cert-response", 33)) return 0x3A;	if(!strncasecmp(type, "application/xhtml+xml", 22)) return 0x3B;	if(!strncasecmp(type, "application/wml+xml", 19)) return 0x3C;	if(!strncasecmp(type, "text/css", 8)) return 0x3D;	return 0x7f; /* not supported */}

⌨️ 快捷键说明

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