Linux Kernel
3.7.1
|
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "libfdt.h"
#include "util.h"
Go to the source code of this file.
Functions | |
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) |
int | utilfdt_read_err (const char *filename, char **buffp) |
char * | utilfdt_read (const char *filename) |
int | utilfdt_write_err (const char *filename, const void *blob) |
int | utilfdt_write (const char *filename, const void *blob) |
int | utilfdt_decode_type (const char *fmt, int *type, int *size) |
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)
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 |
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.
filename | The filename to read, or - for stdin |
buffp | Returns pointer to buffer containing fdt |
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.
filename | The filename to write, or - for stdout |
blob | Poiner to buffer containing fdt |