File: file.h

package info (click to toggle)
qemu 1%3A10.0.3%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 413,680 kB
  • sloc: ansic: 4,733,433; pascal: 114,769; python: 105,506; asm: 68,431; sh: 52,881; makefile: 27,469; perl: 18,778; cpp: 11,435; xml: 3,404; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (34 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
/* Copyright 2013-2016 IBM Corp. */

#ifndef __LIBFLASH_FILE_H
#define __LIBFLASH_FILE_H

#include <stdbool.h>

#include "blocklevel.h"

/*
 * Blockevel functions created leave errno set on errors, as these calls
 * often boil down to standard read() and write() calls, inspecting errno
 * may prove useful
 */

int file_init(int fd, struct blocklevel_device **bl);
void file_exit(struct blocklevel_device *bl);

/*
 * file_init_path() is a convenience wrapper which will open the path and call
 * file_init(). The call to open happens with O_RDWR and no additional flags
 * Because file_exit() doesn't close the file descriptor, file_init_path()
 * makes it available.
 */
int file_init_path(const char *path, int *fd, bool keep_alive, struct blocklevel_device **bl);

/*
 * file_exit_close is a convenience wrapper which will close the open
 * file descriptor and call file_exit().
 */
void file_exit_close(struct blocklevel_device *bl);

#endif /* __LIBFLASH_FILE_H */