master
h 33 lines 1016 Bytes
Raw
1 #ifndef QEMU_DATADIR_H
2 #define QEMU_DATADIR_H
3
4 typedef enum {
5 QEMU_FILE_TYPE_BIOS,
6 QEMU_FILE_TYPE_DTB,
7 QEMU_FILE_TYPE_KEYMAP,
8 } QemuFileType;
9
10 /**
11 * qemu_find_file:
12 * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS)
13 * QEMU_FILE_TYPE_DTB (for device tree blobs)
14 * or QEMU_FILE_TYPE_KEYMAP (for keymaps).
15 * @name: Relative or absolute file name
16 *
17 * If @name exists on disk as an absolute path, or a path relative
18 * to the current directory, then returns @name unchanged.
19 * Otherwise searches for @name file in the data directories, either
20 * configured at build time (DATADIR) or registered with the -L command
21 * line option.
22 *
23 * The caller must use g_free() to free the returned data when it is
24 * no longer required.
25 *
26 * Returns: a path that can access @name, or NULL if no matching file exists.
27 */
28 char *qemu_find_file(QemuFileType type, const char *name);
29 void qemu_add_default_firmwarepath(void);
30 void qemu_add_data_dir(char *path);
31 void qemu_list_data_dirs(void);
32
33 #endif