#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 82+posin #define tranf 38+posin #define ccost 0 #define proye 0 #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 0 #define fech 22+posin #define hor 31+posin #define linea 12+posin #define estac 7+posin // llamadas entrantes #define durac 16+posin #define numero 39+posin #define antran 0 // anexo transferido (pendiente) #define fofech europeo // formato de fecha char reg[99][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<2 && reg[m][vlinea+j]==buf[vlinea+j]; j++){} //compara lineas+rutas if (j==2) {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' || buf[vtranf]=='T') busca_lin(buf, vlinea); //transferencias: busca por linea el anexo desde donde se transfirió else if (buf[vtranf]!='t' || buf[vtranf]!='T') add_reg (buf, vlinea); for(j=0;j<3;j++) tel[k++]=buf[vestac+j]; tel[k++] = ' '; tel[k++]=buf[vlinea+0]; tel[k++]=buf[vlinea+1]; tel[k++] = ' '; tel[k++]='0'; tel[k++]='0'; tel[k++]=':'; for(j=0;j<5;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<8;j++) tel[k++]=buf[vfech+j]; tel[k++] = ' ' ; if ((buf[vtranf]=='t' || buf[vtranf]=='T') && encuentra) tel[k++]=reg[m][vtranf]; else tel[k++]=buf[vtranf]; tel[k++] = ' ' ; /* if (encuentra && isdigit(reg[m][vnumero])) { for(j=0;reg[m][vnumero+j]!=' ' && (vnumero+j