13 struct serv_info serv_info;
16 * get info about the server we've connected to
18 void get_serv_info(void) {
22 serv_printf("IDEN %d|%d|%d|%s|%s",
27 "" /* FIX find out where the user is */
33 if (buf[0]!='1') return;
36 while(serv_gets(buf), strcmp(buf,"000")) {
38 case 0: serv_info.serv_pid = atoi(buf);
40 case 1: strcpy(serv_info.serv_nodename,buf);
42 case 2: strcpy(serv_info.serv_humannode,buf);
44 case 3: strcpy(serv_info.serv_fqdn,buf);
46 case 4: strcpy(serv_info.serv_software,buf);
48 case 5: serv_info.serv_rev_level = atoi(buf);
50 case 6: strcpy(serv_info.serv_bbs_city,buf);
52 case 7: strcpy(serv_info.serv_sysadm,buf);
54 case 9: strcpy(serv_info.serv_moreprompt,buf);
64 * Function to spit out Citadel variformat text in HTML
65 * If fp is non-null, it is considered to be the file handle to read the
66 * text from. Otherwise, text is read from the server.
76 if (fp==NULL) serv_gets(buf);
78 if (fgets(buf,256,fp)==NULL) strcpy(buf,"000");
79 buf[strlen(buf)-1] = 0;
81 if (!strcmp(buf,"000")) {
82 if (bq==1) wprintf("</I>");
86 if ( (intext==1) && (isspace(buf[0])) ) {
91 /* Quoted text should be displayed in italics and in a
92 * different colour. This code understands both Citadel/UX
93 * style " >" quotes and FordBoard-style " :-)" quotes.
96 ((!strncmp(buf," >",2))||(!strncmp(buf," :-)",4)))) {
97 wprintf("<FONT COLOR=\"000044\"><I>");
101 (strncmp(buf," >",2))&&(strncmp(buf," :-)",4))) {
102 wprintf("</FONT></I>");
106 /* Activate embedded URL's */
120 * transmit message text (in memory) to the server
122 void text_to_server(char *ptr) {
129 while (ptr[pos]!=0) {
132 while (isspace(buf[strlen(buf)-1]))
133 buf[strlen(buf)-1]=0;
141 if ((ch==32)&&(strlen(buf)>200)) {
146 if (strlen(buf)>250) {
161 * translate server message output to text
162 * (used for editing room info files and such)
164 void server_to_text() {
169 while (serv_gets(buf), strcmp(buf, "000") ) {
170 if ( (buf[0] == 32) && (count > 0) ) {