跳转到内容

用户:Antigng-bot/convert.h

维基百科,自由的百科全书
const char *G2U(const char* gb2312);
int URLEncode(const char *str, const int strSize, char *result, const int resultSize);
int URLDecode(const char *source,const int source_len,char *dest,const int dest_len);
int URLtryDecode(const char *source,const int source_len,char *dest,const int dest_len,int status);
int xmlparsearg(HTTP h,unsigned length,const char *list[],char *value[]);
int xmlparsetag(HTTP h,char *buffer);
int xmlcontentready(HTTP h);
int xmlpulltext(HTTP h,char *out);
int utf8tounicode(const char *line,unsigned int *dest);

#define XML_PARSE_ERROR -1
#define XML_HAS_VALUE 0
#define XML_NO_VALUE 1
#define XML_CONTENT_READY 2
#define XML_TEXT_CONTINUE 3
#define XML_TEXT_END 4
#define XML_DECODE_ERROR -2

extern const char hec[16];
extern const unsigned char encoding[256];
extern const char *encode_escape;
extern const char decoding[];
#define smartURLEncode(a, result)\
	switch(encoding[(unsigned char)(a)])\
	{\
	case 0:\
		WRITE((a),result);\
		break;\
	case 1:\
		hputs(encode_escape+3*(unsigned int)((unsigned char)(a)),3,result);\
		break;\
	case 2:\
		WRITE('+',result);\
		break;\
	}