|
libfru 2.1
FRU Manupulation Library
|
FRU generator utility JSON support code. More...
#include <assert.h>#include <time.h>#include <limits.h>#include <stdbool.h>#include <unistd.h>#include <json-c/json.h>#include "fru.h"#include "fru-errno.h"#include "frugen-json.h"
Macros | |
| #define | MAX_MR_KEYS 5 |
| #define | MGMT_TYPE_ID(type) ((type) - FRU_MR_MGMT_MIN) |
Functions | |
| int | json_object_to_fd (int fd, struct json_object *obj, int flags) |
| void | load_from_json_file (const char *fname, struct frugen_fruinfo_s *info) |
| void | save_to_json_file (FILE **fp, const char *fname, const struct frugen_fruinfo_s *info, const struct frugen_config_s *config) |
FRU generator utility JSON support code.
Copyright (C) 2016-2023 Alexander Amelkin alexa.nosp@m.nder.nosp@m.@amel.nosp@m.kin..nosp@m.msk.r.nosp@m.u SPDX-License-Identifier: GPL-2.0-or-later OR Apache-2.0
| #define MAX_MR_KEYS 5 |
| #define MGMT_TYPE_ID | ( | type | ) | ((type) - FRU_MR_MGMT_MIN) |
| int json_object_to_fd | ( | int | fd, |
| struct json_object * | obj, | ||
| int | flags | ||
| ) |
| void load_from_json_file | ( | const char * | fname, |
| struct frugen_fruinfo_s * | info | ||
| ) |
Load a FRU template from JSON file into a FRU information structure
References datestr_to_tv(), debug, fatal, frugen_fruinfo_s::fru, frugen_fruinfo_s::has_bdate, frugen_fruinfo_s::has_board, frugen_fruinfo_s::has_chassis, frugen_fruinfo_s::has_internal, frugen_fruinfo_s::has_multirec, and frugen_fruinfo_s::has_product.
Referenced by load_fromfile().


| void save_to_json_file | ( | FILE ** | fp, |
| const char * | fname, | ||
| const struct frugen_fruinfo_s * | info, | ||
| const struct frugen_config_s * | config | ||
| ) |
References DATEBUF_SZ, fatal, frugen_config_s::flags, frugen_fruinfo_s::fru, frugen_fruinfo_s::has_board, frugen_fruinfo_s::has_chassis, frugen_fruinfo_s::has_internal, frugen_fruinfo_s::has_multirec, frugen_fruinfo_s::has_product, json_object_to_fd(), and tv_to_datestr().
Referenced by main().

