t_stub.c

説明を見る。
00001 /*  -*- c-file-style: "linux" -*-
00002  * 
00003  * Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009    
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014    
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #include "rsync.h"
00021 
00022 /**
00023  * @file t_stub.c
00024  *
00025  * This file contains really simple implementations for rsync global
00026  * functions, so that module test harnesses can run standalone.
00027  **/
00028 
00029 int modify_window = 0;
00030 int module_id = -1;
00031 int relative_paths = 0;
00032 int human_readable = 0;
00033 mode_t orig_umask = 002;
00034 char *partial_dir;
00035 struct filter_list_struct server_filter_list;
00036 
00037  void rprintf(UNUSED(enum logcode code), const char *format, ...)
00038 {
00039         va_list ap;
00040         va_start(ap, format);
00041         vfprintf(stderr, format, ap);
00042         va_end(ap);
00043 }
00044 
00045  void rsyserr(UNUSED(enum logcode code), int errcode, const char *format, ...)
00046 {
00047         va_list ap;
00048         fputs(RSYNC_NAME ": ", stderr);
00049         va_start(ap, format);
00050         vfprintf(stderr, format, ap);
00051         va_end(ap);
00052         fprintf(stderr, ": %s (%d)\n", strerror(errcode), errcode);
00053 }
00054 
00055  void _exit_cleanup(int code, const char *file, int line)
00056 {
00057         fprintf(stderr, "exit(%d): %s(%d)\n",
00058                 code, file, line);
00059         exit(code);
00060 }
00061 
00062  int check_filter(UNUSED(struct filter_list_struct *listp), UNUSED(char *name),
00063                    UNUSED(int name_is_dir))
00064 {
00065         /* This function doesn't really get called in this test context, so
00066          * just return 0. */
00067         return 0;
00068 }
00069 
00070  char *lp_name(UNUSED(int mod))
00071 {
00072     return NULL;
00073 }
00074 
00075  BOOL lp_use_chroot(UNUSED(int mod))
00076 {
00077     return 0;
00078 }
00079 
00080  char *lp_path(UNUSED(int mod))
00081 {
00082     return NULL;
00083 }
00084 

rsyncに対してSat Dec 5 19:45:42 2009に生成されました。  doxygen 1.4.7