#define americano 0 #define europeo 1 #define lmax 200 // 200 #define posin 18 #define estac 2+posin #define linea 26+posin #define durac 38+posin #define hor 57+posin #define fech 47+posin #define tranf 1+posin #define numero 7+posin #define ccost 0 #define proye 0+posin #define cuenta 0 #define pulsos 0 #define ruta 36+posin #define prinum 0 #define ring 0 #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 lgua[lmax+3]; char *cuf,*ruf; int mc = 0 ; extern char rgua[]; void in_central() { rgua[0]='\0'; } void fi_central() { } // agregar duración 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 i,k; char tip ; k =0; if (buf[posin]=='$') { gua_buf(buf); return; } cuf = lgua; i = strlen(buf) ; if (i>vestac && cuf[vfech+2]=='-' && cuf[vfech+6]=='-' && cuf[vhor+2]==':'&& cuf[vhor+5]==':' ) { tip = ' '; if (cuf[vlinea+2]=='-') tip = 'O'; else tip = 'I'; if (tip == 'O') { for (i=0;cuf[vestac+i]!=' ' && i<5;i++) tel[k++] = cuf[vestac+i]; tel[k++] = ' ' ; for (i=0;cuf[vlinea+i]!=' ' && i<6;i++) { if (cuf[vlinea+i]!='-') tel[k++] = cuf[vlinea+i]; } } else { for (i=0;cuf[vestac+17+i]!=' ';i++) tel[k++] = cuf[vestac+17+i]; tel[k++] = ' ' ; for (i=0;cuf[vestac+7+i]!=' ';i++) { if (cuf[vestac+7+i]!='-') tel[k++] = cuf[vestac+7+i]; } } tel[k++] = ' ' ; tel[k++] = cuf[vdurac+0]; tel[k++] = cuf[vdurac+1]; tel[k++] = ':'; tel[k++] = cuf[vdurac+3]; tel[k++] = cuf[vdurac+4]; tel[k++] = ':'; tel[k++] = cuf[vdurac+6]; tel[k++] = cuf[vdurac+7]; tel[k++] = ' ' ; tel[k++] = cuf[vhor+0]; tel[k++] = cuf[vhor+1]; tel[k++] = ':'; tel[k++] = cuf[vhor+3]; tel[k++] = cuf[vhor+4]; tel[k++] = ' ' ; if (vfofech == europeo) { tel[k++] = cuf[3]; tel[k++] = cuf[4]; tel[k++] = '/'; tel[k++] = cuf[0]; tel[k++] = cuf[1]; } else { tel[k++] = cuf[0]; tel[k++] = cuf[1]; tel[k++] = '/'; tel[k++] = cuf[3]; tel[k++] = cuf[4]; } tel[k++] = cuf[5]; tel[k++] = cuf[6]; tel[k++] = cuf[7]; tel[k++] = ' ' ; tel[k++] = tip ; tel[k++] = ' ' ; if (tip =='O') { for (i=0;buf[vnumero+i]!=' ' && i<22;i++) tel[k++]= buf[vnumero+i]; } else { tel[k++]='*'; } tel[k++]=' '; tel[k++]='*'; tel[k++]='*'; // centro de costo tel[k++]=' '; tel[k++]='*'; tel[k++]='*'; // codigo de proyecto tel[k++]=' '; tel[k++]='*'; tel[k++]='*'; // codigo de cuenta tel[k++]=' '; for (i=0;i<5;i++) tel[k++]='0'; tel[k++]=' '; tel[k++]= cuf[vruta]; tel[k++]=' '; tel[k++]='*'; // primer numero tel[k++]=' '; tel[k++] = '0'; tel[k++] = '0'; tel[k++] = ':'; tel[k++] = '0'; tel[k++] = '0'; tel[k++] =' '; tel[k++] = '*'; // primer numero tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }