X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fgraphics.c;h=ed1d687dc7f87d18161023e48f9acce7dc3453a4;hb=c90b9009ad3b2411389d3dad969c19ec17688268;hp=56422315026942c4996582b480a61cb78c5881c0;hpb=05b7980adba4f517c3fc30d3ce97adb5c337c750;p=citadel.git diff --git a/webcit/graphics.c b/webcit/graphics.c index 564223150..ed1d687dc 100644 --- a/webcit/graphics.c +++ b/webcit/graphics.c @@ -9,7 +9,8 @@ #include "child.h" -void display_graphics_upload(char *description, char *check_cmd, char *uplurl) { +void display_graphics_upload(char *description, char *check_cmd, char *uplurl) +{ char buf[256]; serv_puts(check_cmd); @@ -17,35 +18,35 @@ void display_graphics_upload(char *description, char *check_cmd, char *uplurl) { if (buf[0] != '2') { display_error(&buf[4]); return; - } - + } printf("HTTP/1.0 200 OK\n"); output_headers(1, "bottom"); - wprintf("
"); - wprintf("Set/change %s\n", description); - wprintf("
\n"); + wprintf("
"); + wprintf("Set/change %s\n", description); + wprintf("
\n"); wprintf("
\n"); wprintf("
\n", uplurl, bstr("which_room")); - + wprintf("You can upload any image directly from your computer,\n"); wprintf("as long as it is in GIF format (JPEG, PNG, etc. won't\n"); wprintf("work).

\n"); wprintf("Please select a file to upload:
\n"); - wprintf("\n"); + wprintf("\n"); wprintf("
"); - wprintf("\n"); - wprintf("\n"); - wprintf("
\n"); + wprintf("\n"); + wprintf("\n"); + wprintf("\n"); wprintf("Cancel\n"); wprintf("
\n"); wDumpContent(1); - } +} -void do_graphics_upload(char *upl_cmd) { +void do_graphics_upload(char *upl_cmd) +{ char buf[256]; int bytes_remaining; int pos = 0; @@ -54,15 +55,13 @@ void do_graphics_upload(char *upl_cmd) { if (upload_length == 0) { display_error("You didn't upload a file.\n"); return; - } - + } serv_puts(upl_cmd); serv_gets(buf); if (buf[0] != '2') { display_error(&buf[4]); return; - } - + } bytes_remaining = upload_length; while (bytes_remaining) { thisblock = ((bytes_remaining > 4096) ? 4096 : bytes_remaining); @@ -73,40 +72,41 @@ void do_graphics_upload(char *upl_cmd) { serv_puts("UCLS 0"); serv_gets(buf); return; - } + } thisblock = extract_int(&buf[4], 0); serv_write(&upload[pos], thisblock); pos = pos + thisblock; bytes_remaining = bytes_remaining - thisblock; - } + } serv_puts("UCLS 1"); serv_gets(buf); if (buf[0] != 'x') { display_success(&buf[4]); return; - } } +} -void select_floor_to_edit_pic(void) { +void select_floor_to_edit_pic(void) +{ int a; printf("HTTP/1.0 200 OK\n"); output_headers(1, "bottom"); - wprintf("
"); - wprintf("Select floor to edit label graphic\n"); - wprintf("
\n"); + wprintf("
"); + wprintf("Select floor to edit label graphic\n"); + wprintf("
\n"); load_floorlist(); - for (a=0; a<128; ++a) if (strlen(floorlist[a])>0) { - wprintf("", a); - escputs(floorlist[a]); - wprintf("\n"); + for (a = 0; a < 128; ++a) + if (strlen(floorlist[a]) > 0) { + wprintf("", a); + escputs(floorlist[a]); + wprintf("\n"); } - wDumpContent(1); - } +}