char *capture_until(char *str) { char *search,*startPos = currentPos; char *cv; int i; size_t len; search = strcasestr(startPos,str); if (search == NULL) return NULL; for(;*startPos == ' ';startPos++); len = search - startPos; cv = calloc(1,len+1); strncpy(cv,startPos,len); for(;cv[strlen(cv)-1]==' ';) cv[strlen(cv)-1]='\0'; for(i=0;i != strlen(cv); i++) { if (strchr("\t\n\r\b",cv[i])) cv[i]=' '; } set_current_value(cv); return seek_to(str); }
void float_setting::read_from_archive(archive_reader& reader, const char* name) { float read_value = 0; read_float(reader, name, read_value); set_current_value(read_value); }