mirror of
https://git.proxmox.com/git/libgit2
synced 2025-11-03 18:08:01 +00:00
Add some more (macro) file operation wrappers
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
This commit is contained in:
parent
54b9460fee
commit
3cc606359d
@ -61,7 +61,7 @@ int gitfo_exists(const char *path)
|
||||
off_t gitfo_size(git_file fd)
|
||||
{
|
||||
struct stat sb;
|
||||
if (fstat(fd, &sb))
|
||||
if (gitfo_fstat(fd, &sb))
|
||||
return git_os_error();
|
||||
return sb.st_size;
|
||||
}
|
||||
|
||||
@ -61,12 +61,16 @@ extern int gitfo_creat(const char *path, int mode);
|
||||
|
||||
extern int gitfo_read(git_file fd, void *buf, size_t cnt);
|
||||
extern int gitfo_write(git_file fd, void *buf, size_t cnt);
|
||||
#define gitfo_lseek(f,n,w) lseek(f, n, w)
|
||||
extern off_t gitfo_size(git_file fd);
|
||||
|
||||
extern int gitfo_read_file(gitfo_buf *obj, const char *path);
|
||||
extern void gitfo_free_buf(gitfo_buf *obj);
|
||||
extern int gitfo_move_file(char *from, char *to);
|
||||
|
||||
#define gitfo_stat(p,b) stat(p, b)
|
||||
#define gitfo_fstat(f,b) fstat(f, b)
|
||||
|
||||
#define gitfo_unlink(p) unlink(p)
|
||||
#define gitfo_rmdir(p) rmdir(p)
|
||||
#define gitfo_chdir(p) chdir(p)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user