forked from mirrors/treebird
f1a407c79f
FossilOrigin-Name: 6ca19819ff1547744a39e4d248a7803bf6dfd8f20ae64e704f044200746acaf1
20 lines
3.1 KiB
Text
20 lines
3.1 KiB
Text
#ifndef __search
|
|
#define __search
|
|
static const char data_search[] = {0X3C,0X74,0X61,0X62,0X6C,0X65,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X73,0X20,0X75,0X69,0X2D,0X74,0X61,0X62,0X6C,0X65,0X22,0X3E,0XA,0X20,0X20,0X3C,0X74,0X72,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X73,0X65,0X61,0X72,0X63,0X68,0X2F,0X73,0X74,0X61,0X74,0X75,0X73,0X65,0X73,0X3F,0X71,0X3D,0X25,0X73,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X73,0X65,0X61,0X72,0X63,0X68,0X2F,0X61,0X63,0X63,0X6F,0X75,0X6E,0X74,0X73,0X3F,0X71,0X3D,0X25,0X73,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X74,0X64,0X3E,0XA,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X61,0X20,0X68,0X72,0X65,0X66,0X3D,0X22,0X25,0X73,0X2F,0X73,0X65,0X61,0X72,0X63,0X68,0X2F,0X68,0X61,0X73,0X68,0X74,0X61,0X67,0X73,0X3F,0X71,0X3D,0X25,0X73,0X22,0X3E,0X3C,0X69,0X6E,0X70,0X75,0X74,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X74,0X61,0X62,0X2D,0X62,0X74,0X6E,0X20,0X62,0X74,0X6E,0X20,0X25,0X73,0X22,0X20,0X74,0X79,0X70,0X65,0X3D,0X22,0X62,0X75,0X74,0X74,0X6F,0X6E,0X22,0X20,0X76,0X61,0X6C,0X75,0X65,0X3D,0X22,0X25,0X73,0X22,0X3E,0X3C,0X2F,0X61,0X3E,0XA,0X20,0X20,0X20,0X20,0X3C,0X2F,0X74,0X64,0X3E,0XA,0X20,0X20,0X3C,0X2F,0X74,0X72,0X3E,0XA,0X3C,0X2F,0X74,0X61,0X62,0X6C,0X65,0X3E,0XA,0XA,0X3C,0X64,0X69,0X76,0X20,0X63,0X6C,0X61,0X73,0X73,0X3D,0X22,0X73,0X65,0X61,0X72,0X63,0X68,0X2D,0X72,0X65,0X73,0X75,0X6C,0X74,0X73,0X22,0X3E,0XA,0X20,0X20,0X25,0X73,0XA,0X3C,0X2F,0X64,0X69,0X76,0X3E,0};
|
|
struct search_template {const char* prefix;
|
|
const char* query;
|
|
const char* statuses_active;
|
|
const char* statuses;
|
|
const char* accounts_active;
|
|
const char* accounts;
|
|
const char* hashtags_active;
|
|
const char* hashtags;
|
|
const char* results;
|
|
};
|
|
char* tmpl_gen_search(struct search_template* data, unsigned* size){
|
|
char* ret;
|
|
unsigned s = easprintf(&ret, data_search, data->prefix?data->prefix:"", data->query?data->query:"", data->statuses_active?data->statuses_active:"", data->statuses?data->statuses:"", data->prefix?data->prefix:"", data->query?data->query:"", data->accounts_active?data->accounts_active:"", data->accounts?data->accounts:"", data->prefix?data->prefix:"", data->query?data->query:"", data->hashtags_active?data->hashtags_active:"", data->hashtags?data->hashtags:"", data->results?data->results:"");
|
|
if (size) *size = s;
|
|
return ret;
|
|
}
|
|
#endif
|