#include #include #include #include #include #include #include unsigned char hexvalue(char c) { if(c >= '0' && c <= '9') return(c-'0'); if(c >= 'A' && c <= 'F') return(c-'A'+10); if(c >= 'a' && c <= 'f') return(c-'a'+10); } int findtoken(char *token,char *str,char *value) { int w,x,y,z; char tok[40]; sprintf(tok,"%s=",token); y = strlen(tok); z = strlen(str); //printf("Searching for .%s. in .%s.\n",tok,str); for(x=0;x"); } else { printf("",gender+1); } if(volume) { if(volume == 1) printf(""); if(volume == 2) printf(""); } if(speed) { if(speed == 1) printf(""); if(speed == 2) printf(""); } if(strncmp(&s[0],"http",4) == 0) { httpmode = 1; buffer[0] = 0; } //printf("httpmode = %d. pos=%d size=%d",httpmode,pos,size); while(pos < size) { c = s[pos++]; if(c == '+') { if(hush <= 0) if(httpmode) break; myputc(' ',buffer,httpmode); } else if(c == '%') { c = s[pos++]; x = hexvalue(c); c = s[pos++]; x = x*16+hexvalue(c); if(x == '<') hush++; if(hush <= 0) myputc(x,buffer,httpmode); if(x == '>') hush--; } else if(hush <= 0) myputc(c,buffer,httpmode); } //printf("Done. pos=%d size=%d.",pos,size); if(httpmode) { int PID; int handle; char filename[40]; char command[2000]; PID = getpid(); // printf("doing the http thing.\n"); sprintf(filename,"/tmp/httpout%d.txt",PID); sprintf(command,"wget -O %s %s > /dev/null 2> /dev/null",filename,buffer); system(command); handle = open(filename,O_RDONLY); x = read(handle, s, 19990); // printf("read %d characters from %s\n",x,filename); s[19990] = 0; pos=0; hush=0; size = strlen(s); while(pos < size) { // printf("h=%d c=%c",hush,c); c = s[pos++]; if(c == '<') hush++; if(hush <= 0) putc(c,stdout); if(c == '>') hush--; } } if(speed) printf(""); if(volume) printf(""); printf(""); }