Files
u-boot/include/u-boot-lib.h
Simon Glass 1db2a3f13b ulib: Add a way to obtain the version
It is possible to simply read the 'version_string' variable, but it
seems better to add a proper API call to get this. It is already
defined in lib/ulib/ulib.c

Add a prototype to u-boot-lib.h

Make use of it from the demo program.

Fix the comment for ulib_uninit() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-11 15:19:22 -06:00

42 lines
964 B
C

/* SPDX-License-Identifier: GPL-2.0+ */
/*
* U-Boot library interface
*
* This provides basic access to setup of the U-Boot library.
*
* Library functions must be individually accessed via their respective headers.
*
* Copyright 2025 Canonical Ltd.
* Written by Simon Glass <simon.glass@canonical.com>
*/
#ifndef __U_BOOT_LIB_H
#define __U_BOOT_LIB_H
struct global_data;
/**
* ulib_init() - set up the U-Boot library
*
* @progname: Program name to use (must be a writeable string, typically argv[0])
* @data: Global data (must remain valid until the program exits)
* Return: 0 if OK, -ve error code on error
*/
int ulib_init(char *progname);
/**
* ulib_uninit() - shut down the U-Boot library
*
* Call this when your program has finished using the library, before it exits
*/
void ulib_uninit(void);
/**
* ulib_get_version() - Get the version string
*
* Return: Full U-Boot version string
*/
const char *ulib_get_version(void);
#endif