about summary refs log tree commit diff
path: root/include/compat/stdio.h
blob: d5725c9ac9bd3713235a1d45d7e4ccaa906ea6a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Public domain
 * stdio.h compatibility shim
 */

#ifndef LIBCRYPTOCOMPAT_STDIO_H
#define LIBCRYPTOCOMPAT_STDIO_H

#ifdef _MSC_VER
#if _MSC_VER >= 1900
#include <../ucrt/stdlib.h>
#include <../ucrt/corecrt_io.h>
#include <../ucrt/stdio.h>
#else
#include <../include/stdio.h>
#endif
#else
#include_next <stdio.h>
#endif

#ifndef HAVE_ASPRINTF
#include <stdarg.h>
int vasprintf(char **str, const char *fmt, va_list ap);
int asprintf(char **str, const char *fmt, ...);
#endif

#ifdef _WIN32

#if defined(_MSC_VER)
#define __func__ __FUNCTION__
#endif

void posix_perror(const char *s);
FILE * posix_fopen(const char *path, const char *mode);
char * posix_fgets(char *s, int size, FILE *stream);
int posix_rename(const char *oldpath, const char *newpath);

#ifndef NO_REDEF_POSIX_FUNCTIONS
#define perror(errnum) posix_perror(errnum)
#define fopen(path, mode) posix_fopen(path, mode)
#define fgets(s, size, stream) posix_fgets(s, size, stream)
#define rename(oldpath, newpath) posix_rename(oldpath, newpath)
#endif

#ifdef _MSC_VER
#define snprintf _snprintf
#endif

#endif

#endif
td>Lars Hjemli This makes cgit read all repo-info from the configfile, instead of scanning for possible git-dirs below a common root path. This is primarily done to get better security (separate physical path from logical repo-name). In /etc/cgitrc each repo is registered with the following keys: repo.url repo.name repo.path repo.desc repo.owner Note: *Required keys are repo.url and repo.path, all others are optional *Each occurrence of repo.url starts a new repository registration *Default value for repo.name is taken from repo.url *The value of repo.url cannot contain characters with special meaning for urls (i.e. one of /?%&), while repo.name can contain anything. Example: repo.url=cgit-pub repo.name=cgit/public repo.path=/pub/git/cgit repo.desc=My public cgit repo repo.owner=Lars Hjemli repo.url=cgit-priv repo.name=cgit/private repo.path=/home/larsh/src/cgit/.git repo.desc=My private cgit repo repo.owner=Lars Hjemli Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-04Do not die if tag has no messageLars Hjemli Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-02-03Fix search for non-virtual urlsLars Hjemli When cgit don't use virtual urls, the current repo and page url parameters must be included in the search form as hidden input fields. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2007-01-28Update README with install/config informationLars Hjemli