vcdiff_vfs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Juergen Fitschen
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
20 #include "vcdiff.h"
21 #include "vfs.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 extern const vcdiff_driver_t vcdiff_vfs_driver;
31 
35 typedef struct {
36  int fd;
37  size_t max_size;
38 } vcdiff_vfs_t;
39 
43 #define VCDIFF_VFS_INIT_MAX_SIZE(FD, SIZE) { .fd = FD, .max_size = SIZE }
44 
48 #define VCDIFF_VFS_INIT(FD) VCDIFF_VFS_INIT_MAX_SIZE(FD, SIZE_MAX)
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
Context for the underlying file.
Definition: vcdiff_vfs.h:35
size_t max_size
Maximum file size for vcdiff target files.
Definition: vcdiff_vfs.h:37
int fd
File descriptor of the VFS file.
Definition: vcdiff_vfs.h:36
const vcdiff_driver_t vcdiff_vfs_driver
Driver for accessing VFS-based file access.