libfru 2.1
FRU Manupulation Library
Loading...
Searching...
No Matches
Macros | Functions
frugen-json.c File Reference

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"
Include dependency graph for frugen-json.c:

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)
 

Detailed Description

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

Macro Definition Documentation

◆ MAX_MR_KEYS

#define MAX_MR_KEYS   5

◆ MGMT_TYPE_ID

#define MGMT_TYPE_ID (   type)    ((type) - FRU_MR_MGMT_MIN)

Function Documentation

◆ json_object_to_fd()

int json_object_to_fd ( int  fd,
struct json_object *  obj,
int  flags 
)

Referenced by save_to_json_file().

Here is the caller graph for this function:

◆ load_from_json_file()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_to_json_file()

void save_to_json_file ( FILE **  fp,
const char *  fname,
const struct frugen_fruinfo_s info,
const struct frugen_config_s config 
)