]> git.proxmox.com Git - libgit2.git/blame - src/win32/posix.h
Make sure we use the `C` locale for `regcomp` on macOS.
[libgit2.git] / src / win32 / posix.h
CommitLineData
bb742ede 1/*
359fc2d2 2 * Copyright (C) the libgit2 contributors. All rights reserved.
bb742ede
VM
3 *
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.
6 */
f79026b4
VM
7#ifndef INCLUDE_posix__w32_h__
8#define INCLUDE_posix__w32_h__
9
10#include "common.h"
3948e862 11#include "../posix.h"
35439f59 12#include "win32-compat.h"
cceae9a2 13#include "path_w32.h"
11d51ca6 14#include "utf-conv.h"
345b6307 15#include "dir.h"
f79026b4 16
2f795d8f 17typedef SOCKET GIT_SOCKET;
238b7614 18
2f795d8f 19#define p_lseek(f,n,w) _lseeki64(f, n, w)
c4d23928
ET
20
21extern int p_fstat(int fd, struct stat *buf);
2f795d8f 22extern int p_lstat(const char *file_name, struct stat *buf);
c4d23928 23extern int p_stat(const char* path, struct stat *buf);
f79026b4 24
35439f59
ET
25extern int p_utimes(const char *filename, const struct p_timeval times[2]);
26extern int p_futimes(int fd, const struct p_timeval times[2]);
121c3171 27
07d03d31
JG
28extern int p_readlink(const char *path, char *buf, size_t bufsiz);
29extern int p_symlink(const char *old, const char *new);
2f795d8f 30extern int p_link(const char *old, const char *new);
f79026b4 31extern int p_unlink(const char *path);
2f795d8f 32extern int p_mkdir(const char *path, mode_t mode);
07d03d31 33extern int p_fsync(int fd);
19ac1ed7 34extern char *p_realpath(const char *orig_path, char *buffer);
07d03d31
JG
35
36extern int p_recv(GIT_SOCKET socket, void *buffer, size_t length, int flags);
37extern int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags);
38extern int p_inet_pton(int af, const char* src, void* dst);
39
2fc78e70 40extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
84dd3820 41extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4);
f978b748 42extern int p_mkstemp(char *tmp_path);
7998ae5a 43extern int p_chdir(const char* path);
33127043 44extern int p_chmod(const char* path, mode_t mode);
7998ae5a 45extern int p_rmdir(const char* path);
33127043 46extern int p_access(const char* path, mode_t mode);
7e9b21aa 47extern int p_ftruncate(int fd, git_off_t size);
2f795d8f 48
cccacac5
RB
49/* p_lstat is almost but not quite POSIX correct. Specifically, the use of
50 * ENOTDIR is wrong, in that it does not mean precisely that a non-directory
51 * entry was encountered. Making it correct is potentially expensive,
52 * however, so this is a separate version of p_lstat to use when correct
53 * POSIX ENOTDIR semantics is required.
54 */
55extern int p_lstat_posixly(const char *filename, struct stat *buf);
56
1920ee4e
W
57extern struct tm * p_localtime_r(const time_t *timer, struct tm *result);
58extern struct tm * p_gmtime_r(const time_t *timer, struct tm *result);
59
ab96ca55
AS
60/* Use the bundled regcomp */
61#define p_regcomp regcomp
62
f79026b4 63#endif