status.c File Reference

Functions for status reporting. More...

#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include "global.h"
#include "actions.h"
#include "status.h"
#include "helper.h"
#include "direnum.h"
#include "cache.h"
#include "url.h"
#include "cp_mv.h"
#include "ignore.h"
#include "options.h"
#include "est_ops.h"
#include "waa.h"
#include "checksum.h"
Include dependency graph for status.c:

Go to the source code of this file.

Data Structures

struct  st___bit_info

Defines

#define BIT_INFO(v, s)   { .val=v, .string=s, .str_len=strlen(s) }
#define st___string_from_bits(v, a, t)   _st___string_from_bits(v, a, sizeof(a)/sizeof(a[0]), t)
 Constructs a string from a bitmask, where one or more bits may be set.

Functions

char * st___visible_file_size (struct estat *sts)
 Returns the visible file size.
char * st___meta_string (int status_bits, int flags)
 Meta-data status string.
char * st___color (int status_bits)
 Roses are red, grass is green .
int st__print_status (char *path, int status_bits, int flags, char *size, struct estat *sts)
 Prints the entry in readable form.
int st__status (struct estat *sts)
 -.
int st__action (struct estat *sts)
 -.
int st__rm_status (struct estat *sts)
 -.
int st__work (struct estat *root, int argc, char *argv[])
 -.
int st__progress (struct estat *sts)
 -.
int st__progress_uninit (void)
 -.
volatile char * _st___string_from_bits (int value, const struct st___bit_info data[], int max, char *text_for_none)
volatile char * st__flags_string_fromint (int mask)
 Return the string interpretation of the flags like RF_CHECK.
volatile char * st__status_string_fromint (int mask)
 Same as st__status_string, but directly given an status.
char * st__type_string (mode_t mode)
 Return the type string - cdev, bdev, whatever.
volatile char * st__status_string (const struct estat *const sts)
 Returns a string describing the entry_status bits of struct estat.
int st__print_entry_info (struct estat *sts)
 Shows detailed information about the entry.

Variables

static FILE * progress_output = NULL
static int max_progress_len = 0

Detailed Description

Functions for status reporting.

Definition in file status.c.


Define Documentation

#define BIT_INFO ( v,
 )     { .val=v, .string=s, .str_len=strlen(s) }

Definition at line 584 of file status.c.

Referenced by st__flags_string_fromint(), and st__status_string_fromint().

#define st___string_from_bits ( v,
a,
 )     _st___string_from_bits(v, a, sizeof(a)/sizeof(a[0]), t)

Constructs a string from a bitmask, where one or more bits may be set.

Must not be free()d.

Definition at line 590 of file status.c.

Referenced by st__flags_string_fromint(), and st__status_string_fromint().


Function Documentation

volatile char* _st___string_from_bits ( int  value,
const struct st___bit_info  data[],
int  max,
char *  text_for_none 
)

Definition at line 591 of file status.c.

References cch__add(), cch__entry_set(), DEBUGP, cache_t::entries, cache_t::lru, STOPIF, and st___bit_info::str_len.

Here is the call graph for this function:

char* st___color ( int  status_bits  ) 

Roses are red, grass is green .

..

Definition at line 164 of file status.c.

References ANSI__BLUE, ANSI__GREEN, ANSI__RED, FS_CHANGED, FS_NEW, FS_REMOVED, and FS_REPLACED.

Referenced by st__print_status().

Here is the caller graph for this function:

char* st___meta_string ( int  status_bits,
int  flags 
) [inline]

Meta-data status string.

Definition at line 137 of file status.c.

References FS_META_CHANGED, FS_META_GROUP, FS_META_MTIME, FS_META_OWNER, FS_META_UMODE, FS_PROPERTIES, opt__is_verbose(), and RF_PUSHPROPS.

Referenced by st__print_status().

Here is the call graph for this function:

Here is the caller graph for this function:

char* st___visible_file_size ( struct estat sts  ) 

Returns the visible file size.

For devices the string dev is printed; for directories dir; files and symlinks get their actual size printed.

Definition at line 112 of file status.c.

References sstat_t::mode, sstat_t::size, and estat::st.

Referenced by st__rm_status(), and st__status().

Here is the caller graph for this function:

int st__action ( struct estat sts  ) 

-.

Definition at line 345 of file status.c.

References estat::entry_status, OPT__STOP_ON_CHANGE, st__status, and STOPIF.

volatile char* st__flags_string_fromint ( int  mask  )  [inline]

Return the string interpretation of the flags like RF_CHECK.

Definition at line 648 of file status.c.

References BIT_INFO, RF_ADD, RF_CHECK, RF_CONFLICT, RF_COPY_BASE, RF_COPY_SUB, RF_PUSHPROPS, RF_UNVERSION, and st___string_from_bits.

Referenced by ci__nondir(), DEBUGP_dump_estat(), and st__print_entry_info().

Here is the caller graph for this function:

int st__print_entry_info ( struct estat sts  ) 
int st__print_status ( char *  path,
int  status_bits,
int  flags,
char *  size,
struct estat sts 
)
int st__progress ( struct estat sts  ) 

-.

A secondary status function for commit and update (and other functions which run silently through the filesystem), which shows local progress when run on a tty. On larger working copies the stat()ing alone can take some time, and we want to keep the user informed that something happens.

Commit and update themselves print the information send to/received from the repository.

Definition at line 438 of file status.c.

References approx_entry_count, DEBUGP, max_progress_len, progress_output, and STOPIF_CODE_ERR.

int st__progress_uninit ( void   ) 

-.

Mostly needed to clear the cursor line, to avoid having part of a progress line mixed with some other output.

Definition at line 552 of file status.c.

References max_progress_len, progress_output, and STOPIF_CODE_ERR.

int st__rm_status ( struct estat sts  ) 

-.

Definition at line 363 of file status.c.

References ops__build_path(), estat::remote_status, st___visible_file_size(), st__print_status(), and STOPIF.

Here is the call graph for this function:

int st__status ( struct estat sts  ) 
volatile char* st__status_string ( const struct estat *const   sts  )  [inline]

Returns a string describing the entry_status bits of struct estat.

Definition at line 702 of file status.c.

References estat::entry_status, and st__status_string_fromint().

Referenced by ci__nondir(), st__print_entry_info(), and waa___finish_directory().

Here is the call graph for this function:

Here is the caller graph for this function:

volatile char* st__status_string_fromint ( int  mask  )  [inline]
char* st__type_string ( mode_t  mode  ) 

Return the type string - cdev, bdev, whatever.

Definition at line 685 of file status.c.

References S_IFGARBAGE.

Referenced by cb__add_entry(), DEBUGP_dump_estat(), df___diff_wc_remote(), and st__print_entry_info().

Here is the caller graph for this function:

int st__work ( struct estat root,
int  argc,
char *  argv[] 
)

Variable Documentation

int max_progress_len = 0 [static]

Definition at line 106 of file status.c.

Referenced by st__progress(), and st__progress_uninit().

FILE* progress_output = NULL [static]

Definition at line 105 of file status.c.

Referenced by st__progress(), and st__progress_uninit().


Generated for fsvs by  doxygen 1.6.1