]>
git.proxmox.com Git - libgit2.git/blob - src/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__
14 typedef struct git_mwindow
{
15 struct git_mwindow
*next
;
22 typedef struct git_mwindow_file
{
28 typedef struct git_mwindow_ctl
{
30 unsigned int open_windows
;
31 unsigned int mmap_calls
;
32 unsigned int peak_open_windows
;
35 git_vector windowfiles
;
38 int git_mwindow_contains(git_mwindow
*win
, git_off_t offset
);
39 void git_mwindow_free_all(git_mwindow_file
*mwf
); /* locks */
40 void git_mwindow_free_all_locked(git_mwindow_file
*mwf
); /* run under lock */
41 unsigned char *git_mwindow_open(git_mwindow_file
*mwf
, git_mwindow
**cursor
, git_off_t offset
, size_t extra
, unsigned int *left
);
42 int git_mwindow_file_register(git_mwindow_file
*mwf
);
43 void git_mwindow_file_deregister(git_mwindow_file
*mwf
);
44 void git_mwindow_close(git_mwindow
**w_cursor
);
46 int git_mwindow_files_init(void);
47 void git_mwindow_files_free(void);
49 struct git_pack_file
; /* just declaration to avoid cyclical includes */
50 int git_mwindow_get_pack(struct git_pack_file
**out
, const char *path
);
51 void git_mwindow_put_pack(struct git_pack_file
*pack
);