11 #include <sys/types.h>
13 #include <sys/socket.h>
16 #include <netinet/in.h>
32 struct serv_info serv_info;
35 * get info about the server we've WC->connected to
37 void get_serv_info(char *browser_host, char *user_agent)
42 serv_printf("IDEN %d|%d|%d|%s|%s",
57 while (serv_gets(buf), strcmp(buf, "000")) {
60 serv_info.serv_pid = atoi(buf);
63 strcpy(serv_info.serv_nodename, buf);
66 strcpy(serv_info.serv_humannode, buf);
69 strcpy(serv_info.serv_fqdn, buf);
72 strcpy(serv_info.serv_software, buf);
75 serv_info.serv_rev_level = atoi(buf);
78 strcpy(serv_info.serv_bbs_city, buf);
81 strcpy(serv_info.serv_sysadm, buf);
84 strcpy(serv_info.serv_moreprompt, buf);
94 * Function to spit out Citadel variformat text in HTML
95 * If fp is non-null, it is considered to be the file handle to read the
96 * text from. Otherwise, text is read from the server.
105 wprintf("<DIV ALIGN=JUSTIFY>\n");
110 if (fgets(buf, SIZ, fp) == NULL)
112 buf[strlen(buf) - 1] = 0;
114 if (!strcmp(buf, "000")) {
117 wprintf("</DIV><BR>\n");
120 if ((intext == 1) && (isspace(buf[0]))) {
125 /* Quoted text should be displayed in italics and in a
126 * different colour. This code understands both Citadel/UX
127 * style " >" quotes and FordBoard-style " :-)" quotes.
130 ((!strncmp(buf, " >", 2)) || (!strncmp(buf, " :-)", 4)))) {
131 wprintf("<FONT COLOR=\"000044\"><I>");
133 } else if ((bq == 1) &&
134 (strncmp(buf, " >", 2)) && (strncmp(buf, " :-)", 4))) {
135 wprintf("</FONT></I>");
138 /* Activate embedded URL's */
152 * transmit message text (in memory) to the server
154 void text_to_server(char *ptr)
162 while (ptr[pos] != 0) {
165 while ( (isspace(buf[strlen(buf) - 1]))
166 && (strlen(buf) > 1) )
167 buf[strlen(buf) - 1] = 0;
170 if (ptr[pos] != 0) strcat(buf, " ");
175 if ((ch == 32) && (strlen(buf) > 200)) {
180 if (strlen(buf) > 250) {
195 * translate server message output to text
196 * (used for editing room info files and such)
198 void server_to_text()
204 while (serv_gets(buf), strcmp(buf, "000")) {
205 if ((buf[0] == 32) && (count > 0)) {