mesa/src/freedreno/decode/io.h
David Heidelberg 0dc791ed57 freedreno: use unicode © instead of DOS-like (C) copyright sign
Acked-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30721>
2024-08-28 08:54:00 +00:00

32 lines
734 B
C

/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
/*
* Copyright © 2014 Rob Clark <robclark@freedesktop.org>
* SPDX-License-Identifier: MIT
*
* Authors:
* Rob Clark <robclark@freedesktop.org>
*/
#ifndef IO_H_
#define IO_H_
/* Simple API to abstract reading from file which might be compressed.
* Maybe someday I'll add writing..
*/
struct io;
struct io *io_open(const char *filename);
struct io *io_openfd(int fd);
void io_close(struct io *io);
unsigned io_offset(struct io *io);
int io_readn(struct io *io, void *buf, int nbytes);
static inline int
check_extension(const char *path, const char *ext)
{
return strcmp(path + strlen(path) - strlen(ext), ext) == 0;
}
#endif /* IO_H_ */