mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-17 03:21:28 +00:00

1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
60 lines
1.4 KiB
C
60 lines
1.4 KiB
C
/*
|
|
* Copyright (C) 2009-2011 the libgit2 contributors
|
|
*
|
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
|
* a Linking Exception. For full terms see the included COPYING file.
|
|
*/
|
|
#ifndef INCLUDE_posix_h__
|
|
#define INCLUDE_posix_h__
|
|
|
|
#include "common.h"
|
|
#include <fcntl.h>
|
|
#include <time.h>
|
|
|
|
#define S_IFGITLINK 0160000
|
|
#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
|
|
|
|
#if !defined(O_BINARY)
|
|
#define O_BINARY 0
|
|
#endif
|
|
|
|
typedef int git_file;
|
|
|
|
/**
|
|
* Standard POSIX Methods
|
|
*
|
|
* All the methods starting with the `p_` prefix are
|
|
* direct ports of the standard POSIX methods.
|
|
*
|
|
* Some of the methods are slightly wrapped to provide
|
|
* saner defaults. Some of these methods are emulated
|
|
* in Windows platforns.
|
|
*
|
|
* Use your manpages to check the docs on these.
|
|
* Straightforward
|
|
*/
|
|
extern int p_open(const char *path, int flags);
|
|
extern int p_creat(const char *path, int mode);
|
|
extern int p_read(git_file fd, void *buf, size_t cnt);
|
|
extern int p_write(git_file fd, const void *buf, size_t cnt);
|
|
extern int p_getcwd(char *buffer_out, size_t size);
|
|
|
|
#define p_lseek(f,n,w) lseek(f, n, w)
|
|
#define p_stat(p,b) stat(p, b)
|
|
#define p_fstat(f,b) fstat(f, b)
|
|
#define p_chdir(p) chdir(p)
|
|
#define p_rmdir(p) rmdir(p)
|
|
#define p_chmod(p,m) chmod(p, m)
|
|
#define p_close(fd) close(fd)
|
|
|
|
/**
|
|
* Platform-dependent methods
|
|
*/
|
|
#ifdef GIT_WIN32
|
|
# include "win32/posix.h"
|
|
#else
|
|
# include "unix/posix.h"
|
|
#endif
|
|
|
|
#endif
|