#include <stdarg.h>
Go to the source code of this file.
|
static void | va_start (ap, str) |
|
| fprintf (stderr,"FATAL ERROR: ") |
|
| vfprintf (stderr, str, ap) |
|
| exit (1) |
|
char * | xstrdup (const char *s) |
|
char * | join_path (const char *path, const char *name) |
|
int | util_is_printable_string (const void *data, int len) |
|
char | get_escape_char (const char *s, int *i) |
|
char * | utilfdt_read (const char *filename) |
|
int | utilfdt_read_err (const char *filename, char **buffp) |
|
int | utilfdt_write (const char *filename, const void *blob) |
|
int | utilfdt_write_err (const char *filename, const void *blob) |
|
int | utilfdt_decode_type (const char *fmt, int *type, int *size) |
|
Value:"<type>\ts=string, i=int, u=unsigned, x=hex\n" \
"\tOptional modifier prefix:\n" \
"\t\thh or b=byte, h=2 byte, l=4 byte (default)\n";
Definition at line 148 of file util.h.
fprintf |
( |
stderr |
, |
|
|
"FATAL ERROR: " |
|
|
) |
| |
Check a string of a given length to see if it is all printable and has a valid terminator.
- Parameters
-
data | The string to check |
len | The string length including terminator |
- Returns
- 1 if a valid printable string, 0 if not
Definition at line 72 of file util.c.
Decode a data type string. The purpose of this string
The string consists of an optional character followed by the type: Modifier characters: hh or b 1 byte h 2 byte l 4 byte, default
Type character: s string i signed integer u unsigned integer x hex
TODO: Implement ll modifier (8 bytes) TODO: Implement o type (octal)
- Parameters
-
fmt | Format string to process |
type | Returns type found(s/d/u/x), or 0 if none |
size | Returns size found(1,2,4,8) or 4 if none |
- Returns
- 0 if ok, -1 on error (no type given, or other invalid format)
Definition at line 295 of file util.c.
Read a device tree file into a buffer. This will report any errors on stderr.
- Parameters
-
filename | The filename to read, or - for stdin |
- Returns
- Pointer to allocated buffer containing fdt, or NULL on error
Definition at line 238 of file util.c.
Read a device tree file into a buffer. Does not report errors, but only returns them. The value returned can be passed to strerror() to obtain an error message for the user.
- Parameters
-
filename | The filename to read, or - for stdin |
buffp | Returns pointer to buffer containing fdt |
- Returns
- 0 if ok, else an errno value representing the error
Definition at line 194 of file util.c.
Write a device tree buffer to a file. This will report any errors on stderr.
- Parameters
-
filename | The filename to write, or - for stdout |
blob | Poiner to buffer containing fdt |
- Returns
- 0 if ok, -1 on error
Definition at line 284 of file util.c.
Write a device tree buffer to a file. Does not report errors, but only returns them. The value returned can be passed to strerror() to obtain an error message for the user.
- Parameters
-
filename | The filename to write, or - for stdout |
blob | Poiner to buffer containing fdt |
- Returns
- 0 if ok, else an errno value representing the error
Definition at line 252 of file util.c.
vfprintf |
( |
stderr |
, |
|
|
str |
, |
|
|
ap |
|
|
) |
| |