Esempio n. 1
0
File: hellox.c Progetto: psfu/ULib
int main(int argc, char* argv[])
{
   unsigned char encoded[1024];

   char* reply = get_reply();

   (void) u_xml_encode(argv[1], strlen(argv[1]), encoded);

   (void) u__snprintf(reply, get_reply_capacity(), U_CONSTANT_TO_PARAM("<h1>Hello %s</h1>"), encoded);

   return 200;
}
Esempio n. 2
0
int main(int argc, char* argv[])
{
   unsigned char l[6];
   unsigned char im[70*200];
   unsigned char gif[GIF_SIZE];
   unsigned char encoded[GIF_SIZE * 3];

   captcha(im, l);
   makegif(im, gif);

   U_ClientImage_request_nocache = true;

   set_reply_capacity(1024 + GIF_SIZE * 3);

   (void) u__snprintf(get_reply(), get_reply_capacity(), "<img src=\"data:img/gif;base64,%.*s\">", u_base64_encode(gif, GIF_SIZE, encoded), encoded);

   return 200;
}