]>
git.proxmox.com Git - libgit2.git/blob - src/libgit2/mwindow.h
2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
8 #ifndef INCLUDE_mwindow__
9 #define INCLUDE_mwindow__
16 typedef struct git_mwindow
{
17 struct git_mwindow
*next
;
24 typedef struct git_mwindow_file
{
25 git_mutex lock
; /* protects updates to fd */
31 typedef struct git_mwindow_ctl
{
33 unsigned int open_windows
;
34 unsigned int mmap_calls
;
35 unsigned int peak_open_windows
;
38 git_vector windowfiles
;
41 int git_mwindow_contains(git_mwindow
*win
, off64_t offset
, off64_t extra
);
42 int git_mwindow_free_all(git_mwindow_file
*mwf
); /* locks */
43 unsigned char *git_mwindow_open(git_mwindow_file
*mwf
, git_mwindow
**cursor
, off64_t offset
, size_t extra
, unsigned int *left
);
44 int git_mwindow_file_register(git_mwindow_file
*mwf
);
45 void git_mwindow_file_deregister(git_mwindow_file
*mwf
);
46 void git_mwindow_close(git_mwindow
**w_cursor
);
48 extern int git_mwindow_global_init(void);
50 struct git_pack_file
; /* just declaration to avoid cyclical includes */
51 int git_mwindow_get_pack(struct git_pack_file
**out
, const char *path
);
52 int git_mwindow_put_pack(struct git_pack_file
*pack
);