Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

rsync.h File Reference

Go to the source code of this file.

Data Structures

struct  file_struct
struct  string_area
struct  file_list
struct  sum_buf
struct  sum_struct
struct  map_struct
struct  exclude_struct
struct  stats

Enumerations

enum  logcode {
  FNONE = 0, FERROR = 1, FINFO = 2,
  FLOG = 3
}

Functions

int flist_up (struct file_list *flist, int i)
int asprintf (char **ptr, const char *format,...)
int vasprintf (char **ptr, const char *format, va_list ap)
int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
int snprintf (char *str, size_t count, const char *fmt,...)
void rprintf (enum logcode, const char *,...) __attribute__((format(printf
void rsyserr (enum logcode, int, const char *,...) __attribute__((format(printf
size_t strlcpy (char *d, const char *s, size_t bufsize)
 Like strncpy but does not 0 fill the buffer and always null terminates. More...

size_t strlcat (char *d, const char *s, size_t bufsize)
 Like strncat() but does not 0 fill the buffer and always null terminates. More...

const char * inet_ntop (int af, const void *src, char *dst, size_t size)
int isc_net_pton (int af, const char *src, void *dst)
const char * get_panic_action (void)
 This routine catches signals and tries to send them to gdb. More...


Variables

char * sys_errlist []
int errno
int verbose
const char * io_write_phase
const char * io_read_phase


Enumeration Type Documentation

enum logcode
 

Enumeration values:
FNONE 
FERROR 
FINFO 
FLOG 

Definition at line 82 of file rsync.h.

Referenced by io_multiplex_write(), log_formatted(), mplex_write(), print_rsync_version(), read_error_fd(), read_unbuffered(), rflush(), rprintf(), rsyserr(), rwrite(), and usage().

00082 {FNONE=0, FERROR=1, FINFO=2, FLOG=3 };


Function Documentation

int flist_up struct file_list   flist,
int    i
[inline, static]
 

Definition at line 418 of file rsync.h.

References file_struct::basename, and file_list::files.

Referenced by flist_find().

00419 {
00420         while (!flist->files[i]->basename) i++;
00421         return i;
00422 }

int asprintf char **    ptr,
const char *    format,
...   
 

Definition at line 791 of file snprintf.c.

References vasprintf().

Referenced by _Insure_trap_error(), and glob_expand().

00792 {
00793         va_list ap;
00794         int ret;
00795         
00796         va_start(ap, format);
00797         ret = vasprintf(ptr, format, ap);
00798         va_end(ap);
00799 
00800         return ret;
00801 }

int vasprintf char **    ptr,
const char *    format,
va_list    ap
 

Definition at line 774 of file snprintf.c.

References vsnprintf().

Referenced by asprintf().

00775 {
00776         int ret;
00777         
00778         ret = vsnprintf(NULL, 0, format, ap);
00779         if (ret <= 0) return ret;
00780 
00781         (*ptr) = (char *)malloc(ret+1);
00782         if (!*ptr) return -1;
00783         ret = vsnprintf(*ptr, ret+1, format, ap);
00784 
00785         return ret;
00786 }

int vsnprintf char *    str,
size_t    count,
const char *    fmt,
va_list    args
 

Definition at line 752 of file snprintf.c.

References dopr().

Referenced by io_printf(), rprintf(), rsyserr(), snprintf(), and vasprintf().

00753 {
00754         return dopr(str, count, fmt, args);
00755 }

int snprintf char *    str,
size_t    count,
const char *    fmt,
...   
 

Definition at line 759 of file snprintf.c.

References vsnprintf().

Referenced by add_cvs_excludes(), check_refuse_options(), daemon_main(), delete_file(), establish_proxy_connection(), get_tmpname(), keep_backup(), log_formatted(), main(), make_bak_dir(), make_simple_backup(), open_socket_in(), open_socket_out(), parse_arguments(), recv_files(), recv_generator(), rep_inet_ntoa(), server_options(), skip_file(), and write_batch_argvs_file().

00760 {
00761         size_t ret;
00762         va_list ap;
00763     
00764         va_start(ap, fmt);
00765         ret = vsnprintf(str, count, fmt, ap);
00766         va_end(ap);
00767         return ret;
00768 }

void rprintf enum    logcode,
const char *   ,
...   
 

void rsyserr enum    logcode,
int   ,
const char *   ,
...   
 

Referenced by daemon_main(), get_secret(), getpassf(), make_exclude_list(), make_simple_backup(), and rsync_module().

size_t strlcpy char *    d,
const char *    s,
size_t    bufsize
 

Like strncpy but does not 0 fill the buffer and always null terminates.

Parameters:
bufsize  is the size of the destination buffer.
Returns:
index of the terminating byte.

Definition at line 115 of file lib/compat.c.

Referenced by f_name(), gen_challenge(), get_secret(), log_formatted(), lp_do_parameter(), make_file(), open_socket_out(), pop_dir(), push_dir(), read_batch_csums_file(), read_batch_delta_file(), read_batch_flist_file(), receive_file_entry(), recv_files(), robust_unlink(), send_directory(), send_exclude_list(), send_file_entry(), send_file_list(), send_files(), timestring(), write_batch_argvs_file(), write_batch_csums_file(), write_batch_delta_file(), and write_batch_flist_file().

00116 {
00117         size_t len = strlen(s);
00118         size_t ret = len;
00119         if (bufsize <= 0) return 0;
00120         if (len >= bufsize) len = bufsize-1;
00121         memcpy(d, s, len);
00122         d[len] = 0;
00123         return ret;
00124 }

size_t strlcat char *    d,
const char *    s,
size_t    bufsize
 

Like strncat() but does not 0 fill the buffer and always null terminates.

Parameters:
bufsize  length of the buffer, which should be one more than the maximum resulting string length.

Definition at line 135 of file lib/compat.c.

Referenced by push_dir(), read_batch_csums_file(), read_batch_delta_file(), read_batch_flist_file(), send_directory(), send_exclude_list(), send_file_list(), send_files(), write_batch_argvs_file(), write_batch_csums_file(), write_batch_delta_file(), and write_batch_flist_file().

00136 {
00137         size_t len1 = strlen(d);
00138         size_t len2 = strlen(s);
00139         size_t ret = len1 + len2;
00140 
00141         if (len1+len2 >= bufsize) {
00142                 len2 = bufsize - (len1+1);
00143         }
00144         if (len2 > 0) {
00145                 memcpy(d+len1, s, len2);
00146                 d[len1+len2] = 0;
00147         }
00148         return ret;
00149 }

const char* inet_ntop int    af,
const void *    src,
char *    dst,
size_t    size
 

Definition at line 46 of file inet_ntop.c.

References af, dst, inet_ntop4(), and inet_ntop6().

00047 {
00048         switch (af) {
00049         case AF_INET:
00050                 return (inet_ntop4(src, dst, size));
00051 #ifdef AF_INET6
00052         case AF_INET6:
00053                 return (inet_ntop6(src, dst, size));
00054 #endif
00055         default:
00056                 errno = EAFNOSUPPORT;
00057                 return (NULL);
00058         }
00059         /* NOTREACHED */
00060 }

int isc_net_pton int    af,
const char *    src,
void *    dst
 

const char* get_panic_action void   
 

This routine catches signals and tries to send them to gdb.

Because it's called from inside a signal handler it ought not to use too many library routines.

Todo:
Perhaps use "screen -X" instead/as well, to help people debugging without easy access to X. Perhaps use an environment variable, or just call a script?

The /proc/ magic probably only works on Linux (and Solaris?) Can we be more portable?

Definition at line 818 of file main.c.

References getenv().

Referenced by print_rsync_version(), and rsync_panic_handler().

00819 {
00820         const char *cmd_fmt = getenv("RSYNC_PANIC_ACTION");
00821 
00822         if (cmd_fmt)
00823                 return cmd_fmt;
00824         else
00825                 return "xterm -display :0 -T Panic -n Panic "
00826                         "-e gdb /proc/%d/exe %d";
00827 }


Variable Documentation

char* sys_errlist[]
 

Definition at line 450 of file rsync.h.

int errno
 

Definition at line 460 of file rsync.h.

int verbose
 

Definition at line 609 of file rsync.h.

const char* io_write_phase
 

Definition at line 626 of file rsync.h.

const char * io_read_phase
 

Definition at line 626 of file rsync.h.


Generated on Tue Apr 16 12:37:39 2002 for rsync by doxygen1.2.15