#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define estac 22+posin #define linea 28+posin #define durac 61+posin #define hor 9 +posin #define fech 0 +posin #define tranf 0 #define numero 39+posin #define ccost 34+posin #define proye 70+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 0 #define antran 0 // anexo transferido #define fofech americano extern char rgua[]; void in_central() { rgua[0]='\0'; } void fi_central() { } 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 i,k,it,ka,hopm,ampm ; char shora[3],enruta,aux ; i = strlen(buf); ampm = vhor+5; aux = 0; if (i>(vdurac+7) && buf[vfech+2]=='/' && buf[vfech+5]=='/' && buf[vhor+2]==':' && buf[vdurac+2]==':' && (buf[vestac]=='E' || buf[vestac]=='T' || buf[vestac]=='A') && (buf[vlinea]=='E' || buf[vlinea]=='T' || buf[vlinea]=='A') ) { k=0 ; if (buf[vestac]!='T') { tel[k++] = buf[vestac+1] ; tel[k++] = buf[vestac+2] ; tel[k++] = buf[vestac+3] ; tel[k++] = buf[vestac+4] ; } else if (buf[vlinea]!='T') { tel[k++] = buf[vlinea+1] ; tel[k++] = buf[vlinea+2] ; tel[k++] = buf[vlinea+3] ; tel[k++] = buf[vlinea+4] ; } else tel[k++] = '*' ; tel[k++] = ' ' ; if (buf[vlinea]=='T') { tel[k++] = buf[vlinea+1] ; tel[k++] = buf[vlinea+2] ; tel[k++] = buf[vlinea+3] ; tel[k++] = buf[vlinea+4] ; tel[k++] = buf[vlinea+5] ; } else if (buf[vestac]=='T') { tel[k++] = buf[vestac+1] ; tel[k++] = buf[vestac+2] ; tel[k++] = buf[vestac+3] ; tel[k++] = buf[vestac+4] ; tel[k++] = buf[vestac+5] ; } else tel[k++] = '*' ; tel[k++] = ' ' ; tel[k++] = buf[vdurac] ; tel[k++] = buf[vdurac+1] ; tel[k++] = ':' ; tel[k++]= buf[vdurac+3] ; tel[k++]= buf[vdurac+4] ; tel[k++]= ':' ; tel[k++]= buf[vdurac+6] ; tel[k++]= buf[vdurac+7] ; tel[k++]= ' ' ; shora[0] = buf[vhor] ; shora[1] = buf[vhor+1] ; shora[2] = '\0' ; hopm=atoi(shora) ; if (buf[ampm]=='P' && hopm< 12) itoa((hopm+12),shora,10) ; if (buf[ampm]=='A' && hopm==12) itoa((hopm-12),shora,10) ; if (shora[2]=='\0') { tel[k++] = shora[0] ; tel[k++] = shora[1] ; } else { tel[k++] = '0' ; tel[k++] = shora[0] ; } tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if (vfofech==americano) for (it=0 ; it<8 ; it++) tel[k++] = buf[vfech+it] ; else { tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4]; tel[k++] = '/'; tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1]; tel[k++] = '/'; tel[k++] = buf[vfech+6] ; tel[k++] = buf[vfech+7]; } tel[k++] = ' ' ; enruta = 0 ; if (buf[vestac]!='T' && buf[vlinea]=='T') tel[k++] = 'O' ; else if(buf[vestac]=='T' && buf[vlinea]!='T') tel[k++] = 'I' ; else if(buf[vestac]!='T' && buf[vlinea]!='T') tel[k++] = 'T' ; else enruta = 1 ; tel[k++] = ' ' ; ka=k ; for (it=vnumero ; it<(vdurac-1) ; it++) { if (isdigit(buf[it])) tel[k++] = buf[it] ; } if (k==ka) tel[k++]='*' ; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = ' ' ; ka=k; for (it=vproye;it