#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define estac posin #define linea 7+posin #define durac 51+posin #define hor 42+posin #define fech 36+posin #define tranf 9 +posin #define numero 11+posin #define ccost 0 #define proye 74+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 0 #define antran 0 // anexo transferido #define fofech europeo #define ampm 15 #define incomin 28 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 k,i=strlen(buf),haux,maux; char smin[5],shora[5]; char aux; aux = 0; if (i>vdurac && buf[vfech+2]=='.' && buf[vhor+2]==':' && buf[vdurac+6]=='"') { k=0; tel[k++] = buf[vestac] ; tel[k++] = buf[vestac+1] ; tel[k++] = ' ' ; tel[k++] = buf[vlinea] ; tel[k++] = buf[vlinea+1] ; tel[k++] = ' ' ; smin[0] = buf[vdurac] ; smin[1] = buf[vdurac+1] ; smin[2] = buf[vdurac+2] ; smin[3] = '\0' ; haux = atoi(smin)/60; maux = atoi(smin)-(haux*60); itoa(haux,shora,10); itoa(maux,smin,10); if (haux<10) { tel[k++] = '0'; tel[k++] = shora[0]; } else { tel[k++] = shora[0]; tel[k++] = shora[1]; } tel[k++] = ':'; if (maux<10) { tel[k++] = '0'; tel[k++] = smin[0]; } else { tel[k++] = smin[0]; tel[k++] = smin[1]; } tel[k++] = ':'; tel[k++] = buf[vdurac+4]; tel[k++] = buf[vdurac+5]; tel[k++] = ' '; tel[k++] = buf[vhor] ; tel[k++] = buf[vhor+1] ; tel[k++] = buf[vhor+2] ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if (vfofech==europeo) { if (buf[vfech]==' ') tel[k++] ='0'; else tel[k++] =buf[vfech]; tel[k++] = buf[vfech+1]; tel[k++] = '/'; tel[k++] = buf[vfech+3]; tel[k++] = buf[vfech+4]; } else { tel[k++] = buf[vfech+3]; tel[k++] = buf[vfech+4]; tel[k++] = '/'; if (buf[vfech]==' ') tel[k++] ='0'; else tel[k++] =buf[vfech]; tel[k++] = buf[vfech+1]; } tel[k++] = '/'; tel[k++] = buf[6]; tel[k++] = buf[7]; tel[k++] = ' '; tel[k++] = 'O'; tel[k++] = ' '; for (i= 0;buf[vnumero+i]!=' ';i++) { if (isdigit(buf[vnumero+i])) tel[k++] = buf[vnumero+i]; } tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; // centro de costo tel[k++] = ' ' ; tel[k++] = ' ' ; tel[k++] = '*' ; // código de proyecto tel[k++] = '*' ; // código de proyecto tel[k++] = '*' ; // código de proyecto tel[k++] = ' ' ; tel[k++] = '*' ; /* codigo de cuenta */ tel[k++] = '*' ; /* codigo de cuenta */ tel[k++] = '*' ; /* codigo de cuenta */ tel[k++] = ' ' ; tel[k++] = '0' ; /* tarifa o pulsos */ tel[k++] = '0' ; /* tarifa o pulsos */ tel[k++] = '0' ; /* tarifa o pulsos */ tel[k++] = '0' ; /* tarifa o pulsos */ tel[k++] = ' ' ; tel[k++] = '*' ; /* ruta */ tel[k++] = '*' ; /* ruta */ tel[k++] = '*' ; /* ruta */ tel[k++] = ' ' ; tel[k++] = '*' ; /* primer numero */ tel[k++] = ' ' ; tel[k++] = '0' ; tel[k++] = '0' ; tel[k++] = ':' ; tel[k++] = '0' ; tel[k++] = '0' ; /* tiempo ring */ tel[k++] = ' ' ; tel[k++] = '*' ; // anexo transferido tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }