f1a407c79f
FossilOrigin-Name: 6ca19819ff1547744a39e4d248a7803bf6dfd8f20ae64e704f044200746acaf1
19 lines
5.6 KiB
Text
19 lines
5.6 KiB
Text
#ifndef __test
|
|
#define __test
|
|
static const char data_test[] = {0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X69,0X6D,0X70,0X6C,0X65,0X2D,0X70,0X61,0X67,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X68,0X31,0X3E,0X54,0X65,0X73,0X74,0X20,0X70,0X61,0X67,0X65,0X3C,0X2F,0X68,0X31,0X3E,0XA,0X20,0X20,0X3C,0X70,0X3E,0X54,0X65,0X73,0X74,0X20,0X79,0X6F,0X75,0X72,0X20,0X6E,0X67,0X69,0X6E,0X78,0X2F,0X61,0X70,0X61,0X63,0X68,0X65,0X20,0X61,0X6E,0X64,0X20,0X62,0X72,0X6F,0X77,0X73,0X65,0X72,0X20,0X68,0X65,0X72,0X65,0X3C,0X2F,0X70,0X3E,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X74,0X65,0X73,0X74,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X67,0X65,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X76,0X61,0X6C,0X75,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X47,0X45,0X54,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0XA,0X20,0X20,0X3C,0X66,0X6F,0X72,0X6D,0X20,0X61,0X63,0X74,0X69,0X6F,0X6E,0X3D,0X22,0X74,0X65,0X73,0X74,0X22,0X20,0X6D,0X65,0X74,0X68,0X6F,0X64,0X3D,0X22,0X70,0X6F,0X73,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X6E,0X61,0X6D,0X65,0X3D,0X22,0X76,0X61,0X6C,0X75,0X65,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X74,0X65,0X78,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X73,0X75,0X62,0X6D,0X69,0X74,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X50,0X4F,0X53,0X54,0X22,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X66,0X6F,0X72,0X6D,0X3E,0XA,0X20,0X20,0XA,0X20,0X20,0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X69,0X64,0X3D,0X22,0X65,0X6E,0X76,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X70,0X72,0X65,0X73,0X65,0X6E,0X74,0X22,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X68,0X3E,0X3C,0X62,0X3E,0X45,0X4E,0X56,0X3C,0X2F,0X62,0X3E,0X3C,0X2F,0X74,0X68,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X68,0X3E,0X3C,0X62,0X3E,0X56,0X61,0X6C,0X75,0X65,0X3C,0X2F,0X62,0X3E,0X3C,0X2F,0X74,0X68,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X48,0X54,0X54,0X50,0X5F,0X43,0X4F,0X4F,0X4B,0X49,0X45,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X50,0X41,0X54,0X48,0X5F,0X49,0X4E,0X46,0X4F,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X51,0X55,0X45,0X52,0X59,0X5F,0X53,0X54,0X52,0X49,0X4E,0X47,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X52,0X45,0X51,0X55,0X45,0X53,0X54,0X5F,0X4D,0X45,0X54,0X48,0X4F,0X44,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X53,0X43,0X52,0X49,0X50,0X54,0X5F,0X4E,0X41,0X4D,0X45,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X48,0X54,0X54,0X50,0X5F,0X52,0X45,0X46,0X45,0X52,0X45,0X52,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X48,0X54,0X54,0X50,0X5F,0X55,0X53,0X45,0X52,0X5F,0X41,0X47,0X45,0X4E,0X54,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X43,0X4F,0X4E,0X54,0X45,0X4E,0X54,0X5F,0X4C,0X45,0X4E,0X47,0X54,0X48,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0X25,0X73,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
|
|
struct test_template {const char* HTTP_COOKIE;
|
|
const char* PATH_INFO;
|
|
const char* QUERY_STRING;
|
|
const char* REQUEST_METHOD;
|
|
const char* SCRIPT_NAME;
|
|
const char* HTTP_REFERER;
|
|
const char* HTTP_USER_AGENT;
|
|
const char* CONTENT_LENGTH;
|
|
};
|
|
char* tmpl_gen_test(struct test_template* data, unsigned* size){
|
|
char* ret;
|
|
unsigned s = easprintf(&ret, data_test, data->HTTP_COOKIE?data->HTTP_COOKIE:"", data->PATH_INFO?data->PATH_INFO:"", data->QUERY_STRING?data->QUERY_STRING:"", data->REQUEST_METHOD?data->REQUEST_METHOD:"", data->SCRIPT_NAME?data->SCRIPT_NAME:"", data->HTTP_REFERER?data->HTTP_REFERER:"", data->HTTP_USER_AGENT?data->HTTP_USER_AGENT:"", data->CONTENT_LENGTH?data->CONTENT_LENGTH:"");
|
|
if (size) *size = s;
|
|
return ret;
|
|
}
|
|
#endif
|