#define americano 0 #define europeo 1 #define lmax 200 // 200 #define posin 18 //#define estac 51+posin #define estac 57+posin #define estac1 15+posin #define linea 60+posin #define durac 45+posin #define hor 27+posin #define fech 21+posin #define tranf 17+posin #define numero 5+posin #define ccost 0 #define proye 0+posin #define cuenta 0 #define pulsos 0 #define ruta 57+posin #define prinum 0 #define ring 39+posin #define antran 0 // anexo transferido #define tip_lla 17+ posin #define mode 21+ posin #define fofech americano // ok #define ladat 82+posin #define l_nume 16 char duraci[6],duraco[6],estacion[7],num[16] ; char lgua[lmax+3]; char *cuf,*ruf,*tuf,*buf; int mc = 0 ; extern char rgua[]; void in_central() { rgua[0]='\0'; } void fi_central() { } // agregar duración void agr_dur(int duracio, char *buf,char *cuf) { char shora[7], shori[3] ; int hori,mini,segi,tot ; hori=mini=segi=0 ; duracio = duracio; shora[0] = cuf[duracio+0] ; shora[1] = cuf[duracio+1] ; shora[2] = cuf[duracio+2] ; shora[3] = cuf[duracio+3] ; shora[4] = cuf[duracio+4] ; shora[5] = cuf[duracio+5] ; shora[6] = '\0' ; tot = atoi(shora) ; mini = (tot/60) ; segi = (tot%60) ; if(mini>59) { hori = (mini/60) ; mini = (mini%60) ; } itoa(hori,shori,10) ; if (shori[1]=='\0') { duraci[0]='0' ; duraci[1]=shori[0] ; } else { duraci[0]=shori[0] ; duraci[1]=shori[1] ; } itoa(mini,shori,10) ; if (shori[1]=='\0') { duraci[2]='0' ; duraci[3]=shori[0] ; } else { duraci[2]=shori[0] ; duraci[3]=shori[1] ; } itoa(segi,shori,10) ; if (shori[1]=='\0') { duraci[4]='0' ; duraci[5]=shori[0] ; } else { duraci[4]=shori[0] ; duraci[5]=shori[1] ; } } void gua_buf(char *buf) { strcpy(lgua,buf); } 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,ka,j,cont; char *cuf; k =0; cont=0; if (isdigit(buf[posin])) { gua_buf(buf); return; } cuf = lgua; if (cuf[vfech+2]!=' ' && cuf[vhor+2]!=' ' && buf[posin] =='V' ) { if(buf[vtranf]=='E') { for(j=0;j<6;j++) { if(isdigit(cuf[vestac+j])) {tel[k++]=cuf[vestac+j]; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; for(j=0;j<3;j++) { if(isdigit(cuf[vestac+j-3])) {tel[k++]=cuf[vestac+j-3];cont++;} } if(cont==0)tel[k++] = '*';cont=0; } if(buf[vtranf]=='S') { for(j=0;j<6;j++) { if(isdigit(cuf[vestac+j-6])) {tel[k++]=cuf[vestac+j-6]; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; for(j=0;j<3;j++) { if(isdigit(cuf[vestac+j+3])) {tel[k++]=cuf[vestac+j+3]; cont++;} } if(cont==0)tel[k++] = '*';cont=0; } tel[k++] = ' ' ; agr_dur(vdurac,buf,cuf) ; tel[k++] = duraci[0] ; tel[k++] = duraci[1] ; tel[k++] = ':' ; tel[k++] = duraci[2] ; tel[k++] = duraci[3] ; tel[k++] = ':' ; tel[k++] = duraci[4] ; tel[k++] = duraci[5] ; tel[k++] = ' ' ; duraci[0] = '\0' ; ka = k ; tel[k++] = cuf[vhor] ; tel[k++] = cuf[vhor+1] ; if (tel[ka]==' ') tel[ka]='0' ; tel[k++] = ':' ; tel[k++] = cuf[vhor+2] ; tel[k++] = cuf[vhor+3] ; tel[k++] = ' ' ; if (vfofech==americano) { tel[k++] = cuf[vfech+2] ; tel[k++] = cuf[vfech+3]; tel[k++] = '/'; tel[k++] = cuf[vfech+4] ; tel[k++] = cuf[vfech+5]; tel[k++] = '/'; tel[k++] = cuf[vfech+0] ; tel[k++] = cuf[vfech+1]; } else { tel[k++] = cuf[vfech+4] ; tel[k++] = cuf[vfech+5]; tel[k++] = '/'; tel[k++] = cuf[vfech+2] ; tel[k++] = cuf[vfech+3]; tel[k++] = '/'; tel[k++] = cuf[vfech+0] ; tel[k++] = cuf[vfech+1]; } tel[k++] = ' ' ; if(buf[vtranf]=='E') { tel[k++]='I'; tel[k++] = ' ' ; tel[k++] = '*' ; } if(buf[vtranf]=='S') { tel[k++]='O'; tel[k++] = ' ' ; for(j=0;j<16;j++) { if(isdigit(cuf[vnumero+j])) {tel[k++]=cuf[vnumero+j];cont++;} } if(cont==0)tel[k++] = '*'; cont=0; } if isdigit(buf[vtranf+9]) { for(j=0;j<4 && (vtranf+9+j)< strlen(buf); j++) tel[k++]=buf[vtranf+9+j]; } tel[k++] = ' ' ; tel[k++] = '*' ;tel[k++] = '*' ; tel[k++] = '*' ; /* centrocosto */ tel[k++] = ' ' ; tel[k++] = '*' ; /* codigoproyecto */ tel[k++] = ' ' ; tel[k++] = '*' ; /* codigocuenta */ tel[k++] = ' ' ; for(j=0;j<5;j++)tel[k++]='0'; tel[k++] = ' ' ; if(buf[vtranf]=='E') /*ruta*/ { for(j=0;j<3;j++) { if(isdigit(cuf[vestac+j-6])) {tel[k++]=cuf[vestac+j-6];cont++;} } if(cont==0)tel[k++] = '*'; cont=0; } if(buf[vtranf]=='S') { for(j=0;j<3;j++) { if(isdigit(cuf[vestac+j])) {tel[k++]=cuf[vestac+j];cont++;} } if(cont==0)tel[k++] = '*'; cont=0; } tel[k++] = ' ' ; tel[k++] = '*' ; /* primer numero */ tel[k++] = ' ' ; // for(j=0;j<6;j++) // { // if(isdigit(cuf[vring+j])) a[j]=cuf[vring+j]; // if(isdigit(cuf[vring+j])) b[j]=cuf[vring+6+j]; // } // a=a-b; // for(j=0;j<6;j++) tel[k++]=a[j]; if((cuf[vdurac+4]==' ' && cuf[vdurac+5]=='0') || buf[vtranf]=='S') //ring { tel[k++] = '0';tel[k++] = '0';tel[k++] = ':';tel[k++] = '0';tel[k++] = '0'; } else { agr_dur(vdurac-6,buf,cuf) ; cont=0; for(j=0;j<6;j++) { duraco[j]=duraci[j]; } agr_dur(vdurac,buf,cuf) ; cont=0; if (duraco[3]