4 * Functions which handle "sticky notes"
18 #include <sys/types.h>
20 #include <sys/socket.h>
21 #ifdef HAVE_SYS_TIME_H
27 #include <netinet/in.h>
28 #include <arpa/inet.h>
37 #include "webserver.h"
39 void display_note(long msgnum) {
42 char display_notetext[SIZ];
46 wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/storenotes_48x.gif\">\n");
48 serv_printf("MSG0 %ld", msgnum);
49 serv_getln(buf, sizeof buf);
51 wprintf("%s<br />\n", &buf[4]);
56 while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
58 /* Fill the buffer to at least 256 characters */
59 if ( (in_text) && (strlen(notetext) < 256) ) {
60 strcat(notetext, buf);
63 if ( (!in_text) && (!strcasecmp(buf, "text")) ) {
68 /* Now sanitize the buffer, and shorten it to just a small snippet */
69 for (i=0; i<strlen(notetext); ++i) {
70 if (isspace(notetext[i])) notetext[i] = ' ';
72 strcpy(¬etext[72], "...");
74 /* Make it HTML-happy and print it. */
75 stresc(display_notetext, notetext, 1, 1);
76 wprintf("%s<br />\n", display_notetext);