#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 100+posin #define estac 5 +posin #define linea 15 +posin #define durac 35 +posin #define hor 26 +posin #define fech 20 +posin #define tranf 44 +posin #define numero 47 +posin #define ccost 34 +posin #define proye 10 +posin #define cuenta 66 +posin #define pulsos 80 +posin #define ruta 0 #define prinum 0 #define ring 0 #define antran 0 // anexo transferido #define fofech americano #define larnum 19 char reg[50][ladat]; int t,m,j,i,h,cont, encuentra; //lb posicion de ruta+linea de buf extern char rgua[]; void in_central() { rgua[0]='\0'; } void fi_central() { } //compara la línea del registro actual (buf) con los registros anteriores (almacenados en el arreglo bidimencional) void busca_lin(char *buf, int vlinea) { //lr, posición de línea en registro for(m=t;m>=0;m--) { for(j=0; j<3 && reg[m][vlinea+j]==buf[vlinea+j]; j++){} //compara lineas+rutas if (j==3) {encuentra=1; h=strlen(reg[m]); return;} //lineas+rutas iguales } } //almacena las llamadas con lineas distintas en un arreglo bidimencional (sobreescribe los registros de líneas iguales) void add_reg(char *buf, int vlinea) { busca_lin(buf, vlinea); if (!encuentra) {m=t;t++;} for(j=0;j<=i;j++) reg[m][j]=buf[j]; } void DatCentral(char *buf, char *tel, int vestac, int vlinea,int vdurac,int vhor, int vfech, int vtranf, int vnumero, int vccost,int vproye, int vcuenta, int vpulsos, int vruta, int vprinum, int vring, int vantran, int vfofech) { int k, corrida, sin_durac; corrida=0; sin_durac=0; tel[0]='\0'; // corrida = (buf[vhor+7]==' ' && buf[vestac-1]==' ' && buf[vestac+4]==' ' && buf[vlinea-1]==' ' && buf[vlinea+3]==' '); // sin_durac=(buf[vdurac+0]=='0' && buf[vdurac+1]=='0' && buf[vdurac+3]=='0' && buf[vdurac+4]=='0' && buf[vdurac+6]=='0' && buf[vdurac+7]=='0') i=strlen(buf); if (i>vnumero && isalnum(buf[vtranf]) && isdigit(buf[vhor]))// && sin_durac && corrida) { k=0; encuentra=0; //TRANSFERENCIAS if (buf[vtranf ]=='T') busca_lin(buf, vlinea); //transferencias: busca por linea el anexo desde donde se transfirió else if (buf[vtranf+1]=='T') add_reg (buf, vlinea); tel[k++]=buf[vestac+0]; tel[k++]=buf[vestac+1]; tel[k++]=buf[vestac+2]; tel[k++]=buf[vestac+3]; tel[k++] = ' '; tel[k++]=buf[vlinea+0]; tel[k++]=buf[vlinea+1]; tel[k++]=buf[vlinea+2]; tel[k++] = ' '; for(j=0;j<8;j++) tel[k++]=buf[vdurac+j]; tel[k++] = ' '; for(j=0;j<5;j++) tel[k++]=buf[vhor+j]; tel[k++] = ' '; for(j=0;j<5;j++) tel[k++]=buf[vfech+j]; tel[k++] = buf[5] ; tel[k++] = buf[6] ; tel[k++] = buf[7] ; tel[k++] = ' ' ; if (buf[vtranf]=='O') tel[k++]='O'; else if (buf[vtranf]=='T') tel[k++]='O'; else tel[k++]='I'; tel[k++] = ' ' ; if (buf[vtranf]=='T' && encuentra && isdigit(reg[m][vnumero])) { for(j=0;reg[m][vnumero+j]!=' ' && (vnumero+j