MCPcopy Create free account
hub / github.com/coreboot/coreboot / process_list

Function process_list

util/smmstoretool/main.c:245–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245static int process_list(int argc, char *argv[], const char store_file[])
246{
247 if (argc != 1) {
248 fprintf(stderr, "Invalid invocation\n");
249 print_sub_command_usage(argv[0]);
250 }
251
252 struct storage_t storage;
253 if (!storage_open(store_file, &storage, /*rw=*/false))
254 return EXIT_FAILURE;
255
256 for (struct var_t *v = storage.vs.vars; v != NULL; v = v->next) {
257 char *name = to_chars(v->name, v->name_size);
258 char *guid = format_guid(&v->guid, /*use_alias=*/true);
259
260 printf("%-*s:%s (%zu %s)\n", GUID_LEN, guid, name, v->data_size,
261 v->data_size == 1 ? "byte" : "bytes");
262
263 free(name);
264 free(guid);
265 }
266
267 storage_drop(&storage);
268 return EXIT_SUCCESS;
269}
270
271static void help_get(FILE *f, const struct subcommand_t *info)
272{

Callers

nothing calls this directly

Calls 8

fprintfFunction · 0.85
print_sub_command_usageFunction · 0.85
storage_openFunction · 0.85
to_charsFunction · 0.85
format_guidFunction · 0.85
printfFunction · 0.85
storage_dropFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected