doc

csync_misc.h

Go to the documentation of this file.
00001 /*
00002  * libcsync -- a library to sync a directory with another
00003  *
00004  * Copyright (c) 2012      by Andreas Schneider <asn@cryptomilk.org>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #ifndef _CSYNC_MISC_H
00022 #define _CSYNC_MISC_H
00023 
00024 #include "config.h"
00025 #include "csync.h"
00026 
00027 #ifdef HAVE_FNMATCH
00028 #include <fnmatch.h>
00029 #else
00030 /* Steal this define to make csync_exclude compile. Note that if fnmatch
00031  * is not defined it's probably Win32 which uses a different implementation
00032  * than fmmatch anyway, which does not care for flags.
00033  **/
00034 #define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
00035 #endif
00036 
00037 char *csync_get_user_home_dir(void);
00038 char *csync_get_local_username(void);
00039 
00040 int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags);
00041 
00042 /**
00043  * @brief csync_errno_to_csync_error - errno to csync error code
00044  *
00045  * This function tries to convert the value of the current set errno
00046  * to a csync error code.
00047  *
00048  * @return the corresponding csync error code.
00049  */
00050 CSYNC_ERROR_CODE csync_errno_to_csync_error(CSYNC_ERROR_CODE default_err);
00051 
00052 struct csync_hbf_info_s {
00053     int start_id;
00054     int transfer_id;
00055 };
00056 typedef struct csync_hbf_info_s csync_hbf_info_t;
00057 
00058 typedef struct {
00059     int64_t file_count;
00060     int64_t current_file_no;
00061     int64_t byte_sum;
00062     int64_t byte_current;
00063 } csync_overall_progress_t;
00064 
00065 #endif /* _CSYNC_MISC_H */