#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 132+posin #define estac 14 #define linea 8 #define durac 30 #define hor 24 #define fech 20 #define tranf 30 #define numero 62 #define ccost 0 #define proye 106 #define cuenta 40 #define pulsos 94 #define ruta 5 #define prinum 19 #define ring 0 #define antran 0 // anexo transferido #define fofech americano // formato de fecha #define incomin 4 #define anoa 6 #define l_ruta 3 #define l_esta 7 #define l_proy 8 #define l_line 3 #define l_nume 24 #define l_cuenta 10 #define l_pulsos 4 char durll[6] ; void cadur(int posk, int vfech, int vdurac, char *buf) { char shora[3] ; int mesi,mesf,diai,diaf,hori,horf,mini,minf,segi,segf ; shora[0] = buf[vfech+posk-3] ; shora[1] = buf[vfech+posk-2] ; shora[2] = '\0' ; mesi = atoi(shora) ; shora[0] = buf[vfech+posk-1] ; shora[1] = buf[vfech+posk-0] ; shora[2] = '\0' ; diai = atoi(shora) ; shora[0] = buf[vfech+posk+1] ; shora[1] = buf[vfech+posk+2] ; shora[2] = '\0' ; hori = atoi(shora) ; shora[0] = buf[vfech+posk+3] ; shora[1] = buf[vfech+posk+4] ; shora[2] = '\0' ; mini = atoi(shora) ; shora[0] = buf[vfech+posk+5] ; shora[1] = buf[vfech+posk+6] ; shora[2] = '\0' ; segi = atoi(shora) ; shora[0] = buf[vdurac+posk-3] ; shora[1] = buf[vdurac+posk-2] ; shora[2] = '\0' ; mesf = atoi(shora) ; shora[0] = buf[vdurac+posk-1] ; shora[1] = buf[vdurac+posk-0] ; shora[2] = '\0' ; diaf = atoi(shora) ; shora[0] = buf[vdurac+posk+1] ; shora[1] = buf[vdurac+posk+2] ; shora[2] = '\0' ; horf = atoi(shora) ; shora[0] = buf[vdurac+posk+3] ; shora[1] = buf[vdurac+posk+4] ; shora[2] = '\0' ; minf = atoi(shora) ; shora[0] = buf[vdurac+posk+5] ; shora[1] = buf[vdurac+posk+6] ; shora[2] = '\0' ; segf = atoi(shora) ; if (segfvnumero /* && buf[posin]==0x2*/ && buf[posk]=='K' && (buf[vfech-4+posk]==' ') && isdigit(buf[vfech+posk])) { k=0 ; if (buf[vestac+posk-3]!=' ' || buf[vestac+posk-2]!=' ' || buf[vestac+posk-1]!=' ') { tel[k++] = buf[vestac+posk-3] ; tel[k++] = buf[vestac+posk-2] ; tel[k++] = buf[vestac+posk-1] ; //tel[k++] = buf[vestac+posk] ; // tel[k++] = buf[vestac+posk+1] ; } else tel[k++] = '*'; tel[k++] = ' ' ; tel[k++] = buf[vlinea+posk-3] ; tel[k++] = buf[vlinea+posk-2] ; tel[k++] = buf[vlinea+posk-1] ; tel[k++] = ' ' ; cadur(posk, vfech, vdurac, buf) ; if (durll[0]=='2' && durll[1]=='3' ) { tel[k++]='0';tel[k++]='0';tel[k++]=':';tel[k++]='0';tel[k++]='0';tel[k++]=':';tel[k++]='0';tel[k++]='0'; } else { tel[k++] = durll[0] ; tel[k++] = durll[1] ; tel[k++] = ':' ; tel[k++] = durll[2] ; tel[k++] = durll[3] ; tel[k++] = ':' ; tel[k++] = durll[4] ; tel[k++] = durll[5] ;} tel[k++]= ' ' ; tel[k++] = buf[vhor+posk-3] ; tel[k++] = buf[vhor+posk-2] ; tel[k++] = ':' ; tel[k++] = buf[vhor+posk-1] ; tel[k++] = buf[vhor+posk] ; tel[k++] = ' ' ; tel[k++] = buf[vfech+posk-3] ; tel[k++] = buf[vfech+posk-2] ; tel[k++] = '/' ; tel[k++] = buf[vfech+posk-1] ; tel[k++] = buf[vfech+posk] ; tel[k++] = '/' ; tel[k++] = buf[anoa] ; tel[k++] = buf[anoa+1] ; tel[k++] = ' ' ; if (buf[incomin+posk-3]=='A') { tel[k++] = 'O' ; tel[k++] = ' ' ; } else { tel[k++] = 'I' ; tel[k++] = ' ' ; } if (buf[incomin+posk-3]=='A') { for (it=vnumero+posk-3; it<(vnumero+posk-3+l_nume) && buf[it]!=' '; it++) tel[k++] = buf[it] ; } else if(buf[vnumero+posk+33]==' ') tel[k++] = '3' ; else { for (it=vnumero+posk+33; it<(vnumero+posk+33+l_nume) && buf[it]!=' '; it++) tel[k++] = buf[it] ; } tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = ' ' ; for (it=0;it