#include "tnn.h" #ifdef SPEECH #include "speech.h" struct speech_msg { char speech[20]; char num1[255]; char mode_num[8]; char default_num[8]; char default_mode_num[9]; unsigned mode; unsigned default_mode; }; struct speech_msg speech_tbl[MAXZEILEN+1]; static int sprachen = EOF; static int meldungen = TRUE; char speech[15] = "Englisch"; char speechpath[MAXPATH] = SPEECHPATH; /* Pfad fuer Sprachen */ static unsigned set_substitute_symbols(const char *speechbuf, char *mode); /* Default Sprache laden. */ static void speech_default(void) { struct { int nummer; int mode; char mode_num[9]; char meldung[255]; } speech_tab[] = { { 0, 0x0000000,"00000000","Convers session terminated.\rEnter command. Type HELP for help.\r" }, { 1, 0x0000000,"00000000","*** You are already in convers-mode.\r" }, { 2, 0x0000000,"00000000","The Convers-Hostname is to long (max.9 indications)!\r" }, { 3, 0x0050000,"00010000","Convers-Hostname successful changed in %s.\r" }, { 4, 0x0000000,"00000000","Locked!\r" }, { 5, 0x0050000,"00040000","%s%s@%s has gone away:\r %s\r" }, { 6, 0x0050000,"00030000","%s%s@%s is back again.\r" }, { 7, 0x0050020,"00020010","%s%s made you a channel operator for channel %d\r" }, { 8, 0x0050020,"00030010","%s%s@%s is now a channel operator for channel %d\r" }, { 9, 0x0000020,"00000010","channel %d" }, { 10, 0x0050000,"00050000","%s%s@%s on %s set personal text:\r %s\r" }, { 11, 0x0050000,"00040000","%s%s@%s on %s removed personal text.\r" }, { 12, 0x0050000,"00050000","%s%s@%s on %s set channel topic:\r %s\r" }, { 13, 0x0050000,"00040000","%s%s@%s on %s removed channel topic.\r" }, { 14, 0x0000000,"00000000","secret channel" }, { 15, 0x0000000,"00000000","this invisible channel" }, { 16, 0x0050000,"00060000","%s%s:%s@%s on %s set personal text:\r %s\r" }, { 17, 0x0050000,"00050000","%s%s:%s@%s left %s.\r" }, { 18, 0x0050000,"00040000","%s%s@%s left %s.\r" }, { 19, 0x0050000,"00050000","%s%s@%s left %s (%s).\r" }, { 20, 0x0050000,"00050000","%s%s:%s@%s joined %s\r" }, { 21, 0x0050000,"00040000","%s%s@%s joined %s\r" }, { 22, 0x0050000,"00030000","%s%s is away: %s" }, { 23, 0x0050000,"00020000","%sYour messages are ignored by %s" }, { 24, 0x0050020,"00030010","\r\007\007%sMessage from %s...\rPlease join %s channel %d.\r\007\007\r" }, { 25, 0x0050000,"00040000","%s%s Invitation sent to %s @ %s." }, { 26, 0x0050000,"00020000","%sUser %s is already on this channel." }, { 27, 0x0000000,"00000000","*** Unknown command '/" }, { 28, 0x0000000,"00000000","'. Type /HELP for Help.\r" }, { 29, 0x0000000,"00000000","*** You are away, aren't you ? :-)\r" }, { 30, 0x0000000,"00000000","*** This is a moderated channel. Only channel operators may write.\r" }, { 31 ,0x0000000,"00000000","*** Queried user left channel.\r" }, { 32, 0x0050000,"00010000","%sYou are marked as being away.\r" }, { 33, 0x0050000,"00010000","%sYou are no longer marked as being away.\r" }, { 34, 0x0050000,"00010000","%sActually you were marked as being here :-)\r" }, { 35, 0x0050000,"00010000","*** Beep mode %sabled\r" }, { 36, 0x0050020,"00010020","%sYou are talking to channel %d. There are %d users.\r" }, { 37, 0x0050000,"00020000","*** current Topic by: %s (%s):\r " }, { 38, 0x0000000,"00000000","*** Also attached:" }, { 39, 0x0000020,"00000010","channel %d (alone)" }, { 40, 0x0000020,"00000020","channel %d (%d users)" }, { 41, 0x0050020,"00010010","%sChannel number must be in the range 0..%d.\r" }, { 42, 0x0050020,"00010010","%sChannel %d is already default.\r" }, { 43, 0x0050020,"00010010","%sYou need an invitation to join the privat channel %d.\r" }, { 44, 0x0050000,"00030000","%s%s@%s try to join your privat channel." }, { 45, 0x0050020,"00010010","%scannot join channel %d, no more space.\r" }, { 46, 0x0050020,"00010010","%sYou are now talking to channel %d" }, { 47, 0x0000000,"00000000","You're alone.\r" }, { 48, 0x0000020,"00000010","There are %d users.\r" }, { 49, 0x0050000,"00020000","*** Charset in/out is %s/%s.\r" }, { 50, 0x0050000,"00020000","Unknown charset: '%s'. You may use one of them:\r%s***\r" }, { 51, 0x0050000,"00020000","*** Charset in/out set to %s/%s.\r" }, { 52, 0x0000000,"00000000","Help on this command not yet implemented ...\rWrite it - or try another one :-)\r" }, { 53, 0x0000000,"00000000","No such command...\r" }, { 54, 0x0050000,"00010000","*** no route to %s\r" }, { 55, 0x0050020,"00010010","%sDefault channel is now %d.\r" }, { 56, 0x0050020,"00010010","%sLeft channel %d.\r" }, { 57 ,0x0050020,"00010010","%sYou were not on channel %d.\r" }, { 58, 0x0050000,"00010000","*** Reguest sent to %s.\r" }, { 59, 0x0000000,"00000000","You must be an operator to set a new links\r" }, { 60, 0x0000000,"00000000","Link table full !\r" }, { 61, 0x0000000,"00000000","Argument error !\r" }, { 62, 0x0050020,"00010010","%sYou have not joined channel %d.\r" }, { 63, 0x0050000,"00020000","%sNo such user: %s.\r" }, { 64 ,0x0050000,"00030000","%s%s is away: %s\r" }, { 65, 0x0000000,"00000000","*** non existing channel !\r" }, { 66, 0x0000000,"00000000","*** no modes on channel 0 !\r" }, { 67, 0x0000000,"00000000","*** You are not on operator !\r" }, { 68, 0x0050000,"00020000","%s @ %s PingPong-Release %5.5s (TNN) - Type /HELP for help.\r" }, { 69, 0x0050020,"00010010","%sYou need an invitation to join channel %d.\r" }, { 70, 0x0050000,"00030000","%s%s@%s try to join your privat channel." }, { 71, 0x0000020,"00000010","*** You created a new channel %d.\r" }, { 72, 0x0050000,"00010000","*** Personal text and date set.\rHello, %s\r" }, { 73, 0x0000000,"00000000","*** Please set your personal text. ( /H PERS )" }, { 74, 0x0050000,"00010000","%sYou are notified if one of the following users sign on/off:\r" }, { 75, 0x0050000,"00010000","%sYou filter the messages of the following users:\r" }, { 76, 0x0050000,"00010000","*** %s is online.\r" }, { 77, 0x0000000,"00000000","and data saved.\r" }, { 78, 0x0000000,"00000000","*** No personal text save.\r" }, { 79, 0x0000000,"00000000","deleted.\r" }, { 80, 0x0000000,"00000000","and data set.\r" }, { 81, 0x0050000,"00010000","*** Prompting mode %sabled\r" }, { 82, 0x0000000,"00000000","en" }, { 83, 0x0000000,"00000000","dis" }, { 84, 0x0000000,"00000000","You must be an operator to restart!\r" }, { 85 ,0x0050000,"00010000","Link to %s delocked.\r" }, { 86, 0x0050000,"00010000","%sNo such user: %.20s.\r" }, { 87, 0x0050000,"00020000","%sStarting privat conversation with %s.\r" }, { 88 ,0x0050000,"00020000","%sEnding privat conversation with %s.\r" }, { 89, 0x0050020,"00030010","%sChannel topic on channel %d removed from %s (%s).\r" }, { 90, 0x0050020,"00030010","%sChannel topic set on channel %d from %s (%s).\r" }, { 91, 0x0050020,"00030010","%sCurrent channel topic on channel %d from %s (%s) is\r " }, { 92, 0x0050020,"00010010","%sNo current channel topic on channel %d.\r" }, { 93, 0x0050020,"00010010","%sChannel channel %d non existent.\r" }, { 94, 0x0050000,"00030000","*** %s@%s is up for %s\r" }, { 95, 0x0050000,"00010000","*** Verbose mode %sabled\r" }, { 96 ,0x0000000,"00000000"," This conversd implementation was originally written by Dieter Deyke\r . It was modified and maintained up to version\r 3.11 by Fred Baumgarten, dc6iq." }, { 97, 0x0000000,"00000000"," This implementation is partly rewritten,\r enhanced and maintained by Odo Roscher \r for TheNetNode and Xnet.\r" }, { 98, 0x0000000,"00000000"," Idle Personal\r" }, { 99 ,0x0000000,"00000000","Login State\r" }, { 100,0x0000000,"00000000","Login Personal\r" }, { 101,0x0000000,"00000000","(here)" }, { 102,0x0000000,"00000000","\r Away: " }, { 103,0x0000000,"00000000"," (since " }, { 104,0x0000000,"00000000"," (AWAY)" }, { 105,0x0000000,"00000000","\r Last Activity: " }, { 106,0x0000020,"00000010","*** Current screen width is %d\r" }, { 107,0x0000000,"00000000","*** Range 32 to 255\r" }, { 108,0x0000020,"00000010","*** Screen width set to %d\r" }, { 109,0x0050000,"00010000","*** Urgent message from operator (%s):\r " }, { 110,0x0050000,"00010000","*** Links at %s" }, { 111,0x0000000,"00000000","free" }, { 112,0x0050000,"00010000","*** Nickname set to: %s.\r" }, { 113,0x0050000,"00020000","none login possible!\ncall signal %s is logged in at the host %s!\n" }, { 114,0x0000000,"00000000","*** your password was deleted!\r" }, { 115,0x0000000,"00000000","*** no password set!\r" }, { 116,0x0050000,"00010000","*** reads. your password:\r%s\r" }, { 117,0x0000000,"00000000","*** it is not defined a password!\r" }, { 118,0x0000000,"00000000","*** password was set!\r" }, { 119,0x0000000,"00000000","*** password must contain at least 5 and/or maximally 80 indications!\r" }, { 120,0x0000000,"00000000","*** is missing. to password!\r" }, { 121,0x0000000,"00000000","*** Syntax: pass [new password]\r" }, { 122,0x0000000,"00000000","*** password is correct!\r" }, { 123,0x0000000,"00000000","*** password is wrong!\r" }, { 124,0x0050000,"00030000","*** current Topic by: %s (%s):\r %s\r" }, { 125,0x0050020,"00010010","\r*** %d user on channel%s ***\r" }, { 126,0x7000000,"01000000"," Average: %lu" }, { 127,0x0000000,"00000000","\r%7s00 02 04 06 08 10 12 14 16 18 20 22\r%9s01 03 05 07 09 11 13 15 17 19 21 23 Hour\r\r" }, { 128,0x0000000,"00000000","\r%7s0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1\r%7s0 6 2 8 0 6 2 8 0 6 2 8 0 6 2 8 0 6 2 8 0 6 2 8 0 6 2 8 h\r%7sMonday Tuesday Wednes. Thursd. Friday Saturd. Sunday\r\r" }, { 129,0x0000000,"00000000"," Elap. time\r%6s-3600 -3240 -2880 -2520 -2160 -1800 -1440 -1080 -720 -360 0 Seconds\r\r" }, { 130,0x0600000,"00100000","> DISCONNECT: Too many non-DAMA Polls (%u) !!\r" }, { 131,0x0600000,"00200000","WARNING: non-DAMA Poll #%u, Disconnect after %u !!\r" }, { 132,0x0000000,"00000000","Graph cleared!\r" }, { 133,0x0000000,"00000000","SYSTEMGRAPH:\r" }, { 134,0x0000000,"00000000","(G)raph (H)our (B)aud\r (D)ay (C)ircuits\r (W)eek (F)ree buffers\r (L)2-Links\r (N)odes\r (R)ounds\r (*) All\r" }, { 135,0x0000000,"00000000","PORTGRAPH:\r(G)raph (H)our (I)nfo frames\r (D)ay (R)eject frames\r (W)eek (F)rmr frames\r (S)abm frames\r dis(C) frames\r" }, { 136,0x0000000,"00000000"," d(M) frames\r (*) All\r" }, { 137,0x0000000,"00000000","\r*** from DAMA-Master " }, { 138,0x0050000,"00020000","%s<>%s broken" }, { 139,0x0000000,"00000000","You are suspended.\r" }, { 140,0x0000000,"00000000","\r- Aborted -\r\r" }, { 141,0x0000000,"00000000","Sri, no text available!\r" }, { 142,0x0000000,"00000000","CLI failed!\r" }, { 143,0x0000000,"00000000","Waiting for AUTOBIN-Transfer...\r" }, { 144,0x0000000,"00000000","\rL2 - User:\rPo SrcCall DstCall LS Rx Tx Tr SRTT RxB TxB Baud ConTime Pr Da\r" }, { 145,0x0000000,"00000000","\rL4 - User:\rCall Node S Rx Tx Tr Win SRTT RxB TxB Baud ConTime\r" }, { 146,0x0000000,"00000000","free" }, { 147,0x0000000,"00000000","free" }, { 148,0x0000000,"00000000","\rHost-User:\rCH Call F NT RX TX ST RxB TxB Baud ConTime\r-------------------------------------------------------------------------\r" }, { 149,0x0000000,"00000000","free" }, { 150,0x0000000,"00000000","\r System Statistics: " }, { 151,0x0000000,"00000000","\r Startup: " }, { 152,0x0000000,"00000000","\r\r Port-Statistics:\r\r Links RxB TxB RxBaud TxBaud RxOver TxOver\r" }, { 153,0x0000000,"00000000","\rTotal = " }, { 154,0x0000000,"00000000"," Bytes\r" }, { 155,0x0000000,"00000000", "\r Error-Statistics:\r\r RxID RxLen RxCtl Resets\r" }, { 156,0x0000000,"00000000","\rLink-Statistics:\r" }, { 157,0x0000000,"00000000","\rLink to " }, { 158,0x0000000,"00000000"," via " }, { 159,0x0000000,"00000000","\rFrames: I UI RR REJ RNR SABM/UA DISC/DM FRMR\r" }, { 160,0x0000000,"00000000","Bytes: Total Info Header Overhead %I %RR %REJ %RNR\r" }, { 161,0x0000000,"00000000"," TQual:" }, { 162,0x0000000,"00000000","\rIP-Gateway-Statistics:\r\r" }, { 163,0x0000000,"00000000","free" }, { 164,0x0000000,"00000000","free" }, { 165,0x0000000,"00000000","Warning - Port not active.\r" }, { 166,0x0000000,"00000000","Invalid callsign.\r" }, { 167,0x0000000,"00000000","Invalid ident.\r" }, { 168,0x0000000,"00000000","free" }, { 169,0x0000000,"00000000","free" }, { 170,0x0000000,"00000000","Type-Port--Alias:Call------Route--------------Infotext------------\r" }, { 171,0x0000000,"00000000","No such User!\r" }, { 172,0x0000000,"00000000","Das Sysop Passwort wurde geaendert!\r" }, { 173,0x0000000,"00000000","Fehler: Das Passwort muss 80 Zeichen enthalten!\r" }, { 174,0x0050000,"00010000","editing>%s\rEnter text. End with '.' in a new line.\r" }, { 175,0x0000000,"00000000","free" }, { 176,0x0000000,"00000000","\r (min) (now) (max)\r Rounds/sec: %8lu %8lu %8lu\r" }, { 177,0x0000000,"00000000"," Free Buffers: %8u %8u %8u\rOverall Throughput:%18lu %8lu Baud\r Active L2-Links:%18u %8u\r Active Circuits:%18u %8u\r Active Nodes:%18u %8u\r" }, { 178,0x0000000,"00000000","\r Active Telnets:%18u %8u\r" }, { 179,0x7000000,"01000000","\r Buffer usage: %lu%%" }, { 180,0x7000000,"01000000","\r Network Heap: %lu Bytes" }, { 181,0x7000000,"01000000","\r CPU load: %lu%%" }, { 182,0x0000000,"00000000","TX: Once:%11lu Repeated:%10lu IQual:" }, { 183,0x0050020,"00010030"," Copyright by NORD> 0 && *clipoi == NUL) putstr("Folgende Sprachen wurden gefunden:\r",mbp); else { if (sprachen == 0) putstr("Es wurden keine Sprachdateien gefunden\r",mbp); } if (*clipoi == NUL) { for (i = 0; i < sprachen; i++) { putprintf(mbp,"%s\r",speech_tbl[i].speech); } } putprintf(mbp,"Sprache ist auf %s eingestellt.\r",speech); prompt(mbp); seteom(mbp); } void dump_speech(MBHEAD *mbp) { putstr(";\r; Sprache\r;\r", mbp); putprintf(mbp,"SPEECH %s\r;\r",speech); } static char *lese_meldung(char *buffer,FILE *fp) { char buf[320]; int i = 1; int j = 0; strcpy(buf,buffer); if(buffer[0]=='"') while(buf) { while( (buf[i] == 0x1b || buf[i] >= 0x20) && (buf[i]!='"' || (i && buf[i-1]=='\\')) && buf[i]!='\n' && i < 255) { if(buf[i]=='\\') { i++; switch(buf[i]) { case 'n': buffer[j]='\n'; break; case 'r': buffer[j]='\r'; break; case '"': buffer[j]='"' ; break; case 'a': buffer[j]='\a'; break; case '\\': buffer[j]='\\'; break; } } else buffer[j] = buf[i]; j++; i++; } buffer[j] = 0; return(buffer); } return(FALSE); } int speech_load(char *bufspeech) { FILE *fp; char speechcfg[255]; char buffer[255]; char mode_num[8] = "0000000"; strcpy(speechcfg,speechpath); strcat(speechcfg,bufspeech); strcat(speechcfg,".txt"); meldungen = 1; if ((fp = xfopen(speechcfg,"rt")) == NULL) return(TRUE); { while(!feof(fp)) { if (meldungen > MAXZEILEN) { printf("Fehler in Sprachdatei %s, maximale Zeilenlaenge von %d ueberschritten !!!\r",speech,MAXZEILEN); fclose(fp); speech_default(); return(FALSE); } fgets(buffer,255,fp); lese_meldung(buffer,fp); if (strlen(buffer) >= 254) { printf("Fehler in Sprachdatei %s Zeile %d ist zu lang !!!\r",speech,meldungen); fclose(fp); return(FALSE); } strcpy(speech_tbl[meldungen].num1, buffer); strcpy(mode_num,"00000000"); speech_tbl[meldungen].mode = set_substitute_symbols(speech_tbl[meldungen].num1,mode_num); strcpy(speech_tbl[meldungen].mode_num ,mode_num); if ((strncmp(speech_tbl[meldungen].default_mode_num,speech_tbl[meldungen].mode_num,7) == FALSE) && (speech_tbl[meldungen].mode == speech_tbl[meldungen].default_mode)) { meldungen++; } else { printf("Fehler in Sprachdatei %s Zeile %d !!!",speech,meldungen); fclose(fp); return(FALSE); } } fclose(fp); } if (meldungen-1 != MAXZEILEN) { printf("Fehler in Sprachdatei %s.txt, maximale Zeilenlaenge von %d unterschritten (letzte Melung %d)!!!\n",speech,MAXZEILEN,meldungen); return(FALSE); } return(TRUE); } void speech_init(void) { struct ffblk dir; char speechname[255]; long erg,hfile; char path[255]; char *loc; int i; if (sprachen == EOF) speech_default(); sprachen = FALSE; strcpy(path,speechpath); addslash(path); strcat(path,"*.txt"); sprachen = 0; hfile = xfindfirst(path,&dir,0); erg = (hfile == -1); while (erg == 0) { strcpy(speechname,dir.ff_name); loc = strstr(speechname,"."); i = loc-speechname; speechname[i] = '\0'; strcpy(speech_tbl[sprachen].speech,speechname); sprachen++; erg = xfindnext(&dir); } } char *speech_message(int msgnum) { if (*speech_tbl[msgnum].num1 == NUL) printf("Fehler in Sprachdatei %s Zeile %d !!!",speech,msgnum); return speech_tbl[msgnum].num1; } static unsigned set_substitute_symbols(const char *speechbuf, char *mode) { unsigned char a[11] = "1234567890"; unsigned num = 0x0; int num_lX = 0; int num_d = 0; int num_ld = 0; int num_f = 0; unsigned num_s = 0; int num_u = 0; int num_lu = 0; while(*speechbuf) { if (strncmp(speechbuf,"%",1) == 0) { speechbuf++; switch (*speechbuf) { case 'd': num |= speech_mode_d; mode[speech_mode_d_num] = a[num_d]; num_d++; break; case 'l': { speechbuf++; if (strncmp(speechbuf,"d",1) == FALSE) { num |= speech_mode_ld; mode[speech_mode_ld_num] = a[num_ld]; num_ld++; break; } if (strncmp(speechbuf,"u",1) == FALSE) { num |= speech_mode_lu; mode[speech_mode_lu_num] = a[num_lu]; num_lu++; break; } if (strncmp(speechbuf,"X",1) == FALSE) { num |= speech_mode_lX; mode[speech_mode_lX_num] = a[num_lX]; num_lX++; break; } } case 'f': num |= speech_mode_f; mode[speech_mode_f_num] = a[num_f]; num_f++; break; case 's': num |= speech_mode_s; mode[speech_mode_s_num] = a[num_s]; num_s++; break; case 'u': num |= speech_mode_u; mode[speech_mode_u_num] = a[num_u]; num_u++; break; } } speechbuf++; } return(num); } #endif