• Home
  • Raw
  • Download

Lines Matching refs:data

57 struct data {  struct
72 static void read_data(struct data *data, const char *filename) { in read_data() argument
74 data->name = strdup(filename); in read_data()
77 data->value = NULL; in read_data()
85 data->value = NULL; in read_data()
91 data->value = malloc(len + 1); in read_data()
92 memcpy(data->value, buf, len); in read_data()
93 data->value[len] = '\0'; in read_data()
105 struct data *stats, int stats_count) { in read_lines()
143 struct data *data = &stats[num++]; in read_lines() local
144 data->name = malloc(filename_len + 1 + (name_end - line) + 1); in read_lines()
145 unspace(data->name, filename, filename_len); in read_lines()
146 data->name[filename_len] = ':'; in read_lines()
147 unspace(data->name + filename_len + 1, line, name_end - line); in read_lines()
148 data->name[filename_len + 1 + (name_end - line)] = '\0'; in read_lines()
152 data->value = strdup(value); in read_lines()
160 static int read_proc_yaffs(struct data *stats, int stats_count) { in read_proc_yaffs()
193 struct data *data = &stats[num++]; in read_proc_yaffs() local
194 data->name = malloc(12 + device_len + 1 + (name_end - line) + 1); in read_proc_yaffs()
195 memcpy(data->name, "/proc/yaffs:", 12); in read_proc_yaffs()
196 unspace(data->name + 12, device, device_len); in read_proc_yaffs()
197 data->name[12 + device_len] = ':'; in read_proc_yaffs()
198 unspace(data->name + 12 + device_len + 1, line, name_end - line); in read_proc_yaffs()
199 data->name[12 + device_len + 1 + (name_end - line)] = '\0'; in read_proc_yaffs()
203 data->value = strdup(value); in read_proc_yaffs()
211 const struct data *data_a = (const struct data *) a; in compare_data()
212 const struct data *data_b = (const struct data *) b; in compare_data()
218 static struct data *read_stats(char *names[], int name_count) { in read_stats()
285 struct data *stats = malloc((stats_count + 1) * sizeof(struct data)); in read_stats()
286 struct data *next = stats; in read_stats()
295 struct data *end = stats + stats_count; in read_stats()
308 qsort(stats, next - stats, sizeof(struct data), compare_data); in read_stats()
313 static void diff_stats(struct data *old_stats, struct data *new_stats) { in diff_stats()
354 static void free_stats(struct data *stats) { in free_stats()
385 struct data *old_stats = malloc(sizeof(struct data)); in main()
393 struct data *new_stats = read_stats(argv + 2, argc - 2); in main()