mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-15 12:08:14 +02:00
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
37 lines
738 B
C
37 lines
738 B
C
/*
|
|
* Copyright 2019 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* File operations helpers
|
|
*/
|
|
|
|
#ifndef _OS_FILE_H_
|
|
#define _OS_FILE_H_
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
* Create a new file and opens it for writing-only.
|
|
* If the given filename already exists, nothing is done and NULL is returned.
|
|
* `errno` gets set to the failure reason; if that is not EEXIST, the caller
|
|
* might want to do something other than trying again.
|
|
*/
|
|
FILE *
|
|
os_file_create_unique(const char *filename, int filemode);
|
|
|
|
/*
|
|
* Read a file.
|
|
* Returns a char* that the caller must free(), or NULL and sets errno.
|
|
*/
|
|
char *
|
|
os_read_file(const char *filename);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _OS_FILE_H_ */
|