Esempio n. 1
0
static void print_detail(const char *field, const char *value, int *x, int col, int percent)
{
	char msg[256]="";
	unsigned long long a=0;
	unsigned long long b=0;
	unsigned long long c=0;
	unsigned long long d=0;
	unsigned long long t=0;
	if(!field || !value || !*value
	  || !strcmp(value, "0")
	  || !strcmp(value, "0/0/0/0")) return;

	if(extract_ul(value, &a, &b, &c, &d, &t)) return;
	to_msg(msg, sizeof(msg), "% 22s % 9llu % 9llu % 9llu % 9llu % 9llu\n",
			field, a, b, c, t, d);
	print_line(msg, (*x)++, col);
	if(percent && d)
	{
	  unsigned long long p;
	  p=(t*100)/d;
	  to_msg(msg, sizeof(msg), "% 22s % 9s % 9s % 9s % 9llu%% % 9s\n",
		"", "", "", "", p, "");
	  print_line(msg, (*x)++, col);
	}
}
Esempio n. 2
0
static void table_header(int *x, int col)
{
	char msg[256]="";
	to_msg(msg, sizeof(msg), "% 22s % 9s % 9s % 9s % 9s % 9s\n",
		"", "New", "Changed", "Unchanged", "Total", "Scanned");
	print_line(msg, (*x)++, col);
}
Esempio n. 3
0
static void print_cntr_ent(const char *field,
	uint64_t a,
	uint64_t b,
	uint64_t c,
	uint64_t d,
	uint64_t e,
	int *x, int col)
{
	char msg[256]="";
	uint64_t t=a+b+c;
	if(!field || (!t && !d && !e)) return;

/* FIX THIS.
	if(phase==STATUS_RESTORING
	  || phase==STATUS_VERIFYING)
	{
		to_msg(msg, sizeof(msg),
			"% 15s % 9s % 9"PRIu64" % 9"PRIu64,
			field, "", t, e);
	}
	else
	{
*/
		to_msg(msg, sizeof(msg),
			"% 15s % 9"PRIu64" % 9"PRIu64" % 9"PRIu64" % 9"PRIu64" % 9"PRIu64" % 9"PRIu64"",
			field, a, b, c, d, t, e);
//	}
	print_line(msg, (*x)++, col);
/* FIX THIS
	if(percent && e)
	{
	  uint64_t p;
	  p=(t*100)/e;
	  if(phase==STATUS_RESTORING
	    || phase==STATUS_VERIFYING)
	  {
	    to_msg(msg, sizeof(msg), "% 15s % 9s % 9"PRIu64"%% % 9s",
		"", "", p, "");
	  }
	  else
	  {
	    to_msg(msg, sizeof(msg), "% 15s % 9s % 9s % 9s % 9s % 9"PRIu64"%% % 9s",
		"", "", "", "", "", p, "");
	  print_line(msg, (*x)++, col);
	}
*/
}
Esempio n. 4
0
static void print_cntr_ent(const char *field,
	unsigned long long a,
	unsigned long long b,
	unsigned long long c,
	unsigned long long d,
	unsigned long long e,
	int *x, int col)
{
	char msg[256]="";
	unsigned long long t=a+b+c;
	if(!field || (!t && !d && !e)) return;

/* FIX THIS.
	if(phase==STATUS_RESTORING
	  || phase==STATUS_VERIFYING)
	{
		to_msg(msg, sizeof(msg),
			"% 15s % 9s % 9llu % 9llu",
			field, "", t, e);
	}
	else
	{
*/
		to_msg(msg, sizeof(msg),
			"% 15s % 9llu % 9llu % 9llu % 9llu % 9llu % 9llu",
			field, a, b, c, d, t, e);
//	}
	print_line(msg, (*x)++, col);
/* FIX THIS
	if(percent && e)
	{
	  unsigned long long p;
	  p=(t*100)/e;
	  if(phase==STATUS_RESTORING
	    || phase==STATUS_VERIFYING)
	  {
	    to_msg(msg, sizeof(msg), "% 15s % 9s % 9llu%% % 9s",
		"", "", p, "");
	  }
	  else
	  {
	    to_msg(msg, sizeof(msg), "% 15s % 9s % 9s % 9s % 9s % 9llu%% % 9s",
		"", "", "", "", "", p, "");
	  print_line(msg, (*x)++, col);
	}
*/
}
Esempio n. 5
0
static void table_header(int *x, int col)
{
	char msg[256]="";
/* FIX THIS
	if(phase==STATUS_RESTORING
	  || phase==STATUS_VERIFYING)
	{
	  to_msg(msg, sizeof(msg), "% 15s % 9s % 9s % 9s",
	    "", "", "Attempted", "Expected");
	}
	else
	{
*/
	  to_msg(msg, sizeof(msg), "% 15s % 9s % 9s % 9s % 9s % 9s % 9s",
	    "", "New", "Changed", "Unchanged", "Deleted", "Total", "Scanned");
//	}
	print_line(msg, (*x)++, col);
}