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.
109 if (fgets(buf, 256, fp) == NULL)
111 buf[strlen(buf) - 1] = 0;
113 if (!strcmp(buf, "000")) {
119 if ((intext == 1) && (isspace(buf[0]))) {
124 /* Quoted text should be displayed in italics and in a
125 * different colour. This code understands both Citadel/UX
126 * style " >" quotes and FordBoard-style " :-)" quotes.
129 ((!strncmp(buf, " >", 2)) || (!strncmp(buf, " :-)", 4)))) {
130 wprintf("<FONT COLOR=\"000044\"><I>");
132 } else if ((bq == 1) &&
133 (strncmp(buf, " >", 2)) && (strncmp(buf, " :-)", 4))) {
134 wprintf("</FONT></I>");
137 /* Activate embedded URL's */
151 * transmit message text (in memory) to the server
153 void text_to_server(char *ptr)
161 while (ptr[pos] != 0) {
164 while (isspace(buf[strlen(buf) - 1]))
165 buf[strlen(buf) - 1] = 0;
172 if ((ch == 32) && (strlen(buf) > 200)) {
177 if (strlen(buf) > 250) {
192 * translate server message output to text
193 * (used for editing room info files and such)
195 void server_to_text()
201 while (serv_gets(buf), strcmp(buf, "000")) {
202 if ((buf[0] == 32) && (count > 0)) {