X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=options.c;h=86ab5d6d230cf0df8d218a66aabe90a01adf6cbf;hp=1c35acc76e57dc8865742ffe241df876ed38bcac;hb=1cf97788d4e533e4216160c2715f14596106e1e5;hpb=c74cb68a1c13077222471e77f4715e0521cb4ed0 diff --git a/options.c b/options.c index 1c35acc7..86ab5d6d 100644 --- a/options.c +++ b/options.c @@ -1240,6 +1240,23 @@ int set_name_idx(char *target, size_t tlen, char *input, int index, return len; } +char* get_name_by_idx(char *input, int index) +{ + unsigned int cur_idx; + char *fname, *str, *p; + + p = str = strdup(input); + + index %= get_max_name_idx(input); + for (cur_idx = 0; cur_idx <= index; cur_idx++) + fname = get_next_name(&str); + + fname = strdup(fname); + free(p); + + return fname; +} + static int str_filename_cb(void *data, const char *input) { struct thread_data *td = cb_data_to_td(data);