]> git.ipfire.org Git - thirdparty/rsync.git/blame - t_stub.c
More tweaks for Actions.
[thirdparty/rsync.git] / t_stub.c
CommitLineData
0f78b815
WD
1/*
2 * This file contains really simple implementations for rsync global
3 * functions, so that module test harnesses can run standalone.
4 *
5 * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
c3b553a9 6 * Copyright (C) 2003-2022 Wayne Davison
cd8e38b1
MP
7 *
8 * This program is free software; you can redistribute it and/or modify
8e41b68e
WD
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
0f78b815
WD
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
e7c67065 18 * You should have received a copy of the GNU General Public License along
4fd842f9 19 * with this program; if not, visit the http://fsf.org website.
0f78b815 20 */
cd8e38b1
MP
21
22#include "rsync.h"
23
82f023d7 24int do_fsync = 0;
f3873b3d 25int inplace = 0;
cd8e38b1 26int modify_window = 0;
28b519c9 27int preallocate_files = 0;
d6df0739 28int protect_args = 0;
9b9114e8 29int module_id = -1;
d649b789 30int relative_paths = 0;
93977bca 31int module_dirlen = 0;
e9489cd6 32int preserve_xattrs = 0;
f14adfd7
WD
33int preserve_perms = 0;
34int preserve_executability = 0;
b774dbc1 35int omit_link_times = 0;
87257f86 36int open_noatime = 0;
d2d6ad48 37size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
a7260c40 38char *partial_dir;
7c73536c 39char *module_dir;
7b6c5c77 40filter_rule_list daemon_filter_list;
cd8e38b1 41
24c906d3 42 void rprintf(UNUSED(enum logcode code), const char *format, ...)
cd8e38b1
MP
43{
44 va_list ap;
45 va_start(ap, format);
46 vfprintf(stderr, format, ap);
47 va_end(ap);
48}
49
a3c8b368
WD
50 void rsyserr(UNUSED(enum logcode code), int errcode, const char *format, ...)
51{
52 va_list ap;
53 fputs(RSYNC_NAME ": ", stderr);
54 va_start(ap, format);
55 vfprintf(stderr, format, ap);
56 va_end(ap);
57 fprintf(stderr, ": %s (%d)\n", strerror(errcode), errcode);
58}
59
cd8e38b1
MP
60 void _exit_cleanup(int code, const char *file, int line)
61{
62 fprintf(stderr, "exit(%d): %s(%d)\n",
63 code, file, line);
64 exit(code);
65}
d542c20c 66
7b6c5c77 67 int check_filter(UNUSED(filter_rule_list *listp), UNUSED(enum logcode code),
1df02d13 68 UNUSED(const char *name), UNUSED(int name_is_dir))
d542c20c 69{
24c906d3
WD
70 /* This function doesn't really get called in this test context, so
71 * just return 0. */
72 return 0;
d542c20c 73}
9b9114e8 74
e9489cd6
WD
75 int copy_xattrs(UNUSED(const char *source), UNUSED(const char *dest))
76{
77 return -1;
78}
79
76340ea4
WD
80 void free_xattr(UNUSED(stat_x *sxp))
81{
82 return;
83}
84
85 void free_acl(UNUSED(stat_x *sxp))
86{
87 return;
88}
89
9b9114e8
WD
90 char *lp_name(UNUSED(int mod))
91{
70c81b0c 92 return NULL;
9b9114e8
WD
93}
94
95 BOOL lp_use_chroot(UNUSED(int mod))
96{
70c81b0c 97 return 0;
9b9114e8
WD
98}
99
ea0ea357
WD
100 const char *who_am_i(void)
101{
102 return "tester";
103}
a5a7d3a2 104
416e719b 105 int csum_len_for_type(int cst, int flg)
a5a7d3a2 106{
416e719b 107 return cst || !flg ? 16 : 1;
a5a7d3a2 108}
df0ed76a
WD
109
110 int canonical_checksum(int cst)
111{
112 return cst ? 0 : 0;
113}