Index: dar/catalogue.cpp
===================================================================
--- dar.orig/catalogue.cpp	2012-05-02 11:23:23.203876579 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,1867 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <netinet/in.h>
-#include <iostream>
-#include <ctype.h>
-#include <algorithm>
-#include <map>
-#include <time.h>
-#include "tools.hpp"
-#include "catalogue.hpp"
-#include "tronc.hpp"
-#include "user_interaction.hpp"
-#include "deci.hpp"
-#include "header.hpp"
-
-#define INODE_FLAG_EA_MASK  0x03
-#define INODE_FLAG_EA_FULL  0x01
-#define INODE_FLAG_EA_PART  0x02
-#define INODE_FLAG_EA_NONE  0x03
-
-#define SAVED_FAKE_BIT 0x80
-
-static version reading_ver = "00"; // version not set here
-
-static string local_perm(const inode & ref);
-static string local_uid(const inode & ref);
-static string local_gid(const inode & ref);
-static string local_size(const inode & ref);
-static string local_date(const inode & ref);
-static string local_flag(const inode & ref);
-static bool extract_base_and_status(unsigned char signature, unsigned char & base, saved_status & saved);
-
-void catalogue_set_reading_version(const version &ver)
-{
-    version_copy(reading_ver, ver);
-}
-
-unsigned char mk_signature(unsigned char base, saved_status state)
-{
-    if(! islower(base))
-	throw SRC_BUG;
-    switch(state)
-    {
-    case s_saved:
-	return base;
-    case s_fake:
-	return base | SAVED_FAKE_BIT;
-    case s_not_saved:
-	return toupper(base);
-    default:
-	throw SRC_BUG;
-    }
-}
-
-
-void entree_stats::add(const entree *ref)
-{
-    if(dynamic_cast<const eod *>(ref) == NULL) // we ignore eod
-    {
-	const inode *ino = dynamic_cast<const inode *>(ref);
-	const hard_link *h = dynamic_cast<const hard_link *>(ref);
-	const detruit *x = dynamic_cast<const detruit *>(ref);
-				    
-	if(ino != NULL && h == NULL) // won't count twice the same inode if it is referenced with hard_link
-	{
-	    if(ino->get_saved_status() == s_saved)
-		saved++;
-	    total++;
-	}
-
-	if(x != NULL)
-	    num_x++;
-	else 
-	{ 
-	    const directory *d = dynamic_cast<const directory*>(ref);
-	    if(d != NULL)
-		num_d++;
-	    else
-	    {
-		const chardev *c = dynamic_cast<const chardev *>(ref);
-		if(c != NULL)
-		    num_c++;
-		else
-		{
-		    const blockdev *b = dynamic_cast<const blockdev *>(ref);
-		    if(b != NULL)
-			num_b++;
-		    else
-		    {
-			const tube *p = dynamic_cast<const tube *>(ref);
-			if(p != NULL)
-			    num_p++;
-			else
-			{
-			    const prise *s = dynamic_cast<const prise *>(ref);
-			    if(s != NULL)
-				num_s++;
-			    else
-			    {
-				const lien *l = dynamic_cast<const lien *>(ref);
-				if(l != NULL)
-				    num_l++;
-				else
-				{
-				    const file *f = dynamic_cast<const file *>(ref);
-				    const file_etiquette *e = dynamic_cast<const file_etiquette *>(ref);
-
-				    if(f != NULL)
-					num_f++;
-					// no else, because a "file_etiquette" is also a "file"
-				    if(e != NULL)
-					num_hard_linked_inodes++;
-				    if(h != NULL)
-					num_hard_link_entries++;
-				}
-			    }
-			}
-		    }
-		}
-	    }
-	}	
-    }
-}
-			
-void entree_stats::listing(ostream & flux) const
-{
-    flux << endl << "CATALOGUE CONTENTS :" << endl << endl;
-    flux << "total number of inode : " << total << endl;
-    flux << "saved inode           : " << saved << endl;
-    flux << "distribution of inodes" << endl;
-    flux << " - directories        : " << num_d << endl;
-    flux << " - plain files        : " << num_f << endl;
-    flux << " - symbolic links     : " << num_l << endl;
-    flux << " - named pipes        : " << num_p << endl;
-    flux << " - unix sockets       : " << num_s << endl;
-    flux << " - character devices  : " << num_c << endl;
-    flux << " - block devices      : " << num_b << endl;
-    flux << "hard links informations" << endl;
-    flux << "   number of file inode with hard links : " << num_hard_linked_inodes << endl;
-    flux << "   total number of hard links           : " << num_hard_link_entries << endl;
-    flux << "destroyed entries informations" <<endl;
-    flux << "   " << num_x << " file(s) have been record as destroyed since backup of reference" << endl;
-    flux << endl;
-}
-
-map <infinint, file_etiquette *> entree::corres;
-entree_stats entree::stats;
-
-entree *entree::read(generic_file & f)
-{
-    char type;
-    saved_status saved;
-    entree *ret = NULL;
-    map <infinint, file_etiquette *>::iterator it;
-    infinint tmp;
-    hard_link *ptr_l = NULL;
-    file_etiquette *ptr_e = NULL;
-    
-    S_I lu = f.read(&type, 1);
-
-    if(lu == 0)
-	return ret;
-
-    if(!extract_base_and_status((unsigned char)type, (unsigned char &)type, saved))
-	throw Erange("entree::read", "corrupted file");
-
-    switch(type)
-    {
-    case 'f':
-	ret = new file(f, saved);
-	break;
-    case 'l':
-	ret = new lien(f, saved);
-	break;
-    case 'c':
-	ret = new chardev(f, saved);
-	break;
-    case 'b':
-	ret = new blockdev(f, saved);
-	break;
-    case 'p':
-	ret = new tube(f, saved);
-	break;
-    case 's':
-	ret = new prise(f, saved);
-	break;
-    case 'd':
-	ret = new directory(f, saved);
-	break;
-    case 'z':
-	if(saved != s_saved)
-	    throw Erange("entree::read", "corrupted file");
-	ret = new eod(f);
-	break;
-    case 'x':
-	if(saved != s_saved)
-	    throw Erange("entree::read", "corrupted file");
-	ret = new detruit(f);
-	break;
-    case 'h':
-	ret = ptr_l = new hard_link(f, tmp);
-	if(ptr_l == NULL)
-	    throw Ememory("entree::read");
-	it = corres.find(tmp);
-	if(it != corres.end())
-	    ptr_l->set_reference(it->second);
-	else
-	{
-	    delete ptr_l;
-	    throw Erange("entree::read", "corrupted file");
-	}
-	break;
-    case 'e':
-	ret = ptr_e = new file_etiquette(f, saved);
-	if(ret == NULL)
-	    throw Ememory("entree::read");
-	if(corres.find(ptr_e->get_etiquette()) != corres.end())
-	    throw SRC_BUG;
-	corres[ptr_e->get_etiquette()] = ptr_e;
-	break;
-    default :
-	throw Erange("entree::read", "unknown type of data in catalogue");
-    }
-
-    stats.add(ret);
-    return ret;
-}
-
-void entree::dump(generic_file & f) const 
-{ 
-    char s = signature();
-    f.write(&s, 1);
-}
-
-bool compatible_signature(unsigned char a, unsigned char b)
-{
-    a = tolower(a) & ~SAVED_FAKE_BIT;
-    b = tolower(b) & ~SAVED_FAKE_BIT;
-
-    switch(a)
-    {
-    case 'e':
-    case 'f':
-	return b == 'e' || b == 'f';
-    default:
-	return b == a;
-    }
-}
-
-nomme::nomme(generic_file & f)
-{
-    tools_read_string(f, xname);
-}
-
-void nomme::dump(generic_file & f) const
-{
-    entree::dump(f);
-    tools_write_string(f, xname);
-}
-
-generic_file *inode::storage = NULL;
-
-bool inode::ignore_owner = false;
-
-inode::inode(U_16 xuid, U_16 xgid, U_16 xperm, 
-	     const infinint & last_access, 
-	     const infinint & last_modif, 
-	     const string & xname) : nomme(xname)
-{
-    uid = xuid;
-    gid = xgid;
-    perm = xperm;
-    last_acc = last_access;
-    last_mod = last_modif;
-    xsaved = s_not_saved;
-	// ea
-    ea_saved = ea_none;
-    ea_offset = 0;
-    ea = NULL;
-    last_cha = 0;
-    clear(ea_crc);
-}
-
-inode::inode(generic_file & f, saved_status saved) : nomme(f)
-{
-    U_16 tmp;
-    unsigned char flag;
-
-    xsaved = saved;
-
-    if(version_greater(reading_ver, "01"))
-    {
-	f.read((char *)(&flag), 1);
-	flag &= INODE_FLAG_EA_MASK;
-	switch(flag)
-	{
-	case INODE_FLAG_EA_FULL:
-	    ea_saved = ea_full;
-	    break;
-	case INODE_FLAG_EA_PART:
-	    ea_saved = ea_partial;
-	    break;
-	case INODE_FLAG_EA_NONE:
-	    ea_saved = ea_none;
-	    break;
-	default:
-	    throw Erange("inode::inode", "badly structured inode: unknown inode flag");
-	}
-    }
-    else 
-	ea_saved = ea_none;
-	
-    if(f.read((char *)&tmp, sizeof(tmp)) != sizeof(tmp))
-	throw Erange("inode::inode", "missing data to build an inode");
-    uid = ntohs(tmp);
-    if(f.read((char *)&tmp, sizeof(tmp)) != sizeof(tmp))
-	throw Erange("inode::inode", "missing data to build an inode");
-    gid = ntohs(tmp);
-    if(f.read((char *)&tmp, sizeof(tmp)) != sizeof(tmp))
-	throw Erange("inode::inode", "missing data to build an inode");
-    perm = ntohs(tmp);
-    last_acc.read_from_file(f);
-    last_mod.read_from_file(f);
-    switch(ea_saved)
-    {
-    case ea_full:
-	ea_offset.read_from_file(f);
-	f.read((char *)ea_crc, CRC_SIZE);
-	last_cha.read_from_file(f);
-	break;
-    case ea_partial:
-	ea_offset = 0;
-	clear(ea_crc);
-	last_cha.read_from_file(f);
-	break;
-    case ea_none:
-	ea_offset = 0;
-	clear(ea_crc);
-	last_cha = 0;
-	break;
-    default:
-	throw SRC_BUG;
-    }
-    ea = NULL; // in any case
-
-	// to be able later to read EA from file
-    storage = &f;
-}
-
-inode::inode(const inode & ref) : nomme(ref)
-{
-    uid = ref.uid;
-    gid = ref.gid;
-    perm = ref.perm;
-    last_acc = ref.last_acc;
-    last_mod = ref.last_mod;
-    xsaved = ref.xsaved;
-    ea_saved = ref.ea_saved;
-    switch(ea_saved)
-    {
-    case ea_full:
-	ea_offset = ref.ea_offset;	
-	copy_crc(ea_crc, ref.ea_crc);
-	if(ref.ea != NULL) // might be NULL if build from a file
-	{
-	    ea = new ea_attributs(*ref.ea);
-	    if(ea == NULL)
-		throw Ememory("inode::inode(const inode &)");
-	}
-	else
-	    ea = NULL;
-	last_cha = ref.last_cha;
-	break;
-    case ea_partial:
-	last_cha = ref.last_cha;
-	ea_offset = 0;
-	ea = NULL;
-	break;
-    case ea_none:
-	ea_offset = 0;
-	last_cha = 0;
-	ea = NULL;
-	break;
-    default:
-	throw SRC_BUG;
-    }
-}
- 
-bool inode::same_as(const inode & ref) const
-{
-    return nomme::same_as(ref) && compatible_signature(ref.signature(), signature());
-}
-
-bool inode::is_more_recent_than(const inode & ref) const
-{
-    return ref.last_mod < last_mod 
-	|| (!ignore_owner && uid != ref.uid)
-	|| (!ignore_owner && gid != ref.gid)
-	|| perm != ref.perm;
-}
-    
-bool inode::has_changed_since(const inode & ref) const
-{
-    return ref.last_mod != last_mod 
-	|| (!ignore_owner && uid != ref.uid)
-	|| (!ignore_owner && gid != ref.gid)
-	|| perm != ref.perm;
-}
-
-void inode::compare(const inode &other, bool root_ea, bool user_ea) const
-{
-    if(!same_as(other))
-	throw Erange("inode::compare","different file type");
-    if(!ignore_owner && get_uid() != other.get_uid())
-	throw Erange("inode.compare", "different owner");
-    if(!ignore_owner && get_gid() != other.get_gid())
-	throw Erange("inode.compare", "different owner group");
-    if(get_perm() != other.get_perm())
-	throw Erange("inode.compare", "different permission");
-    sub_compare(other);
-    if(root_ea || user_ea)
-    {
-	switch(ea_get_saved_status())
-	{
-	case ea_full:
-	    if(other.ea_get_saved_status() == ea_full)
-	    {
-		const ea_attributs *me = get_ea(); // this pointer must not be freed
-		const ea_attributs *you = other.get_ea(); // this pointer must not be freed too
-		if(me->diff(*you, root_ea, user_ea))
-		    throw Erange("inode::compare", "different Extended Attributes");
-	    }
-	    else
-		throw Erange("inode::compare", "no Extended Attributs to compare with");
-		// else we ignore the EA present in the argument, 
-		// this is not a symetrical comparison
-		// we check that all data in current object are the same in the argument
-		// but additional data can reside in the argument
-	    break;
-	case ea_partial:
-	    if(other.ea_get_saved_status() != ea_none)
-	    {
-		if(get_last_change() < other.get_last_change())
-		    throw Erange("inode::compare", "inode last change date (ctime) greater, EA might be different");
-	    }
-	    else
-		throw Erange("inode::compare", "No extended Attributs to compare with");
-	    break;
-	case ea_none:
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-}
-
-void inode::dump(generic_file & r) const
-{
-    U_16 tmp;
-    unsigned char flag = 0;
-
-    switch(ea_saved)
-    {
-    case ea_none:
-	flag |= INODE_FLAG_EA_NONE;
-	break;
-    case ea_partial:
-	flag |= INODE_FLAG_EA_PART;
-	break;
-    case ea_full:
-	flag |= INODE_FLAG_EA_FULL;
-	break;
-    default:
-	throw SRC_BUG; // unknown value for ea_saved
-    }
-    nomme::dump(r);
-
-    r.write((char *)(&flag), 1);
-    tmp = htons(uid);
-    r.write((char *)&tmp, sizeof(tmp));
-    tmp = htons(gid);
-    r.write((char *)&tmp, sizeof(tmp));
-    tmp = htons(perm);
-    r.write((char *)&tmp, sizeof(tmp));
-    last_acc.dump(r);
-    last_mod.dump(r);
-    switch(ea_saved)
-    {
-    case ea_full:
-	ea_offset.dump(r);
-	r.write((char *)ea_crc, CRC_SIZE);
-	    // no break
-    case ea_partial:
-	last_cha.dump(r);
-	break;
-    case ea_none:
-	break;
-    default:
-	throw SRC_BUG;
-    }
-}
-
-void inode::ea_set_saved_status(ea_status status)
-{
-    if(status == ea_saved)
-	return;
-    switch(status)
-    {
-    case ea_none:
-	if(ea != NULL)
-	{
-	    delete ea;
-	    ea = NULL;
-	}
-	break;
-    case ea_full:
-	if(ea != NULL)
-	    throw SRC_BUG;
-	ea_offset = 0;
-	last_cha = 0;	
-	break;
-    case ea_partial:
-	if(ea != NULL)
-	{
-	    delete ea;
-	    ea = NULL;
-	}
-	break;
-    default:
-	throw SRC_BUG;
-    }
-    ea_saved = status;
-}
-
-void inode::ea_attach(ea_attributs *ref)
-{ 
-    if(ref != NULL && ea == NULL) 
-	ea = ref; 
-    else 
-	throw SRC_BUG; 
-    if(ea_saved != ea_full)
-	throw SRC_BUG;
-}
-
-const ea_attributs *inode::get_ea() const 
-{ 
-    if(ea_saved == ea_full)
-	if(ea != NULL)
-	    return ea; 
-	else
-	    if(ea_offset != 0 && storage != NULL)
-	    {
-		crc val;
-		storage->skip(ea_offset);
-		storage->reset_crc();
-		try
-		{
-		    const_cast<ea_attributs *&>(ea) = new ea_attributs(*storage);
-		    if(ea == NULL)
-			throw Ememory("inode::get_ea");
-		}
-		catch(...)
-		{
-		    storage->get_crc(val); // keeps storage in coherent status
-		    throw;
-		}
-		storage->get_crc(val);
-		if(!same_crc(val, ea_crc))
-		    throw Erange("inode::get_ea", "CRC error detected while reading EA");
-		return ea;
-	    }
-	    else
-		throw SRC_BUG;
-    else 
-	throw SRC_BUG; 
-}
-
-void inode::ea_detach() const
-{ 
-    if(ea != NULL) 
-    { 
-	delete ea; 
-	const_cast<ea_attributs *&>(ea) = NULL; 
-    } 
-}
-
-infinint inode::get_last_change() const
-{ 
-    if(ea_saved != ea_none) 
-	return last_cha; 
-    else 
-	throw SRC_BUG; 
-}
-
-void inode::set_last_change(const infinint & x_time) 
-{ 
-    if(ea_saved != ea_none) 
-	last_cha = x_time; 
-    else 
-	throw SRC_BUG; 
-}
-
-compression file::algo = none;
-generic_file *file::loc = NULL;
-
-file::file(U_16 xuid, U_16 xgid, U_16 xperm, 
-	   const infinint & last_access, 
-	   const infinint & last_modif, 
-	   const string & src, 
-	   const path & che,
-	   const infinint & taille) : inode(xuid, xgid, xperm, last_access, last_modif, src), chemin(che + src)
-{
-    status = from_path;
-    offset = 0;
-    size = taille;
-    storage_size = 0;
-    set_saved_status(s_saved);
-}
-
-file::file(generic_file & f, saved_status saved) : inode(f, saved), chemin("vide")
-{
-    status = from_cat;
-    size.read_from_file(f);
-    if(saved == s_saved)
-    {
-	offset.read_from_file(f);
-	if(version_greater(reading_ver, "01"))
-	    storage_size.read_from_file(f);
-	else
-	    storage_size = 2*size; 
-	    // compressed file should be less than twice 
-	    // larger than original file 
-	    // (in case the compression is very bad
-	    // and takes more place than no compression !)
-    }
-    else
-    {
-	offset = 0;
-	storage_size = 0;
-    }
-    if(version_greater(reading_ver, "01"))
-	if(f.read(check, CRC_SIZE) != CRC_SIZE)
-	    throw Erange("file::file", "can't read CRC data");
-}    
-
-void file::dump(generic_file & f) const
-{
-    inode::dump(f);
-    size.dump(f);
-    if(get_saved_status() == s_saved)
-    {
-	offset.dump(f);
-	storage_size.dump(f);
-    }
-    if(f.write((char *)check, CRC_SIZE) != CRC_SIZE)
-	throw Erange("file::dump", "cannot dump CRC data to file");
-}
-
-bool file::is_more_recent_than(const inode & ref) const
-{
-    const file *tmp = dynamic_cast<const file *>(&ref);
-    if(tmp != NULL)
-	return inode::is_more_recent_than(*tmp) || size != tmp->size;
-    else
-	throw SRC_BUG;
-}
-
-bool file::has_changed_since(const inode & ref) const
-{
-    const file *tmp = dynamic_cast<const file *>(&ref);
-    if(tmp != NULL)
-	return inode::has_changed_since(*tmp) || size != tmp->size;
-    else
-	throw SRC_BUG;
-}
-
-generic_file *file::get_data() const
-{
-    generic_file *ret;
-
-    if(get_saved_status() != s_saved)
-	throw Erange("file::get_data", "cannot provide data from a \"not saved\" file object");
-    
-    if(status == empty)
-	throw Erange("file::get_data", "data has been cleaned, object is now empty");
-    
-    if(status == from_path)
-	ret = new fichier(chemin, gf_read_only);
-    else
-	if(loc == NULL)
-	    throw SRC_BUG; // set_archive_localisation never called or with a bad argument
-	else
-	    if(loc->get_mode() == gf_write_only)
-		throw SRC_BUG; // cannot get data from a write-only file !!! 
-	    else
-	    {
-		tronc *tmp = new tronc(loc, offset, storage_size == 0 ? size : storage_size, gf_read_only);
-		if(tmp == NULL)
-		    throw Ememory("file::get_data");
-		if(size > 0 && storage_size != 0)
-		{
-		    ret = new compressor(get_compression_algo_used(), tmp);
-		    if(ret == NULL)
-			delete tmp;
-		}
-		else
-		    ret = tmp;
-	    }
-
-    if(ret == NULL)
-	throw Ememory("file::get_data");
-    else
-	return ret;
-}
-
-void file::clean_data()
-{
-    switch(status)
-    {
-    case from_path:
-	chemin = "/"; // smallest possible memory allocation
-	break;
-    case from_cat:
-	offset = 0; // smallest possible memory allocation
-	    // warning, cannot change "size", as it is dump() in catalogue later
-	break;
-    case empty:
-	    // nothing to do
-	break;
-    default:
-	throw SRC_BUG;
-    }
-    status = empty;
-}
-
-void file::set_offset(const infinint & r)
-{
-    if(status != from_path)
-	throw SRC_BUG;
-    set_saved_status(s_saved);
-    offset = r;
-}
-
-bool file::get_crc(crc & c) const
-{ 
-    if(version_greater(reading_ver, "01"))
-    {
-	copy_crc(c, check);
-	return true;
-    }
-    else
-	return false;
-}
-
-void file::sub_compare(const inode & other) const
-{
-    const file *f_other = dynamic_cast<const file *>(&other);
-    if(f_other == NULL)
-	throw SRC_BUG; // inode::compare should have called us with a correct argument
-
-    if(get_size() != f_other->get_size())
-	throw Erange("file::sub_compare", "not same size");
-    if(get_saved_status() == s_saved && f_other->get_saved_status() == s_saved)
-    {
-	generic_file *me = get_data();
-	if(me == NULL)
-	    throw SRC_BUG;
-	try
-	{
-	    generic_file *you = f_other->get_data();
-	    if(you == NULL)
-		throw SRC_BUG;
-	    try
-	    {
-		if(me->diff(*you))
-		    throw Erange("file::sub_compare", "different file data");
-	    }
-	    catch(...)
-	    {
-		delete you;
-		throw;
-	    }
-	    delete you;
-	}
-	catch(...)
-	{
-	    delete me;
-	    throw;
-	}
-	delete me;
-    }
-}
-
-infinint file_etiquette::compteur = 0;
-
-file_etiquette::file_etiquette(generic_file &f, saved_status saved) : file(f, saved)
-{
-    etiquette.read_from_file(f);
-    if(etiquette >= compteur)
-	compteur = etiquette + 1;
-}
-
-void file_etiquette::dump(generic_file &f) const
-{
-    file::dump(f);
-    etiquette.dump(f);
-}
-
-hard_link::hard_link(const string & name, file_etiquette *ref) : nomme(name) 
-{
-    if(ref == NULL)
-	throw SRC_BUG;
-    set_reference(ref);
-}
-
-hard_link::hard_link(generic_file & f, infinint & etiquette) : nomme(f)
-{
-    etiquette.read_from_file(f);
-}
-
-void hard_link::dump(generic_file &f) const
-{
-    nomme::dump(f);
-    get_etiquette().dump(f);
-}
- 
-void hard_link::set_reference(file_etiquette *ref)
-{   
-    if(ref == NULL) 
-	throw SRC_BUG;
-    x_ref = ref; 
-}
-
-lien::lien(U_16 uid, U_16 gid, U_16 perm, 
-	   const infinint & last_access, 
-	   const infinint & last_modif, 
-	   const string & name, 
-	   const string & target) : inode(uid, gid, perm, last_access, last_modif, name)
-{
-    points_to = target;
-    set_saved_status(s_saved);
-}
-
-lien::lien(generic_file & f, saved_status saved) : inode(f, saved)
-{
-    if(saved == s_saved)
-	tools_read_string(f, points_to);
-}
-
-string lien::get_target() const
-{
-    if(get_saved_status() != s_saved)
-	throw SRC_BUG;
-    return points_to;
-}
-
-void lien::set_target(string x) 
-{
-    set_saved_status(s_saved);
-    points_to = x; 
-}
-
-void lien::sub_compare(const inode & other) const
-{
-    const lien *l_other = dynamic_cast<const lien *>(&other);
-    if(l_other == NULL)
-	throw SRC_BUG; // bad argument inode::compare has a bug
-
-    if(get_saved_status() == s_saved && l_other->get_saved_status() == s_saved)
-	if(get_target() != l_other->get_target())
-	    throw Erange("lien:sub_compare", "symbolic link does not point to the same target");
-}
-
-void lien::dump(generic_file & f) const
-{
-    inode::dump(f);
-    if(get_saved_status() == s_saved)
-	tools_write_string(f, points_to);
-}
-
-directory::directory(U_16 xuid, U_16 xgid, U_16 xperm, 
-		     const infinint & last_access, 
-		     const infinint & last_modif, 
-		     const string & xname) : inode(xuid, xgid, xperm, last_access, last_modif, xname)
-{
-    parent = NULL;
-    fils.clear();
-    it = fils.begin();
-    set_saved_status(s_saved);
-}
-
-directory::directory(const directory &ref) : inode(ref)
-{
-    parent = NULL;
-    fils.clear();
-    it = fils.begin();
-}
-
-directory::directory(generic_file & f, saved_status saved) : inode(f, saved)
-{
-    entree *p;
-    nomme *t;
-    directory *d;
-    eod *fin = NULL;
-
-    parent = NULL;
-    fils.clear();
-    it = fils.begin();
-    
-    try
-    {
-	while(fin == NULL)
-	{
-	    p = entree::read(f);
-	    if(p != NULL)
-	    {
-		d = dynamic_cast<directory *>(p);
-		fin = dynamic_cast<eod *>(p);
-		t = dynamic_cast<nomme *>(p);
-		
-		if(t != NULL) // p is a "nomme"
-		    fils.push_back(t);
-		if(d != NULL) // p is a directory
-		    d->parent = this;
-		if(t == NULL && fin == NULL)
-		    throw SRC_BUG; // neither an eod nor a nomme ! what's that ???
-	    }
-	    else
-		throw Erange("directory::directory", "missing data to build a directory");
-	}
-	delete fin; // no nead to keep it
-    }
-    catch(Egeneric & e)
-    {
-	clear();
-	throw;
-    }
-}
-
-directory::~directory()
-{
-    clear();
-}
-
-void directory::dump(generic_file & f) const
-{
-    vector<nomme *>::iterator x = const_cast<directory *>(this)->fils.begin();
-    inode::dump(f);
-    eod fin;
-    
-    while(x != fils.end())
-	if(dynamic_cast<ignored *>(*x) != NULL)
-	    x++; // "ignored" need not to be saved, they are only useful when updating_destroyed
-	else
-	    (*x++)->dump(f);
-
-    fin.dump(f); // end of "this" directory   
-}
-	
-void directory::add_children(nomme *r)
-{
-    directory *d = dynamic_cast<directory *>(r);
-    nomme *ancien;
-    
-    if(search_children(r->get_name(), ancien))
-    {
-	directory *a_dir = const_cast<directory *>(dynamic_cast<const directory *>(ancien));
-	vector<nomme *>::iterator pos = find(fils.begin(), fils.end(), ancien);
-	if(pos == fils.end())
-	    throw SRC_BUG; // ancien not found in fils !!!?
-
-	if(a_dir != NULL && d != NULL)
-	{
-	    vector<nomme *>::iterator it = a_dir->fils.begin();
-	    while(it != a_dir->fils.end())
-		d->add_children(*it++);
-	    a_dir->fils.clear();
-	    delete a_dir;
-	    *pos = r;
-	}
-	else
-	{
-	    delete ancien;
-	    *pos = r;
-	}
-    }
-    else
-	fils.push_back(r);
-    if(d != NULL)
-	d->parent = this;
-}
-
-void directory::reset_read_children() const 
-{
-    directory *moi = const_cast<directory *>(this);
-    moi->it = moi->fils.begin(); 
-}
-
-bool directory::read_children(const nomme *&r) const
-{
-    directory *moi = const_cast<directory *>(this);
-    if(moi->it != moi->fils.end())
-    {
-	r = *(moi->it)++;
-	return true;
-    }
-    else
-	return false;
-}
-
-void directory::clear()
-{
-    it = fils.begin();
-    while(it != fils.end())
-    {
-	delete *it;
-	it++;
-    }
-    fils.clear();
-    it = fils.begin();
-}
-
-void directory::listing(ostream & flux,const mask &m, string marge) const
-{
-    vector<nomme *>::iterator it = const_cast<directory *>(this)->fils.begin();
-    while(it != fils.end())
-    {
-	const directory *d = dynamic_cast<directory *>(*it);
-	const detruit *det = dynamic_cast<detruit *>(*it);
-	const inode *ino = dynamic_cast<inode *>(*it);
-	const hard_link *hard = dynamic_cast<hard_link *>(*it);
-
-	if(*it == NULL)
-	    throw SRC_BUG; // NULL entry ! should not be
-	if(m.is_covered((*it)->get_name()) || d != NULL)
-	{
-	    if(det != NULL)
-		flux << marge << "[ REMOVED ]    " << (*it)->get_name() << endl; 
-	    else
-	    {
-		if(hard != NULL)
-		    ino = hard->get_inode();
-		
-		if(ino == NULL)
-		    throw SRC_BUG;
-		else
-		    flux <<  marge << local_perm(*ino)
-			 << "\t" << local_uid(*ino)
-			 << "\t" << local_gid(*ino)
-			 << "\t" << local_size(*ino) 
-			 << "\t" << local_date(*ino)
-			 << "\t" << local_flag(*ino)
-			 << "   " << (*it)->get_name() << endl; 
-	    }
-
-	    if(d != NULL)
-	    {
-		d->listing(flux, m, marge + "|  ");
-		user_interaction_stream() << marge << "+--- " <<endl;
-	    }
-	}
-
-	it++;
-    }
-}
-
-void directory::tar_listing(ostream & flux, const mask &m, const string & beginning) const
-{
-    vector<nomme *>::iterator it = const_cast<directory *>(this)->fils.begin();
-    string sep = beginning == "" ? "" : "/";
-
-    while(it != fils.end())
-    {
-	const directory *d = dynamic_cast<directory *>(*it);
-	const detruit *det = dynamic_cast<detruit *>(*it);
-	const inode *ino = dynamic_cast<inode *>(*it);
-	const hard_link *hard = dynamic_cast<hard_link *>(*it);
-
-	if(*it == NULL)
-	    throw SRC_BUG; // NULL entry ! should not be
-	if(m.is_covered((*it)->get_name()))
-	{
-	    if(det != NULL)
-		flux << "[     REMOVED       ] "<< beginning << sep << (*it)->get_name() << endl; 
-	    else
-	    {
-		if(hard != NULL)
-		    ino = hard->get_inode();
-		
-		if(ino == NULL)
-		    throw SRC_BUG;
-		else
-		    flux << local_flag(*ino) << "   "
-			 << local_perm(*ino) << "   "
-			 << local_uid(*ino) << " \t"
-			 << local_gid(*ino) << "\t"
-			 << local_size(*ino) << "\t"
-			 << local_date(*ino) << "\t"
-			 << beginning << sep << (*it)->get_name() << "   " << endl; 
-	    }
-	}
-
-	if(d != NULL)
-	    d->tar_listing(flux, m, beginning + sep + (*it)->get_name());
-
-	it++;
-    }
-}
-
-bool directory::search_children(const string &name, nomme *&ref)
-{
-    vector<nomme *>::iterator ut = fils.begin();
-
-    while(ut != fils.end() && (*ut)->get_name() != name)
-	ut++;
-
-    if(ut != fils.end())
-    {
-	ref = *ut;
-	return true;
-    }
-    else
-	return false;
-}
-
-device::device(U_16 uid, U_16 gid, U_16 perm, 
-	       const infinint & last_access, 
-	       const infinint & last_modif, 
-	       const string & name, 
-	       U_16 major, 
-	       U_16 minor) : inode(uid, gid, perm, last_access, last_modif, name)
-{
-    xmajor = major;
-    xminor = minor;
-    set_saved_status(s_saved);
-}
-
-device::device(generic_file & f, saved_status saved) : inode(f, saved)
-{
-    U_16 tmp;
-
-    if(saved == s_saved)
-    {
-	if(f.read((char *)&tmp, (size_t)sizeof(tmp)) != sizeof(tmp))
-	    throw Erange("special::special", "missing data to build a special device");
-	xmajor = ntohs(tmp);
-	if(f.read((char *)&tmp, (size_t)sizeof(tmp)) != sizeof(tmp))
-	    throw Erange("special::special", "missing data to build a special device");
-	xminor = ntohs(tmp);
-    }
-}
-
-void device::dump(generic_file & f) const
-{
-    U_16 tmp;
-
-    inode::dump(f);
-    if(get_saved_status() == s_saved)
-    {	
-	tmp = htons(xmajor);
-	f.write((char *)&tmp, (size_t)sizeof(tmp));
-	tmp = htons(xminor);
-	f.write((char *)&tmp, (size_t)sizeof(tmp));
-    }
-}
-
-void device::sub_compare(const inode & other) const
-{
-    const device *d_other = dynamic_cast<const device *>(&other);
-    if(d_other == NULL)
-	throw SRC_BUG; // bug in inode::compare 
-    if(get_saved_status() == s_saved && d_other->get_saved_status() == s_saved)
-    {
-	if(get_major() != d_other->get_major())
-	    throw Erange("device::sub_compare", "devices have not the same major number");
-	if(get_minor() != d_other->get_minor())
-	    throw Erange("device::sub_compare", "devices have not the same minor number");
-    }
-}
-
-void ignored_dir::dump(generic_file & f) const
-{
-    directory tmp = directory(get_uid(), get_gid(), get_perm(), get_last_access(), get_last_modif(), get_name());
-    tmp.set_saved_status(get_saved_status());
-    tmp.dump(f); // dump an empty directory 
-}
-
-catalogue::catalogue() : out_compare("/")
-{
-    contenu = new directory(0,0,0,0,0,"root");
-    if(contenu == NULL)
-	throw Ememory("catalogue::catalogue(path)");
-    current_compare = contenu;
-    current_add = contenu;
-    current_read = contenu;
-    sub_tree = NULL;
-    stats.clear();
-}
-
-catalogue::catalogue(generic_file & f) : out_compare("/")
-{
-    string tmp;
-    unsigned char a;
-    saved_status st;
-    unsigned char base;
-
-    f.read((char *)&a, 1); // need to read the signature before constructing "contenu"
-    if(! extract_base_and_status(a, base, st))
-	throw Erange("catalogue::catalogue(generic_file &)", "incoherent catalogue structure");
-    if(base != 'd')
-	throw Erange("catalogue::catalogue(generic_file &)", "incoherent catalogue structure");
-
-    entree::reset_read();
-    contenu = new directory(f, st);
-    if(contenu == NULL)
-	throw Ememory("catalogue::catalogue(path)");
-    current_compare = contenu;
-    current_add = contenu;
-    current_read = contenu;
-    sub_tree = NULL;
-    stats = entree::get_stats();
-    entree::freemem(); // free memory from hard_link map
-}
-
-catalogue & catalogue::operator = (const catalogue &ref)
-{ 
-    detruire(); 
-    out_compare = ref.out_compare; 
-    partial_copy_from(ref); 
-    return *this; 
-}
-
-void catalogue::reset_read()
-{
-    current_read = contenu;
-    contenu->reset_read_children();
-}
-
-void catalogue::skip_read_to_parent_dir()
-{
-    directory *tmp = current_read->get_parent();
-    if(tmp == NULL)
-	throw Erange("catalogue::skip_read_to_parent_dir", "root does not have a parent directory");
-    current_read = tmp;
-}
-
-bool catalogue::read(const entree * & ref)
-{
-    const nomme *tmp;
-    
-    if(current_read->read_children(tmp))
-    {
-	const directory *dir = dynamic_cast<const directory *>(tmp);
-	if(dir != NULL)
-	{
-	    current_read = const_cast<directory *>(dir);
-	    dir->reset_read_children();
-	}
-	ref = tmp;
-	return true;
-    }
-    else
-    {
-	directory *papa = current_read->get_parent();
-	ref = & r_eod;
-	if(papa == NULL)
-	    return false; // we reached end of root, no eod generation
-	else
-	{
-	    current_read = papa;
-	    return true;
-	}
-    }
-}
-
-bool catalogue::read_if_present(string *name, const nomme * & ref)
-{
-    nomme *tmp;
-
-    if(current_read == NULL)
-	throw Erange("catalogue::read_if_present", "no current directory defined");
-    if(name == NULL) // we have to go to parent directory
-    {
-	if(current_read->get_parent() == NULL)
-	    throw Erange("catalogue::read_if_present", "root directory has no parent directory");
-	else
-	    current_read = current_read->get_parent();
-	ref = NULL;
-	return true;
-    }
-    else // looking for a real filename
-	if(current_read->search_children(*name, tmp))
-	{
-	    directory *d = dynamic_cast<directory *>(tmp);
-	    if(d != NULL) // this is a directory need to chdir to it
-		current_read = d;
-	    ref = tmp;
-	    return true;
-	}
-	else // filename not present in current dir
-	    return false;
-}
-
-void catalogue::reset_sub_read(const path &sub)
-{
-    if(! sub.is_relative())
-	throw SRC_BUG;
-    
-    if(sub_tree != NULL)
-	delete sub_tree;
-    sub_tree = new path(sub);
-    if(sub_tree == NULL)
-	throw Ememory("catalogue::reset_sub_read");
-    sub_count = -1; // must provide the path to subtree;
-    reset_read();
-}
-
-bool catalogue::sub_read(const entree * &ref)
-{
-    string tmp;
-
-    if(sub_tree == NULL)
-	throw SRC_BUG; // reset_sub_read
-
-    switch(sub_count)
-    {
-    case 0 : // sending oed to go back to the root
-	if(sub_tree->pop(tmp))
-	{
-	    ref = &r_eod;
-	    return true;
-	}
-	else
-	{
-	    ref = NULL;
-	    delete sub_tree;
-	    sub_tree = NULL;
-	    sub_count = -2;
-	    return false;
-	}
-    case -2: // reading is finished
-	return false;
-    case -1: // providing path to sub_tree
-	if(sub_tree->read_subdir(tmp))
-	{
-	    nomme *xtmp;
-
-	    if(current_read->search_children(tmp, xtmp))
-	    {
-		ref = xtmp;
-		directory *dir = dynamic_cast<directory *>(xtmp);
-		
-		if(dir != NULL)
-		{
-		    current_read = dir;
-		    return true;
-		}
-		else
-		    if(sub_tree->read_subdir(tmp)) 
-		    {
-			user_interaction_warning(sub_tree->display() + " is not present in the archive");
-			delete sub_tree;
-			sub_tree = NULL;
-			sub_count = -2;
-			return false;
-		    }
-		    else // subdir is a single file (no tree))
-		    {
-			sub_count = 0;
-			return true;
-		    }
-	    }
-	    else
-	    {
-		user_interaction_warning(sub_tree->display() + " is not present in the archive");
-		delete sub_tree;
-		sub_tree = NULL;
-		sub_count = -2;
-		return false;
-	    }
-	}
-	else
-	{
-	    sub_count = 1;
-	    current_read->reset_read_children();
-		// now reading the sub_tree
-		// no break !
-	}
-
-    default:
-	if(read(ref) && sub_count > 0)
-	{
-	    const directory *dir = dynamic_cast<const directory *>(ref);
-	    const eod *fin = dynamic_cast<const eod *>(ref);
-	    
-	    if(dir != NULL)
-		sub_count++;
-	    if(fin != NULL)
-		sub_count--;
-
-	    return true;
-	}
-	else
-	    throw SRC_BUG;
-    }	    
-}
-
-void catalogue::reset_add()
-{
-    current_add = contenu;
-}
-
-void catalogue::add(entree *ref)
-{
-    if(current_add == NULL)
-	throw SRC_BUG;
-
-    eod *f = dynamic_cast<eod *>(ref);
-
-    if(f == NULL) // ref is not eod
-    {
-	nomme *n = dynamic_cast<nomme *>(ref);
-	directory *t = dynamic_cast<directory *>(ref);
-
-	if(n == NULL)
-	    throw SRC_BUG; // unknown type neither "eod" nor "nomme"
-	current_add->add_children(n);
-	if(t != NULL) // ref is a directory
-	    current_add = t;
-	stats.add(ref);
-    }
-    else // ref is an eod
-    {
-	directory *parent = current_add->get_parent();
-	delete ref; // all data given throw add becomes owned by the catalogue object
-	if(parent == NULL)
-	    throw Erange("catalogue::add_file", "root has no parent directory, cannot change to it");
-	else
-	    current_add = parent;
-    }
-}
-
-void catalogue::add_in_current_read(nomme *ref)
-{
-    if(current_read == NULL)
-	throw SRC_BUG; // current read directory does not exists
-    current_read->add_children(ref);
-}
-
-void catalogue::reset_compare()
-{
-    current_compare = contenu;
-    out_compare = "/";
-}
-
-bool catalogue::compare(const entree * target, const entree * & extracted)
-{
-    const directory *dir = dynamic_cast<const directory *>(target);
-    const eod *fin = dynamic_cast<const eod *>(target);
-    const nomme *nom = dynamic_cast<const nomme *>(target);
-	
-    if(out_compare.degre() > 1) // actually scanning a inexisting directory
-    {
-	if(dir != NULL)
-	    out_compare += dir->get_name();
-	else
-	    if(fin != NULL)
-	    {
-		string tmp_s;
-
-		if(!out_compare.pop(tmp_s))
-		    if(out_compare.is_relative())
-			throw SRC_BUG; // should not be a relative path !!!
-		    else // both cases are bugs, but need to know which case is generating a bug
-			throw SRC_BUG; // out_compare.degre() > 0 but cannot pop !
-	    }
-	
-	return false;
-    }
-    else // scanning an existing directory
-    {
-	nomme *found;
-
-	if(fin != NULL)
-	{
-	    directory *tmp = current_compare->get_parent();
-	    if(tmp == NULL)
-		throw Erange("catalogue::compare", "root has no parent directory");
-	    current_compare = tmp;
-	    extracted = target;
-	    return true;
-	}
-	    
-	if(nom == NULL)
-	    throw SRC_BUG; // ref, is neither a eod nor a nomme ! what's that ???
-
-	if(current_compare->search_children(nom->get_name(), found))
-	{
-	    const detruit *src_det = dynamic_cast<const detruit *>(nom);
-	    const detruit *dst_det = dynamic_cast<const detruit *>(found);
-	    const inode *src_ino = dynamic_cast<const inode *>(nom);
-	    const inode *dst_ino = dynamic_cast<const inode *>(found);
-	    const etiquette *src_eti = dynamic_cast<const etiquette *>(nom);
-	    const etiquette *dst_eti = dynamic_cast<const etiquette *>(found);
-	    
-		// extracting inode from hard links
-	    if(src_eti != NULL)
-		src_ino = src_eti->get_inode();
-	    if(dst_eti != NULL)
-		dst_ino = dst_eti->get_inode();
-	 
-		// updating internal structure to follow directory tree :
-	    if(dir != NULL)
-	    {
-		directory *d_ext = dynamic_cast<directory *>(found);
-		if(d_ext != NULL)
-		    current_compare = d_ext;
-		else
-		    out_compare += dir->get_name();
-	    }
-
-		// now comparing the objects :
-	    if(src_ino != NULL) 
-		if(dst_ino != NULL)
-		{
-		    if(!src_ino->same_as(*dst_ino))
-			return false;
-		}
-		else
-		    return false;
-	    else
-		if(src_det != NULL)
-		    if(dst_det != NULL)
-		    {
-			if(!dst_det->same_as(*dst_det))
-			    return false;
-		    }
-		    else
-			return false;
-		else
-		    throw SRC_BUG; // src_det == NULL && src_ino == NULL, thus a nomme which is neither detruit nor inode !
-	    
-	    if(dst_eti != NULL)
-		extracted = dst_eti->get_inode();
-	    else
-		extracted = found;
-	    return true;
-	}
-	else
-	{
-	    if(dir != NULL)
-		out_compare += dir->get_name();
-	    return false;
-	}
-    }
-}
-
-infinint catalogue::update_destroyed_with(catalogue & ref)
-{
-    directory *current = contenu;
-    nomme *ici;
-    const entree *projo;
-    const eod *pro_eod;
-    const directory *pro_dir;
-    const detruit *pro_det;
-    const nomme *pro_nom;
-    infinint count = 0;
-    
-    ref.reset_read();
-    while(ref.read(projo))
-    {
-	pro_eod = dynamic_cast<const eod *>(projo);
-	pro_dir = dynamic_cast<const directory *>(projo);
-	pro_det = dynamic_cast<const detruit *>(projo);
-	pro_nom = dynamic_cast<const nomme *>(projo);
-	
-	if(pro_eod != NULL)
-	{
-	    directory *tmp = current->get_parent();
-	    if(tmp == NULL)
-		throw SRC_BUG; // reached root for "contenu", and not yet for "ref";
-	    current = tmp;
-	    continue;
-	}
-	
-	if(pro_det != NULL)
-	    continue;
-
-	if(pro_nom == NULL)
-	    throw SRC_BUG; // neither an eod nor a nomme ! what's that ?
-
-	if(!current->search_children(pro_nom->get_name(), ici))
-	{
-	    current->add_children(new detruit(pro_nom->get_name(), pro_nom->signature()));
-	    count++;
-	    if(pro_dir != NULL)
-		ref.skip_read_to_parent_dir();
-	}
-	else
-	    if(pro_dir != NULL)
-	    {
-		directory *ici_dir = dynamic_cast<directory *>(ici);
-
-		if(ici_dir != NULL)
-		    current = ici_dir;
-		else
-		    ref.skip_read_to_parent_dir();
-	    }
-    }
-
-    return count;
-}
-
-void catalogue::listing(ostream & flux, const mask &m, string marge) const
-{
-    flux << "access mode    | user | group | size  |          date                 | [data ][ EA  ][compr] |   filename" << endl;
-    flux << "---------------+------+-------+-------+-------------------------------+-----------------------+-----------" << endl;
-    contenu->listing(flux, m, marge); 
-}
-
-void catalogue::tar_listing(ostream & flux, const mask &m, const string & beginning) const 
-{ 
-    flux << "[data ][ EA  ][compr] | permission | user  | group | size  |          date                 |    filename" << endl;
-    flux << "----------------------+------------+-------+-------+-------+-------------------------------+------------" << endl;
-    contenu->tar_listing(flux, m, beginning); 
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void catalogue::dump(generic_file & ref) const
-{
-    contenu->dump(ref);
-}
-
-void catalogue::partial_copy_from(const catalogue & ref)
-{
-    if(ref.contenu == NULL)
-	throw SRC_BUG;
-    contenu = new directory(*ref.contenu);
-    if(contenu == NULL)
-	throw Ememory("catalogue::catalogue(const catalogue &)");
-    current_compare = contenu;
-    current_add = contenu;
-    current_read = contenu;
-    if(ref.sub_tree != NULL)
-	sub_tree = new path(*ref.sub_tree);
-    else
-	sub_tree = NULL;
-    sub_count = ref.sub_count;
-    stats = ref.stats;
-}
-
-void catalogue::detruire()
-{
-    if(contenu != NULL)
-	delete contenu;
-    if(sub_tree != NULL)
-	delete sub_tree;
-}
-
-
-const eod catalogue::r_eod;
-
-
-static string local_perm(const inode &ref)
-{
-    string ret = "";
-    saved_status st;
-    char type;
-
-    U_32 perm = ref.get_perm();
-    if(!extract_base_and_status(ref.signature(), (unsigned char &)type, st))
-	throw SRC_BUG;    
-
-    if(type == 'f')
-	type = '-';
-    if(type == 'e')
-	type = 'h';
-    ret += type;
-    if((perm & 0400) != 0)
-	ret += 'r';
-    else
-	ret += '-';
-    if((perm & 0200) != 0)
-	ret += 'w';
-    else
-	ret += '-';
-    if((perm & 0100) != 0)
-	if((perm & 04000) != 0)
-	    ret += 's';
-	else
-	    ret += 'x';
-    else
-	if((perm & 04000) != 0)
-	    ret += 'S';
-	else
-	    ret += '-';
-    if((perm & 040) != 0)
-	ret += 'r';
-    else
-	ret += '-';
-    if((perm & 020) != 0)
-	ret += 'w';
-    else
-	ret += '-';
-    if((perm & 010) != 0)
-	if((perm & 02000) != 0)
-	    ret += 's';
-	else
-	    ret += 'x';
-    else
-	if((perm & 02000) != 0)
-	    ret += 'S';
-	else
-	    ret += '-';
-    if((perm & 04) != 0)
-	ret += 'r';
-    else
-	ret += '-';
-    if((perm & 02) != 0)
-	ret += 'w';
-    else
-	ret += '-';
-    if((perm & 01) != 0)
-	if((perm & 01000) != 0)
-	    ret += 't';
-	else
-	    ret += 'x';
-    else
-	if((perm & 01000) != 0)
-	    ret += 'T';
-	else
-	    ret += '-';
-    
-    return ret;
-}
-
-static string local_uid(const inode & ref)
-{
-    return tools_name_of_uid(ref.get_uid());
-}
-
-static string local_gid(const inode & ref)
-{
-    return tools_name_of_gid(ref.get_gid());
-}
-
-static string local_size(const inode & ref)
-{
-    string ret;
-
-    const file *fic = dynamic_cast<const file *>(&ref);
-    if(fic != NULL)
-    {
-	deci d = fic->get_size();
-	ret = d.human();
-    }
-    else
-	ret = "0";
-
-    return ret;
-}
-
-static string local_date(const inode & ref)
-{
-    return tools_display_date(ref.get_last_modif());
-}
-    
-static string local_flag(const inode & ref)
-{
-    string ret;
-
-    switch(ref.get_saved_status())
-    {
-    case s_saved:
-	ret = "[Saved]";
-	break;
-    case s_fake:
-	ret = "[InRef]";
-	break;
-    case s_not_saved:
-	ret = "[     ]";
-	break;
-    default:
-	throw SRC_BUG;
-    }
-
-    switch(ref.ea_get_saved_status())
-    {
-    case inode::ea_full:
-	ret += "[Saved]";
-	break;
-    case inode::ea_partial:
-	ret += "[     ]";
-	break;
-    case inode::ea_none:
-	ret += "       ";
-	break;
-    default:
-	throw SRC_BUG;
-    }
-
-    const file *fic = dynamic_cast<const file *>(&ref);
-    if(fic != NULL && fic->get_saved_status() == s_saved)
-	if(fic->get_storage_size() == 0)
-	    ret += "[     ]";
-	else
-	    if(fic->get_size() >= fic->get_storage_size())
-		ret += "[" + tools_addspacebefore(deci(((fic->get_size() - fic->get_storage_size())*100)/fic->get_size()).human(), 4) +"%]";
-	    else
-		ret += "[Worse]";
-    else
-	ret += "[-----]";
-    
-    return ret;
-}
-
-
-static bool extract_base_and_status(unsigned char signature, unsigned char & base, saved_status & saved)
-{
-    bool fake = (signature & SAVED_FAKE_BIT) != 0;
-
-    signature &= ~SAVED_FAKE_BIT;
-    if(!isalpha(signature))
-	return false; 
-    base = tolower(signature);
-
-    if(fake)
-	if(base == signature)
-	    saved = s_fake;
-	else
-	    return false;
-    else
-	if(signature == base)
-	    saved = s_saved;
-	else
-	    saved = s_not_saved;
-    return true;
-}
Index: dar/catalogue.hpp
===================================================================
--- dar.orig/catalogue.hpp	2012-05-02 11:23:23.251875008 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,580 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef CATALOGUE_HPP
-#define CATALOGUE_HPP
-
-#pragma interface
-
-#include <unistd.h>
-#include <vector>
-#include <map>
-#include "infinint.hpp"
-#include "path.hpp"
-#include "generic_file.hpp"
-#include "header_version.hpp"
-#include "ea.hpp"
-#include "compressor.hpp"
-#include "integers.hpp"
-#include "mask.hpp"
-
-class file_etiquette;
-class entree;
-
-enum saved_status { s_saved, s_fake, s_not_saved };
-
-extern void catalogue_set_reading_version(const version &ver);
-extern unsigned char mk_signature(unsigned char base, saved_status state);
-
-struct entree_stats
-{
-    infinint num_x;                  // number of file referenced as destroyed since last backup
-    infinint num_d;                  // number of directories
-    infinint num_f;                  // number of plain files (hard link or not, thus file directory entries)
-    infinint num_c;                  // number of char devices
-    infinint num_b;                  // number of block devices
-    infinint num_p;                  // number of named pipes
-    infinint num_s;                  // number of unix sockets
-    infinint num_l;                  // number of symbolic links
-    infinint num_hard_linked_inodes; // number of inode that have more than one link (inode with "hard links")
-    infinint num_hard_link_entries;  // total number of hard links (file directory entry pointing to an
-	// inode already linked in the same or another directory (i.e. hard linked))
-    infinint saved; // total number of saved inode (unix inode, not inode class) hard links do not count here
-    infinint total; // total number of inode in archive (unix inode, not inode class) hard links do not count here
-    void clear() { num_x = num_d = num_f = num_c = num_b = num_p 
-		       = num_s = num_l = num_hard_linked_inodes 
-		       = num_hard_link_entries = saved = total = 0; };
-    void add(const entree *ref);
-    void listing(ostream & flux) const;
-};
-
-class entree
-{
-public :
-    static void reset_read() { corres.clear(); stats.clear(); };
-    static entree *read(generic_file & f);
-    static entree_stats get_stats() { return stats; };
-    static void freemem() { stats.clear(); corres.clear(); };
-
-    virtual ~entree() {};
-    virtual void dump(generic_file & f) const;
-    virtual unsigned char signature() const = 0;
-    virtual entree *clone() const = 0;
-
-private :
-    static map <infinint, file_etiquette *> corres;
-    static entree_stats stats;
-};
-
-extern bool compatible_signature(unsigned char a, unsigned char b);
-
-class eod : public entree
-{
-public :
-    eod() {};
-    eod(generic_file & f) {};
-	// dump defined by entree
-    unsigned char signature() const { return 'z'; };
-    entree *clone() const { return new eod(); };
-};
-
-class nomme : public entree
-{
-public :
-    nomme(const string & name) { xname = name; };
-    nomme(generic_file & f);
-    void dump(generic_file & f) const;
-
-    string get_name() const { return xname; };
-    void change_name(const string &x) { xname = x; };
-    bool same_as(const nomme & ref) const { return xname == ref.xname; };
-	// no need to have a virtual method, as signature will differ in inherited classes (argument type changes)
-
-	// signature() is kept as an abstract method
-	// clone() is abstract
-    
-private :
-    string xname;
-};
-
-class inode : public nomme
-{
-public:
-    inode(U_16 xuid, U_16 xgid, U_16 xperm, 
-	  const infinint & last_access, 
-	  const infinint & last_modif, 
-	  const string & xname);
-    inode(generic_file & f, saved_status saved);
-    inode(const inode & ref);
-    ~inode() { if(ea != NULL) delete ea; };
-
-    void dump(generic_file & f) const;
-    U_16 get_uid() const { return uid; };
-    U_16 get_gid() const { return gid; };
-    U_16 get_perm() const { return perm; };
-    infinint get_last_access() const { return last_acc; };
-    infinint get_last_modif() const { return last_mod; };
-    void set_last_access(const infinint & x_time) { last_acc = x_time; };
-    void set_last_modif(const infinint & x_time) { last_mod = x_time; };    
-    saved_status get_saved_status() const { return xsaved; };
-    void set_saved_status(saved_status x) { xsaved = x; };
-	
-    bool same_as(const inode & ref) const;
-    virtual bool is_more_recent_than(const inode & ref) const;
-    virtual bool has_changed_since(const inode & ref) const;
-	// signature() left as an abstract method
-	// clone is abstract
-    void compare(const inode &other, bool root_ea, bool user_ea) const;
-	// throw Erange exception if a difference has been detected
-	// this is not a symetrical comparison, but all what is present
-	// in the current object is compared against the argument
-	// which may contain supplementary informations
-
-
-
-	//////////////////////////////////
-	// EXTENDED ATTRIBUTS Methods
-	//
-
-    enum ea_status { ea_none, ea_partial, ea_full };
-	// ea_none    : no EA present to this inode in filesystem
-	// ea_partial : EA present in filesystem but not stored (ctime used to check changes)
-	// ea_full    : EA present in filesystem and attached to this inode
-
-	// I : to know whether EA data is present or not for this object
-    void ea_set_saved_status(ea_status status); 
-    ea_status ea_get_saved_status() const { return ea_saved; };
-
-	// II : to associate EA list to an inode object (mainly for backup operation) #EA_FULL only#
-    void ea_attach(ea_attributs *ref);
-    const ea_attributs *get_ea() const;
-    void ea_detach() const; //discards any future call to get_ea() ! 
-
-	// III : to record where is dump the EA in the archive #EA_FULL only#
-    void ea_set_offset(const infinint & pos) { ea_offset = pos; };
-    void ea_set_crc(const crc & val) { copy_crc(ea_crc, val); };
-
-	// IV : to know/record if EA have been modified #EA_FULL or EA_PARTIAL#
-    infinint get_last_change() const;
-    void set_last_change(const infinint & x_time);
-
-	////////////////////////
-
-    static void set_ignore_owner(bool mode) { ignore_owner = mode; };
-    
-protected:
-    virtual void sub_compare(const inode & other) const {};
-
-private :
-    U_16 uid;
-    U_16 gid;
-    U_16 perm;
-    infinint last_acc, last_mod;
-    saved_status xsaved;
-    ea_status ea_saved;
-	//  the following is used only if ea_saved == full
-    infinint ea_offset;
-    ea_attributs *ea;
-	// the following is used if ea_saved == full or ea_saved == partial
-    infinint last_cha;
-    crc ea_crc;
-
-    static generic_file *storage; // where are stored EA
-	// this is a static variable (shared amoung all objects)
-	// because it is not efficient to have many copies of the same value
-	// if in the future, all inode have their EA stored in their own 
-	// generic_file, this will be changed.
-    static bool ignore_owner;
-};
-
-class file : public inode
-{
-public :
-    file(U_16 xuid, U_16 xgid, U_16 xperm, 
-	 const infinint & last_access, 
-	 const infinint & last_modif, 
-	 const string & src,
-	 const path & che,
-	 const infinint & taille);
-    file(generic_file & f, saved_status saved);
-    
-    void dump(generic_file & f) const;
-    bool is_more_recent_than(const inode & ref) const;
-    bool has_changed_since(const inode & ref) const;
-    infinint get_size() const { return size; };
-    infinint get_storage_size() const { return storage_size; };
-    void set_storage_size(const infinint & s) { storage_size = s; };
-    generic_file *get_data() const; // return a newly alocated object in read_only mode
-    void clean_data(); // partially free memory (but get_data() becomes disabled)
-    void set_offset(const infinint & r);
-    unsigned char signature() const { return mk_signature('f', get_saved_status()); };
-
-    void set_crc(const crc &c) { copy_crc(check, c); };
-    bool get_crc(crc & c) const;
-    entree *clone() const { return new file(*this); };
-
-    static void set_compression_algo_used(compression a) { algo = a; };
-    static compression get_compression_algo_used() { return algo; };
-    static void set_archive_localisation(generic_file *f) { loc = f; };
-
-protected :
-    void sub_compare(const inode & other) const;
-
-private :	
-    enum { empty, from_path, from_cat } status;
-    path chemin;
-    infinint offset;
-    infinint size;
-    infinint storage_size;
-    crc check;
-
-    static generic_file *loc;
-    static compression algo;
-};
-
-class etiquette
-{
-public:
-    virtual infinint get_etiquette() const = 0;
-    virtual const file *get_inode() const = 0;
-};
-
-class file_etiquette : public file, public etiquette
-{
-public :
-    file_etiquette(U_16 xuid, U_16 xgid, U_16 xperm, 
-		   const infinint & last_access, 
-		   const infinint & last_modif, 
-		   const string & src,
-		   const path & che,
-		   const infinint & taille) : file(xuid, xgid, xperm, last_access, last_modif, src, che, taille) 
-	{ etiquette = compteur++; };
-    file_etiquette(generic_file & f, saved_status saved);
-
-    void dump(generic_file &f) const;
-    unsigned char signature() const { return mk_signature('e', get_saved_status()); };
-    entree *clone() const { return new file_etiquette(*this); };
-
-    static void reset_etiquette_counter() { compteur = 0; };
-    
-	// inherited from etiquette
-    infinint get_etiquette() const { return etiquette; };
-    void change_etiquette() { etiquette = compteur++; };
-    const file *get_inode() const { return this; };
-
-private :
-    infinint etiquette;
-
-    static infinint compteur;
-};
-
-class hard_link : public nomme, public etiquette
-{
-public :
-    hard_link(const string & name, file_etiquette *ref);
-    hard_link(generic_file & f, infinint & etiquette); // with etiquette, a call to set_reference() follows
-
-    void dump(generic_file &f) const;
-    unsigned char signature() const { return 'h'; };
-    entree *clone() const { return new hard_link(*this); };
-    void set_reference(file_etiquette *ref);
-
-	// inherited from etiquette
-    infinint get_etiquette() const { return x_ref->get_etiquette(); };
-    const file *get_inode() const { return x_ref; };
-
-private :
-    file_etiquette *x_ref;
-};
-
-
-class lien : public inode
-{
-public :
-    lien(U_16 uid, U_16 gid, U_16 perm, 
-	 const infinint & last_access, 
-	 const infinint & last_modif, 
-	 const string & name, const string & target);
-    lien(generic_file & f, saved_status saved);
-
-    void dump(generic_file & f) const;
-    string get_target() const;
-    void set_target(string x);
-
-	// using the method is_more_recent_than() from inode
-	// using method has_changed_since() from inode class
-    unsigned char signature() const { return mk_signature('l', get_saved_status()); };
-    entree *clone() const { return new lien(*this); };
-
-protected :
-    void sub_compare(const inode & other) const;
-
-private :
-    string points_to;
-};
-
-class directory : public inode
-{
-public :
-    directory(U_16 xuid, U_16 xgid, U_16 xperm, 
-	      const infinint & last_access, 
-	      const infinint & last_modif, 
-	      const string & xname);
-    directory(const directory &ref); // only the inode part is build, no children is duplicated (empty dir)
-    directory(generic_file & f, saved_status saved);
-    ~directory(); // detruit aussi tous les fils et se supprime de son 'parent'
-
-    void dump(generic_file & f) const;
-    void add_children(nomme *r); // when r is a directory, 'parent' is set to 'this'
-    void reset_read_children() const;
-    bool read_children(const nomme * &r) const; // read the direct children of the directory, returns false if no more is available
-    void listing(ostream & flux, const mask &m = bool_mask(true), string marge = "") const;
-    void tar_listing(ostream & flux, const mask &m = bool_mask(true), const string & beginning = "") const;
-    directory * get_parent() const { return parent; };
-    bool search_children(const string &name, nomme *&ref);
-
-	// using is_more_recent_than() from inode class
-	// using method has_changed_since() from inode class
-    unsigned char signature() const { return mk_signature('d', get_saved_status()); };
-    entree *clone() const { return new directory(*this); };
-
-private :
-    directory *parent;
-    vector<nomme *> fils;
-    vector<nomme *>::iterator it;
-
-    void clear();
-};
-
-class device : public inode
-{
-public :
-    device(U_16 uid, U_16 gid, U_16 perm, 
-	   const infinint & last_access, 
-	   const infinint & last_modif, 
-	   const string & name, 
-	   U_16 major,
-	   U_16 minor);
-    device(generic_file & f, saved_status saved);
-    
-    void dump(generic_file & f) const;
-    int get_major() const { if(get_saved_status() != s_saved) throw SRC_BUG; else return xmajor; };
-    int get_minor() const { if(get_saved_status() != s_saved) throw SRC_BUG; else return xminor; };
-    void set_major(int x) { xmajor = x; };
-    void set_minor(int x) { xminor = x; };
-
-	// using method is_more_recent_than() from inode class
-	// using method has_changed_since() from inode class
-	// signature is left pure abstract
-
-protected :
-    void sub_compare(const inode & other) const;
-
-private :
-    U_16 xmajor, xminor;
-};
-
-class chardev : public device
-{
-public:
-    chardev(U_16 uid, U_16 gid, U_16 perm, 
-	    const infinint & last_access, 
-	    const infinint & last_modif, 
-	    const string & name, 
-	    U_16 major, 
-	    U_16 minor) : device(uid, gid, perm, last_access, 
-				 last_modif, name,
-				 major, minor) {};
-    chardev(generic_file & f, saved_status saved) : device(f, saved) {};
-    
-	// using dump from device class
-	// using method is_more_recent_than() from device class
-	// using method has_changed_since() from device class
-    unsigned char signature() const { return mk_signature('c', get_saved_status()); };
-    entree *clone() const { return new chardev(*this); };
-};
-
-class blockdev : public device
-{
-public:
-    blockdev(U_16 uid, U_16 gid, U_16 perm, 
-	     const infinint & last_access, 
-	     const infinint & last_modif, 
-	     const string & name, 
-	     U_16 major, 
-	     U_16 minor) : device(uid, gid, perm, last_access, 
-				  last_modif, name,
-				  major, minor) {};
-    blockdev(generic_file & f, saved_status saved) : device(f, saved) {};
-    
-	// using dump from device class
-	// using method is_more_recent_than() from device class
-	// using method has_changed_since() from device class
-    unsigned char signature() const { return mk_signature('b', get_saved_status()); };
-    entree *clone() const { return new blockdev(*this); };
-};
-
-class tube : public inode
-{
-public :
-    tube(U_16 xuid, U_16 xgid, U_16 xperm, 
-	 const infinint & last_access, 
-	 const infinint & last_modif, 
-	 const string & xname) : inode(xuid, xgid, xperm, last_access, last_modif, xname) { set_saved_status(s_saved); };
-    tube(generic_file & f, saved_status saved) : inode(f, saved) {};
-    
-    	// using dump from inode class
-	// using method is_more_recent_than() from inode class
-	// using method has_changed_since() from inode class
-    unsigned char signature() const { return mk_signature('p', get_saved_status()); };
-    entree *clone() const { return new tube(*this); };
-};
-
-class prise : public inode
-{
-public :
-    prise(U_16 xuid, U_16 xgid, U_16 xperm, 
-	  const infinint & last_access, 
-	  const infinint & last_modif, 
-	  const string & xname) : inode(xuid, xgid, xperm, last_access, last_modif, xname) { set_saved_status(s_saved); };
-    prise(generic_file & f, saved_status saved) : inode(f, saved) {};
-
-    	// using dump from inode class
-	// using method is_more_recent_than() from inode class
-	// using method has_changed_since() from inode class
-    unsigned char signature() const { return mk_signature('s', get_saved_status()); };
-    entree *clone() const { return new prise(*this); };
-};
-
-class detruit : public nomme
-{
-public :
-    detruit(const string & name, unsigned char firm) : nomme(name) { signe = firm; };
-    detruit(generic_file & f) : nomme(f) { if(f.read((char *)&signe, 1) != 1) throw Erange("detruit::detruit", "missing data to buid"); };
-
-    void dump(generic_file & f) const { nomme::dump(f); f.write((char *)&signe, 1); };
-    unsigned char get_signature() const { return signe; };
-    void set_signature(unsigned char x) { signe = x; };
-    unsigned char signature() const { return 'x'; };
-    entree *clone() const { return new detruit(*this); };
-
-private :
-    unsigned char signe;
-};
-
-class ignored : public nomme
-{
-public :
-    ignored(const string & name) : nomme(name) {};
-    ignored(generic_file & f) : nomme(f) { throw SRC_BUG; };
-
-    void dump(generic_file & f) const { throw SRC_BUG; };
-    unsigned char signature() const { return 'i'; };
-    entree *clone() const { return new ignored(*this); };
-};
-
-class ignored_dir : public inode
-{
-public:
-    ignored_dir(const directory &target) : inode(target) {};
-    ignored_dir(generic_file & f) : inode(f, s_not_saved) { throw SRC_BUG; };
-
-    void dump(generic_file & f) const; // behaves like an empty directory
-    unsigned char signature() const { return 'j'; }; 
-    entree *clone() const { return new ignored_dir(*this); };
-};
-
-class catalogue
-{
-public :
-    catalogue();
-    catalogue(generic_file & f);
-    catalogue(const catalogue & ref) : out_compare(ref.out_compare) { partial_copy_from(ref); };
-    catalogue & operator = (const catalogue &ref);
-    ~catalogue() { detruire(); };
-
-    void reset_read();
-    void skip_read_to_parent_dir(); 
-	// skip all items of the current dir and of any subdir, the next call will return 
-	// next item of the parent dir (no eod to exit from the current dir !)
-    bool read(const entree * & ref); 
-	// sequential read (generates eod) and return false when all files have been read
-    bool read_if_present(string *name, const nomme * & ref); 
-	// pseudo-sequential read (reading a directory still 
-	// implies that following read are located in this subdirectory up to the next EOD) but
-	// it returns false if no entry of this name are present in the current directory 
-	// a call with NULL as first argument means to set the current dir the parent directory
-
-    void reset_sub_read(const path &sub); // return false if the path do not exists in catalogue 
-    bool sub_read(const entree * &ref); // sequential read of the catalogue, ignoring all that
-	// is not part of the subdirectory specified with reset_sub_read
-	// the read include the inode leading to the sub_tree as well as the pending eod
-
-    void reset_add();
-    void add(entree *ref); // add at end of catalogue (sequential point of view)
-    void add_in_current_read(nomme *ref); // add in currently read directory
-
-    void reset_compare();
-    bool compare(const entree * name, const entree * & extracted);
-	// returns true if the ref exists, and gives it back in second argument as it is in the current catalogue.
-	// returns false is no entry of that nature exists in the catalogue (in the current directory)
-	// if ref is a directory, the operation is normaly relative to the directory itself, but 
-	// such a call implies a chdir to that directory. thus, a call with an EOD is necessary to 
-	// change to the parent directory.
-	// note :
-	// if a directory is not present, returns false, but records the inexistant subdirectory 
-	// structure defined by the following calls to this routine, this to be able to know when 
-	// the last available directory is back the current one when changing to parent directory, 
-	// and then proceed with normal comparison of inode. In this laps of time, the call will
-	// always return false, while it temporary stores the missing directory structure
-
-    bool direct_read(const path & ref, const nomme * &ret);
-            
-    infinint update_destroyed_with(catalogue & ref);
-	// ref must have the same root, else the operation generates a exception
-    
-    void dump(generic_file & ref) const;
-    void listing(ostream & flux, const mask &m = bool_mask(true), string marge = "") const;
-    void tar_listing(ostream & flux, const mask & m = bool_mask(true), const string & beginning = "") const;
-    entree_stats get_stats() const { return stats; };
-
-    const directory *get_contenu() const { return contenu; }; // used by data_tree
-
-private :
-    directory *contenu;
-    path out_compare;                 // stores the missing directory structure, when extracting
-    directory *current_compare;       // points to the current directory when extracting
-    directory *current_add;           // points to the directory where to add the next file with add_file;
-    directory *current_read;          // points to the directory where the next item will be read
-    path *sub_tree;                   // path to sub_tree
-    signed int sub_count;             // count the depth in of read routine in the sub_tree
-    entree_stats stats;               // statistics catalogue contents
-
-    void partial_copy_from(const catalogue &ref);
-    void detruire();
-
-    static const eod r_eod;           // needed to return eod reference, without taking risk of saturating memory
-};
-
-#endif
Index: dar/command_line.cpp
===================================================================
--- dar.orig/command_line.cpp	2012-05-02 11:23:23.311876335 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,1865 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <string>
-#include <string.h>
-#include <errno.h>
-#include <algorithm>
-#include <vector>
-#include <deque>
-#include <iostream>
-#include "deci.hpp"
-#include "command_line.hpp"
-#include "user_interaction.hpp"
-#include "tools.hpp"
-#include "dar.hpp"
-#include "dar_suite.hpp"
-#include "etage.hpp"
-#include "integers.hpp"
-#include "no_comment.hpp"
-#include "config_file.hpp"
-
-#define OPT_STRING "c:A:x:d:t:l:vz::y::nwpkR:s:S:X:I:P:bhLWDruUVC:i:o:OTE:F:K:J:Y:Z:B:fm:N"
-
-using namespace std;
-
-static const infinint min_compr_size_default = 100; 
-    // the default value for --mincompr
-
- // return a newly allocated memory (to be deleted by the caller)
-static void show_license();
-static void show_warranty();
-static void show_version(const char *command_name);
-static void usage(const char *command_name);
-static const struct option *get_long_opt();
-static bool get_args_recursive(vector<string> & inclusions, 
-			       S_I argc, 
-			       char *argv[], 
-			       operation &op, 
-			       path * &fs_root, 
-			       path * &sauv_root, 
-			       path * &ref_root,
-			       infinint &file_size, 
-			       infinint &first_file_size,
-			       ou_mask & inclus, 
-			       ou_mask & exclus, 
-			       deque<string> & l_path_inclus, 
-			       deque<string> & l_path_exclus,
-			       string & filename, 
-			       string *& ref_filename,
-			       bool &allow_over, 
-			       bool &warn_over, 
-			       bool &info_details,
-			       compression &algo, 
-			       U_I & compression_level,
-			       bool &detruire, 
-			       bool &pause, 
-			       bool &beep, 
-			       bool &make_empty_dir, 
-			       bool & only_more_recent, 
-			       bool & ea_root, 
-			       bool & ea_user,
-			       string & input_pipe, 
-			       string &output_pipe,
-			       bool & ignore_owner, 
-			       string & execute, 
-			       string & execute_ref,
-			       string & pass, 
-			       string & pass_ref,
-			       ou_mask & compr_inclus, 
-			       ou_mask & compr_exclus,
-			       bool &tar_format,
-			       bool & flat,
-			       infinint & min_compr_size,
-			       bool & readconfig,
-			       bool & nodump);
-static void make_args_from_file(operation op, const char *filename, S_I & argc, 
-				char **&argv);
-static void destroy(S_I argc, char **argv);
-static char * make_word(generic_file & fic, off_t start, off_t end);
-static void skip_getopt(S_I argc, char *argv[], S_I next_to_read);
-static void check_basename(const path & loc, string & base);
-static bool is_a_slice_available(const string & base);
-static string retreive_basename(const string & base);
-static bool update_with_config_files(const char * home,
-				     operation &op, 
-				     path * &fs_root, 
-				     path * &sauv_root, 
-				     path * &ref_root,
-				     infinint &file_size, 
-				     infinint &first_file_size,
-				     ou_mask & inclus, 
-				     ou_mask & exclus, 
-				     deque<string> & l_path_inclus, 
-				     deque<string> & l_path_exclus,
-				     string & filename, 
-				     string *& ref_filename,
-				     bool &allow_over, 
-				     bool &warn_over, 
-				     bool &info_details,
-				     compression &algo, 
-				     U_I & compression_level,
-				     bool &detruire, 
-				     bool &pause, 
-				     bool &beep, 
-				     bool &make_empty_dir, 
-				     bool & only_more_recent, 
-				     bool & ea_root, 
-				     bool & ea_user,
-				     string & input_pipe, 
-				     string &output_pipe,
-				     bool & ignore_owner, 
-				     string & execute, 
-				     string & execute_ref,
-				     string & pass, 
-				     string & pass_ref,
-				     ou_mask & compr_inclus, 
-				     ou_mask & compr_exclus,
-				     bool &tar_format,
-				     bool & flat,
-				     infinint & min_compr_size,
-				     bool & nodump);
-
-    // #define DEBOGGAGE
-#ifdef DEBOGGAGE
-static void show_args(S_I argc, char *argv[]);
-#endif
-
-bool get_args(const char *home, S_I argc, char *argv[], operation &op, path * &fs_root, path * &sauv_root, path * &ref_root,
-	      infinint &file_size, infinint &first_file_size, mask *&selection, mask *&subtree,
-	      string &filename, string *&ref_filename,
-	      bool &allow_over, bool &warn_over, bool &info_details,
-	      compression &algo, U_I & compression_level,
-	      bool &detruire, bool &pause, bool &beep, bool &make_empty_dir, 
-	      bool & only_more_recent, bool & ea_root, bool & ea_user,
-	      string & input_pipe, string &output_pipe,
-	      bool & ignore_owner, 
-	      string & execute, string & execute_ref,
-	      string & pass, string & pass_ref,
-	      mask *& compress_mask,
-	      bool & flat,
-	      infinint & min_compr_size,
-	      bool & nodump)
-{
-    op = noop;
-    fs_root = NULL;
-    sauv_root = NULL;
-    ref_root = NULL;
-    selection = NULL;
-    subtree = NULL;
-    ref_filename = NULL;
-    file_size = 0;
-    first_file_size = 0;
-    filename = "";
-    allow_over = true;
-    warn_over = true;
-    info_details = false;
-    algo = none;
-    compression_level = 9;
-    detruire = true;
-    pause = false;
-    beep = false;
-    make_empty_dir = false;
-    only_more_recent = false; // when listing, it is set to true, if tar-format is asked
-    input_pipe = "";
-    output_pipe = "";
-    ignore_owner = false;
-    execute = "";
-    execute_ref = "";
-    pass = "";
-    pass_ref = "";
-    compress_mask = NULL;
-#ifdef EA_SUPPORT
-    ea_user = true;
-    ea_root = true;
-#else
-    ea_user = false;
-    ea_root = false;
-#endif
-    ou_mask inclus, exclus;
-    ou_mask path_inclus, path_exclus;
-    ou_mask compr_inclus, compr_exclus;
-    deque<string> l_path_exclus;
-    deque<string> l_path_inclus;
-    et_mask *tmp_mask;
-    bool tar_format = true;
-    vector<string> inclusions;
-    flat = false;
-    min_compr_size = min_compr_size_default;
-    nodump = false;
-
-    bool readconfig = true;
-
-    try
-    {
-	try
-	{
-	    opterr = 0;
-
-
-	    if(!get_args_recursive(inclusions, argc, argv, 
-				   op, fs_root, 
-				   sauv_root, ref_root, 
-				   file_size, first_file_size, inclus, exclus,
-				   l_path_inclus, l_path_exclus,
-				   filename, ref_filename, 
-				   allow_over, warn_over, info_details,
-				   algo, compression_level, detruire, pause, 
-				   beep, make_empty_dir,
-				   only_more_recent, ea_root, ea_user,
-				   input_pipe, output_pipe,
-				   ignore_owner,
-				   execute,
-				   execute_ref,
-				   pass, pass_ref,
-				   compr_inclus, compr_exclus,
-				   tar_format,
-				   flat, min_compr_size, readconfig, nodump))
-		return false;
-
-		// checking and updating options with configuration file if any
-	    if(readconfig)
-		if(! update_with_config_files(home,
-					      op, fs_root, 
-					      sauv_root, ref_root, 
-					      file_size, first_file_size, inclus, 
-					      exclus,
-					      l_path_inclus, l_path_exclus,
-					      filename, ref_filename, 
-					      allow_over, warn_over, info_details,
-					      algo, compression_level, detruire, pause, 
-					      beep, make_empty_dir,
-					      only_more_recent, ea_root, ea_user,
-					      input_pipe, output_pipe,
-					      ignore_owner,
-					      execute,
-					      execute_ref,
-					      pass, pass_ref,
-					      compr_inclus, compr_exclus,
-					      tar_format,
-					      flat, min_compr_size, nodump))
-		    return false;
-
-		// some sanity checks
-
-	    if(filename == "" || sauv_root == NULL || op == noop)
-		throw Erange("get_args", string("missing -c -x -d -t -l -C option, see `") + path(argv[0]).basename() + " -h' for help");
-	    if(filename == "-" && file_size != 0)
-		throw Erange("get_args", "slicing (-s option), is not compatible with archive on standart output (\"-\" as filename)");
-	    if(filename != "-" && (op != create || op != isolate))
-		if(sauv_root == NULL)
-		    throw SRC_BUG;
-	    if(filename != "-")
-		check_basename(*sauv_root, filename);
-	    if(fs_root == NULL)
-		fs_root = new path(".");
-	    if(ref_filename != NULL && op != create && op != isolate)
-		user_interaction_warning("-A option is only useful with -c option\n");
-	    if(op == isolate && ref_filename == NULL)
-		throw Erange("get_args", "with -C option, -A option is mandatory");
-	    if(filename == "-" && ref_filename != NULL && *ref_filename == "-"
-	       && output_pipe == "")
-		throw Erange("get_args", "-o is mandatory when using \"-A -\" with \"-c -\" or \"-C -\"");
-	    if(ref_filename != NULL && *ref_filename != "-")
-		if(ref_root == NULL)
-		    throw SRC_BUG;
-		else
-		    check_basename(*ref_root, *ref_filename);
-	    if(algo != none && op != create && op != isolate)
-		user_interaction_warning("-z or -y need only to be used with -c\n");
-	    if(first_file_size != 0 && file_size == 0)
-		throw Erange("get_args", "-S option requires the use of -s\n");
-	    if(ignore_owner && (op == isolate || (op == create && ref_root == NULL) || op == test || op == listing))
-		user_interaction_warning("ignoring -O option, as it is useless in this situation");
-	    if(getuid() != 0 && op == extract && !ignore_owner) // uid == 0 for root
-	    {
-		char *name = tools_extract_basename(argv[0]);
-
-		try
-		{
-		    ignore_owner = true;
-		    string msg = string("file ownership will not be restored as ") + name + " is not run as root. to avoid this message use -O option";
-		    user_interaction_pause(msg);
-		}
-		catch(...)
-		{
-		    delete name;
-		    throw;
-		}
-		delete name;
-	    }
-	    if(op == listing && tar_format)
-		only_more_recent = true; 
-	    if(execute != "" && file_size == 0 && (op == create || op == isolate))
-		user_interaction_warning("-E is not possible (and useless) with -c or -C and without slicing (-s option), -E will be ignored");
-	    if(execute_ref != "" && ref_filename == NULL)
-		user_interaction_warning("-F is only useful with -A option, for the archive of reference");
-	    if(pass_ref != "" && ref_filename == NULL)
-		user_interaction_warning("-J is only useful with -A option, for the archive of reference");
-	    if(flat && op != extract)
-		user_interaction_warning("-f in only available with -x option, ignoring");
-	    if(min_compr_size != min_compr_size_default && op != create)
-		user_interaction_warning("-m is only useful with -c");
-
-		// generating masks
-		// for filenames
-		//
-	    tmp_mask = new et_mask();
-	    selection = tmp_mask; // tmp_mask is a pointer on et_mask which "selection" is not
-	    if(tmp_mask == NULL)
-		throw Ememory("get_args");
-	    if(inclus.size() > 0)
-		tmp_mask->add_mask(inclus);
-	    else
-		tmp_mask->add_mask(bool_mask(true));
-	    if(exclus.size() > 0)
-		tmp_mask->add_mask(not_mask(exclus));
-
-		// generating masks for
-		// directory tree
-		//
-		// reading arguments remaining on the command line
-	    if(l_path_inclus.size() > 0)
-		while(l_path_inclus.size() > 0)
-		{
-		    path_inclus.add_mask(simple_path_mask((*fs_root + path(l_path_inclus.front())).display()));
-		    l_path_inclus.pop_front();
-		}				  
-	    else
-		path_inclus.add_mask(bool_mask(true));
-
-		// making exclude mask from file
-
-	    while(l_path_exclus.size() > 0)
-	    {
-		path_exclus.add_mask(simple_mask((*fs_root + path(l_path_exclus.front())).display()));
-		l_path_exclus.pop_front();
-	    }
-
-	    tmp_mask = new et_mask();
-	    subtree = tmp_mask;
-	    if(tmp_mask == NULL)
-		throw Ememory("get_args");
-	    if(path_inclus.size() > 0)
-		tmp_mask->add_mask(path_inclus);
-	    else
-		tmp_mask->add_mask(bool_mask(true));
-	    if(path_exclus.size() > 0)
-		tmp_mask->add_mask(not_mask(path_exclus));
-
-		// generating mask for 
-		// compression selected files
-		//
-	    if(algo == none)
-	    {
-		if(compr_inclus.size() > 0)
-		    user_interaction_warning("-Y is only useful with -z or -y option, ignoring -Y");
-		if(compr_exclus.size() > 0)
-		    user_interaction_warning("-Z is only useful with -z or -y option, ignoring -Z");
-		if(min_compr_size != min_compr_size_default)
-		    user_interaction_warning("-m is only useful with -z or -y option, ignoring -m");
-	    }
-	    tmp_mask = new et_mask();
-	    compress_mask = tmp_mask;  // tmp_mask is a pointer on et_mask which "compress_mask" is not
-	    if(tmp_mask == NULL)
-		throw Ememory("get_args");
-	    if(compr_inclus.size() > 0 && algo != none)
-		tmp_mask->add_mask(compr_inclus);
-	    else
-		tmp_mask->add_mask(bool_mask(true));
-	    if(compr_exclus.size() > 0 && algo != none)
-		tmp_mask->add_mask(not_mask(compr_exclus));
-	}
-	catch(...)
-	{
-	    if(fs_root != NULL)
-		delete fs_root;
-	    if(sauv_root != NULL)
-		delete sauv_root;
-	    if(selection != NULL)
-		delete selection;
-	    if(subtree != NULL)
-		delete subtree;
-	    if(ref_filename != NULL)
-		delete ref_filename;
-	    if(compress_mask != NULL)
-		delete compress_mask;
-	    throw;
-	}
-    }
-    catch(Erange & e)
-    {
-	user_interaction_warning(string("parse error on command line : ") + e.get_message());
-	return false;
-    }
-    return true;
-}
-
-bool get_args_recursive(vector<string> & inclusions, 
-			S_I argc, 
-			char *argv[], 
-			operation &op, 
-			path * &fs_root, 
-			path * &sauv_root, 
-			path * &ref_root,
-			infinint &file_size, 
-			infinint &first_file_size, 
-			ou_mask & inclus, 
-			ou_mask & exclus, 
-			deque<string> & l_path_inclus, 
-			deque<string> & l_path_exclus,
-			string & filename,
-			string *& ref_filename,
-			bool &allow_over, 
-			bool &warn_over, 
-			bool &info_details,
-			compression &algo, 
-			U_I & compression_level,
-			bool &detruire, 
-			bool &pause, 
-			bool &beep, 
-			bool &make_empty_dir, 
-			bool & only_more_recent, 
-			bool & ea_root, 
-			bool & ea_user,
-			string & input_pipe, 
-			string &output_pipe,
-			bool & ignore_owner, 
-			string & execute, 
-			string & execute_ref,
-			string & pass, 
-			string & pass_ref,
-			ou_mask & compr_inclus, 
-			ou_mask & compr_exclus,
-			bool &tar_format,
-			bool & flat,
-			infinint & min_compr_size,
-			bool & readconfig,
-			bool & nodump)
-{ 
-    S_I lu;
-    S_I rec_c;
-    char **rec_v = NULL;
-
-    while((lu = getopt_long(argc, argv, OPT_STRING, get_long_opt(), NULL)) != EOF)
-    {
-	switch(lu)
-	{
-	case 'c':
-	case 'x':
-	case 'd':
-	case 't':
-	case 'l':
-	case 'C':
-	    if(optarg == NULL)
-		throw Erange("get_args", string(" missing argument to -")+char(lu));
-	    if(filename != "" || sauv_root != NULL)
-		throw Erange("get_args", " only one option of -c -d -t -l -C or -x is allowed");
-	    if(optarg != "")
-		tools_split_path_basename(optarg, sauv_root, filename);
-	    else
-		throw Erange("get_args", string(" invalid argument for option -") + char(lu));
-	    switch(lu)
-	    {
-	    case 'c':
-		op = create;
-		break;
-	    case 'x':
-		op = extract;
-		break;
-	    case 'd':
-		op = diff;
-		break;
-	    case 't':
-		op = test;
-		break;
-	    case 'l':
-		op = listing;
-		break;
-	    case 'C':
-		op = isolate;
-		break;
-	    default:
-		throw SRC_BUG;
-	    }
-	    break;
-	case 'A':
-	    if(ref_filename != NULL || ref_root != NULL)
-		throw Erange("get_args", "only one -A option is allowed");
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -A");
-	    if(optarg == "")
-		throw Erange("get_args", "invalid argument for option -A");
-	    if(optarg == "-")
-		throw Erange("get_args", "- not allowed with -A option");
-	    ref_filename = new string();
-	    if(ref_filename == NULL)
-		throw Ememory("get_args");
-	    try
-	    {
-		tools_split_path_basename(optarg, ref_root, *ref_filename);
-	    }
-	    catch(...)
-	    {
-		delete ref_filename;
-		throw;
-	    }
-	    break;
-	case 'v':
-	    info_details = true;
-	    break;
-	case 'z':
-	    if(algo == none)
-		algo = gzip;
-	    else
-		throw Erange("get_args", "choose either -z or -y not both");
-	    if(optarg != NULL)
-	    {
-		S_I tmp = atoi(optarg);
-
-		if(tmp < 0 || tmp > 9)
-		    throw Erange("get_args", "gzip compression level must be inbetween 0 and 9");
-		else
-		    compression_level = tmp;
-	    } 
-	    break;
-	case 'y':
-	    if(algo == none)
-		algo = bzip2;
-	    else
-		throw Erange("get_args", "choose either -z or -y not both");
-	    if(optarg != NULL)
-	    {
-		S_I tmp = atoi(optarg);
-
-		if(tmp < 0 || tmp > 9)
-		    throw Erange("get_args", "bzip2 compression level must be inbetween 0 and 9");
-		else
-		    compression_level = tmp;
-	    } 
-	    break;
-	case 'n':
-	    allow_over = false;
-	    if(!warn_over)
-	    {
-		user_interaction_warning("-w option is useless with -n");
-		warn_over = false;
-	    }
-	    break;
-	case 'w':
-	    warn_over = false;
-	    break;
-	case 'p':
-	    pause = true;
-	    break;
-	case 'k':
-	    detruire = false;
-	    break;
-	case 'R':
-	    if(fs_root != NULL)
-		throw Erange("get_args", "only one -R option is allowed");
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -R");
-	    else
-		fs_root = new path(optarg);
-	    if(fs_root == NULL)
-		throw Ememory("get_args");
-	    break;
-	case 's':
-	    if(file_size != 0)
-		throw Erange("get_args", "only one -s option is allowed");
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -s");
-	    else
-	    {
-		try
-		{
-		    file_size = tools_get_extended_size(optarg);
-		    if(first_file_size == 0)
-			first_file_size = file_size;
-		}
-		catch(Edeci &e)
-		{
-		    user_interaction_warning("invalid size for option -s");
-		    return false;
-		}
-	    }
-	    break;
-	case 'S':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -S");
-	    if(first_file_size == 0)
-		first_file_size = tools_get_extended_size(optarg);
-	    else
-		if(file_size == 0)
-		    throw Erange("get_args", "only one -S option is allowed");
-		else
-		    if(file_size == first_file_size)
-		    {
-			try
-			{
-			    first_file_size = tools_get_extended_size(optarg);
-			    if(first_file_size == file_size)
-				user_interaction_warning("specifying -S with the same value as the one given in -s is useless");
-			}
-			catch(Egeneric &e)
-			{
-			    user_interaction_warning("invalid size for option -S");
-			    return false;
-			}
-
-		    }
-		    else
-			throw Erange("get_args", "only one -S option is allowed");
-	    break;
-	case 'X':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missiong argument to -X");
-	    exclus.add_mask(simple_mask(string(optarg)));
-	    break;
-	case 'I':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -X");
-	    inclus.add_mask(simple_mask(string(optarg)));
-	    break;
-	case 'P':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -P");
-	    l_path_exclus.push_back(optarg);
-	    break;
-	case 'b':
-	    beep = true;
-	    break;
-	case 'h':
-	    usage(argv[0]);
-	    return false;
-	case 'L':
-	    show_license();
-	    return false;
-	case 'W':
-	    show_warranty();
-	    return false;
-	case 'D':
-	    if(make_empty_dir)
-		user_interaction_warning("syntax error: -D option has not to be present only once, ignoring additional -D");
-	    else
-		make_empty_dir = true;
-	    break;
-	case 'r':
-	    if(!allow_over)
-		user_interaction_warning("NOTE : -r is useless with -n\n");
-	    if(only_more_recent)
-		user_interaction_warning("syntax error: -r is only necessary once, ignoring other occurences\n");
-	    else
-		only_more_recent = true;
-	    break;
-	case 'u':
-#ifdef EA_SUPPORT
-	    if(!ea_user)
-		user_interaction_warning("syntax error: -u is only necessary once, ignoring other occurences\n");
-	    else
-		ea_user = false;
-#else
-	    user_interaction_warning("WARNING! Extended Attributs Support has not been activated at compilation time, thus -u option does nothing");
-#endif 
-	    break;
-	case 'U':
-#ifdef EA_SUPPORT
-	    if(!ea_root)
-		user_interaction_warning("syntax error : -U is only necessary once, ignoring other occurences\n");
-	    else
-		ea_root = false;
-#else
-	    user_interaction_warning("WARNING! Extended Attributs Support has not been activated at compilation time, thus -U option does nothing.");
-#endif
-	    break;
-	case 'V':
-	    show_version(argv[0]);
-	    return false;
-	case ':':
-	    throw Erange("get_args", string("missing parameter to option ") + char(optopt));
-	case 'i':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -i");
-	    if(input_pipe == "")
-		input_pipe = optarg;
-	    else
-		user_interaction_warning("only one -i option is allowed, considering the first one");
-	    break;
-	case 'o':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -o");
-	    if(output_pipe == "")
-		output_pipe = optarg;
-	    else
-		user_interaction_warning("only one -o option is allowed, considering the first one");
-	    break;
-	case 'O':
-	    if(ignore_owner)
-		user_interaction_warning("only one -O option is necessary, ignoring other instances");
-	    else
-		ignore_owner = true;
-	    break;
-	case 'T': // long option --tar-format
-	    if(!tar_format)
-		user_interaction_warning("only one -T option is necessary, ignoring other instances");
-	    else
-		tar_format = false;
-	    break;
-	case 'E':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -E");
-	    if(execute == "")
-		execute = optarg;
-	    else
-		user_interaction_warning("only one -E option is allowed, ignoring other instances");
-	    break;
-	case 'F':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -F");
-	    if(execute_ref == "")
-		execute_ref = optarg;
-	    else
-		user_interaction_warning("only one -F option is allowed, ignoring other instances");
-	    break;
-	case 'J':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -J");
-	    if(pass_ref == "")
-		pass_ref = optarg;
-	    else
-		user_interaction_warning("only one -J option is allowed, ignoring other instances");
-	    break;
-	case 'K':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -K");
-	    if(pass == "")
-		pass = optarg;
-	    else
-		user_interaction_warning("only one -K option is allowed, ignoring other instances");
-	    break;
-	case 'Y':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missiong argument to -Y");
-	    compr_inclus.add_mask(simple_mask(string(optarg)));
-	    break;
-	case 'Z':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -Z");
-	    compr_exclus.add_mask(simple_mask(string(optarg)));
-	    break;
-	case 'B':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -B");
-	    if(find(inclusions.begin(), inclusions.end(), string(optarg)) != inclusions.end())
-		throw Erange("geta_args", string("file inclusion loop detected. The file ") + optarg  + " includes itslef directly or through other files (-B option)");
-	    else
-	    {
-		bool ret;
-		make_args_from_file(op, optarg, rec_c, rec_v);
-#ifdef DEBOGGAGE
-		show_args(rec_c, rec_v);
-#endif
-		S_I optind_mem = optind; // save the external variable to use recursivity (see getopt)
-		optind = 0; // reset getopt module
-
-		try
-		{
-		    inclusions.push_back(optarg);
-		    ret = get_args_recursive(inclusions, rec_c, rec_v, op, fs_root, sauv_root, ref_root, 
-					     file_size, first_file_size, inclus, exclus,
-					     l_path_inclus, l_path_exclus,
-					     filename, ref_filename, 
-					     allow_over, warn_over, info_details,
-					     algo, compression_level, detruire, pause, 
-					     beep, make_empty_dir,
-					     only_more_recent, ea_root, ea_user,
-					     input_pipe, output_pipe,
-					     ignore_owner,
-					     execute,
-					     execute_ref,
-					     pass, pass_ref,
-					     compr_inclus, compr_exclus,
-					     tar_format,
-					     flat,
-					     min_compr_size,
-					     readconfig, nodump);
-		    inclusions.pop_back();
-		}
-		catch(...)
-		{
-		    destroy(rec_c, rec_v);
-		    optind = optind_mem;
-		    throw;
-		}
-		destroy(rec_c, rec_v);
-		skip_getopt(argc, argv, optind_mem); // restores getopt after recursion
-
-		if(!ret)
-		    return false;
-	    }
-	    break;
-	case 'f':
-	    if(flat)
-		user_interaction_warning("only one -f option is allowed, ignoring other instances");
-	    else
-		flat = true;
-	    break;
-	case 'm':
-	    if(min_compr_size != min_compr_size_default)
-		user_interaction_warning("only one -m option is allowed, ignoring other instances");
-	    else
-	    {
-		if(optarg == NULL)
-		    throw Erange("get_args", "missing argument to -m");
-		min_compr_size = tools_get_extended_size(optarg);
-		if(min_compr_size == min_compr_size_default)
-		    user_interaction_warning(deci(min_compr_size_default).human() + " is the default falue for -m, no need to specify it on command line, ignoring");
-		break;
-	    }
-	case 'N':
-	    if(!readconfig)
-		user_interaction_warning("only one -N option is allowed, ignoring other instances");
-	    else
-		readconfig = false;
-	    break;
-	case ' ':
-#ifdef NO_DUMP_FEATURE
-	    if(nodump)
-		user_interaction_warning("only one --nodump option is allowed, ignoring other instances");
-	    else
-		nodump = true;
-	    break;
-#else
-	    throw Erange("command_line.cpp:get_args.recursive", "--nodump feature has not been activated at compilation time, it is thus not available");
-#endif
-	case '?':
-	    user_interaction_warning(string("ignoring unknown option ") + char(optopt));
-	    break;
-	default:
-	    user_interaction_warning(string("ignoring unknown option ") + char(lu)); 
-	}
-    }
-    for(S_I i = optind; i < argc; i++)
-	l_path_inclus.push_back(argv[i]);
-
-    return true;
-}
-
-static void usage(const char *command_name)
-{
-    char *name = tools_extract_basename(command_name);
-    user_interaction_change_non_interactive_output(&cout);
-
-    try
-    {
-	ui_printf("usage: %s [-c|-x|-d|-t|-l|-C] [<path>/]<basename> [options...] [list of paths]\n", name);
-	ui_printf("       %s -h\n", name);
-	ui_printf("       %s -V\n", name);
-#include "dar.usage"
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-
-    delete name;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void show_warranty()
-{
-    ui_printf("			    NO WARRANTY\n");
-    ui_printf("\n");
-    ui_printf("  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n");
-    ui_printf("FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\n");
-    ui_printf("OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n");
-    ui_printf("PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n");
-    ui_printf("OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n");
-    ui_printf("MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\n");
-    ui_printf("TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\n");
-    ui_printf("PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n");
-    ui_printf("REPAIR OR CORRECTION.\n");
-    ui_printf("\n");
-    ui_printf("  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n");
-    ui_printf("WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n");
-    ui_printf("REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n");
-    ui_printf("INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n");
-    ui_printf("OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n");
-    ui_printf("TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n");
-    ui_printf("YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n");
-    ui_printf("PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n");
-    ui_printf("POSSIBILITY OF SUCH DAMAGES.\n");
-    ui_printf("\n");
-}
-
-static void show_license()
-{
-    ui_printf("		    GNU GENERAL PUBLIC LICENSE\n");
-    ui_printf("		       Version 2, June 1991\n");
-    ui_printf("\n");
-    ui_printf(" Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n");
-    ui_printf("                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n");
-    ui_printf(" Everyone is permitted to copy and distribute verbatim copies\n");
-    ui_printf(" of this license document, but changing it is not allowed.\n");
-    ui_printf("\n");
-    ui_printf("			    Preamble\n");
-    ui_printf("\n");
-    ui_printf("  The licenses for most software are designed to take away your\n");
-    ui_printf("freedom to share and change it.  By contrast, the GNU General Public\n");
-    ui_printf("License is intended to guarantee your freedom to share and change free\n");
-    ui_printf("software--to make sure the software is free for all its users.  This\n");
-    ui_printf("General Public License applies to most of the Free Software\n");
-    ui_printf("Foundation's software and to any other program whose authors commit to\n");
-    ui_printf("using it.  (Some other Free Software Foundation software is covered by\n");
-    ui_printf("the GNU Library General Public License instead.)  You can apply it to\n");
-    ui_printf("your programs, too.\n");
-    ui_printf("\n");
-    ui_printf("  When we speak of free software, we are referring to freedom, not\n");
-    ui_printf("price.  Our General Public Licenses are designed to make sure that you\n");
-    ui_printf("have the freedom to distribute copies of free software (and charge for\n");
-    ui_printf("this service if you wish), that you receive source code or can get it\n");
-    ui_printf("if you want it, that you can change the software or use pieces of it\n");
-    ui_printf("in new free programs; and that you know you can do these things.\n");
-    ui_printf("\n");
-    ui_printf("  To protect your rights, we need to make restrictions that forbid\n");
-    ui_printf("anyone to deny you these rights or to ask you to surrender the rights.\n");
-    ui_printf("These restrictions translate to certain responsibilities for you if you\n");
-    ui_printf("distribute copies of the software, or if you modify it.\n");
-    ui_printf("\n");
-    ui_printf("  For example, if you distribute copies of such a program, whether\n");
-    ui_printf("gratis or for a fee, you must give the recipients all the rights that\n");
-    ui_printf("you have.  You must make sure that they, too, receive or can get the\n");
-    ui_printf("source code.  And you must show them these terms so they know their\n");
-    ui_printf("rights.\n");
-    ui_printf("\n");
-    ui_printf("  We protect your rights with two steps: (1) copyright the software, and\n");
-    ui_printf("(2) offer you this license which gives you legal permission to copy,\n");
-    ui_printf("distribute and/or modify the software.\n");
-    ui_printf("\n");
-    ui_printf("  Also, for each author's protection and ours, we want to make certain\n");
-    ui_printf("that everyone understands that there is no warranty for this free\n");
-    ui_printf("software.  If the software is modified by someone else and passed on, we\n");
-    ui_printf("want its recipients to know that what they have is not the original, so\n");
-    ui_printf("that any problems introduced by others will not reflect on the original\n");
-    ui_printf("authors' reputations.\n");
-    ui_printf("\n");
-    ui_printf("  Finally, any free program is threatened constantly by software\n");
-    ui_printf("patents.  We wish to avoid the danger that redistributors of a free\n");
-    ui_printf("program will individually obtain patent licenses, in effect making the\n");
-    ui_printf("program proprietary.  To prevent this, we have made it clear that any\n");
-    ui_printf("patent must be licensed for everyone's free use or not licensed at all.\n");
-    ui_printf("\n");
-    ui_printf("  The precise terms and conditions for copying, distribution and\n");
-    ui_printf("modification follow.\n");
-    ui_printf("\n");
-    ui_printf("		    GNU GENERAL PUBLIC LICENSE\n");
-    ui_printf("   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n");
-    ui_printf("\n");
-    ui_printf("  0. This License applies to any program or other work which contains\n");
-    ui_printf("a notice placed by the copyright holder saying it may be distributed\n");
-    ui_printf("under the terms of this General Public License.  The \"Program\", below,\n");
-    ui_printf("refers to any such program or work, and a \"work based on the Program\"\n");
-    ui_printf("means either the Program or any derivative work under copyright law:\n");
-    ui_printf("that is to say, a work containing the Program or a portion of it,\n");
-    ui_printf("either verbatim or with modifications and/or translated into another\n");
-    ui_printf("language.  (Hereinafter, translation is included without limitation in\n");
-    ui_printf("the term \"modification\".)  Each licensee is addressed as \"you\".\n");
-    ui_printf("\n");
-    ui_printf("Activities other than copying, distribution and modification are not\n");
-    ui_printf("covered by this License; they are outside its scope.  The act of\n");
-    ui_printf("running the Program is not restricted, and the output from the Program\n");
-    ui_printf("is covered only if its contents constitute a work based on the\n");
-    ui_printf("Program (independent of having been made by running the Program).\n");
-    ui_printf("Whether that is true depends on what the Program does.\n");
-    ui_printf("\n");
-    ui_printf("  1. You may copy and distribute verbatim copies of the Program's\n");
-    ui_printf("source code as you receive it, in any medium, provided that you\n");
-    ui_printf("conspicuously and appropriately publish on each copy an appropriate\n");
-    ui_printf("copyright notice and disclaimer of warranty; keep intact all the\n");
-    ui_printf("notices that refer to this License and to the absence of any warranty;\n");
-    ui_printf("and give any other recipients of the Program a copy of this License\n");
-    ui_printf("along with the Program.\n");
-    ui_printf("\n");
-    ui_printf("You may charge a fee for the physical act of transferring a copy, and\n");
-    ui_printf("you may at your option offer warranty protection in exchange for a fee.\n");
-    ui_printf("\n");
-    ui_printf("  2. You may modify your copy or copies of the Program or any portion\n");
-    ui_printf("of it, thus forming a work based on the Program, and copy and\n");
-    ui_printf("distribute such modifications or work under the terms of Section 1\n");
-    ui_printf("above, provided that you also meet all of these conditions:\n");
-    ui_printf("\n");
-    ui_printf("    a) You must cause the modified files to carry prominent notices\n");
-    ui_printf("    stating that you changed the files and the date of any change.\n");
-    ui_printf("\n");
-    ui_printf("    b) You must cause any work that you distribute or publish, that in\n");
-    ui_printf("    whole or in part contains or is derived from the Program or any\n");
-    ui_printf("    part thereof, to be licensed as a whole at no charge to all third\n");
-    ui_printf("    parties under the terms of this License.\n");
-    ui_printf("\n");
-    ui_printf("    c) If the modified program normally reads commands interactively\n");
-    ui_printf("    when run, you must cause it, when started running for such\n");
-    ui_printf("    interactive use in the most ordinary way, to print or display an\n");
-    ui_printf("    announcement including an appropriate copyright notice and a\n");
-    ui_printf("    notice that there is no warranty (or else, saying that you provide\n");
-    ui_printf("    a warranty) and that users may redistribute the program under\n");
-    ui_printf("    these conditions, and telling the user how to view a copy of this\n");
-    ui_printf("    License.  (Exception: if the Program itself is interactive but\n");
-    ui_printf("    does not normally print such an announcement, your work based on\n");
-    ui_printf("    the Program is not required to print an announcement.)\n");
-    ui_printf("\n");
-    ui_printf("These requirements apply to the modified work as a whole.  If\n");
-    ui_printf("identifiable sections of that work are not derived from the Program,\n");
-    ui_printf("and can be reasonably considered independent and separate works in\n");
-    ui_printf("themselves, then this License, and its terms, do not apply to those\n");
-    ui_printf("sections when you distribute them as separate works.  But when you\n");
-    ui_printf("distribute the same sections as part of a whole which is a work based\n");
-    ui_printf("on the Program, the distribution of the whole must be on the terms of\n");
-    ui_printf("this License, whose permissions for other licensees extend to the\n");
-    ui_printf("entire whole, and thus to each and every part regardless of who wrote it.\n");
-    ui_printf("\n");
-    ui_printf("Thus, it is not the intent of this section to claim rights or contest\n");
-    ui_printf("your rights to work written entirely by you; rather, the intent is to\n");
-    ui_printf("exercise the right to control the distribution of derivative or\n");
-    ui_printf("collective works based on the Program.\n");
-    ui_printf("\n");
-    ui_printf("In addition, mere aggregation of another work not based on the Program\n");
-    ui_printf("with the Program (or with a work based on the Program) on a volume of\n");
-    ui_printf("a storage or distribution medium does not bring the other work under\n");
-    ui_printf("the scope of this License.\n");
-    ui_printf("\n");
-    ui_printf("  3. You may copy and distribute the Program (or a work based on it,\n");
-    ui_printf("under Section 2) in object code or executable form under the terms of\n");
-    ui_printf("Sections 1 and 2 above provided that you also do one of the following:\n");
-    ui_printf("\n");
-    ui_printf("    a) Accompany it with the complete corresponding machine-readable\n");
-    ui_printf("    source code, which must be distributed under the terms of Sections\n");
-    ui_printf("    1 and 2 above on a medium customarily used for software interchange; or,\n");
-    ui_printf("\n");
-    ui_printf("    b) Accompany it with a written offer, valid for at least three\n");
-    ui_printf("    years, to give any third party, for a charge no more than your\n");
-    ui_printf("    cost of physically performing source distribution, a complete\n");
-    ui_printf("    machine-readable copy of the corresponding source code, to be\n");
-    ui_printf("    distributed under the terms of Sections 1 and 2 above on a medium\n");
-    ui_printf("    customarily used for software interchange; or,\n");
-    ui_printf("\n");
-    ui_printf("    c) Accompany it with the information you received as to the offer\n");
-    ui_printf("    to distribute corresponding source code.  (This alternative is\n");
-    ui_printf("    allowed only for noncommercial distribution and only if you\n");
-    ui_printf("    received the program in object code or executable form with such\n");
-    ui_printf("    an offer, in accord with Subsection b above.)\n");
-    ui_printf("\n");
-    ui_printf("The source code for a work means the preferred form of the work for\n");
-    ui_printf("making modifications to it.  For an executable work, complete source\n");
-    ui_printf("code means all the source code for all modules it contains, plus any\n");
-    ui_printf("associated interface definition files, plus the scripts used to\n");
-    ui_printf("control compilation and installation of the executable.  However, as a\n");
-    ui_printf("special exception, the source code distributed need not include\n");
-    ui_printf("anything that is normally distributed (in either source or binary\n");
-    ui_printf("form) with the major components (compiler, kernel, and so on) of the\n");
-    ui_printf("operating system on which the executable runs, unless that component\n");
-    ui_printf("itself accompanies the executable.\n");
-    ui_printf("\n");
-    ui_printf("If distribution of executable or object code is made by offering\n");
-    ui_printf("access to copy from a designated place, then offering equivalent\n");
-    ui_printf("access to copy the source code from the same place counts as\n");
-    ui_printf("distribution of the source code, even though third parties are not\n");
-    ui_printf("compelled to copy the source along with the object code.\n");
-    ui_printf("\n");
-    ui_printf("  4. You may not copy, modify, sublicense, or distribute the Program\n");
-    ui_printf("except as expressly provided under this License.  Any attempt\n");
-    ui_printf("otherwise to copy, modify, sublicense or distribute the Program is\n");
-    ui_printf("void, and will automatically terminate your rights under this License.\n");
-    ui_printf("However, parties who have received copies, or rights, from you under\n");
-    ui_printf("this License will not have their licenses terminated so long as such\n");
-    ui_printf("parties remain in full compliance.\n");
-    ui_printf("\n");
-    ui_printf("  5. You are not required to accept this License, since you have not\n");
-    ui_printf("signed it.  However, nothing else grants you permission to modify or\n");
-    ui_printf("distribute the Program or its derivative works.  These actions are\n");
-    ui_printf("prohibited by law if you do not accept this License.  Therefore, by\n");
-    ui_printf("modifying or distributing the Program (or any work based on the\n");
-    ui_printf("Program), you indicate your acceptance of this License to do so, and\n");
-    ui_printf("all its terms and conditions for copying, distributing or modifying\n");
-    ui_printf("the Program or works based on it.\n");
-    ui_printf("\n");
-    ui_printf("  6. Each time you redistribute the Program (or any work based on the\n");
-    ui_printf("Program), the recipient automatically receives a license from the\n");
-    ui_printf("original licensor to copy, distribute or modify the Program subject to\n");
-    ui_printf("these terms and conditions.  You may not impose any further\n");
-    ui_printf("restrictions on the recipients' exercise of the rights granted herein.\n");
-    ui_printf("You are not responsible for enforcing compliance by third parties to\n");
-    ui_printf("this License.\n");
-    ui_printf("\n");
-    ui_printf("  7. If, as a consequence of a court judgment or allegation of patent\n");
-    ui_printf("infringement or for any other reason (not limited to patent issues),\n");
-    ui_printf("conditions are imposed on you (whether by court order, agreement or\n");
-    ui_printf("otherwise) that contradict the conditions of this License, they do not\n");
-    ui_printf("excuse you from the conditions of this License.  If you cannot\n");
-    ui_printf("distribute so as to satisfy simultaneously your obligations under this\n");
-    ui_printf("License and any other pertinent obligations, then as a consequence you\n");
-    ui_printf("may not distribute the Program at all.  For example, if a patent\n");
-    ui_printf("license would not permit royalty-free redistribution of the Program by\n");
-    ui_printf("all those who receive copies directly or indirectly through you, then\n");
-    ui_printf("the only way you could satisfy both it and this License would be to\n");
-    ui_printf("refrain entirely from distribution of the Program.\n");
-    ui_printf("\n");
-    ui_printf("If any portion of this section is held invalid or unenforceable under\n");
-    ui_printf("any particular circumstance, the balance of the section is intended to\n");
-    ui_printf("apply and the section as a whole is intended to apply in other\n");
-    ui_printf("circumstances.\n");
-    ui_printf("\n");
-    ui_printf("It is not the purpose of this section to induce you to infringe any\n");
-    ui_printf("patents or other property right claims or to contest validity of any\n");
-    ui_printf("such claims; this section has the sole purpose of protecting the\n");
-    ui_printf("integrity of the free software distribution system, which is\n");
-    ui_printf("implemented by public license practices.  Many people have made\n");
-    ui_printf("generous contributions to the wide range of software distributed\n");
-    ui_printf("through that system in reliance on consistent application of that\n");
-    ui_printf("system; it is up to the author/donor to decide if he or she is willing\n");
-    ui_printf("to distribute software through any other system and a licensee cannot\n");
-    ui_printf("impose that choice.\n");
-    ui_printf("\n");
-    ui_printf("This section is intended to make thoroughly clear what is believed to\n");
-    ui_printf("be a consequence of the rest of this License.\n");
-    ui_printf("\n");
-    ui_printf("  8. If the distribution and/or use of the Program is restricted in\n");
-    ui_printf("certain countries either by patents or by copyrighted interfaces, the\n");
-    ui_printf("original copyright holder who places the Program under this License\n");
-    ui_printf("may add an explicit geographical distribution limitation excluding\n");
-    ui_printf("those countries, so that distribution is permitted only in or among\n");
-    ui_printf("countries not thus excluded.  In such case, this License incorporates\n");
-    ui_printf("the limitation as if written in the body of this License.\n");
-    ui_printf("\n");
-    ui_printf("  9. The Free Software Foundation may publish revised and/or new versions\n");
-    ui_printf("of the General Public License from time to time.  Such new versions will\n");
-    ui_printf("be similar in spirit to the present version, but may differ in detail to\n");
-    ui_printf("address new problems or concerns.\n");
-    ui_printf("\n");
-    ui_printf("Each version is given a distinguishing version number.  If the Program\n");
-    ui_printf("specifies a version number of this License which applies to it and \"any\n");
-    ui_printf("later version\", you have the option of following the terms and conditions\n");
-    ui_printf("either of that version or of any later version published by the Free\n");
-    ui_printf("Software Foundation.  If the Program does not specify a version number of\n");
-    ui_printf("this License, you may choose any version ever published by the Free Software\n");
-    ui_printf("Foundation.\n");
-    ui_printf("\n");
-    ui_printf("  10. If you wish to incorporate parts of the Program into other free\n");
-    ui_printf("programs whose distribution conditions are different, write to the author\n");
-    ui_printf("to ask for permission.  For software which is copyrighted by the Free\n");
-    ui_printf("Software Foundation, write to the Free Software Foundation; we sometimes\n");
-    ui_printf("make exceptions for this.  Our decision will be guided by the two goals\n");
-    ui_printf("of preserving the free status of all derivatives of our free software and\n");
-    ui_printf("of promoting the sharing and reuse of software generally.\n");
-    ui_printf("\n");
-    show_warranty();
-    ui_printf("		     END OF TERMS AND CONDITIONS\n");
-    ui_printf("\n");
-    ui_printf("	    How to Apply These Terms to Your New Programs\n");
-    ui_printf("\n");
-    ui_printf("  If you develop a new program, and you want it to be of the greatest\n");
-    ui_printf("possible use to the public, the best way to achieve this is to make it\n");
-    ui_printf("free software which everyone can redistribute and change under these terms.\n");
-    ui_printf("\n");
-    ui_printf("  To do so, attach the following notices to the program.  It is safest\n");
-    ui_printf("to attach them to the start of each source file to most effectively\n");
-    ui_printf("convey the exclusion of warranty; and each file should have at least\n");
-    ui_printf("the \"copyright\" line and a pointer to where the full notice is found.\n");
-    ui_printf("\n");
-    ui_printf("    <one line to give the program's name and a brief idea of what it does.>\n");
-    ui_printf("    Copyright (C) <year>  <name of author>\n");
-    ui_printf("\n");
-    ui_printf("    This program is free software; you can redistribute it and/or modify\n");
-    ui_printf("    it under the terms of the GNU General Public License as published by\n");
-    ui_printf("    the Free Software Foundation; either version 2 of the License, or\n");
-    ui_printf("    (at your option) any later version.\n");
-    ui_printf("\n");
-    ui_printf("    This program is distributed in the hope that it will be useful,\n");
-    ui_printf("    but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
-    ui_printf("    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n");
-    ui_printf("    GNU General Public License for more details.\n");
-    ui_printf("\n");
-    ui_printf("    You should have received a copy of the GNU General Public License\n");
-    ui_printf("    along with this program; if not, write to the Free Software\n");
-    ui_printf("    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n");
-    ui_printf("\n");
-    ui_printf("\n");
-    ui_printf("Also add information on how to contact you by electronic and paper mail.\n");
-    ui_printf("\n");
-    ui_printf("If the program is interactive, make it output a short notice like this\n");
-    ui_printf("when it starts in an interactive mode:\n");
-    ui_printf("\n");
-    ui_printf("    Gnomovision version 69, Copyright (C) year name of author\n");
-    ui_printf("    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n");
-    ui_printf("    This is free software, and you are welcome to redistribute it\n");
-    ui_printf("    under certain conditions; type `show c' for details.\n");
-    ui_printf("\n");
-    ui_printf("The hypothetical commands `show w' and `show c' should show the appropriate\n");
-    ui_printf("parts of the General Public License.  Of course, the commands you use may\n");
-    ui_printf("be called something other than `show w' and `show c'; they could even be\n");
-    ui_printf("mouse-clicks or menu items--whatever suits your program.\n");
-    ui_printf("\n");
-    ui_printf("You should also get your employer (if you work as a programmer) or your\n");
-    ui_printf("school, if any, to sign a \"copyright disclaimer\" for the program, if\n");
-    ui_printf("necessary.  Here is a sample; alter the names:\n");
-    ui_printf("\n");
-    ui_printf("  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n");
-    ui_printf("  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n");
-    ui_printf("\n");
-    ui_printf("  <signature of Ty Coon>, 1 April 1989\n");
-    ui_printf("  Ty Coon, President of Vice\n");
-    ui_printf("\n");
-    ui_printf("This General Public License does not permit incorporating your program into\n");
-    ui_printf("proprietary programs.  If your program is a subroutine library, you may\n");
-    ui_printf("consider it more useful to permit linking proprietary applications with the\n");
-    ui_printf("library.  If this is what you want to do, use the GNU Library General\n");
-    ui_printf("Public License instead of this License.\n");
-    ui_printf("\n");
-}
-
-static void show_version(const char *command_name)
-{
-    char *name = tools_extract_basename(command_name);
-    try
-    {
-	ui_printf("\n %s version %s, Copyright (C) 2002-2052 Denis Corbin\n\n",  name, dar_suite_version());
-
-#ifdef EA_SUPPORT
-	ui_printf(" Extended Attributes support: YES\n");
-#else
-	ui_printf(" Extended Attributes support:  NO\n");
-#endif
-#ifdef _FILE_OFFSET_BITS
-	ui_printf(" Large files support (> 2GB): YES\n");
-#else
-	ui_printf(" Large files support (> 2GB):  NO\n");
-#endif
-#ifdef NO_DUMP_FEATURE
-	ui_printf(" ext2fs NODUMP flag support : YES\n");
-#else
-	ui_printf(" ext2fs NODUMP flag support :  NO\n");
-#endif
-	ui_printf("\n");
-	ui_printf(" %s with %s version %s\n", __DATE__, CC_NAT, __VERSION__);
-	ui_printf(" %s comes with ABSOLUTELY NO WARRANTY; for details\n", name);
-	ui_printf(" type `%s -W'.  This is free software, and you are welcome\n", name);
-	ui_printf(" to redistribute it under certain conditions; type `%s -L | more'\n", name);
-	ui_printf(" for details.\n\n");
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
-
-static const struct option *get_long_opt()
-{
-    static const struct option ret[] = {
-	{"beep", no_argument, NULL, 'b' },
-	{"create", required_argument, NULL, 'c'},
-	{"diff", required_argument, NULL, 'd'},
-	{"help", no_argument, NULL, 'h'},
-	{"input", required_argument, NULL, 'i'},
-	{"no-deleted", no_argument, NULL, 'k'},
-	{"list", required_argument, NULL, 'l'},
-	{"no-overwrite", no_argument, NULL, 'n'},
-	{"output", required_argument, NULL, 'o'},
-	{"pause", no_argument, NULL, 'p'},
-	{"recent", no_argument, NULL, 'r'},
-	{"slice", required_argument, NULL, 's'},
-	{"test", required_argument, NULL, 't'},
-	{"no-user-EA", no_argument, NULL, 'u'},
-	{"verbose", no_argument, NULL, 'v'},
-	{"no-warn", no_argument, NULL, 'w'},
-	{"extract", required_argument, NULL, 'x'},
-	{"bzip2", optional_argument, NULL, 'y'},
-	{"gzip", optional_argument, NULL, 'z'},
-	{"ref", required_argument, NULL, 'A'},
-	{"isolate", required_argument, NULL, 'C'},
-	{"empty-dir", no_argument, NULL, 'D'},
-	{"include", required_argument, NULL, 'I'},
-	{"prune", required_argument, NULL, 'P'},
-	{"fs-root", required_argument, NULL, 'R'},
-	{"first-slice", required_argument, NULL, 'S'},
-	{"no-system-EA", no_argument, NULL, 'U'},
-	{"version", no_argument, NULL, 'V'},
-	{"exclude", required_argument, NULL, 'X'},
-	{"ignore-owner", no_argument, NULL, 'O'},
-	{"tree-format", no_argument, NULL, 'T'},
-	{"execute", required_argument, NULL, 'E'},
-	{"execute-ref",required_argument, NULL, 'F'},
-	{"key", required_argument, NULL, 'K'},
-	{"key-ref", required_argument, NULL, 'J'},
-	{"include-compression", required_argument, NULL, 'Y'},
-	{"exclude-compression", required_argument, NULL, 'Z'},
-	{"batch", required_argument, NULL, 'B'},
-	{"flat", no_argument, NULL, 'f'},
-	{"mincompr", required_argument, NULL, 'm'},
-	{"noconf", no_argument, NULL, 'N'},
-	{"nodump", no_argument, NULL, ' '},
-	{ NULL, 0, NULL, 0 }
-    };
-
-    return ret;
-}
-
-static void make_args_from_file(operation op, const char *filename, S_I & argc, char **&argv)
-{
-    vector <char> quotes;
-    vector <char *> mots;
-    vector <string> cibles;
-    argv = NULL;
-
-    S_I fd = open(filename, O_RDONLY);
-    if(fd < 0)
-	throw Erange("make_args_from_file", string("cannot open file ") + filename + " : " + strerror(errno));
-
-    fichier conf = fd; // the object conf will close fd
-
-	////////
-	// removing the comments from file
-	//
-    no_comment sousconf = conf;
-
-	////////
-	// defining the conditional syntax targets
-	// that will be considered in the file
-    cibles.clear();
-    cibles.push_back("all");
-    switch(op)
-    {
-    case noop:
-	cibles.push_back("default");
-	break;
-    case create:
-	cibles.push_back("create");
-	break;
-    case extract:
-	cibles.push_back("extract");
-	break;
-    case diff:
-	cibles.push_back("diff");
-	break;
-    case test:
-	cibles.push_back("test");
-	break;
-    case listing:
-	cibles.push_back("listing");
-	break;
-    case isolate:
-	cibles.push_back("isolate");
-	break;
-    default:
-	throw SRC_BUG;
-    }
-
-
-	//////
-	//  hide the targets we don't want to see
-	//  
-    config_file surconf = config_file(cibles, sousconf);
-
-	//////
-	//  now we have surconf -> sousconf -> conf -> fd
-	//  which makes the job to remove comments
-	//  and hide unwanted conditional statements on the fly
-	//  surconf can be used as a normal file.
-	// 
-
-    try
-    {
-	char a;
-	off_t start = 0;
-	off_t end = 0;
-	bool loop = true;
-
-	    // adding a fake "dar" word as first argument (= argv[0])
-	    //
-	const char *command = "dar";
-	char *pseudo_command = new char[strlen(command)+1];
-
-	if(pseudo_command == NULL)
-	    throw Ememory("make_args_from_file");
-	strncpy(pseudo_command, command, strlen(command));
-	pseudo_command[strlen(command)] = '\0';
-	mots.push_back(pseudo_command);
-
-
-	    // now parsing the file and cutting words
-	    // taking care of quotes
-	    //
-
-	while(loop)
-	{
-	    if(surconf.read(&a, 1) != 1) // reached end of file
-	    {
-		loop = false;
-		a = ' '; // to close the last word
-	    }
-
-	    if(quotes.size() == 0) // outside a word
-		switch(a)
-		{
-		case ' ':
-		case '\t':
-		case '\n':
-		case '\r':
-		    start++;
-		    break;
-		case '"':
-		case '\'':
-		case '`':
-		    quotes.push_back(a);
-		    end = start;
-		    start++;
-		    break;
-		default:
-		    quotes.push_back(' '); // the quote space means no quote
-		    end = start;
-		    break;
-		}
-	    else // inside a word
-		switch(a)
-		{
-		case '\t':
-		    if(quotes.back() != ' ')
-		    {
-			end++;
-			break;
-		    }
-			// no break !
-		case '\n':
-		case '\r':
-		    a = ' ';
-			// no break !
-		case ' ':
-		case '"':
-		case '\'':
-		case '`':
-		    if(a == quotes.back()) // "a" is an ending quote
-		    { 
-			quotes.pop_back();
-			if(quotes.size() == 0) // reached end of word
-			{
-			    mots.push_back(make_word(surconf, start, end));
-			    if(a != ' ') 
-				end++;  // skip the trailing quote
-			    if(! surconf.skip(end+1))
-				loop = false; // reached end of file
-			    start = end+1;
-			}
-			else 
-			    end++;
-		    }
-		    else // "a" is a nested starting quote
-		    {
-			if(a != ' ') // quote ' ' does not have ending quote
-			    quotes.push_back(a);
-			end++;
-		    }
-		    break;
-		default:
-		    end++;
-		}
-	}
-	if(quotes.size() > 0)
-	    throw Erange("make_args_from_file", string("Parse error reading config file ") + filename + " : Unmatched " + quotes.back());
-
-	argc = mots.size();
-	argv = new char *[argc];
-	if(argv == NULL)
-	    throw Ememory("make_args_from_file");
-	for(S_I i = 0; i < argc; i++)
-	    argv[i] = mots[i]; // copy of the address of each string
-    }
-    catch(...)
-    {
-	while(mots.size() > 0)
-	{
-	    delete mots.back();
-	    mots.pop_back();
-	}
-	throw;
-    }
-	// all (char *) addresses in "mots" are now known by argv, 
-	// thus they must be preserved.
-}
-
-
-static void destroy(S_I argc, char **argv)
-{
-    register S_I i = 0;
-    for(i = 0; i < argc; i++)
-	delete argv[i];
-    delete argv;
-}
-
-static char * make_word(generic_file &fic, off_t start, off_t end)
-{
-    off_t longueur = end - start + 1;
-    S_I lu = 0, tmp;
-    char *ret = new char[longueur+1];
-
-    if(ret == NULL)
-	throw Ememory("make_word");
-    try
-    {
-	if(! fic.skip(start))
-	    throw Erange("make_word", "End of file reached while skipping to the begin of a word");
-
-	do
-	{
-	    tmp = fic.read(ret+lu, longueur-lu);
-	    if(tmp > 0)
-		lu += tmp;
-	    else
-		if(tmp < 0)
-		    throw SRC_BUG;
-		else // tmp == 0
-		    throw Erange("make_word", "reached EOF while reading a word");
-	}
-	while(lu < longueur);
-	ret[longueur] = '\0';
-    }
-    catch(...)
-    {
-	delete ret;
-	throw;
-    }
-
-    return ret;
-}
-
-static void skip_getopt(S_I argc, char *argv[], S_I next_to_read)
-{
-    optind = 0; // reset getopt
-    while(getopt_long(argc, argv, OPT_STRING, get_long_opt(), NULL) != EOF && optind < next_to_read)
-	;
-}
-
-#ifdef DEBOGGAGE
-static void show_args(S_I argc, char *argv[])
-{
-    register S_I i;
-    for(i = 0; i < argc; i++)
-	ui_printf("[%s]\n", argv[i]);
-}
-#endif
-
-static void check_basename(const path & loc, string & base)
-{
-    regular_mask suspect = string(".\\.[1-9][0-9]*\\.")+EXTENSION;
-    string old_path = (loc+base).display();
-
-	// is basename is suspect ?
-    if(!suspect.is_covered(base))
-	return; // not a suspect basename
-
-	// is there a slice available ?
-    if(is_a_slice_available(old_path))
-	return; // yes, thus basename is not a mistake
-
-	// removing the suspicious end (.<number>.EXTENSION)
-	// and checking the avaibility of such a slice
-
-    string new_base = retreive_basename(base);
-    string new_path = (loc+new_base).display();
-    if(is_a_slice_available(new_path))
-    {
-	try
-	{
-	    user_interaction_pause(string("Warning, ") + base + " seems more to be a slice name than a base name. Do you want to replace it by " + new_base + " ?");
-	    base = new_base;
-	}
-	catch(Euser_abort & e)
-	{
-	    user_interaction_warning(string("OK, keeping ") + base + " as basename");
-	}
-    }
-}
-
-
-static bool is_a_slice_available(const string & base)
-{
-    char *name = tools_str2charptr(base);
-    path *chem = NULL;
-    bool ret = false;
-
-    try
-    {
-	char *char_chem = NULL;
-	string rest;
-
-	tools_split_path_basename(name, chem, rest);
-	char_chem = tools_str2charptr(chem->display());
-
-	try
-	{
-	    etage contents = char_chem;
-	    regular_mask slice = rest + "\\.[1-9][0-9]*\\."+ EXTENSION;
-
-	    while(!ret && contents.read(rest))
-		ret = slice.is_covered(rest);
-	}
-	catch(Erange & e)
-	{
-	    ret = false;
-	}
-	catch(...)
-	{
-	    delete char_chem;
-	    throw;
-	}
-	delete char_chem;
-    }
-    catch(...)
-    {
-	delete name;
-	if(chem != NULL)
-	    delete chem;
-	throw;
-    }
-    delete name;
-    if(chem != NULL)
-	delete chem;
-
-    return ret;
-}
-
-static string retreive_basename(const string & base)
-{
-    string new_base = base;
-    S_I index;
-
-    if(new_base.size() < 2+1+strlen(EXTENSION))
-	throw SRC_BUG; // must be a slice filename
-    index = new_base.find_last_not_of(string(".")+EXTENSION);
-    new_base = string(new_base.begin(), new_base.begin()+index);
-    index = new_base.find_last_not_of("0123456789");
-    new_base = string(new_base.begin(), new_base.begin()+index);
-
-    return new_base;
-}
-
-static bool update_with_config_files(const char * home,
-				     operation &op, 
-				     path * &fs_root, 
-				     path * &sauv_root, 
-				     path * &ref_root,
-				     infinint &file_size, 
-				     infinint &first_file_size,
-				     ou_mask & inclus, 
-				     ou_mask & exclus, 
-				     deque<string> & l_path_inclus, 
-				     deque<string> & l_path_exclus,
-				     string & filename, 
-				     string *& ref_filename,
-				     bool &allow_over, 
-				     bool &warn_over, 
-				     bool &info_details,
-				     compression &algo, 
-				     U_I & compression_level,
-				     bool &detruire, 
-				     bool &pause, 
-				     bool &beep, 
-				     bool &make_empty_dir, 
-				     bool & only_more_recent, 
-				     bool & ea_root, 
-				     bool & ea_user,
-				     string & input_pipe, 
-				     string &output_pipe,
-				     bool & ignore_owner, 
-				     string & execute, 
-				     string & execute_ref,
-				     string & pass, 
-				     string & pass_ref,
-				     ou_mask & compr_inclus, 
-				     ou_mask & compr_exclus,
-				     bool &tar_format,
-				     bool & flat,
-				     infinint & min_compr_size,
-				     bool & nodump)
-{
-    const unsigned int len = strlen(home);
-    const unsigned int delta = 20;
-    char *buffer = new char[len+delta+1];
-    enum { syntax, ok, unknown } retour = unknown;
-
-    if(buffer == NULL)
-	throw Ememory("command_line.cpp:update_with_config_files");
-
-    try
-    {
-	    // 20 bytes is enough for 
-	    // "/.darrc" and "/etc/darrc"
-	S_I rec_c = 0;
-	char **rec_v = NULL;
-	bool btmp = true;
-	
-	
-	    // trying to open $HOME/.darrc
-	strncpy(buffer, home, len+1); // +1 because of final '\0'
-	strncat(buffer, "/.darrc", delta);
-	
-	try
-	{
-	    make_args_from_file(op, buffer, rec_c, rec_v);
- 	    
-	    try
-	    {
-		vector<string> inclusions;
-		user_interaction_warning(string("Reading config file: ")+buffer);
-		optind = 0; // reset getopt call
-		
-		if(! get_args_recursive(inclusions, 
-					rec_c, rec_v, op, fs_root,
-					sauv_root, ref_root, 
-					file_size, first_file_size,
-					inclus, exclus,
-					l_path_inclus, 
-					l_path_exclus,
-					filename, ref_filename, 
-					allow_over, warn_over, 
-					info_details,
-					algo, compression_level, 
-					detruire, pause, 
-					beep, make_empty_dir,
-					only_more_recent, ea_root, 
-					ea_user,
-					input_pipe, output_pipe,
-					ignore_owner,
-					execute,
-					execute_ref,
-					pass, pass_ref,
-					compr_inclus, compr_exclus,
-					tar_format,
-					flat,
-					min_compr_size,
-					btmp, nodump))
-		    retour = syntax;
-		else
-		    retour = ok;
-	    }
-	    catch(...)
-	    {
-		if(rec_v != NULL)
-		    destroy(rec_c, rec_v);
-		throw;
-	    }
-	    if(rec_v != NULL)
-		destroy(rec_c, rec_v);
-	}
-	catch(Erange & e)
-	{
-		// failed openning the file,
-		// nothing to do,
-		// we will try the other config file
-		// below
-	}
-
-	
-	rec_c = 0;
-	rec_v = NULL;
-	
-	if(retour == unknown)
-	{
-		// trying to open /etc/darrc
-	    strncpy(buffer, "/etc/darrc", len+delta);
-	    
-	    try
-	    {
-		make_args_from_file(op, buffer, rec_c, rec_v);
-		try
-		{
-		    vector<string> inclusions;
-		    user_interaction_warning(string("Reading config file: ")+buffer);
-		    optind = 0; // reset getopt call
-		    
-		    if(! get_args_recursive(inclusions, 
-					    rec_c, rec_v, op, fs_root,
-					    sauv_root, ref_root, 
-					    file_size, first_file_size,
-					    inclus, exclus,
-					    l_path_inclus, 
-					    l_path_exclus,
-					    filename, ref_filename, 
-					    allow_over, warn_over, 
-					    info_details,
-					    algo, compression_level, 
-					    detruire, pause, 
-					    beep, make_empty_dir,
-					    only_more_recent, ea_root, 
-					    ea_user,
-					    input_pipe, output_pipe,
-					    ignore_owner,
-					    execute,
-					    execute_ref,
-					    pass, pass_ref,
-					    compr_inclus, compr_exclus,
-					    tar_format,
-					    flat,
-					    min_compr_size,
-					    btmp,
-					    nodump))
-			retour = syntax;
-		    else
-			retour = ok;
-		}
-		catch(...)
-		{
-		    if(rec_v != NULL)
-			destroy(rec_c, rec_v);
-		    throw;
-		}
-		if(rec_v != NULL)
-		    destroy(rec_c, rec_v);
-	    }
-	    catch(Erange & e)
-	    {
-		    // nothing to do
-	    }
-	}
-    }
-    catch(...)
-    {
-	delete buffer;
-	throw;
-    }
-    delete buffer;
-	
-    return retour != syntax;
-}
Index: dar/command_line.hpp
===================================================================
--- dar.orig/command_line.hpp	2012-05-02 11:23:23.199877545 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,62 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef COMMAND_LINE_HPP
-#define COMMAND_LINE_HPP
-
-#include <string>
-#include <vector>
-#include "infinint.hpp"
-#include "compressor.hpp"
-#include "mask.hpp"
-#include "path.hpp"
-
-using namespace std;
-
-enum operation { noop, extract, create, diff, test, listing, isolate };
-    // noop stands for no-operation. get_args() never returns such value,
-    // it is just necessary within the command_line module
-
-extern bool get_args(const char *home,
-		     S_I argc, char *argv[], operation &op, path * &fs_root, 
-		     path *&sauv_root, path *&ref_root, 
-		     infinint &file_size, infinint &first_file_size, 
-		     mask *&selection, mask *&subtree,
-		     string &filename, string *&ref_filename,
-		     bool &allow_over, bool &warn_over, bool &info_details,
-		     compression &algo, U_I & compression_level,
-		     bool &detruire, 
-		     bool &pause, bool &beep,
-		     bool & make_empty_dir, bool & only_more_recent, 
-		     bool & ea_root, bool & ea_user,
-		     string & input_pipe, string &output_pipe,
-		     bool &ignore_owner,
-		     string & execute, string & execute_ref,
-		     string & pass, string & pass_ref,
-		     mask *&compress_mask,
-		     bool & flat,
-		     infinint & min_compr_size,
-		     bool & nodump);
-    
-#endif
Index: dar/compressor.cpp
===================================================================
--- dar.orig/compressor.cpp	2012-05-02 11:23:23.303876718 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,434 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <signal.h>
-#include <pthread.h>
-#include "compressor.hpp"
-
-#define BUFFER_SIZE 102400
-
-compressor::compressor(compression algo, generic_file & compressed_side, U_I compression_level) : generic_file(compressed_side.get_mode())
-{
-    init(algo, &compressed_side, compression_level);
-    compressed_owner = false;
-}
-
-compressor::compressor(compression algo, generic_file *compressed_side, U_I compression_level) : generic_file(compressed_side->get_mode())
-{
-    init(algo, compressed_side, compression_level);
-    compressed_owner = true;
-}
-
-void compressor::init(compression algo, generic_file *compressed_side, U_I compression_level)
-{
-	// theses are eventually overwritten below
-    wrapperlib_mode wr_mode = zlib_mode;
-    current_algo = algo;
-
-    compr = decompr = NULL;
-    switch(algo)
-    {
-    case none :
-	read_ptr = &compressor::none_read;
-	write_ptr = &compressor::none_write;
-	break;
-    case zip :
-	throw Efeature("zip compression not implemented");
-	break;
-    case bzip2 :
-	wr_mode = bzlib_mode;
-	    // NO BREAK !
-    case gzip :
-	read_ptr = &compressor::gzip_read;
-	write_ptr = &compressor::gzip_write;
-	compr = new xfer(BUFFER_SIZE, wr_mode);
-	if(compr == NULL)
-	    throw Ememory("compressor::compressor");
-	decompr = new xfer(BUFFER_SIZE, wr_mode);
-	if(decompr == NULL)
-	{
-	    delete compr;
-	    throw Ememory("compressor::compressor");
-	}
-
-	if(compression_level > 9)
-	    throw SRC_BUG;
-	
-	switch(compr->wrap.compressInit(compression_level))
-	{
-	case WR_OK:
-	    break;
-	case WR_MEM_ERROR:
-	    delete compr;
-	    delete decompr;
-	    throw Ememory("compressor::compressor");
-	case WR_VERSION_ERROR:
-	    delete compr;
-	    delete decompr;
-	    throw Erange("compressor::compressor", "incompatible Zlib version");
-	case WR_STREAM_ERROR:
-	default:
-	    delete compr;
-	    delete decompr;
-	    throw SRC_BUG;
-	}
-
-	switch(decompr->wrap.decompressInit())
-	{
-	case WR_OK:
-	    decompr->wrap.set_avail_in(0);
-	    break;
-	case WR_MEM_ERROR:
-	    compr->wrap.compressEnd();
-	    delete compr;
-	    delete decompr;
-	    throw Ememory("compressor::compressor");
-	case WR_VERSION_ERROR:
-	    compr->wrap.compressEnd();
-	    delete compr;
-	    delete decompr;
-	    throw Erange("compressor::compressor", "incompatible Zlib version");
-	case WR_STREAM_ERROR:
-	default:
-	    compr->wrap.compressEnd();
-	    delete compr;
-	    delete decompr;
-	    throw SRC_BUG;
-	}
-	break;
-    default :
-	throw SRC_BUG;
-    }
-
-    compressed = compressed_side;
-}
-
-compressor::~compressor()
-{
-    terminate();
-    if(compressed_owner)
-	delete compressed;
-}
-
-void compressor::terminate()
-{
-    if(compr != NULL)
-    {
-	S_I ret;
-
-		// flushing the pending data
-	flush_write();
-	clean_write();
-
-	ret = compr->wrap.compressEnd();
-	delete compr;
-
-	switch(ret)
-	{
-	case WR_OK:
-	    break;
-	case WR_DATA_ERROR: // some data remains in the compression pipe (data loss)
-	    throw SRC_BUG;
-	case WR_STREAM_ERROR:
-	    throw Erange("compressor::~compressor", "compressed data is corrupted");
-	default :
-	    throw SRC_BUG;
-	}
-    }
-
-    if(decompr != NULL)
-    {
-	    // flushing data
-	flush_read();
-	clean_read();
-
-	S_I ret = decompr->wrap.decompressEnd();
-	delete decompr;
-
-	switch(ret)
-	{
-	case WR_OK:
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-}
-
-void compressor::change_algo(compression new_algo, U_I new_compression_level)
-{
-    if(new_algo == get_algo())
-	return;
-
-	// flush data and release zlib memory structures
-    terminate();
-
-	// change to new algorithm
-    init(new_algo, compressed, new_compression_level);
-}
-
-
-compressor::xfer::xfer(U_I sz, wrapperlib_mode mode) : wrap(mode)
-{
-    try 
-    {
-	buffer = new char[sz];
-	if(buffer == NULL)
-	    throw Ememory("");
-	size = sz;
-    }
-    catch(Ememory &e)
-    {
-	throw Ememory("compressor::xfer::xfer");
-    }
-}
-
-compressor::xfer::~xfer()
-{
-    delete buffer;
-}
-
-S_I compressor::none_read(char *a, size_t size)
-{
-    return compressed->read(a, size);
-}
-
-S_I compressor::none_write(char *a, size_t size)
-{
-    return compressed->write(a, size);
-}
-
-S_I compressor::gzip_read(char *a, size_t size)
-{
-    S_I ret;
-    S_I flag = WR_NO_FLUSH;
-
-    if(size == 0)
-	return 0;
-
-    decompr->wrap.set_next_out(a);
-    decompr->wrap.set_avail_out(size);
-  
-    do
-    {
-	    // feeding the input buffer if necessary
-	if(decompr->wrap.get_avail_in() == 0)
-	{
-	    decompr->wrap.set_next_in(decompr->buffer);
-	    decompr->wrap.set_avail_in(compressed->read(decompr->buffer, 
-							decompr->size));
-	}
-
-	ret = decompr->wrap.decompress(flag);
-
-	switch(ret)
-	{
-	case WR_OK:
-	case WR_STREAM_END:
-	    break;
-	case WR_DATA_ERROR:
-	    throw Erange("compressor::gzip_read", "compressed data CRC error");
-	case WR_MEM_ERROR:
-	    throw Ememory("compressor::gzip_read");
-	case WR_BUF_ERROR:
-		// no process is possible:
-	    if(decompr->wrap.get_avail_in() == 0) // because we reached EOF
-		ret = WR_STREAM_END; // lib did not returned WR_STREAM_END (why ?) 
-	    else // nothing explains why no process is possible:
-		if(decompr->wrap.get_avail_out() == 0)
-		    throw SRC_BUG; // bug from DAR: no output possible
-		else
-		    throw SRC_BUG; // unexpected comportment from lib
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-    while(decompr->wrap.get_avail_out() > 0 && ret != WR_STREAM_END);
-
-    return decompr->wrap.get_next_out() - a;
-}
-
-S_I compressor::gzip_write(char *a, size_t size)
-{
-    compr->wrap.set_next_in(a);
-    compr->wrap.set_avail_in(size);
-
-    if(a == NULL)
-	throw SRC_BUG;
-
-    while(compr->wrap.get_avail_in() > 0)
-    {
-	    // making room for output
-	compr->wrap.set_next_out(compr->buffer);
-	compr->wrap.set_avail_out(compr->size);
-
-	switch(compr->wrap.compress(WR_NO_FLUSH))
-	{
-	case WR_OK:
-	case WR_STREAM_END:
-	    break;
-	case WR_STREAM_ERROR:
-	    throw SRC_BUG;
-	case WR_BUF_ERROR:
-	    throw SRC_BUG;
-	default :
-	    throw SRC_BUG;
-	}
-
-	if(compr->wrap.get_next_out() != compr->buffer)
-	    compressed->write(compr->buffer, (char *)compr->wrap.get_next_out() - compr->buffer);
-    }
-
-    return size;
-}
-
-void compressor::flush_write()
-{
-    S_I ret;
-
-    if(compr != NULL && compr->wrap.get_total_in() != 0)  // (z/bz)lib
-    {
-	    // no more input
-	compr->wrap.set_avail_in(0);
-	do 
-	{
-		// setting the buffer for reception of data
-	    compr->wrap.set_next_out(compr->buffer);
-	    compr->wrap.set_avail_out(compr->size);
-
-	    ret = compr->wrap.compress(WR_FINISH);
-		
-	    switch(ret)
-	    {
-	    case WR_OK:
-	    case WR_STREAM_END:
-		if(compr->wrap.get_next_out() != compr->buffer)
-		    compressed->write(compr->buffer, (char *)compr->wrap.get_next_out() - compr->buffer);
-		break;
-	    case WR_BUF_ERROR :
-		throw SRC_BUG;
-	    case WR_STREAM_ERROR :
-		throw SRC_BUG;
-	    default :
-		throw SRC_BUG;
-	    }
-	}
-	while(ret != WR_STREAM_END);   
-
-	if(compr->wrap.compressReset() != WR_OK)
-	    throw SRC_BUG;
-    }
-}
-
-void compressor::flush_read()
-{
-    if(decompr != NULL) // zlib
-	if(decompr->wrap.decompressReset() != WR_OK)
-	    throw SRC_BUG;
-	// keep in the buffer the bytes already read, theses are discarded in case of a call to skip
-}
-
-void compressor::clean_read()
-{
-    if(decompr != NULL)
-	decompr->wrap.set_avail_in(0);
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void compressor::clean_write()
-{
-    if(compr != NULL)
-    {
-	S_I ret;
-
-	do
-	{
-	    compr->wrap.set_next_out(compr->buffer);
-	    compr->wrap.set_avail_out(compr->size);
-	    compr->wrap.set_avail_in(0);
-	    
-	    ret = compr->wrap.compress(WR_FINISH);
-	}
-	while(ret == WR_OK);
-    }
-}
-
-compression char2compression(char a)
-{
-    switch(a)
-    {
-    case 'n':
-	return none;
-    case 'p':
-	return zip;
-    case 'z':
-	return gzip;
-    case 'y':
-	return bzip2;
-    default :
-	throw Erange("char2compression", "unknown compression");
-    }
-}
-
-char compression2char(compression c)
-{
-    switch(c)
-    {
-    case none:
-	return 'n';
-    case zip:
-	return 'p';
-    case gzip:
-	return 'z';
-    case bzip2:
-	return 'y';
-    default :
-	throw Erange("char2compression", "unknown compression");
-    }
-}
-
-string compression2string(compression c)
-{
-    switch(c)
-    {
-    case none :
-	return "none";
-    case zip :
-	return "zip";
-    case gzip :
-	return "gzip";
-    case bzip2 :
-	return "bzip2";
-    default :
-	throw Erange("compresion2char", "unknown compression");
-    }
-}
Index: dar/compressor.hpp
===================================================================
--- dar.orig/compressor.hpp	2012-05-02 11:23:23.151876338 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,102 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef COMPRESSOR_HPP
-#define COMPRESSOR_HPP
-
-#pragma interface
-
-#include "generic_file.hpp"
-#include "integers.hpp"
-#include "wrapperlib.hpp"
-
-enum compression { none = 'n', zip = 'p', gzip = 'z', bzip2 = 'y' };
-
-extern compression char2compression(char a);
-extern char compression2char(compression c);
-extern string compression2string(compression c);
-
-class compressor : public generic_file
-{
-public :
-    compressor(compression algo, generic_file & compressed_side, U_I compression_level = 9);
-	// compressed_side is not owned by the object and will remains
-	// after the objet destruction
-    compressor(compression algo, generic_file *compressed_side, U_I compression_level = 9);
-	// compressed_side is owned by the object and will be 
-	// deleted a destructor time
-    ~compressor();
-    
-    void flush_write(); // flush all data to compressed_side, and reset the compressor 
-	// for that additional write can be uncompresssed starting at this point.
-    void flush_read(); // reset decompression engine to be able to read the next block of compressed data 
-	// if not called, furthur read return EOF
-    void clean_read(); // discard any byte buffered and not yet returned by read()
-    void clean_write(); // discard any byte buffered and not yet wrote to compressed_side;
-
-    compression get_algo() const { return current_algo; };
-    void change_algo(compression new_algo, U_I new_compression_level = 9);
-    
-	// inherited from generic file	 
-    bool skip(const infinint & position) { flush_write(); flush_read(); clean_read(); return compressed->skip(position); };
-    bool skip_to_eof()  { flush_write(); flush_read(); clean_read(); return compressed->skip_to_eof(); };
-    bool skip_relative(S_I x) { flush_write(); flush_read(); clean_read(); return compressed->skip_relative(x); };
-    infinint get_position() { return compressed->get_position(); };
-
-protected :
-    S_I inherited_read(char *a, size_t size) { return (this->*read_ptr)(a, size); };
-    S_I inherited_write(char *a, size_t size) { return (this->*write_ptr)(a, size); };
-
-private :
-    struct xfer 
-    {
-	wrapperlib wrap;
-	char *buffer;
-	U_I size;
-
-	xfer(U_I sz, wrapperlib_mode mode);
-	~xfer();
-    };
-    
-    xfer *compr, *decompr;
-    generic_file *compressed;
-    bool compressed_owner;
-    compression current_algo;
-
-    void init(compression algo, generic_file *compressed_side, U_I compression_level);
-    void terminate();
-    S_I (compressor::*read_ptr) (char *a, size_t size);
-    S_I none_read(char *a, size_t size);
-    S_I gzip_read(char *a, size_t size);
-	// S_I zip_read(char *a, size_t size);
-	// S_I bzip2_read(char *a, size_t size); // using gzip_read, same code thanks to wrapperlib
-    
-    S_I (compressor::*write_ptr) (char *a, size_t size);
-    S_I none_write(char *a, size_t size);
-    S_I gzip_write(char *a, size_t size);
-	// S_I zip_write(char *a, size_t size);
-	// S_I bzip2_write(char *a, size_t size); // using gzip_write, same code thanks to wrapperlib
-};
-
-#endif
Index: dar/config_file.cpp
===================================================================
--- dar.orig/config_file.cpp	2012-05-02 11:23:23.395876559 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,158 +0,0 @@
-//*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <ctype.h>
-#include "config_file.hpp"
-#include "tools.hpp"
-
-void config_file::fill_morceau()
-{
-    string read_target; 
-    partie tmp;
-    infinint last_offset = 0;
-    infinint first, last;	
-    enum { debut, fin } status = fin;
-
-	// we read any text put before the first condition
-    tmp.debut = 0;
-    tmp.offset = 0;
-    morceau.clear();
-
-    if(ref == NULL)
-	throw SRC_BUG;
-    ref->skip(0);
-	
-    while(find_next_target(*ref, first, read_target, last))
-    {
-	switch(status)
-	{
-	case fin:
-	    if(first < tmp.debut)
-		throw SRC_BUG; // first byte of the line where next target 
-		// resides is before where we started looking for new target ! 
-	    tmp.longueur = first - tmp.debut;
-	    last_offset += tmp.longueur;
-	    if(tmp.longueur > 0)
-		morceau.push_back(tmp);
-	    status = debut;
-		// no break !
-	case debut:
-	    if(tools_is_member(read_target, cibles))
-	    {
-		tmp.debut = last;
-		tmp.offset = last_offset;
-		status = fin;
-	    }
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-			
-    if(status == fin)
-    {
-	if(ref->get_position() < tmp.debut)
-	    throw SRC_BUG;
-	tmp.longueur = ref->get_position() - tmp.debut;
-	if(tmp.longueur > 0)
-	    morceau.push_back(tmp);
-    }
-}
-
-
-bool config_file::find_next_target(generic_file &f, infinint & debut, string & nature, infinint & fin)
-{
-    char a;
-    bool found = false;
-    enum { init, search, end, purge } status = init;
-    debut = f.get_position();
-
-
-    while(f.read(&a, 1) == 1 && !found)
-    {
-	switch(status)
-	{
-	case init:
-	    switch(a)
-	    {
-	    case ' ':
-	    case '\t':
-		break;
-	    case '\n':
-		debut = f.get_position();
-		break;
-	    default:
-		if(isalpha(a))
-		{
-		    nature = a;
-		    status = search;
-		}
-		else
-		    status = purge;
-	    }
-	    break;
-	case search:
-	    if(isalpha(a))
-		nature += a;
-	    else
-		if(a == ':')
-		    status = end;
-		else
-		    status = purge;
-	    break;
-	case end:
-	    switch(a)
-	    {
-	    case ' ':
-	    case '\t':
-	    case '\r':
-		break;
-	    case '\n':
-		fin = f.get_position();
-		found = true;
-		break;
-	    default:
-		status = purge;
-	    }
-	    break;
-	case purge:
-	    if(a == '\n')
-	    {
-		status = init;
-		debut = f.get_position();
-	    }
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-
-    return found;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
Index: dar/config_file.hpp
===================================================================
--- dar.orig/config_file.hpp	2012-05-02 11:23:23.463875916 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,47 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef CONFIG_FILE_HPP
-#define CONFIG_FILE_HPP
-
-
-#include "hide_file.hpp"
-#include <vector>
-
-class config_file : public hide_file
-{
-public:	
-    config_file(const vector<string> & target, generic_file &f) : hide_file(f) { cibles = target; };
-
-protected:
-    void fill_morceau();
-
-private:
-    vector<string> cibles;
-
-    bool find_next_target(generic_file &f, infinint & debut, string & nature, infinint & fin);
-};
-
-
-#endif
Index: dar/dar.cpp
===================================================================
--- dar.orig/dar.cpp	2012-05-02 11:23:23.195877080 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,834 +0,0 @@
-//*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <string>
-#include <iostream>
-#include "erreurs.hpp"
-#include "generic_file.hpp"
-#include "infinint.hpp"
-#include "path.hpp"
-#include "mask.hpp"
-#include "user_interaction.hpp"
-#include "terminateur.hpp"
-#include "compressor.hpp"
-#include "command_line.hpp"
-#include "catalogue.hpp"
-#include "sar.hpp"
-#include "filtre.hpp"
-#include "tools.hpp"
-#include "header.hpp"
-#include "header_version.hpp"
-#include "defile.hpp"
-#include "deci.hpp"
-#include "test_memory.hpp"
-#include "dar.hpp"
-#include "sar_tools.hpp"
-#include "dar_suite.hpp"
-#include "zapette.hpp"
-#include "tuyau.hpp"
-#include "scrambler.hpp"
-#include "macro_tools.hpp"
-#include "integers.hpp"
-
-using namespace std;
-
-static void op_create(const operation op, const path &fs_root, const path &sauv_path, 
-		      const path *ref_path,
-		      const mask &selection, const mask &subtree, 
-		      const string &filename, const string *ref_filename,
-		      bool allow_over, bool warn_over, bool info_details, 
-		      bool pause, bool empty_dir, compression algo, U_I compression_level,
-		      const infinint &file_size, 
-		      const infinint &first_file_size,
-		      S_I argc, const char *argv[],
-		      bool root_ea, bool user_ea,
-		      const string &input_pipe, const string &output_pipe,
-		      const string & execute, const string & execute_ref,
-		      const string & pass, const string & pass_ref,
-		      const mask &compr_mask,
-		      const infinint & min_compr_size,
-		      bool nodump);
-static void op_extract(const path &fs_root, const path &sauv_path,
-		       const mask &selection, const mask &subtree, 
-		       const string &filename, bool allow_over, bool warn_over, 
-		       bool info_details, bool detruire,
-		       bool only_more_recent, bool restore_ea_root, 
-		       bool restore_ea_user,
-		       const string &input_pipe, const string &output_pipe,
-		       const string & execute,
-		       const string & pass,
-		       bool flat,
-		       bool ignore_owner);
-static void op_diff(const path & fs_root, const path &sauv_path,
-		    const mask &selection, const mask &subtree,
-		    const string &filename, bool info_details,
-		    bool check_ea_root, bool check_ea_user,
-		    const string &input_pipe, const string &output_pipe,
-		    const string & execute,
-		    const string & pass);
-static void op_listing(const path &sauv_path, const string &filename, 
-		       bool info_details, bool tar_format,
-		       const string &input_pipe, const string &output_pipe,
-		       const string & execute,
-		       const string & pass,
-		       const mask &selection);
-static void op_test(const path &sauv_path, const mask &selection, 
-		    const mask &subtree, const string &filename, 
-		    bool info_details,
-		    const string &input_pipe, const string &output_pipe,
-		    const string & execute,
-		    const string & pass);
-static string make_string_from(S_I argc, const char *argv[]);
-static void display_sauv_stat(const statistics & st);
-static void display_rest_stat(const statistics & st);
-static void display_diff_stat(const statistics &st);
-static void display_test_stat(const statistics & st);
-static S_I little_main(S_I argc, char *argv[], const char **env);
-
-S_I main(S_I argc, char *argv[], const char **env)
-{
-    return dar_suite_global(argc, argv, env, &little_main);
-}
-
-static S_I little_main(S_I argc, char *argv[], const char **env)
-{
-    operation op;
-    path *fs_root;
-    path *sauv_root;
-    path *ref_root;
-    infinint file_size;
-    infinint first_file_size;
-    mask *selection, *subtree, *compr_mask;
-    string filename, *ref_filename;
-    bool allow_over, warn_over, info_details, detruire, pause, beep, empty_dir, only_more_recent, ea_user, ea_root;
-    compression algo;
-    U_I compression_level;
-    string input_pipe, output_pipe;
-    bool ignore_owner;
-    string execute, execute_ref;
-    string pass;
-    string pass_ref;
-    bool flat;
-    infinint min_compr_size;
-    const char *home = tools_get_from_env(env, "HOME");
-    bool nodump;
-
-    if(home == NULL)
-	home = "/";
-    if(! get_args(home, argc, argv, op, fs_root, sauv_root, ref_root,
-		  file_size, first_file_size, selection, 
-		  subtree, filename, ref_filename, 
-		  allow_over, warn_over, info_details, algo, 
-		  compression_level, detruire, 
-		  pause, beep, empty_dir, only_more_recent, 
-		  ea_root, ea_user,
-		  input_pipe, output_pipe, 
-		  ignore_owner,
-		  execute, execute_ref,
-		  pass, pass_ref,
-		  compr_mask,
-		  flat, min_compr_size, nodump))
-	return EXIT_SYNTAX;
-    else
-    {
-	MEM_IN;
-
-	user_interaction_set_beep(beep);
-	inode::set_ignore_owner(ignore_owner);
-
-	if(filename != "-"  || (output_pipe != "" && op != create && op != isolate))
-	    user_interaction_change_non_interactive_output(&cout);
-	    // standart output can be used to send non interactive
-	    // messages
-	
-	try
-	{
-            MEM_IN;
-	    switch(op)
-	    {
-	    case create:
-	    case isolate:
-		op_create(op, *fs_root, *sauv_root, ref_root, *selection, *subtree, filename, ref_filename, 
-			  allow_over, warn_over, info_details, pause, empty_dir, algo, compression_level, file_size, 
-			  first_file_size, argc, (const char **)argv, ea_root, ea_user, input_pipe, output_pipe,
-			  execute, execute_ref, pass, pass_ref, *compr_mask,
-			  min_compr_size, nodump);
-		break;
-	    case extract:
-		op_extract(*fs_root, *sauv_root, *selection, *subtree, filename, allow_over, warn_over,
-			   info_details, detruire, only_more_recent, ea_root, ea_user, input_pipe, output_pipe,
-			   execute, pass, flat, ignore_owner);
-		break;
-	    case diff:
-		op_diff(*fs_root, *sauv_root, *selection, *subtree, filename, info_details, ea_root, ea_user, 
-			input_pipe, output_pipe, execute, pass);
-		break;
-	    case test:
-		op_test(*sauv_root, *selection, *subtree, filename, info_details, input_pipe, output_pipe,
-			execute, pass);
-		break;
-	    case listing:
-		op_listing(*sauv_root, filename, info_details, only_more_recent, input_pipe, output_pipe,
-			   execute, pass, *selection);
-		    // only_more_recent is set to true when listing and -T (--tar-format) is asked
-		break;
-	    default:
-		throw SRC_BUG;
-	    }
-	    MEM_OUT;
-	}
-	catch(...)
-	{
-	    if(fs_root != NULL)
-		delete fs_root;
-	    if(sauv_root != NULL)
-		delete sauv_root;
-	    if(selection != NULL)
-		delete selection;
-	    if(subtree != NULL)
-		delete subtree;
-	    if(ref_root != NULL)
-		delete ref_root;
-	    if(ref_filename != NULL)
-		delete ref_filename;
-	    if(compr_mask != NULL)
-		delete compr_mask;
-	    throw;
-	}
-
-	MEM_OUT;
-
-	if(fs_root != NULL)
-	    delete fs_root;
-	if(sauv_root != NULL)
-	    delete sauv_root;
-	if(selection != NULL)
-	    delete selection;
-	if(subtree != NULL)
-	    delete subtree;
-	if(ref_root != NULL)
-	    delete ref_root;
-	if(ref_filename != NULL)
-	    delete ref_filename;
-	if(compr_mask != NULL)
-	    delete compr_mask;
-
-	return EXIT_OK;
-    }
-}
-
-static void op_create(const operation op, const path &fs_root, const path &sauv_path, const path *ref_path,
-		      const mask &selection, const mask &subtree, 
-		      const string &filename, const string *ref_filename,
-		      bool allow_over, bool warn_over, bool info_details, bool pause,
-		      bool empty_dir, compression algo, U_I compression_level,
-		      const infinint &file_size, 
-		      const infinint &first_file_size, 
-		      S_I argc, const char *argv[], bool root_ea, bool user_ea,
-		      const string &input_pipe, const string &output_pipe,
-		      const string & execute, const string & execute_ref,
-		      const string & pass, const string & pass_ref,
-		      const mask &compr_mask,
-		      const infinint & min_compr_size,
-		      bool nodump)
-{
-    MEM_IN;
-
-    try
-    {
-	terminateur coord;
-	catalogue current;
-	catalogue *ref = NULL;
-	generic_file *decoupe = NULL;
-	compressor *zip = NULL;
-	scrambler *scram = NULL;
-	S_I sar_opt = 0;
-	generic_file *zip_base = NULL;
-
-/*
-
-	if(op == create && sauv_path.is_subdir_of(fs_root)
-	   && selection.is_covered(filename+".1."+EXTENSION)
-	   && subtree.is_covered((sauv_path + (filename+".1."+EXTENSION)).display()))
-	    user_interaction_pause(string("WARNING! The archive is located in the directory to backup, this may create an endless loop when the archive will try to save itself. You can either add -X \"")+ filename + ".*." + EXTENSION +"\" on the command line, or change the location of the archive (see -h for help). Do you really want to continue?");
-*/
-	    // building the reference catalogue
-	if(ref_filename != NULL) // from a existing archive
-	{
-	    generic_file *tmp = NULL;
-	    scrambler *scram_ref = NULL;
-	    header_version v;
-
-	    if(ref_path == NULL)
-		throw SRC_BUG; // ref_filename != NULL but ref_path == NULL;
-	    try
-	    {
-		infinint tmp2;
-
-		macro_tools_open_archive(*ref_path, *ref_filename, EXTENSION, SAR_OPT_DONT_ERASE, pass_ref, tmp, scram_ref, zip, v, input_pipe, output_pipe, execute_ref);
-		ref = macro_tools_get_catalogue_from(*tmp, *zip, info_details, tmp2);
-	    }
-	    catch(...)
-	    {
-		if(zip != NULL)
-		    delete zip;
-		if(scram_ref != NULL)
-		    delete scram_ref;
-		if(tmp != NULL)
-		    delete tmp;
-		throw;
-	    }
-	    if(zip != NULL)
-		delete zip;
-	    if(scram_ref != NULL)
-		delete scram_ref;
-	    if(tmp != NULL)
-		delete tmp;
-	    zip = NULL;
-	}
-	else // building reference catalogue from scratch (empty catalogue)
-	    ref = new catalogue();
-
-	if(ref == NULL)
-	    throw Ememory("op_create");
-	try
-	{
-	    statistics st;
-	    header_version ver;
-
-	    if(allow_over)
-		sar_opt &= ~SAR_OPT_DONT_ERASE;
-	    else
-		sar_opt |= SAR_OPT_DONT_ERASE;
-	    if(warn_over)
-		sar_opt |= SAR_OPT_WARN_OVERWRITE;
-	    else
-		sar_opt &= ~SAR_OPT_WARN_OVERWRITE;
-	    if(pause)
-		sar_opt |= SAR_OPT_PAUSE;
-	    else
-		sar_opt &= ~SAR_OPT_PAUSE;
-	    if(pause && ref_path != NULL && *ref_path == sauv_path)
-		user_interaction_pause("Ready to start writing the archive? ");
-	    
-	    if(file_size == 0) // one SLICE
-		if(filename == "-") // output to stdout
-		    decoupe = sar_tools_open_archive_tuyau(1, gf_write_only); //archive goes to stdout
-		else
-		    decoupe = sar_tools_open_archive_fichier((sauv_path + sar_make_filename(filename, 1, EXTENSION)).display(), allow_over, warn_over);
-	    else
-		decoupe = new sar(filename, EXTENSION, file_size, first_file_size, sar_opt, sauv_path, execute);
-		
-	    if(decoupe == NULL)
-		throw Ememory("op_create");
-
-	    version_copy(ver.edition, macro_tools_supported_version);
-	    ver.algo_zip = compression2char(algo);
-	    ver.cmd_line = make_string_from(argc-1, argv+1); // argv[0] is the command itself, we don't need it (where from `+1')
-	    ver.flag = 0;
-	    if(root_ea)
-		ver.flag |= VERSION_FLAG_SAVED_EA_ROOT;
-	    if(user_ea)
-		ver.flag |= VERSION_FLAG_SAVED_EA_USER;
-	    if(pass != "")
-		ver.flag |= VERSION_FLAG_SCRAMBLED;
-	    ver.write(*decoupe);
-
-	    if(pass != "")
-	    {
-		scram = new scrambler(pass, *decoupe);
-		if(scram == NULL)
-		    throw Ememory("op_create");
-		zip_base = scram;
-	    }
-	    else
-		zip_base = decoupe;
-
-
-	    zip = new compressor(algo, *zip_base, compression_level);
-	    if(zip == NULL)
-		throw Ememory("op_create");
-
-	    switch(op)
-	    {
-	    case create:
-		filtre_sauvegarde(selection, subtree, zip, current, *ref, fs_root, info_details, st, empty_dir, root_ea, user_ea, compr_mask, min_compr_size, nodump);
-		break;
-	    case isolate:
-		st.clear(); // used for not to have Edata exception thrown at the final checkpoint
-		filtre_isolate(current, *ref, info_details);
-		break;
-	    default:
-		throw SRC_BUG; // op_create must only be called for creation or isolation
-	    }
-
-	    zip->flush_write();
-	    coord.set_catalogue_start(zip->get_position());
-	    if(ref_filename != NULL && op == create)
-	    {
-		if(info_details)
-		    user_interaction_warning("Adding reference to files that have been destroyed since reference backup...");
-		st.deleted = current.update_destroyed_with(*ref);
-	    }
-
-		// making some place in memory
-	    if(ref != NULL) 
-	    {
-		delete ref;
-		ref = NULL;
-	    }
-
-	    if(info_details)
-		user_interaction_warning("Writing archive contents...");
-	    current.dump(*zip);
-	    zip->flush_write();
-	    delete zip; 
-	    zip = NULL;
-	    if(scram != NULL)
-	    {
-		delete scram;
-		scram = NULL;
-	    }
-	    coord.dump(*decoupe);
-	    delete decoupe;
-	    decoupe = NULL;
-	    if(op == create)
-		display_sauv_stat(st);
-
-		// final checkpoint:
-	    if(st.errored > 0) // st is not used for isolation
-		throw Edata("some file could not be saved");
-	}
-	catch(...)
-	{
-	    if(ref != NULL)
-		delete ref;
-	    if(zip != NULL)
-	    {
-		zip->clean_write();
-		delete zip;
-	    }
-	    if(scram != NULL)
-		delete scram;
-	    if(decoupe != NULL)
-		delete decoupe;
-	    throw;
-	}
-    }
-    catch(Erange &e)
-    {
-	string msg = string("error while saving data: ") + e.get_message();
-	user_interaction_warning(msg);
-	throw Edata(msg);
-    }
-
-    MEM_OUT;
-}
-
-static void op_extract(const path &fs_root, const path &sauv_path,
-		       const mask &selection, const mask &subtree, 
-		       const string &filename, bool allow_over, bool warn_over, 
-		       bool info_details,  bool detruire, 
-		       bool only_more_recent, bool restore_ea_root, 
-		       bool restore_ea_user,
-		       const string &input_pipe, const string &output_pipe,
-		       const string & execute,
-		       const string & pass,
-		       bool flat, bool ignore_owner)
-{
-    try
-    {
-	generic_file *decoupe = NULL;
-	compressor *zip = NULL;
-	scrambler *scram = NULL;
-	header_version ver;
-
-	try
-	{
-	    infinint tmp;
-
-	    macro_tools_open_archive(sauv_path, filename, EXTENSION, SAR_OPT_DEFAULT, pass, decoupe, scram, zip, ver, input_pipe, output_pipe, execute);
-	    if((ver.flag & VERSION_FLAG_SAVED_EA_ROOT) == 0)
-		restore_ea_root = false; // not restoring something not saved
-	    if((ver.flag & VERSION_FLAG_SAVED_EA_USER) == 0)
-		restore_ea_user = false; // not restoring something not saved
-	    
-	    catalogue *cat = macro_tools_get_catalogue_from(*decoupe, *zip, info_details, tmp);
-	    try
-	    {
-		statistics st;
-		MEM_IN;
-		filtre_restore(selection, subtree, *cat, detruire, 
-			       fs_root, allow_over, warn_over, info_details,
-			       st, only_more_recent, restore_ea_root,
-			       restore_ea_user, flat, ignore_owner);
-		MEM_OUT;
-		display_rest_stat(st);
-		if(st.errored > 0)
-		    throw Edata("all file asked could not be restored");
-	    }
-	    catch(...)
-	    {
-		delete cat;
-		throw;
-	    }
-	    delete cat;
-	}
-	catch(...)
-	{
-	    if(zip != NULL)
-		delete zip;	    
-	    if(scram != NULL)
-		delete scram;
-	    if(decoupe != NULL)
-		delete decoupe;
-	    throw;
-	}
-	if(zip != NULL)
-	    delete zip;	    
-	if(scram != NULL)
-	    delete scram;
-	if(decoupe != NULL)
-	    delete decoupe;
-    }
-    catch(Erange &e)
-    {
-	string msg = string("error while restoring data: ") + e.get_message();
-	user_interaction_warning(msg);
-	throw Edata(msg);
-    }
-}
-
-static void op_listing(const path &sauv_path, const string &filename, 
-		       bool info_details, bool tar_format,  
-		       const string &input_pipe, const string &output_pipe,
-		       const string & execute,
-		       const string & pass,
-		       const mask &selection)
-{
-    try
-    {
-	generic_file *decoupe = NULL;
-	compressor *zip = NULL;
-	scrambler *scram = NULL;
-	header_version ver;
-
-	MEM_IN;	
-	try
-	{
-	    infinint cat_size;
-
-	    macro_tools_open_archive(sauv_path, filename, EXTENSION, SAR_OPT_DEFAULT, pass, decoupe, scram, zip, ver, input_pipe, output_pipe, execute);
- 
-	    catalogue *cat = macro_tools_get_catalogue_from(*decoupe, *zip, info_details, cat_size);
-	    try
-	    {
-		if(info_details)
-		{
-		    sar *real_decoupe = dynamic_cast<sar *>(decoupe);
-		    infinint sub_file_size;
-		    infinint first_file_size;
-		    infinint last_file_size, file_number;
-		    
-		    user_interaction_stream() << "Archive version format               : " << ver.edition << endl;
-		    user_interaction_stream() << "Compression algorithm used           : " << compression2string(char2compression(ver.algo_zip)) << endl;
-		    user_interaction_stream() << "Scrambling                           : " << ((ver.flag & VERSION_FLAG_SCRAMBLED) != 0 ? "yes" : "no") << endl;
-		    user_interaction_stream() << "Catalogue size in archive            : " << deci(cat_size).human() << " bytes" << endl;
-		    user_interaction_stream() << "Command line options used for backup : " << ver.cmd_line << endl;
-		    
-		    if(real_decoupe != NULL)
-		    {
-			infinint sub_file_size = real_decoupe->get_sub_file_size();
-			infinint first_file_size = real_decoupe->get_first_sub_file_size();
-			if(real_decoupe->get_total_file_number(file_number) 
-			   && real_decoupe->get_last_file_size(last_file_size))
-			{
-			    user_interaction_stream() << "Archive is composed of " << file_number << " file" << endl;
-			    if(file_number == 1)
-				user_interaction_stream() << "File size: " <<  last_file_size << " bytes" << endl;
-			    else
-			    {
-				if(first_file_size != sub_file_size)
-				    user_interaction_stream() << "First file size       : " << first_file_size << " bytes" << endl;
-				user_interaction_stream() << "File size             : " << sub_file_size << " bytes" << endl;
-				user_interaction_stream() << "Last file size        : " << last_file_size << " bytes" << endl;
-			    }
-			    if(file_number > 1)
-				user_interaction_stream() << "Archive total size is : " << (first_file_size + (file_number-2)*sub_file_size + last_file_size ) << " bytes" << endl;
-			}
-			else // could not read size parameters
-			    user_interaction_stream() << "Sorry, file size is unknown at this step of the program." << endl;
-		    }
-		    else // not reading from a sar
-		    {
-			decoupe->skip_to_eof();
-			user_interaction_stream() << "Archive size is: " << decoupe->get_position() << " bytes" << endl;
-			user_interaction_stream() << "Previous archive size does not include headers present in each slice" << endl;
-		    }
-		    
-		    entree_stats stats = cat->get_stats();
-		    stats.listing(user_interaction_stream());
-		    user_interaction_pause("Continue listing archive contents?");
-		}
-		if(tar_format)
-		    cat->tar_listing(user_interaction_stream(), selection);
-		else
-		    cat->listing(user_interaction_stream(), selection);
-	    }
-	    catch(...)
-	    {
-		delete cat;
-		throw;
-	    }
-	    delete cat;
-	}
-	catch(...)
-	{
-	    if(zip != NULL)
-		delete zip;
-	    if(scram != NULL)
-		delete scram;
-	    if(decoupe != NULL)
-		delete decoupe;
-	    throw;
-	}
-	if(zip != NULL)
-	    delete zip;
-	if(scram != NULL)
-	    delete scram;
-	if(decoupe != NULL)
-	    delete decoupe;
-	MEM_OUT;
-    }
-    catch(Erange &e)
-    {
-	string msg = string("error while listing archive contents: ") + e.get_message();
-	user_interaction_warning(msg);
-	throw Edata(msg);
-    }
-}
-
-static void op_diff(const path & fs_root, const path &sauv_path,
-		    const mask &selection, const mask &subtree,
-		    const string &filename, bool info_details,
-		    bool check_ea_root, bool check_ea_user,
-		    const string &input_pipe, const string &output_pipe,
-		    const string & execute,
-		    const string & pass)
-{
-    MEM_IN;
-    try
-    {
-	generic_file *decoupe = NULL;
-	scrambler *scram = NULL;
-	compressor *zip = NULL;
-	header_version ver;
-	catalogue *cat = NULL;
-	
-	try
-	{
-	    infinint cat_size;
-	    statistics st;
-	    
-	    macro_tools_open_archive(sauv_path, filename, EXTENSION, SAR_OPT_DEFAULT, pass, decoupe, scram, zip, ver, input_pipe, output_pipe, execute);
-	    cat = macro_tools_get_catalogue_from(*decoupe, *zip, info_details, cat_size);
-	    filtre_difference(selection, subtree, *cat, fs_root, info_details, st, check_ea_root, check_ea_user);
-	    display_diff_stat(st);
-	    if(st.errored > 0 || st.deleted > 0)
-		throw Edata("some file comparisons failed");
-	}
-	catch(...)
-	{
-	    if(cat != NULL)
-		delete cat;
-	    if(zip != NULL)
-		delete zip;
-	    if(scram != NULL)
-		delete scram;
-	    if(decoupe != NULL)
-		delete decoupe;
-	    throw;
-	}
-	if(cat != NULL)
-	    delete cat;
-	if(zip != NULL)
-	    delete zip;
-	if(scram != NULL)
-	    delete scram;
-	if(decoupe != NULL)
-	    delete decoupe;
-    }
-    catch(Erange & e)
-    {
-	string msg = string("error while comparing archive with filesystem: ")+e.get_message();
-	user_interaction_warning(msg);
-	throw Edata(msg);
-    }
-    MEM_OUT;
-}
-
-
-static void op_test(const path &sauv_path, const mask &selection, 
-		    const mask &subtree, const string &filename, 
-		    bool info_details,
-		    const string &input_pipe, const string &output_pipe,
-		    const string & execute,
-		    const string & pass)
-{
-    MEM_IN;
-    try
-    {
-	generic_file *decoupe = NULL;
-	scrambler *scram = NULL;
-	compressor *zip = NULL;
-	header_version ver;
-	catalogue *cat = NULL;
-	
-	try
-	{
-	    infinint cat_size;
-	    statistics st;
-	    
-	    macro_tools_open_archive(sauv_path, filename, EXTENSION, SAR_OPT_DEFAULT, pass, decoupe, scram, zip, ver, input_pipe, output_pipe, execute);
-	    cat = macro_tools_get_catalogue_from(*decoupe, *zip, info_details, cat_size);
-	    filtre_test(selection, subtree, *cat, info_details, st);
-	    display_test_stat(st);
-	    if(st.errored > 0)
-		throw Edata("some files are corrupted in the archive and it will not be possible to restore them");
-	}
-	catch(...)
-	{
-	    if(cat != NULL)
-		delete cat;
-	    if(zip != NULL)
-		delete zip;
-	    if(scram != NULL)
-		delete scram;
-	    if(decoupe != NULL)
-		delete decoupe;
-	    throw;
-	}
-	if(cat != NULL)
-	    delete cat;
-	if(zip != NULL)
-	    delete zip;
-	if(scram != NULL)
-	    delete scram;
-	if(decoupe != NULL)
-	    delete decoupe;
-    }
-    catch(Erange & e)
-    {
-	string msg = string("error while testing archive: ")+e.get_message();
-	user_interaction_warning(msg);
-	throw Edata(msg);
-    }
-    MEM_OUT;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-
-static void display_sauv_stat(const statistics & st)
-{
-    user_interaction_stream() << endl << endl << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " " << st.treated << " inode(s) saved" << endl;
-    user_interaction_stream() << " with " << st.hard_links << " hard link(s) recorded" << endl;
-    user_interaction_stream() << " " << st.skipped << " inode(s) not saved (no file change)" << endl;
-    user_interaction_stream() << " " << st.errored << " inode(s) failed to save (filesystem error)" << endl;
-    user_interaction_stream() << " " << st.ignored << " files(s) ignored (excluded by filters)" << endl;
-    user_interaction_stream() << " " << st.deleted << " files(s) recorded as deleted from reference backup" << endl;
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " Total number of file considered: " << st.total() << endl;
-#ifdef EA_SUPPORT
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " EA saved for " << st.ea_treated << " file(s)" << endl;
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-#endif
-}
-
-static void display_rest_stat(const statistics & st)
-{
-
-    user_interaction_stream() << endl << endl << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " " << st.treated << " file(s) restored" << endl;
-    user_interaction_stream() << " " << st.skipped << " file(s) not restored (not saved in archive)" << endl;
-    user_interaction_stream() << " " << st.ignored << " file(s) ignored (excluded by filters)" << endl;
-    user_interaction_stream() << " " << st.tooold  << " file(s) less recent than the one on filesystem" << endl;
-    user_interaction_stream() << " " << st.errored << " file(s) failed to restore (filesystem error)" << endl;
-    user_interaction_stream() << " " << st.deleted << " file(s) deleted" << endl;
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " Total number of file considered: " << st.total() << endl;
-#ifdef EA_SUPPORT
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " EA restored for " << st.ea_treated << " file(s)" << endl;
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-#endif
-}
-
-static void display_diff_stat(const statistics &st)
-{
-    user_interaction_stream() << endl;
-    user_interaction_stream() << " " << st.errored << " file(s) do not match those on filesystem" << endl;
-    user_interaction_stream() << " " << st.deleted << " file(s) failed to be read" << endl;
-    user_interaction_stream() << " " << st.ignored << " file(s) ignored (excluded by filters)" << endl;
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " Total number of file considered: " << st.total() << endl;
-}
-
-static void display_test_stat(const statistics & st)
-{
-    user_interaction_stream() << endl;
-    user_interaction_stream() << " " << st.errored << " file(s) with error" << endl;
-    user_interaction_stream() << " " << st.ignored << " file(s) ignored (excluded by filters)" << endl;
-    user_interaction_stream() << " -------------------------------------------- " << endl;
-    user_interaction_stream() << " Total number of file considered: " << st.total() << endl;
-}
-
-static string make_string_from(S_I argc, const char *argv[])
-{
-    string ret = "";
-    S_I i;
-    bool hide = false;
-
-    for(i = 0; i < argc; i++)
-    {
-	if(!hide)
-	    ret += argv[i];
-	else
-	{
-	    ret += "...";
-	    hide = false;
-	}
-	if(strcmp(argv[i], "-K") == 0 || strcmp(argv[i], "-J") == 0)
-	    hide = true;
-	ret += " ";
-    }
-
-    return ret;
-}
Index: dar/dar.hpp
===================================================================
--- dar.orig/dar.hpp	2012-05-02 11:23:22.999876322 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,31 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef DAR_HPP
-#define DAR_HPP
-
-// nothing
-
-#endif
-
Index: dar/dar_manager.cpp
===================================================================
--- dar.orig/dar_manager.cpp	2012-05-02 11:23:23.259874690 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,672 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <getopt.h>
-#include <vector>
-#include <string>
-#include "dar_suite.hpp"
-#include "database_header.hpp"
-#include "macro_tools.hpp"
-#include "data_tree.hpp"
-#include "database.hpp"
-#include "test_memory.hpp"
-#include "user_interaction.hpp"
-#include "integers.hpp"
-
-#define DAR_MANAGER_VERSION "1.0.0_dev"
-
-enum operation { none_op, create, add, listing, del, chbase, where, options, dar, restore, used, files, stats, move };
-
-static S_I little_main(S_I argc, char *argv[], const char **env);
-static bool command_line(S_I argc, char *argv[], 
-			 operation & op, 
-			 string & base, 
-			 string & arg, 
-			 archive_num & num, 
-			 vector<string> & rest,
-			 archive_num & num2);
-static void show_usage(const char *command);
-static void show_version(const char *command);
-static const struct option *get_long_opt();
-static void op_create(const string & base);
-static void op_add(const string & base, const string &arg, string fake);
-static void op_listing(const string & base);
-static void op_del(const string & base, archive_num num);
-static void op_chbase(const string & base, archive_num num, const string & arg);
-static void op_where(const string & base, archive_num num, const string & arg);
-static void op_options(const string & base, const vector<string> & rest);
-static void op_dar(const string & base, const string & arg);
-static void op_restore(const string & base, const vector<string> & rest);
-static void op_used(const string & base, archive_num num);
-static void op_files(const string & base, const string & arg);
-static void op_stats(const string & base);
-static void op_move(const string & base, archive_num src, archive_num dst);
-
-static database *read_base(const string & base);
-static void write_base(const string & filename, const database *base, bool overwrite);
-
-S_I main(S_I argc, char *argv[], const char **env)
-{
-    return dar_suite_global(argc, argv, env, &little_main);
-}
-
-S_I little_main(S_I argc, char *argv[], const char **env)
-{
-    operation op;
-    string base;
-    string arg;
-    archive_num num, num2;
-    vector<string> rest;
-
-    if(!command_line(argc, argv, op, base, arg, num, rest, num2))
-	return EXIT_SYNTAX;
-    MEM_IN;
-    switch(op)
-    {
-    case none_op:
-	throw SRC_BUG;
-    case create:
-	op_create(base);
-	break;
-    case add:
-	op_add(base, arg, rest.size() > 0 ? rest[0] : "");
-	break;
-    case listing:
-	op_listing(base);
-	break;
-    case del:
-	op_del(base, num);
-	break;
-    case chbase:
-	op_chbase(base, num, arg);
-	break;
-    case where:
-	op_where(base, num, arg);
-	break;
-    case options:
-	op_options(base, rest);
-	break;
-    case dar:
-	op_dar(base, arg);
-	break;
-    case restore:
-	op_restore(base, rest);
-	break;
-    case used:
-	op_used(base, num);
-	break;
-    case files:
-	op_files(base, arg);
-	break;
-    case stats:
-	op_stats(base);
-	break;
-    case move:
-	op_move(base, num, num2);
-	break;
-    default:
-	throw SRC_BUG;
-    }
-    MEM_OUT;
-    return EXIT_OK;
-}
-
-static bool command_line(S_I argc, char *argv[], 
-			 operation & op, 
-			 string & base, 
-			 string & arg, 
-			 archive_num & num, 
-			 vector<string> & rest,
-			 archive_num & num2)
-{
-    S_I lu;
-
-    base = arg = "";
-    num = num2 = 0;
-    rest.clear();
-    op = none_op;
-
-    while((lu = getopt_long(argc, argv, "C:B:A:lD:b:p:od:ru:f:shVm:", get_long_opt(), NULL)) != EOF)
-    {
-	switch(lu)
-	{
-	case 'C':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = create;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -C");
-	    base = optarg;
-	    break;
-	case 'B':
-	    if(base != "")
-		throw Erange("command_line", "only one -B option on command line is allowed");
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -B");
-	    base = optarg;
-	    break;
-	case 'A':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = add;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -A");
-	    arg = optarg;
-	    break;
-	case 'l':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = listing;
-	    break;
-	case 'D':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = del;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -D");
-	    num = atoi(optarg);
-	    break;
-	case 'b':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = chbase;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -b");
-	    num = atoi(optarg);
-	    break;
-	case 'p':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = where;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -p");
-	    num = atoi(optarg);
-	    break;
-	case 'o':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = options;
-	    break;
-	case 'd':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = dar;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -d");
-	    arg = optarg;
-	    break;
-	case 'r':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = restore;
-	    break;
-	case 'u':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = used;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -u");
-	    num = atoi(optarg);
-	    break;
-	case 'f':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = files;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -p");
-	    arg = optarg;
-	    break;
-	case 's':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = stats;
-	    break;
-	case 'm':
-	    if(op != none_op)
-		throw Erange("command_line", "only one action is allowed at a time");
-	    op = move;
-	    if(optarg == NULL)
-		throw Erange("command_line", "missing argument to -m");
-	    num = atoi(optarg);
-	    break;
-	case 'h':
-	    show_usage(argv[0]);
-	    return false;
-	case 'V':
-	    show_version(argv[0]);
-	    return false;
-	case '?':
-	    user_interaction_warning(string("ignoring unknown option ") + char(optopt));
-	    break;
-	default:
-	    user_interaction_warning(string("ignoring unknown option ") + char(lu));
-	}
-	if(lu == 'o' || lu == 'r')
-	    break; // stop reading arguments
-    }
-    
-    for(S_I i = optind; i < argc; i++)
-	rest.push_back(argv[i]);
-
-	// sanity checks
-
-    switch(op)
-    {
-    case none_op:
-	user_interaction_warning("no action specified, aborting");
-	return false;
-    case create:
-    case listing:
-    case del:
-    case dar:
-    case used:
-    case files:
-    case stats:
-	if(rest.size() > 0)
-	    user_interaction_warning("ignoring extra arguments on command line");
-	break;
-    case add:
-	if(rest.size() > 1)
-	    user_interaction_warning("ignoring extra arguments on command line");
-	break;
-    case chbase:
-    case where:
-	if(rest.size() != 1)
-	{
-	    user_interaction_warning("missing argument to command line, aborting");
-	    return false;
-	}
-	arg = rest[0];
-	rest.clear();
-	break;
-    case restore:
-	for(unsigned int i = 0; i < rest.size(); i++)
-	    if(!path(rest[i]).is_relative())
-		throw Erange("command_line", "arguments to -r must be relative path (never begin by '/')");
-	break;
-    case options:
-	break;
-    case move:
-	if(rest.size() != 1)
-	{
-	    user_interaction_warning("missing argument to command line, aborting");
-	    return false;
-	}
-	num2 = tools_str2int(rest[0]);
-	rest.clear();
-	break;
-    default:
-	throw SRC_BUG;
-    }
-
-    if(base == "")
-    {
-	user_interaction_warning("no database specified, aborting");
-	return false;
-    }
-
-    return true;
-}
-
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void op_create(const string & base)
-{
-    database dat; // created empty;
-
-    write_base(base, &dat, false);
-}
-
-static void op_add(const string & base, const string &arg, string fake)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	catalogue *catal = macro_tools_get_catalogue_from(arg);
-	
-	try
-	{
-	    string chemin, b;
-	 
-	    if(fake == "")
-		fake = arg;
-	    tools_split_path_basename(fake, chemin, b);
-	    dat->add_archive(*catal, chemin, b);
-	}
-	catch(...)
-	{
-	    if(catal != NULL)
-		delete catal;
-	    throw;
-	}
-	delete catal;
-	
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-}
-
-static void op_listing(const string & base)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->show_contents();
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-}
-
-static void op_del(const string & base, archive_num num)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->remove_archive(num);
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-}
-
-static void op_chbase(const string & base, archive_num num, const string & arg)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->change_name(num, arg);
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void op_where(const string & base, archive_num num, const string & arg)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->set_path(num, arg);
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void op_options(const string & base, const vector<string> & rest)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->set_options(rest);
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void op_dar(const string & base, const string & arg)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->set_dar_path(arg);
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void op_restore(const string & base, const vector<string> & rest)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->restore(rest);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-}
-
-static void op_used(const string & base, archive_num num)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->show_files(num);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void op_files(const string & base, const string & arg)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->show_version(arg);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void op_stats(const string & base)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->show_most_recent_stats();
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-}
-
-static void op_move(const string & base, archive_num src, archive_num dst)
-{
-    database *dat = read_base(base);
-
-    try
-    {
-	dat->set_permutation(src, dst);
-	write_base(base, dat, true);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    delete dat;
-
-}
-
-static void show_usage(const char *command)
-{
-    ui_printf("usage :\n\n");
-    ui_printf("\tdar_manager -C [<path>/]<database>\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -A [<path>/]<basename> [[<path>/]<archive_basename>]\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -l\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -D <number>\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -b <number> <new_archive_basename>\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -p <number> <path>\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -o [list of options to pass to dar]\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -d [<path to dar command>]\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -r [list of files to restore]\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -u <number>\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -f file\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -s\n");
-    ui_printf("\tdar_manager -B [<path>/]<database> -m <number> <number>\n");
-    ui_printf("\tdar_manager -h\n");
-    ui_printf("\tdar_manager -V\n");
-    ui_printf("\n");
-#include "dar_manager.usage"
-}
-
-static void show_version(const char *command_name)
-{
-    char *name = tools_extract_basename(command_name);
-    try
-    {
-	ui_printf("\n %s version %s, Copyright (C) 2002 Denis Corbin\n\n", name, DAR_MANAGER_VERSION);
-	ui_printf(" %s with %s version %s\n", __DATE__, CC_NAT, __VERSION__);
-	ui_printf(" %s is part of the Disk ARchive suite (DAR %s)\n", name,dar_suite_version());
-	ui_printf(" %s comes with ABSOLUTELY NO WARRANTY; for details\n", name);
-	ui_printf(" type `%s -W'.  This is free software, and you are welcome\n", "dar");
-	ui_printf(" to redistribute it under certain conditions; type `%s -L | more'\n", "dar");
-	ui_printf(" for details.\n\n");
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
-
-static const struct option *get_long_opt()
-{
-    static const struct option ret[] = {
-	{"create", required_argument, NULL, 'C'},
-	{"base", required_argument, NULL, 'B'},
-	{"add", required_argument, NULL, 'A'},
-	{"list", no_argument, NULL, 'l'},
-	{"delete", required_argument, NULL, 'D'},
-	{"basename", required_argument, NULL, 'b'},
-	{"path", required_argument, NULL, 'p'},
-	{"options", no_argument, NULL, 'o'},
-	{"dar", no_argument, NULL, 'd'},
-	{"restore", no_argument, NULL, 'r'},
-	{"used", required_argument, NULL, 'u'},
-	{"file", required_argument, NULL, 'f'},
-	{"stats", no_argument, NULL, 's'},
-	{"help", no_argument, NULL, 'h'},
-	{"version", no_argument, NULL, 'V'},
-	{ NULL, 0, NULL, 0 }
-    };
-
-    return ret;
-}
-
-static database *read_base(const string & base)
-{
-    generic_file *f = database_header_open(base);
-    database *ret = NULL;
-
-    try
-    {
-	ret = new database(*f);
-	if(ret == NULL)
-	    throw Ememory("read_base");
-    }
-    catch(...)
-    {
-	delete f;
-	throw;
-    }
-    delete f;
-    return ret;
-}
-    
-static void write_base(const string & filename, const database *base, bool overwrite)
-{
-    generic_file *dat = database_header_create(filename, overwrite);
-
-    try
-    {
-	base->dump(*dat);
-    }
-    catch(...)
-    {
-	delete dat;
-	throw;
-    }
-    
-    delete dat;
-}
Index: dar/dar_slave.cpp
===================================================================
--- dar.orig/dar_slave.cpp	2012-05-02 11:23:23.507875964 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,234 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <string>
-#include <string.h>
-#include <iostream>
-#include <getopt.h>
-#include "user_interaction.hpp"
-#include "zapette.hpp"
-#include "sar.hpp"
-#include "path.hpp"
-#include "tuyau.hpp"
-#include "erreurs.hpp"
-#include "tools.hpp"
-#include "dar_suite.hpp"
-#include "integers.hpp"
-
-#define DAR_SLAVE_VERSION "1.1.0"
-
-static bool command_line(S_I argc, char *argv[], path * &chemin, string & filename, 
-			 string &input_pipe, string &output_pipe, string & execute);
-static void show_usage(const char *command);
-static void show_version(const char *command);
-static S_I little_main(S_I argc, char *argv[], const char **env);
-
-S_I main(S_I argc, char *argv[], const char **env)
-{
-    return dar_suite_global(argc, argv, env, &little_main);
-}
-
-static S_I little_main(S_I argc, char *argv[], const char **env)
-{
-    path *chemin = NULL;
-    string filename;
-    string input_pipe;
-    string output_pipe;
-    string execute;
-
-    if(command_line(argc, argv, chemin, filename, input_pipe, output_pipe, execute))
-    {
-	tuyau *input = NULL;
-	tuyau *output = NULL;
-	sar *source = NULL;
-	try
-	{
-	    source = new sar(filename, EXTENSION, SAR_OPT_DONT_ERASE, *chemin, execute);
-	    if(source == NULL)
-		throw Ememory("little_main");
-
-	    tools_open_pipes(input_pipe, output_pipe, input, output);
-
-	    slave_zapette zap = slave_zapette(input, output, source);
-	    input = output = NULL; // now managed by zap;
-	    source = NULL;  // now managed by zap;
-	    
-	    try
-	    {
-		zap.action();
-	    }
-	    catch(Erange &e)
-	    {
-		user_interaction_warning(e.get_message());
-		throw Edata(e.get_message());
-	    }
-	}
-	catch(...)
-	{
-	    delete chemin;
-	    if(input != NULL)
-		delete input;
-	    if(output != NULL)
-		delete output;
-	    if(source != NULL)
-		delete source;
-	    throw;
-	}
-	delete chemin;
-	if(input != NULL)
-	    delete input;
-	if(output != NULL)
-	    delete output;
-	if(source != NULL)
-	    delete source;
-	
-	return EXIT_OK;
-    }
-    else
-	return EXIT_SYNTAX;
-}
-
-static bool command_line(S_I argc,char *argv[], path * &chemin, string & filename, 
-			 string &input_pipe, string &output_pipe, string & execute)
-{
-    S_I lu;
-    execute = "";
-
-    if(argc < 1)
-    {
-	user_interaction_warning("cannot read arguments on command line, aborting");
-	return false;
-    }
-
-    while((lu = getopt(argc, argv, "i:o:hVE:")) != EOF)
-    {
-	switch(lu)
-	{
-	case 'i':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -i");
-	    if(input_pipe == "")
-		input_pipe = optarg;
-	    else
-		user_interaction_warning("only one -i option is allowed, considering the first one");
-	    break;
-	case 'o':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -o");
-	    if(output_pipe == "")
-		output_pipe = optarg;
-	    else
-		user_interaction_warning("only one -o option is allowed, considering the first one");
-	    break;
-	case 'h':
-	    show_usage(argv[0]);
-	    return false;
-	case 'V':
-	    show_version(argv[0]);
-	    return false;
-	case 'E':
-	    if(optarg == NULL)
-		throw Erange("get_args", "missing argument to -E");
-	    if(execute == "")
-		execute = optarg;
-	    else
-		user_interaction_warning("only one -E option is allowed, ignoring other instances");
-	    break;
-	case ':':
-	    throw Erange("get_args", string("missing parameter to option ") + char(optopt));
-	case '?':
-	    user_interaction_warning(string("ignoring unknown option ") + char(optopt)); 
-	    break;
-	default:
-	    user_interaction_warning(string("ignoring unknown option ") + char(lu)); 
-	}
-    }
-	
-    if(optind + 1 > argc)
-    {
-	user_interaction_warning("missing archive basename, see -h option for help");
-	return false;
-    }
-    
-    if(optind + 1 < argc)
-    {
-	user_interaction_warning("too many argument on command line, see -h option for help");
-	return false;
-    }
-    
-    tools_split_path_basename(argv[optind], chemin, filename);
-    return true;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void show_usage(const char *command)
-{
-    ostream & out = user_interaction_stream(); // for readability
-
-    char *cmd = tools_extract_basename(command);
-    try
-    {
-	out << endl;
-	out << "usage : " << endl;
-	out << "  command1 | " << cmd << " [options] [<path>/]basename | command2" << endl;
-	out  << "  " << cmd << "[options] [-i input_pipe] [-o output_pipe] [<path>/]basename" << endl;
-	out << "  " << cmd << " -h" << endl;
-	out << "  " << cmd << " -V" << endl << endl;
-#include "dar_slave.usage"
-    }
-    catch(...)
-    {
-	delete cmd;
-	throw;
-    }
-    delete cmd;
-}
-    
-static void show_version(const char *command)
-{
-    ostream & out = user_interaction_stream(); // for readability
-
-    char *cmd = tools_extract_basename(command);
-    try
-    {
-	out << endl << " " << cmd << " version " << DAR_SLAVE_VERSION << ", Copyright (C) 2002 Denis Corbin" << endl << endl;
-	out << " " << __DATE__ << " with " << CC_NAT << " version " << __VERSION__ << endl;
-	out << " " << cmd << " is part of the Disk ARchive suite (DAR " << dar_suite_version() << ")" << endl;
-	out << " " << cmd << " comes with ABSOLUTELY NO WARRANTY; for details" << endl;
-	out << " type `dar -W'.  This is free software, and you are welcome" << endl;
-	out << " to redistribute it under certain conditions; type `dar -L | more'" << endl;
-	out << " for details." << endl << endl;
-    }
-    catch(...)
-    {
-	delete cmd;
-	throw;
-    }
-    delete cmd;
-}
Index: dar/dar_suite.cpp
===================================================================
--- dar.orig/dar_suite.cpp	2012-05-02 11:23:23.231876541 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,103 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <iostream>
-#include "dar_suite.hpp"
-#include "user_interaction.hpp"
-#include "erreurs.hpp"
-#include "test_memory.hpp"
-
-const char *application_version = "1.2.1_dev";
-
-const char *dar_suite_version()
-{
-    return application_version;
-}
-
-int dar_suite_global(int argc, char *argv[], const char **env, int (*call)(int, char *[], const char **env))
-{
-    MEM_BEGIN;
-    MEM_IN;
-    int ret = EXIT_OK;
-
-    try
-    {
-	user_interaction_init(&cerr, &cerr);
-	ret = (*call)(argc, argv, env);
-    }
-    catch(Efeature &e)
-    {
-	user_interaction_warning(string("NOT YET IMPLEMENTED FEATURE has been used : ") + e.get_message());
-	user_interaction_warning("please check documentation or upgrade your software if available");
-	ret = EXIT_SYNTAX;
-    }
-    catch(Ehardware & e)
-    {
-	user_interaction_warning(string("SEEMS TO BE A HARDWARE PROBLEM : ")+e.get_message());
-	user_interaction_warning("please check your hardware");
-	ret = EXIT_ERROR;
-    }
-    catch(Ememory & e)
-    {
-	user_interaction_warning("lack of memory to achieve the operation, aborting operation");
-	ret = EXIT_ERROR;
-    }
-    catch(Erange & e)
-    {
-	user_interaction_warning("FATAL error, aborting operation");
-	user_interaction_warning(e.get_message());
-	ret = EXIT_ERROR;
-    }
-    catch(Euser_abort & e)
-    {
-	user_interaction_warning(string("aborting program. User refused to continue while asking: ") + e.get_message());
-	ret = EXIT_USER_ABORT;
-    }
-    catch(Edata & e)
-    {
-	    // no output just the exit code is set
-	ret = EXIT_DATA_ERROR;
-    }
-    catch(Escript & e)
-    {
-	user_interaction_warning(string("aborting program. An error occured concerning user command execution: ") + e.get_message());
-	ret = EXIT_SCRIPT_ERROR;
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-	user_interaction_warning("INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINER");
-	ret = EXIT_BUG;
-    }
-    user_interaction_close();
-    MEM_OUT;
-    MEM_END;
-    return ret;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
Index: dar/dar_suite.hpp
===================================================================
--- dar.orig/dar_suite.hpp	2012-05-02 11:23:23.459877289 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,60 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#ifndef DAR_SUITE_HPP
-#define DAR_SUITE_HPP
-
-#define EXIT_OK 0           // all that was asked is done
-#define EXIT_SYNTAX 1       // syntax error on command line
-#define EXIT_ERROR 2        // error not related to the data treated 
-    // (lack of memory, hardware problem, etc.)
-#define EXIT_BUG 3          // detected a condition that should never happen
-#define EXIT_USER_ABORT 4   // user asked to abort (or question in non 
-    // interactive mode)
-#define EXIT_DATA_ERROR 5   // error in data treated (could not save/restore/
-    // compare all data due for example to bad access permission.  Comparison
-    // mismatch of some files, archive testing failed etc...)
-#define EXIT_SCRIPT_ERROR 6 // error around the execution of a user command 
-    // using -E or -F options
-
-#define EXTENSION "dar"
-
-
-/// the compiler version MACRO
-#ifndef __VERSION__
-#define __VERSION__ "unknown"
-#endif
-
-/// the compiler Nature MACRO
-#ifdef __GNUC__
-#define CC_NAT "GNUC"
-#else
-#define CC_NAT "unknown"
-#endif
-
-extern int dar_suite_global(int argc, char *argv[], const char **env, int (*call)(int, char *[], const char **env));
-extern const char *dar_suite_version();
-
-
-#endif
Index: dar/dar_xform.cpp
===================================================================
--- dar.orig/dar_xform.cpp	2012-05-02 11:23:23.451877557 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,375 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <unistd.h>
-#include <iostream>
-#include "sar.hpp"
-#include "sar_tools.hpp"
-#include "user_interaction.hpp"
-#include "tools.hpp"
-#include "tuyau.hpp"
-#include "dar_suite.hpp"
-#include "integers.hpp"
-
-#define EXTENSION "dar"
-#define DAR_XFORM_VERSION "1.1.0"
-
-static bool command_line(S_I argc, char *argv[], 
-			 path * & src_dir, string & src, 
-			 path * & dst_dir, string & dst,
-			 infinint & first_file_size,
-			 infinint & file_size,
-			 bool & warn,
-			 bool & allow,
-			 bool & pause,
-			 bool & beep,
-			 string & execute_src,
-			 string & execute_dst);
-static void show_usage(const char *command_name);
-static void show_version(const char *command_name);
-static S_I sub_main(S_I argc, char *argv[], const char **env);
-
-S_I main(S_I argc, char *argv[], const char **env)
-{
-    return dar_suite_global(argc, argv, env, &sub_main);
-}
-
-static S_I sub_main(S_I argc, char *argv[], const char **env)
-{
-    path *src_dir = NULL;
-    path *dst_dir = NULL;
-    string src, dst;
-    infinint first, size;
-    bool warn, allow, pause, beep;
-    string execute_src, execute_dst;
-
-    if(command_line(argc, argv, src_dir, src, dst_dir, dst, first, size,
-		    warn, allow, pause, beep, execute_src, execute_dst))
-    {
-	try
-	{
-	    generic_file *dst_sar = NULL;
-	    generic_file *src_sar = NULL;
-	    
-	    if(dst != "-")
-		user_interaction_change_non_interactive_output(&cout);
-	    try
-	    {
-		S_I dst_opt = 
-		    (allow ? 0 : SAR_OPT_DONT_ERASE) 
-		    | (warn ? SAR_OPT_WARN_OVERWRITE : 0)
-		    | (pause ? SAR_OPT_PAUSE : 0);
-		user_interaction_set_beep(beep);
-		if(src == "-")
-		{
-		    generic_file *tmp = new tuyau(0, gf_read_only);
-		    
-		    if(tmp == NULL)
-			throw Ememory("main");
-		    try
-		    {
-			src_sar = new trivial_sar(tmp);
-			if(src_sar == NULL)
-			    delete tmp;
-			tmp = NULL;
-		    }
-		    catch(...)
-		    {
-			if(tmp != NULL)
-			    delete tmp;
-			throw;
-		    }
-		}
-		else 
-		    src_sar = new sar(src, EXTENSION, SAR_OPT_DEFAULT, *src_dir, execute_src);
-		if(src_sar == NULL)
-		    throw Ememory("main");
-		
-		if(size == 0)
-		    if(dst == "-")
-			dst_sar = sar_tools_open_archive_tuyau(1, gf_write_only);
-		    else
-			dst_sar = sar_tools_open_archive_fichier((*dst_dir + sar_make_filename(dst, 1, EXTENSION)).display(), allow, warn);
-		else
-		    dst_sar = new sar(dst, EXTENSION, size, first, dst_opt, *dst_dir, execute_dst);
-		if(dst_sar == NULL)
-		    throw Ememory("main");
-
-		try
-		{
-		    src_sar->copy_to(*dst_sar);
-		}
-		catch(Escript & e)
-		{
-		    throw;
-		}
-		catch(Euser_abort & e)
-		{
-		    throw;
-		}
-		catch(Ebug & e)
-		{
-		    throw;
-		}
-		catch(Egeneric & e)
-		{
-		    string msg = string("Error transforming the archive :")+e.get_message();
-		    user_interaction_warning(msg);
-		    throw Edata(msg);
-		}
-	    }
-	    catch(...)
-	    {
-		if(dst_sar != NULL)
-		    delete dst_sar;
-		if(src_sar != NULL)
-		    delete src_sar;
-		throw;
-	    }
-	    delete src_sar;
-	    delete dst_sar;
-	}
-	catch(...)
-	{
-	    delete src_dir;
-	    delete dst_dir;
-	    throw;
-	}
-	delete src_dir;
-	delete dst_dir;
-	
-	return EXIT_OK;
-    }
-    else
-	return EXIT_SYNTAX;
-}
-
-static bool command_line(S_I argc, char *argv[], 
-			 path * & src_dir, string & src, 
-			 path * & dst_dir, string & dst,
-			 infinint & first_file_size,
-			 infinint & file_size,
-			 bool & warn,
-			 bool & allow,
-			 bool & pause,
-			 bool & beep,
-			 string & execute_src,
-			 string & execute_dst)
-{
-    S_I lu;
-    src_dir = NULL;
-    dst_dir = NULL;
-    warn = true;
-    allow = true;
-    pause = false;
-    beep = false;
-    first_file_size = 0;
-    file_size = 0;
-    src = dst = "";
-    execute_src = execute_dst = "";
-
-    try
-    {
-	while((lu = getopt(argc, argv, "s:S:pwnhbVE:F:")) != EOF)
-	{
-	    switch(lu)
-	    {
-	    case 's':
-		if(file_size != 0)
-		    throw Erange("command_line", "only one -s option is allowed");
-		if(optarg == NULL)
-		    throw Erange("command_line", "missing argument to -s");
-		else
-		{
-		    try
-		    {
-			file_size = tools_get_extended_size(optarg);
-			if(first_file_size == 0)
-			    first_file_size = file_size;
-		    }
-		    catch(Edeci &e)
-		    {
-			user_interaction_warning("invalid size for option -s");
-			return false;
-		    }
-		}
-		break;
-	    case 'S':
-		if(optarg == NULL)
-		    throw Erange("command_line", "missing argument to -S");
-		if(first_file_size == 0)
-		    first_file_size = tools_get_extended_size(optarg);
-		else
-		    if(file_size == 0)
-			throw Erange("command_line", "only one -S option is allowed");
-		    else
-			if(file_size == first_file_size)
-			{
-			    try
-			    {
-				first_file_size = tools_get_extended_size(optarg);
-				if(first_file_size == file_size)
-				    user_interaction_warning("specifying -S with the same value as the one given in -s is useless");
-			    }
-			    catch(Egeneric &e)
-			    {
-				user_interaction_warning("invalid size for option -S");
-				return false;
-			    }
-			    
-			}
-			else
-			    throw Erange("command_line", "only one -S option is allowed");
-		break;
-	    case 'p':
-		pause = true;
-		break;
-	    case 'w':
-		warn = false;
-		break;
-	    case 'n':
-		allow = false;
-		break;
-	    case 'b':
-		beep = true;
-		break;
-	    case 'h':
-		show_usage(argv[0]);
-		return false;
-	    case 'V':
-		show_version(argv[0]);
-		return false;
-	    case 'E':
-		if(optarg == NULL)
-		    throw Erange("get_args", "missing argument to -E");
-		if(execute_dst == "")
-		    execute_dst = optarg;
-		else
-		    user_interaction_warning("only one -E option is allowed, ignoring other instances");
-		break;
-	    case 'F':
-		if(optarg == NULL)
-		    throw Erange("get_args", "missing argument to -F");
-		if(execute_src == "")
-		    execute_src = optarg;
-		else
-		    user_interaction_warning("only one -F option is allowed, ignoring other instances");
-		break;
-	    case ':':
-		throw Erange("command_line", string("missing parameter to option ") + char(optopt));
-	    case '?':
-		user_interaction_warning(string("ignoring unknown option ") + char(optopt)); 
-		break;
-	    default:
-		throw SRC_BUG;
-	    }
-	}
-
-	    // reading arguments remain on the command line 
-	if(optind + 2 > argc)
-	{
-	    user_interaction_warning("missing source or destination argument on command line, see -h option for help");
-	    return false;
-	}
-	if(optind + 2 < argc)
-	{
-	    user_interaction_warning("too many argument on command line, see -h option for help");
-	    return false;
-	}
-	if(argv[optind] != "")
-	    tools_split_path_basename(argv[optind], src_dir, src);
-	else
-	{
-	    user_interaction_warning("invalid argument as source archive");
-	    return false;
-	}
-	if(argv[optind+1] != "")
-	    tools_split_path_basename(argv[optind+1], dst_dir, dst);
-	else
-	{
-	    user_interaction_warning("invalid argument as destination archive");
-	    return false;
-	}
-
-	    // sanity checks
-	if(dst == "-" && file_size != 0)
-	    throw Erange("dar_xform::command_line", "archive on stdout is not compatible with slicing (-s option)");
-    }
-    catch(...)
-    {
-	if(src_dir != NULL)
-	    delete src_dir;
-	if(dst_dir != NULL)
-	    delete dst_dir;
-	throw;
-    }
-    return true;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void show_usage(const char *command_name)
-{
-    char *name = tools_extract_basename(command_name);
-
-    try
-    {
-	ui_printf("usage :\t %s [options] [<path>/]<basename> [<path>/]<basename>\n", name);
-	ui_printf("       \t %s -h\n",name);
-	ui_printf("       \t %s -V\n",name);
-#include "dar_xform.usage"
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
-
-static void show_version(const char *command_name)
-{
-    char *name = tools_extract_basename(command_name);
-
-    try
-    {
-	ui_printf("\n %s version %s, Copyright (C) 2002 Denis Corbin\n\n", name, DAR_XFORM_VERSION);
-	ui_printf(" %s with %s version %s\n", __DATE__, CC_NAT, __VERSION__);
-	ui_printf(" %s is part of the Disk ARchive suite (DAR %s)\n", name,dar_suite_version());
-	ui_printf(" %s comes with ABSOLUTELY NO WARRANTY; for details\n", name);
-	ui_printf(" type `%s -W'.  This is free software, and you are welcome\n", "dar");
-	ui_printf(" to redistribute it under certain conditions; type `%s -L | more'\n", "dar");
-	ui_printf(" for details.\n\n");
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
Index: dar/data_tree.cpp
===================================================================
--- dar.orig/data_tree.cpp	2012-05-02 11:23:23.183876138 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,719 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <netinet/in.h>
-#include <iomanip>
-#include "data_tree.hpp"
-#include "tools.hpp"
-#include "user_interaction.hpp"
-
-static data_tree *read_from_file(generic_file & f);
-static void read_from_file(generic_file &f, archive_num &a);
-static void write_to_file(generic_file &f, archive_num a);
-static void display_line(archive_num num, const infinint *data, const infinint *ea);
-
-data_tree::data_tree(const string & name)
-{
-    filename = name;
-}
-
-data_tree::data_tree(generic_file & f)
-{
-    infinint tmp;
-    archive_num k;
-    infinint v;
-
-	// signature has already been read
-    tools_read_string(f, filename);
-    tmp.read_from_file(f); // number of entry in last_mod map
-    while(tmp > 0)
-    {
-	read_from_file(f, k);
-	v.read_from_file(f);
-	last_mod[k] = v;
-	tmp--;
-    }
-    tmp.read_from_file(f); // number of entry in last_change map
-    while(tmp > 0)
-    {
-	read_from_file(f, k);
-	v.read_from_file(f);
-	last_change[k] = v;
-	tmp--;
-    }
-}
-
-void data_tree::dump(generic_file & f) const
-{
-    char tmp = obj_signature();
-    infinint sz;
-    map<archive_num, infinint>::iterator it;
-    map<archive_num, infinint>::iterator fin;
-
-    f.write(&tmp, 1);
-    tools_write_string(f, filename);
-    sz = last_mod.size();
-    sz.dump(f);
-    it = const_cast<data_tree *>(this)->last_mod.begin();
-    fin = const_cast<data_tree *>(this)->last_mod.end();
-    while(it != fin)
-    {
-	write_to_file(f, it->first); // key
-	it->second.dump(f); // value
-	it++;
-    }
-    sz = last_change.size();
-    sz.dump(f);
-    it = const_cast<data_tree *>(this)->last_change.begin();
-    fin = const_cast<data_tree *>(this)->last_change.end();
-    while(it != fin)
-    {
-	write_to_file(f, it->first); // key
-	it->second.dump(f); // value
-	it++;
-    }
-}
-
-
-bool data_tree::get_data(archive_num & archive) const
-{
-    infinint max = 0;
-    map<archive_num, infinint>::iterator it  = const_cast<data_tree *>(this)->last_mod.begin();
-    map<archive_num, infinint>::iterator fin = const_cast<data_tree *>(this)->last_mod.end();
-
-    archive = 0; // 0 is never assigned to an archive number
-    while(it != fin)
-    {
-	if(it->second >= max) // > and = because there should never be twice the same value
-		// and we must be able to see a value of 0 (initially max = 0) which is valid.
-	{
-	    max = it->second;
-	    archive = it->first;
-	}
-	it++;
-    }
-    
-    return archive != 0;
-}
-
-bool data_tree::get_EA(archive_num & archive) const
-{
-    infinint max = 0;
-    map<archive_num, infinint>::iterator it  = const_cast<data_tree *>(this)->last_change.begin();
-    map<archive_num, infinint>::iterator fin = const_cast<data_tree *>(this)->last_change.end();
-
-    archive = 0; // 0 is never assigned to an archive number
-    while(it != fin)
-    {
-	if(it->second >= max) // > and = because there should never be twice the same value
-		// and we must be able to see a value of 0 (initially max = 0) which is valid.
-	{
-	    max = it->second;
-	    archive = it->first;
-	}
-	it++;
-    }
-    
-    return archive != 0;
-}
-
-bool data_tree::read_data(archive_num num, infinint & val) const
-{
-    map<archive_num, infinint>::iterator it = const_cast<data_tree *>(this)->last_mod.find(num);
-    map<archive_num, infinint>::iterator fin = const_cast<data_tree *>(this)->last_mod.end();
-
-    if(it != fin)
-    {
-	val = it->second;
-	return true;
-    }
-    else
-	return false;
-}
-
-bool data_tree::read_EA(archive_num num, infinint & val) const
-{
-    map<archive_num, infinint>::iterator it = const_cast<data_tree *>(this)->last_change.find(num);
-    map<archive_num, infinint>::iterator fin = const_cast<data_tree *>(this)->last_change.end();
-    
-    if(it != fin)
-    {
-	val = it->second;
-	return true;
-    }
-    else
-	return false;
-}
-
-bool data_tree::remove_all_from(archive_num archive)
-{
-    map<archive_num, infinint>::iterator it = last_mod.begin();
-    while(it != last_mod.end())
-    {
-	if(it->first == archive)
-	{
-	    last_mod.erase(it);
-	    break; // stops the while loop, as there is at most one element with that key
-	}
-	else
-	    it++;
-    }
-
-    it = last_change.begin();
-    while(it != last_change.end())
-    {
-	if(it->first == archive)
-	{
-	    last_change.erase(it);
-	    break; // stops the while loop, as there is at most one element with that key
-	}
-	else
-	    it++;
-    }
-
-    return last_mod.size() == 0 && last_change.size() == 0;
-}
-
-void data_tree::listing() const
-{
-    map<archive_num, infinint>::iterator it, fin_it, ut, fin_ut;
-
-    user_interaction_stream() << "Archive number |  Data      |  EA " << endl;
-    user_interaction_stream() << "---------------+------------+------------" << endl;
-    
-    it = const_cast<data_tree *>(this)->last_mod.begin();
-    fin_it = const_cast<data_tree *>(this)->last_mod.end();
-    ut = const_cast<data_tree *>(this)->last_change.begin();
-    fin_ut = const_cast<data_tree *>(this)->last_change.begin();
-
-    while(it != fin_it || ut != fin_ut)
-    {
-	if(it != fin_it)
-	    if(ut != fin_ut)
-		if(it->first == ut->first)
-		{
-		    display_line(it->first, &(it->second), &(ut->second));
-		    it++;
-		    ut++;
-		}
-		else // not converning the same archive
-		    if(it->first < ut->first) // it only
-		    {
-			display_line(it->first, &(it->second), NULL);
-			it++;
-		    } 
-		    else // ut only
-		    {
-			display_line(ut->first, NULL, &(ut->second));
-			ut++;
-		    }
-	    else // ut at end of list thus it != fin_it (see while condition)
-	    {
-		display_line(it->first, &(it->second), NULL);
-		it++;
-	    }
-	else // it at end of list, this ut != fin_ut (see while condition)
-	{
-	    display_line(ut->first, &(ut->second), NULL);
-	    ut++;
-	}
-    }	    
-}
-
-void data_tree::apply_permutation(archive_num src, archive_num dst)
-{
-    map<archive_num, infinint> transfert;
-    map<archive_num, infinint>::iterator it = last_mod.begin();
-
-    transfert.clear();
-    while(it != last_mod.end())
-    {
-	transfert[data_tree_permutation(src, dst, it->first)] = it->second;
-	it++;
-    }
-    last_mod = transfert;
-
-    transfert.clear();
-    it = last_change.begin();
-    while(it != last_change.end())
-    {
-	transfert[data_tree_permutation(src, dst, it->first)] = it->second;
-	it++;
-    }
-    last_change = transfert;
-}
-
-void data_tree::skip_out(archive_num num)
-{
-    map<archive_num, infinint> resultant;
-    map<archive_num, infinint>::iterator it = last_mod.begin();
-    infinint tmp;
-
-    while(it != last_mod.end())
-    {
-	if(it->first > num)
-	    resultant[it->first-1] = it->second;
-	else
-	    resultant[it->first] = it->second;
-	it++;
-    }
-    last_mod = resultant;
-    resultant.clear();
-    it = last_change.begin();
-    while(it != last_change.end())
-    {
-	if(it->first > num)
-	    resultant[it->first-1] = it->second;
-	else
-	    resultant[it->first] = it->second;
-	it++;
-    }
-    last_change = resultant;
-}
-
-void data_tree::compute_most_recent_stats(vector<infinint> & data, vector<infinint> & ea, 
-					  vector<infinint> & total_data, vector<infinint> & total_ea) const
-{
-    archive_num most_recent = 0;
-    infinint max = 0;
-    map<archive_num, infinint>::iterator it = const_cast<data_tree *>(this)->last_mod.begin();
-    map<archive_num, infinint>::iterator fin = const_cast<data_tree *>(this)->last_mod.end();
-
-    while(it != fin)
-    {
-	if(it->second >= max)
-	    most_recent = it->first;
-	total_data[it->first]++;
-	it++;
-    }
-    if(most_recent > 0)
-	data[most_recent]++;
-
-    it = const_cast<data_tree *>(this)->last_change.begin();
-    fin = const_cast<data_tree *>(this)->last_change.end();
-
-    max = 0;
-    most_recent = 0;
-    while(it != fin)
-    {
-	if(it->second >= max)
-	    most_recent = it->first;
-	total_ea[it->first]++;
-	it++;
-    }
-    if(most_recent > 0)
-	ea[most_recent]++;
-}
-
-////////////////////////////////////////////////////////////////
-
-data_dir::data_dir(const string &name) : data_tree(name)
-{
-    rejetons.clear();
-}
-
-data_dir::data_dir(generic_file &f) : data_tree(f)
-{
-    infinint tmp;
-    data_tree *entry = NULL;
-
-    tmp.read_from_file(f); // number of children
-    try
-    {
-	while(tmp > 0)
-	{
-	    entry = read_from_file(f);
-	    if(entry == NULL)
-		throw Erange("data_dir::data_dir", "unexpected end of file");
-	    rejetons.push_back(entry);
-	    entry = NULL;
-	    tmp--;
-	}
-    }
-    catch(...)
-    {
-	list<data_tree *>::iterator next = rejetons.begin();
-	while(next != rejetons.end())
-	    delete *next;
-	if(entry != NULL)
-	    delete entry;
-	throw;
-    }
-}
-
-data_dir::data_dir(const data_dir & ref) : data_tree(ref)
-{
-    rejetons.clear();
-}
-
-data_dir::data_dir(const data_tree & ref) : data_tree(ref)
-{
-    rejetons.clear();
-}
-
-data_dir::~data_dir()
-{
-    list<data_tree *>::iterator next = rejetons.begin();
-    while(next != rejetons.end())
-    {
-	delete *next;
-	next++;
-    }
-}
-
-void data_dir::dump(generic_file & f) const
-{
-    list<data_tree *>::iterator it = const_cast<data_dir *>(this)->rejetons.begin();
-    list<data_tree *>::iterator fin = const_cast<data_dir *>(this)->rejetons.end();
-    infinint tmp = rejetons.size();
-
-    data_tree::dump(f);
-    tmp.dump(f);
-    while(it != fin)
-    {
-	if(*it == NULL)
-	    throw SRC_BUG;
-	(*it)->dump(f);
-	it++;
-    }
-}
-
-
-void data_dir::add(const inode *entry, const archive_num & archive)
-{
-    const data_tree *fils = read_child(entry->get_name());
-    const directory *entry_dir = dynamic_cast<const directory *>(entry);
-    data_tree *fils_mod = NULL;
-
-    if(fils == NULL) // brand-new data_tree to build
-    {
-	if(entry_dir != NULL)
-	    fils_mod = new data_dir(entry->get_name());
-	else
-	    fils_mod = new data_tree(entry->get_name());
-	if(fils_mod == NULL)
-	    throw Ememory("data_dir::add");
-	add_child(fils_mod);
-    }
-    else  // already saved in another archive
-    {
-	    // check if dir/file nature has changed
-	const data_dir *fils_dir = dynamic_cast<const data_dir *>(fils);
-	if(fils_dir == NULL && entry_dir != NULL) // need to upgrade data_tree to data_dir
-	{
-	    fils_mod = new data_dir(*fils); // upgrade data_tree in an empty data_dir
-	    if(fils_mod == NULL)
-		throw Ememory("data_dir::add");
-	    try
-	    {
-		remove_child(entry->get_name());
-		add_child(fils_mod);
-	    }
-	    catch(...)
-	    {
-		delete fils_mod;
-		throw;
-	    }
-	}
-	else // no change in dir/file nature
-	    fils_mod = const_cast<data_tree *>(fils);
-    }
-
-    if(entry->get_saved_status() != s_not_saved)
-	fils_mod->set_data(archive, entry->get_last_modif());
-    if(entry->ea_get_saved_status() == inode::ea_full)
-	fils_mod->set_EA(archive, entry->get_last_change());
-}
-
-const data_tree *data_dir::read_child(const string & name) const
-{
-    list<data_tree *>::iterator it = const_cast<data_dir *>(this)->rejetons.begin();
-    list<data_tree *>::iterator fin = const_cast<data_dir *>(this)->rejetons.end();
-    
-    while(it != fin && *it != NULL && (*it)->get_name() != name)
-	it++;
-
-    if(it == fin)
-	return NULL;
-    else
-	if(*it == NULL)
-	    throw SRC_BUG;
-	else
-	    return *it;
-}
-
-bool data_dir::remove_all_from(const archive_num & archive)
-{
-    list<data_tree *>::iterator it = rejetons.begin();
-    
-    while(it != rejetons.end())
-    {
-	if((*it) == NULL)
-	    throw SRC_BUG;
-	if((*it)->remove_all_from(archive))
-	{
-	    delete *it; // release the memory used by the object
-	    rejetons.erase(it); // remove the entry from the list
-	    it = rejetons.begin(); // does not seems "it" points to the next item after erase
-	}
-	else
-	    it++;
-    }
-
-    return data_tree::remove_all_from(archive) && rejetons.size() == 0;
-}
-
-void data_dir::show(archive_num num, string marge) const
-{
-    list<data_tree *>::iterator it = const_cast<data_dir *>(this)->rejetons.begin();
-    list<data_tree *>::iterator fin = const_cast<data_dir *>(this)->rejetons.end();
-    archive_num ou;
-
-    while(it != fin)
-    {
-	if(*it == NULL)
-	    throw SRC_BUG;
-	data_dir *dir = dynamic_cast<data_dir *>(*it);
-	string etat = string( (*it)->get_data(ou) && (ou == num || num == 0) ? "[Data]" : "[    ]")
-	    + ( (*it)->get_EA(ou) && (ou == num || num == 0)  ? "[EA]" : "[  ]");
-	
-	user_interaction_stream() << etat << "  " << marge << (*it)->get_name() << endl;
-	if(dir != NULL)
-	    dir->show(num, marge+dir->get_name()+"/");
-	it++;
-    }
-}
-
-void data_dir::apply_permutation(archive_num src, archive_num dst)
-{
-    list<data_tree *>::iterator it = rejetons.begin();
-
-    data_tree::apply_permutation(src, dst);
-    while(it != rejetons.end())
-    {
-	(*it)->apply_permutation(src, dst);
-	it++;
-    }
-}
-
-
-void data_dir::skip_out(archive_num num)
-{
-    list<data_tree *>::iterator it = rejetons.begin();
-
-    data_tree::skip_out(num);
-    while(it != rejetons.end())
-    {
-	(*it)->skip_out(num);
-	it++;
-    }
-}
-
-void data_dir::compute_most_recent_stats(vector<infinint> & data, vector<infinint> & ea,
-					 vector<infinint> & total_data, vector<infinint> & total_ea) const
-{
-    list<data_tree *>::iterator it = const_cast<data_dir *>(this)->rejetons.begin();
-    list<data_tree *>::iterator fin = const_cast<data_dir *>(this)->rejetons.end();
-
-    data_tree::compute_most_recent_stats(data, ea, total_data, total_ea);
-    while(it != fin)
-    {
-	(*it)->compute_most_recent_stats(data, ea, total_data, total_ea);
-	it++;
-    }
-}
-
-void data_dir::add_child(data_tree *fils)
-{
-    if(fils == NULL)
-	throw SRC_BUG;
-    rejetons.push_back(fils);
-}
-
-void data_dir::remove_child(const string & name)
-{
-    list<data_tree *>::iterator it = rejetons.begin();
-    
-    while(it != rejetons.end() && *it != NULL && (*it)->get_name() != name)
-	it++;
-
-    if(it != rejetons.end())
-	if(*it == NULL)
-	    throw SRC_BUG;
-	else
-	    rejetons.erase(it);
-}
-
-////////////////////////////////////////////////////////////////
-
-data_dir *data_tree_read(generic_file & f)
-{
-    data_tree *lu = read_from_file(f);
-    data_dir *ret = dynamic_cast<data_dir *>(lu);
-
-    if(ret == NULL && lu != NULL)
-	delete lu;
-
-    return ret;
-}
-
-bool data_tree_find(path chemin, const data_dir & racine, const data_tree *& ptr)
-{
-    string filename;
-    const data_dir *current = &racine;
-    bool loop = true;
-
-    if(!chemin.is_relative())
-	throw SRC_BUG;
-
-    while(loop)
-    {
-	if(!chemin.pop_front(filename))
-	{
-	    filename = chemin.display();
-	    loop = false;
-	}
-	ptr = current->read_child(filename);
-	if(ptr == NULL)
-	    loop = false;
-	if(loop)
-	{
-	    current = dynamic_cast<const data_dir *>(ptr);
-	    if(current == NULL)
-	    {
-		loop = false;
-		ptr = NULL;
-	    }
-	}
-    }
-    
-    return ptr != NULL;
-}
-
-void data_tree_update_with(const directory *dir, archive_num archive, data_dir *racine)
-{
-    const nomme *entry;
-
-    dir->reset_read_children();
-    while(dir->read_children(entry))
-    {
-	const directory *entry_dir = dynamic_cast<const directory *>(entry);
-	const inode *entry_ino = dynamic_cast<const inode *>(entry);
-	
-	if(entry_ino == NULL)
-	    continue; // continue with next loop
-	else
-	    racine->add(entry_ino, archive);
-
-	if(entry_dir != NULL) // going into recursion 
-	{
-	    data_tree *new_root = const_cast<data_tree *>(racine->read_child(entry->get_name()));
-	    data_dir *new_root_dir = dynamic_cast<data_dir *>(new_root);
-
-	    if(new_root == NULL)
-		throw SRC_BUG; // the racine->add method did not add an item for "entry"
-	    if(new_root_dir == NULL)
-		throw SRC_BUG; // the racine->add method did not add an data_dir item
-	    data_tree_update_with(entry_dir, archive, new_root_dir);
-	}
-    }
-}
-
-archive_num data_tree_permutation(archive_num src, archive_num dst, archive_num x)
-{
-    if(src < dst)
-	if(x < src || x > dst)
-	    return x;
-	else
-	    if(x == src)
-		return dst;
-	    else
-		return x-1;
-    else
-	if(src == dst)
-	    return x;
-	else // src > dst
-	    if(x > src || x < dst)
-		return x;
-	    else
-		if(x == src)
-		    return dst;
-		else
-		    return x+1;
-}
-
-////////////////////////////////////////////////////////////////
-
-static data_tree *read_from_file(generic_file & f)
-{
-    char sign;
-    data_tree *ret;
-
-    if(f.read(&sign, 1) != 1)
-	return NULL; // nothing more to read
-
-    if(sign == data_tree::signature())
-	ret = new data_tree(f);
-    else if (sign == data_dir::signature())
-	ret = new data_dir(f);
-    else
-	throw Erange("read_from_file", "unknown record type");
-
-    if(ret == NULL)
-	throw Ememory("read_from_file");
-
-    return ret;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void read_from_file(generic_file &f, archive_num &a)
-{
-    char buffer[sizeof(archive_num)];
-    archive_num *ptr = (archive_num *)&(buffer[0]);
-
-    f.read(buffer, sizeof(archive_num));
-    a = ntohs(*ptr);
-}
-
-static void write_to_file(generic_file &f, archive_num a)
-{
-    char buffer[sizeof(archive_num)];
-    archive_num *ptr = (archive_num *)&(buffer[0]);
-
-    *ptr = htons(a);
-    f.write(buffer, sizeof(archive_num));
-}
-
-static void display_line(archive_num num, const infinint *data, const infinint *ea)
-{
-    
-    user_interaction_stream() << setw(10) << num << "\t" 
-			      << (data == NULL ? "   " : tools_display_date(*data)) << "\t" 
-			      << (ea == NULL ? "   " : tools_display_date(*ea)) << endl;
-}
Index: dar/data_tree.hpp
===================================================================
--- dar.orig/data_tree.hpp	2012-05-02 11:23:23.351877299 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,110 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef DATA_TREE_HPP
-#define DATA_TREE_HPP
-
-#include <map>
-#include <string>
-#include <list>
-#include "generic_file.hpp"
-#include "infinint.hpp"
-#include "catalogue.hpp"
-
-typedef U_16 archive_num;
-#define ARCHIVE_NUM_MAX  65534
-
-class data_tree
-{
-public:
-
-    data_tree(const string &name);
-    data_tree(generic_file &f);
-    virtual ~data_tree() {};
-
-    virtual void dump(generic_file & f) const;
-    string get_name() const { return filename; };
-    bool get_data(archive_num & archive) const; // return the archive where to find the most recent version
-    bool get_EA(archive_num & archive) const; // if EA has been saved alone later, returns in which version
-    bool read_data(archive_num num, infinint & val) const; // return the date of last modification within this archive
-    bool read_EA(archive_num num, infinint & val) const; // return the date of last inode change
-
-    void set_data(const archive_num & archive, const infinint & date) { last_mod[archive] = date; };
-    void set_EA(const archive_num & archive, const infinint & date) { last_change[archive] = date; };
-    virtual bool remove_all_from(archive_num archive); // return true if the corresponding file 
-	// is no more located by any archive (this the object is no more usefull)
-    void listing() const; // list where is saved this file
-    virtual void apply_permutation(archive_num src, archive_num dst);
-    virtual void skip_out(archive_num num); // decrement archive numbers above num
-    virtual void compute_most_recent_stats(vector<infinint> & data, vector<infinint> & ea, 
-					   vector<infinint> & total_data, vector<infinint> & total_ea) const;
-    
-    virtual char obj_signature() const { return signature(); };
-    static char signature() { return 't'; };
-    
-private:
-    string filename;
-    map<archive_num, infinint> last_mod; // key is archive number ; value is last_mod time
-    map<archive_num, infinint> last_change; // key is archive number ; value is last_change time
-};
-
-class data_dir : public data_tree
-{
-public:
-    data_dir(const string &name);
-    data_dir(generic_file &f);
-    data_dir(const data_dir & ref);
-    data_dir(const data_tree & ref);
-    ~data_dir();
-
-    void dump(generic_file & f) const;
-
-    void add(const inode *entry, const archive_num & archive);
-    const data_tree *read_child(const string & name) const;
-
-    bool remove_all_from(const archive_num & archive); 
-    void show(archive_num num, string marge = "") const; 
-	// list the most recent files owned by that archive 
-	// (or by any archive if num == 0)
-    void apply_permutation(archive_num src, archive_num dst);
-    void skip_out(archive_num num);
-    void compute_most_recent_stats(vector<infinint> & data, vector<infinint> & ea, 
-				   vector<infinint> & total_data, vector<infinint> & total_ea) const;
-
-    char obj_signature() const { return signature(); };
-    static char signature() { return 'd'; };
-    
-private:
-    list<data_tree *> rejetons;
-
-    void add_child(data_tree *fils); // "this" is now responsible of "fils" disalocation
-    void remove_child(const string & name);
-};
-
-extern data_dir *data_tree_read(generic_file & f);
-extern bool data_tree_find(path chemin, const data_dir & racine, const data_tree *& ptr);
-extern void data_tree_update_with(const directory *dir, archive_num archive, data_dir *racine);
-extern archive_num data_tree_permutation(archive_num src, archive_num dst, archive_num x);
-
-#endif
Index: dar/database.cpp
===================================================================
--- dar.orig/database.cpp	2012-05-02 11:23:23.431877818 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,323 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <stdlib.h>
-#include <errno.h>
-#include <iomanip>
-#include <iostream>
-#include "database.hpp"
-#include "user_interaction.hpp"
-#include "deci.hpp"
-#include "tools.hpp"
-
-database::database()
-{
-  archive_data dat;
-
-  dat.chemin = "";
-  dat.basename = "";
-  coordinate.clear();
-  coordinate.push_back(dat); // coordinate[0] is never used, but must exist
-  options_to_dar.clear();
-  dar_path = "";
-  files = new data_dir("root"); // "root" or whaterver else
-  if(files == NULL)
-    throw Ememory("database::database");
-}
-
-database::database(generic_file & f)
-{
-  infinint tmp;
-  struct archive_data dat;
-
-  coordinate.clear();
-  tmp.read_from_file(f); // number of archive to read
-  while(tmp > 0)
-    {
-      tools_read_string(f, dat.chemin);
-      tools_read_string(f, dat.basename);
-      coordinate.push_back(dat);
-      tmp--;
-    }
-  if(coordinate.size() < 1)
-    throw Erange("database::database", "badly formated database");
-  tools_read_vector(f, options_to_dar);
-  tools_read_string(f, dar_path);
-  files = data_tree_read(f);
-    
-  if(files == NULL)
-    throw Ememory("database::database");
-}
-
-database::~database()
-{
-  if(files != NULL)
-    delete files;
-}
-
-void database::dump(generic_file & f) const
-{
-  archive_num tmp = coordinate.size();
-    
-  infinint(tmp).dump(f);
-  for(archive_num i = 0; i < tmp; i++)
-    {
-      tools_write_string(f, coordinate[i].chemin);
-      tools_write_string(f, coordinate[i].basename);
-    }
-  tools_write_vector(f, options_to_dar);
-  tools_write_string(f, dar_path);
-  files->dump(f);
-}
-
-void database::add_archive(const catalogue & cat, const string & chemin, const string & basename)
-{
-  struct archive_data dat;
-  archive_num number = coordinate.size();
-    
-  if(basename == "")
-    throw Erange("database::add_archive", "empty string is an invalid archive basename");
-  if(number >= ARCHIVE_NUM_MAX)
-    throw Erange("database::add_archive", "cannot add another archive, database is full");
- 
-  dat.chemin = chemin;
-  dat.basename = basename;
-  coordinate.push_back(dat);
-  data_tree_update_with(cat.get_contenu(), number, files);
-}
-
-void database::remove_archive(archive_num num)
-{
-  vector<struct archive_data>::iterator it = coordinate.begin() + num;
-
-  if(num == 0 || num >= coordinate.size())
-    throw Erange("database::remove_archive", "non-existant archive in database");
-  coordinate.erase(it);
-  if(files == NULL)
-    throw SRC_BUG;
-  files->remove_all_from(num);
-  files->skip_out(num);
-}
-
-void database::change_name(archive_num num, const string & basename)
-{
-  if(num < coordinate.size() && num != 0)
-    coordinate[num].basename = basename;
-  else
-    throw Erange("database::change_name", "non-existant archive in database");
-}
-
-void database::set_path(archive_num num, const string & chemin)
-{
-  if(num < coordinate.size() && coordinate[num].basename != "")
-    coordinate[num].chemin = chemin;
-  else
-    throw Erange("database::change_name", "non-existant archive in database");
-}
-
-void database::set_permutation(archive_num src, archive_num dst)
-{
-  struct archive_data moved;
-
-  if(files == NULL)
-    throw SRC_BUG;
-  if(src > coordinate.size() || src <= 0)
-    throw Erange("database::set_permutation", string("Invalid archive number: ") + tools_int2str(src));
-  if(dst > coordinate.size() || dst <= 0)
-    throw Erange("database::set_permutation", string("Invalid archive number: ") + tools_int2str(dst));
-
-  moved = coordinate[src];
-  coordinate.erase(coordinate.begin()+src);
-  coordinate.insert(coordinate.begin()+dst, moved);
-  files->apply_permutation(src, dst);
-}
-
-static void dummy_call(char *x)
-{
-  static char id[]="$Id$";
-  dummy_call(id);
-}
-
-void database::show_contents() const
-{
-  user_interaction_stream() << endl;
-  user_interaction_stream() << "dar path    : " << dar_path << endl;
-  user_interaction_stream() << "dar options : " << tools_concat_vector(" ", options_to_dar) << endl;
-  user_interaction_stream() << endl;
-        
-  user_interaction_stream() << "archive #   |    path      |    basename " <<endl;
-  user_interaction_stream() << "------------+--------------+---------------" <<endl;
-  for(archive_num i = 1; i < coordinate.size(); i++)
-    user_interaction_stream() << setw(10) << i << "\t" << ((coordinate[i].chemin == "") ? "<empty>" : coordinate[i].chemin) << "\t" << coordinate[i].basename << endl;
-}
-
-void database::show_files(archive_num num) const
-{
-  if(num < coordinate.size())
-    {
-      if(files == NULL)
-	throw SRC_BUG;
-
-      files->show(num);
-    }
-  else
-    throw Erange("database::show_files", "non existant archive in database");
-}
-
-
-void database::show_version(path chemin) const
-{
-  const data_tree *ptr = NULL;
-  const data_dir *ptr_dir = files;
-  string tmp;
-
-  if(!chemin.is_relative())
-    throw Erange("database::show_version", "invalid path, path must be relative");
-
-  while(chemin.pop_front(tmp) && ptr_dir != NULL)
-    {
-      ptr = ptr_dir->read_child(tmp);
-      if(ptr == NULL)
-	throw Erange("database::show_version", "non existant file in database");
-      ptr_dir = dynamic_cast<const data_dir *>(ptr);
-    }
-
-  if(ptr_dir == NULL)
-    throw Erange("database::show_version", "non existant file in database");
-
-  ptr = ptr_dir->read_child(chemin.display());
-  if(ptr == NULL)
-    throw Erange("database::show_version", "non existant file in database");
-  else
-    ptr->listing();
-}
-
-void database::show_most_recent_stats() const
-{
-  vector<infinint> stats_data(coordinate.size(), 0);
-  vector<infinint> stats_ea(coordinate.size(), 0);
-  vector<infinint> total_data(coordinate.size(), 0);
-  vector<infinint> total_ea(coordinate.size(), 0);
-  if(files == NULL)
-    throw SRC_BUG;
-  files->compute_most_recent_stats(stats_data, stats_ea, total_data, total_ea);
-
-  user_interaction_stream() << "  archive #   |  most recent/total data |  most recent/total EA" << endl;
-  user_interaction_stream() << "--------------+-------------------------+-----------------------" << endl;
-  for(archive_num i = 1; i < coordinate.size(); i++)
-    user_interaction_stream() << setw(10) << i << " " << stats_data[i]
-			      << "/" << total_data[i] 
-			      << "\t\t\t" << stats_ea[i] 
-			      << "/" << total_ea[i] 
-			      << endl;
-}
-
-
-void database::restore(const vector<string> & filename)
-{
-  map<archive_num, vector<string> > command_line;
-  vector<string>::iterator it = const_cast<vector<string> *>(&filename)->begin();
-  vector<string>::iterator fin = const_cast<vector<string> *>(&filename)->end();
-  const data_tree *ptr;
-    
-  // determination of the archive to restore and files to restore for each selected archive
-  while(it != fin)
-    {
-      if(data_tree_find(*it, *files, ptr))
-	{
-	  archive_num num_data = 0;
-	  archive_num num_ea = 0;
-	    
-	  ptr->get_data(num_data);
-	  ptr->get_EA(num_ea);
-	    
-	  if(num_data == num_ea)
-	    {
-	      if(num_data != 0)
-		command_line[num_data].push_back(*it);
-	    }
-	  else 
-	    {
-	      if(num_data != 0)
-		command_line[num_data].push_back(*it);
-	      if(num_ea != 0)
-		command_line[num_ea].push_back(*it);
-	      if(num_data != 0 && num_ea != 0)
-		if(num_data > num_ea) // will restore "EA only" then "data + old EA"
-		  user_interaction_warning(string("concerning file ") + *it 
-					   + " : archive #" + tools_int2str(num_data) 
-					   + " contains the most recent data and some old EA while archive #"
-					   + tools_int2str(num_ea)
-					   + " contains a delta with the most recent EA only. Dar manager "
-					   + "will always restore archive in the order they have been added "
-					   + "in database, thus, for this file, last EA version, will not be "
-					   + "overwritten by the older version, saved with the data. "
-					   + " Either rebuid the database adding archive following chronological order "
-					   + " or restore EA manually from archive#" + tools_int2str(num_ea) + ".");
-	    }
-	}
-      else
-	user_interaction_warning(string("cannot restore file ") + *it + " : non existant file in database");
-      it++;
-    }
-
-  // calling dar for each archive
-  if(command_line.size() > 0) 
-    {
-      string dar_cmd = dar_path != "" ? dar_path : "dar";
-      map<archive_num, vector<string> >::iterator ut = command_line.begin();
-      vector<string> argvector_init = vector<string>(1, dar_cmd) + options_to_dar;
-	
-      while(ut != command_line.end())
-	{
-	  try
-	    {
-	      string archive_name;
-	      vector<string> argvector = argvector_init;
-		
-	      if(coordinate[ut->first].chemin != "")
-		archive_name = coordinate[ut->first].chemin + "/";
-	      else
-		archive_name = "";
-	      archive_name += coordinate[ut->first].basename;
-	      argvector.push_back("-x");
-	      argvector.push_back(archive_name);
-	      argvector += ut->second;
-		
-	      cout << "CALLING DAR: " << tools_concat_vector(" ", argvector) << endl;
-	      tools_system(argvector);
-	    }
-	  catch(Erange & e)
-	    {
-	      user_interaction_warning(string("Error while restoring the following files : ") 
-				       + tools_concat_vector( " ", ut->second) 
-				       + "   : " 
-				       + e.get_message());
-	    }
-	  ut++;
-	}
-    }
-  else
-    user_interaction_warning("Cannot restore any file, nothing to do");
-}
Index: dar/database.hpp
===================================================================
--- dar.orig/database.hpp	2012-05-02 11:23:23.375876434 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,80 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-
-#ifndef DATABASE_HPP
-#define DATABASE_HPP
-
-#include "catalogue.hpp"
-#include "generic_file.hpp"
-#include "data_tree.hpp"
-#include <list>
-
-
-class database
-{
-public:
-    database(); // build an empty database
-    database(generic_file & f); // build a database from a file
-    ~database();
-
-    void dump(generic_file & f) const; // write a database to a file
-
-	// SETTINGS
-	//
-    void add_archive(const catalogue & cat, const string & chemin, const string & basename);
-    void remove_archive(archive_num num);
-    void change_name(archive_num num, const string & basename);
-    void set_path(archive_num num, const string & chemin);
-    void set_options(const vector<string> &opt) { options_to_dar = opt; };
-    void set_dar_path(const string & chemin) { dar_path = chemin; };
-    void set_permutation(archive_num src, archive_num dst);
-
-	// "GETTINGS"
-	//
-    void show_contents() const; // displays all archive information
-    vector<string> get_options() const { return options_to_dar; }; // show option passed to dar
-    string get_dar_path() const { return dar_path; }; // show path to dar command
-    void show_files(archive_num num) const; // 0 displays all files else files related to archive number
-    void show_version(path chemin) const; // list archive where the given file is saved
-    void show_most_recent_stats() const; // display the most recent version statistics (number of files by archive)
-
-	// ACTION
-	//
-    void restore(const vector<string> & filename);
-
-private:
-    struct archive_data 
-    {
-	string chemin;
-	string basename;
-    };
-
-    vector<struct archive_data> coordinate;
-    vector<string> options_to_dar;
-    string dar_path;
-    data_dir *files;
-};
-
-#endif
Index: dar/database_header.cpp
===================================================================
--- dar.orig/database_header.cpp	2012-05-02 11:23:23.051875911 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,127 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include "database_header.hpp"
-#include "compressor.hpp"
-#include "tools.hpp"
-#include "user_interaction.hpp"
-#include "integers.hpp"
-
-static unsigned char database_version = 1;
-
-#define HEADER_OPTION_NONE 0x00
-
-generic_file *database_header_create(const string & filename, bool overwrite)
-{
-    char *ptr = tools_str2charptr(filename);
-    generic_file *ret = NULL;
-    
-    try
-    {
-	struct stat buf;
-	S_I fd;
-	database_header h;
-	compressor *comp;
-	
-	if(stat(ptr, &buf) >= 0 && !overwrite)
-	    throw Erange("database_header_create", "Cannot create database, file exists");
-	fd = open(ptr, O_WRONLY|O_CREAT|O_TRUNC, 0666);
-	if(fd < 0)
-	    throw Erange("database_header_create", string("Cannot create database: ") + strerror(errno));
-	ret = new fichier(fd);
-	if(ret == NULL)
-	{
-	    close(fd);
-	    throw Ememory("database_header_create");
-	}
-	
-	h.version = database_version;
-	h.options = HEADER_OPTION_NONE;
-	h.write(*ret);
-
-	comp = new compressor(gzip, ret); // upon success, ret is owned by compr
-	if(comp == NULL)
-	    throw Ememory("database_header_create");
-	else
-	    ret = comp; 
-    }
-    catch(...)
-    {
-	delete ptr;
-	if(ret != NULL)
-	    delete ret;
-	throw;
-    }
-    delete ptr;
-
-    return ret;
-}
-
-generic_file *database_header_open(const string & filename)
-{
-    char *ptr = tools_str2charptr(filename);
-    generic_file *ret = NULL;
-
-    try
-    {
-	database_header h;
-	compressor *comp;
-
-	ret = new fichier(ptr, gf_read_only);
-	if(ret == NULL)
-	    throw Ememory("database_header_open");
-	h.read(*ret);
-	if(h.version != database_version)
-	    user_interaction_pause("The format version of the database is too high for that software version, try reading anyway ? ");
-	if(h.options != HEADER_OPTION_NONE)
-	    throw Erange("database_header_open", "Unknown header option in database, aborting\n");
-	
-	comp = new compressor(gzip, ret);
-	if(comp == NULL)
-	    throw Ememory("database_header_open");
-	else
-	    ret = comp;
-    }
-    catch(...)
-    {
-	delete ptr;
-	if(ret != NULL)
-	    delete ret;
-	throw;
-    }
-    
-    delete ptr;
-    return ret;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
Index: dar/database_header.hpp
===================================================================
--- dar.orig/database_header.hpp	2012-05-02 11:23:23.063877171 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,42 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef DATABASE_HEADER_HPP
-#define DATABASE_HEADER_HPP
-
-#include "generic_file.hpp"
-
-struct database_header
-{
-    unsigned char version;
-    unsigned char options;
-    
-    void read(generic_file & f) { f.read((char *)&version, 1); f.read((char *)&options, 1); };
-    void write(generic_file & f) { f.write((char *)&version, 1); f.write((char *)&options, 1); };
-};
-
-extern generic_file *database_header_create(const string & filename, bool overwrite);
-extern generic_file *database_header_open(const string & filename);
-
-#endif
Index: dar/deci.cpp
===================================================================
--- dar.orig/deci.cpp	2012-05-02 11:23:23.339877383 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,314 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include "deci.hpp"
-#include "erreurs.hpp"
-#include "integers.hpp"
-
-typedef unsigned char chiffre;
-
-static const U_I PAS = 5;
-static inline chiffre get_left(unsigned char a) { return (a & 0xF0) >> 4; };
-static inline chiffre get_right(unsigned char a) { return a & 0x0F; };
-static inline void set_left(unsigned char & a, chiffre val) { val <<= 4; a &= 0x0F; a |= val; };
-static inline void set_right(unsigned char & a, chiffre val) { val &= 0x0F; a &= 0xF0; a |= val; };
-
-static inline chiffre digit_htoc(unsigned char c) throw(Edeci)
-{ 
-    E_BEGIN;
-    if(c < '0' || c > '9') 
-	throw Edeci("deci.cpp : digit_htoc", "invalid decimal digit"); 
-    return chiffre(c - '0'); 
-    E_END("deci.cpp : digit_htoc", "");
-}
-
-static inline unsigned char digit_ctoh(chiffre c) throw(Ebug)
-{ 
-    E_BEGIN;
-    if(c > 9) throw SRC_BUG; 
-    return '0' + c; 
-    E_END("deci.cpp : digit_ctoh", "");
-}
-
-template <class T> void decicoupe(storage * &decimales, T x) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    try 
-    {
-	chiffre r;
-	const T d_t = 10;
-	T r_t;
-	storage::iterator it;
-	bool recule = false;
-	unsigned char tmp;
-	
-	decimales = new storage(PAS);
-	if(decimales == NULL)
-	    throw Ememory("template deci::decicoupe");
-	
-	decimales->clear(0xFF);
-	it = decimales->rbegin();
-	
-	while(x > 0 || recule)
-	{
-	    if(x > 0)
-	    {
-		euclide(x,d_t,x,r_t);
-		r = 0;
-		r_t.unstack(r);
-	    }
-	    else
-		r = 0xF; // not significative information
-	    if(recule)
-	    {
-		set_left(tmp, chiffre(r));
-		if(it == decimales->rend())
-		{
-		    decimales->insert_const_bytes_at_iterator(decimales->begin(), 0xFF, PAS);
-		    it = decimales->begin() + PAS - 1;
-		}
-		*(it--) = tmp;
-	    }
-	    else
-		set_right(tmp, chiffre(r));
-	    recule = ! recule;
-	}
-    }
-    catch(Ememory & e)
-    {
-	delete decimales;
-	throw;
-    }
-
-    E_END("decicoupe", "");
-}
-
-deci::deci(string s) throw(Edeci, Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    string::reverse_iterator it = s.rbegin();
-    storage::iterator ut;
-    bool recule = false;
-    unsigned char tmp = 0xFF;
-
-    U_I size = s.size() / 2;
-    if(s.size() % 2 != 0)
-	size++;
-
-    if(size == 0) // empty string
-	throw Erange("deci::deci(string s)", "an empty string is an invalid argument");
-
-    decimales = new storage(size);
-    if(decimales == NULL)
-	throw Ememory("deci::deci(string s)");
-    decimales->clear(0xFF); // FF is not a valid couple of decimal digit
-
-    ut = decimales->rbegin();
-    while(it != s.rend() || recule)
-    {
-	if(recule)
-	{
-	    if(it != s.rend())
-		set_left(tmp, digit_htoc(*it));
-	    else
-		set_left(tmp, 0xF);
-	    if(ut == decimales->rend())
-		throw SRC_BUG;
-	    *(ut--) = tmp;
-	}
-	else
-	    set_right(tmp, digit_htoc(*it));
-	
-	recule = ! recule;
-	if(it != s.rend())
-	    it++; // it is a reverse iterator thus ++ for going backward
-    }
-
-    reduce();
-    E_END("deci::deci", "string");
-}
-
-deci::deci(const infinint & x) throw(Ememory, Erange, Ebug)
-{ 
-    E_BEGIN; 
-    decicoupe(decimales, x); 
-    reduce();
-    E_END("deci::deci", "infinint"); 
-}
-
-void deci::copy_from(const deci & ref) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(decimales != NULL)
-	throw SRC_BUG;
-    
-    decimales = new storage(*ref.decimales);
-    E_END("deci::copy_from", "");
-}
-
-void deci::detruit() throw(Ebug)
-{
-    E_BEGIN;
-    if(decimales != NULL)
-    {
-	delete decimales;
-	decimales = NULL;
-    }
-    E_END("deci::detruit", "");
-}
-
-
-void deci::reduce() throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    bool avance = false, leading_zero = true;
-    chiffre tmp;
-    infinint justif_size = 0;
-
-    if(decimales == NULL)
-	throw SRC_BUG;
-
-    storage::iterator it = decimales->begin();
-
-    while(it != decimales->end() && leading_zero)
-    {
-	if(avance)
-	    tmp = get_right(*it);
-	else
-	    tmp = get_left(*it);
-	   
-	if(tmp == 0 && leading_zero)
-	{
-	    if(avance)
-		set_right(*it, 0xF);
-	    else
-		set_left(*it, 0xF);
-
-	    tmp = 0xF;
-	}
-
-	if(tmp == 0xF)
-	    if(leading_zero)
-	    {
-		if(avance)
-		    justif_size++;
-	    }
-	    else
-		throw SRC_BUG;
-
-	if(tmp != 0 && tmp != 0xF)
-	    leading_zero = false;
-
-	if(avance)
-	    it++;
-
-	avance = ! avance;
-    }
-
-    if(justif_size == decimales->size())
-    {
-	justif_size--;
-	it = decimales->rbegin();
-	*it = 0xF0; // need at least one digit
-    }
-    if(justif_size > 0)
-	decimales->remove_bytes_at_iterator(decimales->begin(), justif_size);
-    E_END("deci::reduce", "");
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-string deci::human() const throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    string s = "";
-    storage::iterator it = decimales->begin(), fin = decimales->end();
-    bool avance = false;
-    chiffre c;
-
-    while(it != fin)
-    {
-	if(avance)
-	{
-	    c = get_right(*it);
-	    it++;
-	}
-	else
-	    c = get_left(*it);
-
-	if(c != 0xF)
-	    s = s + string(1, digit_ctoh(c));
-	    
-	avance = ! avance;
-    }
-
-    return s;
-    E_END("deci::human", "");
-}
-
-infinint deci::computer() const throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    infinint r = 0;
-    storage::iterator it = decimales->begin(), fin = decimales->end();
-    bool avance = false;
-    chiffre c;
-
-    while(it != fin)
-    {
-	if(avance)
-	{
-	    c = get_right(*it);
-	    it++;
-	}
-	else
-	    c = get_left(*it);
-
-	if(c != 0xF)
-	{
-	    r *= 10;
-	    r += c;
-	}
-
-	avance = ! avance;
-    }
-
-    return r;
-    E_END("deci::computer", "");
-}
-
-ostream & operator << (ostream & ref, const infinint & arg)
-{
-    deci tmp = arg;
-    ref << tmp.human();
-
-    return ref;
-}
-
Index: dar/deci.hpp
===================================================================
--- dar.orig/deci.hpp	2012-05-02 11:23:23.479876441 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,63 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef DECI_HPP
-#define DECI_HPP
-
-#pragma interface
-
-#include <string>
-#include "storage.hpp"
-#include "infinint.hpp"
-
-using namespace std;
-
-class deci
-{
-public :
-    deci(string s) throw(Edeci, Ememory, Erange, Ebug);
-    deci(const infinint & x) throw(Ememory, Erange, Ebug);
-    deci(const deci & ref) throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; copy_from(ref); E_END("deci::deci", "deci"); };
-    ~deci() throw(Ebug) 
-	{ E_BEGIN; detruit(); E_END("deci::~deci", ""); };
-    
-
-    deci & operator = (const deci & ref) throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; detruit(); copy_from(ref); return *this; E_END("deci::operator = ", ""); };
-
-    infinint computer() const throw(Ememory, Erange, Ebug);
-    string human() const throw(Ememory, Erange, Ebug);
-
-private :
-    storage *decimales;
-
-    void detruit() throw(Ebug);
-    void copy_from(const deci & ref) throw(Ememory, Erange, Ebug);
-    void reduce() throw(Ememory, Erange, Ebug);
-};
-
-ostream & operator << (ostream & ref, const infinint & arg);
-
-#endif
Index: dar/defile.cpp
===================================================================
--- dar.orig/defile.cpp	2012-05-02 11:23:23.127876581 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,57 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include "defile.hpp"
-
-void defile::enfile(const entree *e)
-{
-    const eod *fin = dynamic_cast<const eod *>(e);
-    const directory *dir = dynamic_cast<const directory *>(e);
-    const nomme *nom = dynamic_cast<const nomme *>(e);
-    string s;
-
-    if(! init)
-	chemin.pop(s);
-    else
-	init = false;
-
-    if(fin == NULL)
-	if(nom == NULL)
-	    throw SRC_BUG; // neither eod nor nomme
-	else
-	{
-	    chemin += nom->get_name();
-	    if(dir != NULL)
-		init = true;
-	}
-}
-	    
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-    
Index: dar/defile.hpp
===================================================================
--- dar.orig/defile.hpp	2012-05-02 11:23:23.131876196 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,47 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef DEFILE_HPP
-#define DEFILE_HPP
-
-#pragma interface
-
-#include "catalogue.hpp"
-#include "path.hpp"
-
-class defile
-{
-public :
-    defile(const path &racine) : chemin(racine) { init = true; };
-    
-    void enfile(const entree *e);
-    path get_path() const { return chemin; };
-    string get_string() const { return chemin.display(); };
-
-private :
-    path chemin;
-    bool init;
-};
-
-#endif
Index: dar/ea.cpp
===================================================================
--- dar.orig/ea.cpp	2012-05-02 11:23:23.047876136 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,169 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-
-#pragma implementation
-
-#include "ea.hpp"
-#include "tools.hpp"
-#include "integers.hpp"
-
-// theses MACRO to are used when dump in file only
-#define EA_ROOT 0x80
-#define EA_DEL 0x40
-#define EA_DEFAULT_USER_INSERT 0x00
-
-ea_attributs::ea_attributs(const ea_attributs & ref)
-{
-    attr = ref.attr;
-    alire = attr.begin();
-}
-
-ea_entry::ea_entry(generic_file & f)
-{
-    unsigned char fl;
-    infinint tmp = 0;
-
-    f.read((char *)(&fl), 1);
-    domain = (fl & EA_ROOT) != 0 ? ea_root : ea_user;
-    mode = (fl & 
-	    EA_DEL) != 0 ? ea_del : ea_insert;
-    tools_read_string(f, key);
-    tmp.read_from_file(f);
-    tools_read_string_size(f, value, tmp);
-}
-
-void ea_entry::dump(generic_file & f) const
-{
-    unsigned char fl = 0;
-    infinint tmp = value.size();
-    if(domain == ea_root) 
-	fl |= EA_ROOT;
-    if(mode == ea_del)
-	fl |= EA_DEL;
-    f.write((char *)(&fl), 1);
-    tools_write_string(f, key);
-    tmp.dump(f);
-    tools_write_string_all(f, value);
-}
-
-///////////// EA_ATTRIBUTS IMPLEMENTATION //////////    
-
-ea_attributs::ea_attributs(generic_file & f)
-{
-    infinint tmp;
-    U_32 tmp2 = 0;
-
-    tmp.read_from_file(f);
-    tmp.unstack(tmp2);
-
-    do
-    {
-	while(tmp2 > 0)
-	{
-	    attr.push_back(ea_entry(f));
-	    tmp2--;
-	}
-	tmp.unstack(tmp2);
-    }
-    while(tmp2 > 0);
-    
-    alire = attr.begin();
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void ea_attributs::dump(generic_file & f) const
-{
-    vector<ea_entry>::iterator it = const_cast<ea_attributs &>(*this).attr.begin();
-    vector<ea_entry>::iterator fin = const_cast<ea_attributs &>(*this).attr.end();
-    
-    
-    size().dump(f);
-    while(it != fin)
-    {
-	it->dump(f);
-	it++;
-    }
-}
-
-void ea_attributs::reset_read() const
-{
-    ea_attributs *moi = const_cast<ea_attributs *>(this);
-    moi->alire = moi->attr.begin(); 
-}
-
-bool ea_attributs::read(ea_entry & x) const
-{
-    ea_attributs *moi = const_cast<ea_attributs *>(this);
-    if(alire != attr.end())
-    {
-	x = *(moi->alire)++;
-	return true;
-    }
-    else
-	return false;
-}
-
-bool ea_attributs::diff(const ea_attributs & other, bool check_ea_root, bool check_ea_user) const
-{
-    ea_entry ea;
-    string value;
-    ea_mode mode;
-    bool diff = false;
-
-    reset_read();
-    while(!diff && read(ea))
-	if(ea.mode == ea_insert)
-	    if((ea.domain == ea_user && check_ea_user) || (ea.domain == ea_root && check_ea_root))
-		if(other.find(ea.domain, ea.key, mode, value))
-		{
-		    if(value != ea.value) // found but different
-			diff = true;
-		}
-		else // not found
-		    diff = true;
-    return diff;
-}
-
-bool ea_attributs::find(ea_domain dom, const string &key, ea_mode & found_mode, string & found_value) const
-{
-    vector<ea_entry>::iterator it = const_cast<vector<ea_entry> &>(attr).begin();
-    vector<ea_entry>::iterator fin = const_cast<vector<ea_entry> &>(attr).end();
-
-    while(it != fin && (it->domain != dom || it->key != key))
-	it++;
-    if(it != fin)
-    {
-	found_mode = it->mode;
-	found_value = it->value;
-	return true;
-    }
-    else
-	return false;
-}
Index: dar/ea.hpp
===================================================================
--- dar.orig/ea.hpp	2012-05-02 11:23:23.087876196 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,84 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef EA_HPP
-#define EA_HPP
-
-#pragma interface
-
-#include <vector>
-#include <string>
-#include "generic_file.hpp"
-#include "infinint.hpp"
-
-enum ea_mode { ea_insert, ea_del }; // for use later
-// actually the whole EA list is stored/restored, but
-// it could be possible to check which EA have changed to save only thoses
-// and also record EA that have been removed.
-// the problem is the localisation of EA in the archive, 
-// comparison implies retrieving each EA list, which could implies
-// reading the whole archive for EA lists. 
-// other thing to consider, is the catalogue extraction, it must also contain
-// all EA lists. to be able to compare. 
-// solution : store the EA lists after the data and before the catalogue.
-// to be seen.
-//
-enum ea_domain { ea_root, ea_user };
-
-struct ea_entry
-{
-    ea_mode mode;
-    enum ea_domain domain;
-    string key, value;
-
-    ea_entry() { mode = ea_insert; domain = ea_user; key = value = ""; };
-    ea_entry(generic_file & f);
-
-    void dump(generic_file & f) const;
-};
-
-class ea_attributs
-{
-public:
-    ea_attributs() { alire = attr.begin(); };
-    ea_attributs(generic_file & f);
-    ea_attributs(const ea_attributs & ref);
-
-    void dump(generic_file & f) const;
-    void add(const ea_entry &x) { attr.push_back(x); };
-    void reset_read() const;
-    bool read(ea_entry & x) const;
-    infinint size() const { return attr.size(); };
-    void clear() { attr.clear(); alire = attr.begin(); };
-    bool find(ea_domain dom, const string &key, ea_mode & found_mode, string & found_value) const;
-    bool diff(const ea_attributs & other, bool check_ea_root, bool check_ea_user) const;
-    
-    void check() const {}; // actually empty, but additional checks could be added
-
-private:
-    vector<ea_entry> attr;
-    vector<ea_entry>::iterator alire;
-};
-
-#endif
Index: dar/ea_filesystem.cpp
===================================================================
--- dar.orig/ea_filesystem.cpp	2012-05-02 11:23:23.411876118 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,323 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifdef EA_SUPPORT
-#include <sys/types.h>
-#include <attr/xattr.h>
-#include <errno.h>
-#endif
-#include "ea.hpp"
-#include "tools.hpp"
-#include "ea_filesystem.hpp"
-#include "user_interaction.hpp"
-
-#ifdef EA_SUPPORT
-static string ea_convert[] = { "system", "user" };
-
-static bool write_ea(const string & chemin, const ea_attributs & val, bool ea_root, bool ea_user);
-static void read_ea(const string & name, ea_attributs & val, bool read_ea_root, bool read_ea_user);
-static vector<string> ea_filesystem_get_ea_list_for(const char *filename);
-static string ea_domain2string(ea_domain d);
-static ea_domain string2ea_domain(const string & x);
-static void split_ea_name(const string & src, ea_domain & d, string & key);
-static string glue_ea_name(const ea_domain & d, const string & key);
-#endif
-
-bool ea_filesystem_write_ea(const string & chemin, const ea_attributs & val, bool root, bool user)
-{
-#ifdef EA_SUPPORT
-    return write_ea(chemin, val, root, user);
-#else
-    return false;
-#endif
-}
-
-void ea_filesystem_read_ea(const string & name, ea_attributs & val, bool root, bool user)
-{
-#ifdef EA_SUPPORT
-    read_ea(name, val, root, user);
-#else
-    val.clear();
-#endif
-}
-
-void ea_filesystem_clear_ea(const string &name, ea_domain dom)
-{
-#ifdef EA_SUPPORT
-    ea_attributs eat;
-    ea_attributs res;
-    ea_entry one;
-	
-    ea_filesystem_read_ea(name, eat, true, true);
-    eat.reset_read();    
-    while(eat.read(one))
-    {
-	if(one.domain == dom)
-	{
-	    one.mode = ea_del;
-	    res.add(one);
-	}
-    }
-    ea_filesystem_write_ea(name, res, true, true);
-#endif
-}
-
-bool ea_filesystem_is_present(const string & name, ea_domain dom)
-{
-    ea_attributs tmp;
-    ea_entry ea_ent;
-    bool found = false;
-
-    ea_filesystem_read_ea(name, tmp, true, true);
-    tmp.reset_read();
-    while(!found && tmp.read(ea_ent))
-    {
-	if(ea_ent.domain == dom)
-	    found = true;
-    }
-
-    return found;
-}	
-
-#ifdef EA_SUPPORT
-
-static bool write_ea(const string & chemin, const ea_attributs & val, bool rest_ea_root, bool rest_ea_user)
-{
-    char *p_chemin = NULL;
-    U_I num = 0;
-
-    if(!ea_root && !ea_user)
-	return false; // no EA can be restored
-
-    p_chemin = tools_str2charptr(chemin);
-    try
-    {
-	ea_entry ea_ent;
-	
-	val.reset_read();
-	while(val.read(ea_ent))
-	{
-		// doing this for each attribute
-	    
-	    if(ea_ent.domain == ea_root && !rest_ea_root)
-		continue; // silently skipping this EA 
-	    if(ea_ent.domain == ea_user && !rest_ea_user)
-		continue; // silently skipping this EA
-
-	    char *k = tools_str2charptr(glue_ea_name(ea_ent.domain, ea_ent.key));
-	    try
-	    {
-		char *v = tools_str2charptr(ea_ent.value);
-		U_32 v_size = ea_ent.value.size();
-		try
-		{
-				// now, action !
-		    switch(ea_ent.mode)
-		    {
-		    case ea_insert:
-			if(lsetxattr(p_chemin, k, v, v_size, 0) < 0)
-			    throw Erange("ea_filesystem write_ea", string("aborting operations for the EA of ")+chemin+ " : error while adding EA "+ k + " : " + strerror(errno));
-			else
-			    num++;
-			break;
-		    case ea_del:
-			if(lremovexattr(p_chemin, k) < 0)
-			{
-			    if(errno != ENOATTR)
-				throw Erange("ea_filesystem write_ea", string("aborting operations for the EAs of ")+chemin+ " : error while removing " + k + " : " + strerror(errno));
-			}
-			else
-			    num++;
-			break;
-		    default:
-			throw SRC_BUG;
-		    }
-		}
-		catch(...)
-		{
-		    delete v;
-		    throw;
-		}
-		delete v;
-	    }
-	    catch(...)
-	    {
-		delete k;
-		throw;
-	    }
-	    delete k;
-	}
-    }
-    catch(Egeneric & e)
-    {
-	delete p_chemin;
-	throw;
-    }
-    delete p_chemin;
-
-    return num > 0;
-}
-
-static void read_ea(const string & name, ea_attributs & val, bool read_ea_root, bool read_ea_user)
-{
-    val.clear();
-    if(! read_ea_root && ! read_ea_user)
-	return; // nothing to do
-
-    char *n_ptr = tools_str2charptr(name);
-    if(n_ptr == NULL)
-	throw Ememory("read_ea_from");
-    try
-    {
-	vector<string> ea_liste = ea_filesystem_get_ea_list_for(n_ptr);
-	vector<string>::iterator it = ea_liste.begin();
-	
-	while(it != ea_liste.end())
-	{
-	    char *a_name = tools_str2charptr(*it);
-	    if(a_name == NULL)
-		throw Ememory("filesystem : read_ea_from");
-	    try
-	    {
-		const U_I MARGIN = 10;
-		ea_entry ea_ent;
-		S_32 taille = lgetxattr(n_ptr, a_name, NULL, 0);
-		char *value = NULL;
-		if(taille < 0)
-		    throw Erange("ea_filesystem read_ea", string("error reading attribut ") + a_name + " of file " + n_ptr + "  : " + strerror(errno));
-		value = new char[taille+MARGIN];
-		if(value == NULL)
-		    throw Ememory("filesystem : read_ea_from");
-		try
-		{
-		    taille = lgetxattr(n_ptr, a_name, value, taille+MARGIN);
-		    if(taille < 0)
-			throw Erange("ea_filesystem read_ea", string("error reading attribut ") + a_name + " of file " + n_ptr + "  : " + strerror(errno));
-		    split_ea_name(*it, ea_ent.domain, ea_ent.key);
-		    ea_ent.mode = ea_insert;
-		    ea_ent.value = string(&(value[0]), &(value[taille]));
-		    if((ea_ent.domain == ea_root && read_ea_root) ||
-		       (ea_ent.domain == ea_user && read_ea_user))
-			val.add(ea_ent);
-		}
-		catch(...)
-		{
-		    delete value;
-		    throw;
-		}
-		delete value;
-	    }
-	    catch(...)
-	    {
-		delete a_name;
-		throw;
-	    }
-	    delete a_name;
-	    it++;
-	}
-    }
-    catch(...)
-    {
-	delete n_ptr;
-	throw;
-    }
-    delete n_ptr;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-
-    dummy_call(id);
-}
-
-static vector<string> ea_filesystem_get_ea_list_for(const char *filename)
-{
-    vector<string> ret;
-    const U_I MARGIN = 20;
-    ssize_t taille = llistxattr(filename, NULL, 0);
-    char *liste = NULL;
-
-    if(taille < 0)
-    {
-	if(errno == ENOSYS || errno == ENOTSUP)
-	    return ret;
-	throw Erange("ea_filesystem_get_ea_list_for", string("error retreiving EA list for ")+filename+ " : " + strerror(errno));
-    }
-    
-    liste = new char[taille+MARGIN];
-    if(liste == NULL)
-	throw Ememory("filesystem : get_ea_list_for");
-    try
-    {
-	S_32 cursor = 0;
-	taille = llistxattr(filename, liste, taille+MARGIN);
-	if(taille < 0)
-	    throw Erange("ea_filesystem_get_ea_list_for", string("error retreiving EA list for ")+filename+ " : " + strerror(errno));
-	while(cursor < taille)
-	{
-	    ret.push_back(string(liste+cursor));
-	    cursor += strlen(liste+cursor)+1;
-	}
-    }
-    catch(...)
-    {
-	delete liste;
-	throw;
-    }
-    delete liste;
-    return ret;
-}
-
-static string ea_domain2string(ea_domain d)
-{
-    return ea_convert[d];
-}
-
-static ea_domain string2ea_domain(const string & x)
-{
-    if(x == ea_convert[ea_root])
-	return ea_root;
-    else if(x == ea_convert[ea_user])
-	return ea_user;
-    else
-	throw Erange("ea_filesystem : string2ea_domain", string("unknow EA namespace : ") + x);
-}
-
-static void split_ea_name(const string & src, ea_domain & d, string & key)
-{
-    U_I cesure = src.find_first_of(".");
-
-    if(cesure >= src.size() || cesure < 0)
-	throw Erange("ea_filesystem split_ea_name", string("unknown EA attribute name format : ") + src);
-    d = string2ea_domain(string(src.begin(), src.begin()+cesure));
-    key = string(src.begin()+cesure+1, src.end());
-}
-
-static string glue_ea_name(const ea_domain & d, const string & key)
-{
-    return ea_domain2string(d) + "." + key;
-}
-
-#endif
Index: dar/ea_filesystem.hpp
===================================================================
--- dar.orig/ea_filesystem.hpp	2012-05-02 11:23:23.075876134 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,38 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#ifndef EA_FILESYSTEM_HPP
-#define EA_FILESYSTEM_HPP
-
-#include <vector>
-#include <string>
-#include "ea.hpp"
-
-extern void ea_filesystem_read_ea(const string & chemin, ea_attributs & val, bool root, bool user);
-extern bool ea_filesystem_write_ea(const string & chemin, const ea_attributs & val, bool root, bool user);
-    // false if no EA could be set (true if at least one could be set)
-extern void ea_filesystem_clear_ea(const string & name, ea_domain dom);
-extern bool ea_filesystem_is_present(const string & name, ea_domain dom);
-
-#endif
Index: dar/erreurs.cpp
===================================================================
--- dar.orig/erreurs.cpp	2012-05-02 11:23:23.455876199 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,217 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <iostream>
-#include "infinint.hpp"
-#include "deci.hpp"
-#include "erreurs.hpp"
-
-static bool initialized = false;
-
-static void init();
-static void inattendue();
-static void notcatched();
-static string int_to_string(S_I i);
-
-list<Egeneric *> Egeneric::destroyed;
-list<Egeneric *> Egeneric::all_instances;
-
-Egeneric::Egeneric(const string &source, const string &message)
-{
-    if(!initialized)
-	init();
-    pile.push_front(niveau(source, message));
-    zombie = false;
-    all_instances.push_back(this);
-}
-
-Egeneric::Egeneric(const Egeneric & ref)
-{
-    pile = ref.pile;
-    zombie = ref.zombie;
-    all_instances.push_back(this);
-}
-
-void Egeneric::add_to_last_destroyed(Egeneric *obj)
-{
-    if(obj->zombie)
-	throw SRC_BUG;
-    else
-    {
-	destroyed.push_back(obj);
-	obj->zombie = true;
-	if(destroyed.size() > fifo_size)
-	{
-	    delete destroyed.front();
-	    destroyed.pop_front();
-	}
-    }
-}
-
-void Egeneric::dump() const
-{
-    string s;
-    list<niveau> & tmp = const_cast< list<niveau> & >(pile);
-    list<niveau>::iterator it;
-
-    it = tmp.begin();
-
-    cerr << "---- exception nature = [" << (zombie ? "zombie" : "alive") << "]  exception type = ["  << exceptionID() << "] ----------" << endl;
-    cerr << "[source]" << endl;
-    while(it != tmp.end())
-    {
-	cerr << '\t' << it->lieu << " : " << it->objet << endl;
-	it++;
-    }
-    cerr << "[most outside call]" << endl;
-    cerr << "-----------------------------------" << endl << endl;
-}
-
-U_I Egeneric::alive()
-{
-    U_I ret = 0;
-    list<Egeneric *>::iterator it = all_instances.begin();
-    
-    while(it != all_instances.end())
-	if(! (*it++)->zombie)
-	    ret++;
-
-    return ret;
-}
-
-void Egeneric::clear_last_destroyed()
-{
-    list<Egeneric *>::iterator it = destroyed.begin(); 
-
-    while(it != destroyed.end())
-	delete (*it++);
-
-    destroyed.clear();
-}
-
-void Egeneric::display_last_destroyed()
-{
-    list<Egeneric *>::iterator it = destroyed.begin(); 
-
-    while(it != destroyed.end())
-	(*it++)->dump();
-}
-
-void Egeneric::display_alive()
-{
-    list<Egeneric *>::iterator it = all_instances.begin();
-    
-    while(it != all_instances.end())
-    {
-	if(! (*it)->zombie)
-	    (*it)->dump();
-	it++;
-    }
-}
-
-Ebug::Ebug(const string & file, S_I line) : Egeneric(string("file ") + file + " line " + int_to_string(line), "it seems to be a bug here") {};
-void Ebug::stack(const string & passage, const string & file, const string & line) 
-{
-    Egeneric::stack(passage, string("in file ") + file + " line " + string(line));
-}
-
-static void init()
-{
-    set_unexpected(inattendue);
-    set_terminate(notcatched);
-    initialized = true;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void status()
-{
-    cerr << endl <<" Exceptions : " << endl;
-    cerr << "\t alive  = " << Egeneric::alive() << endl;
-    cerr << "\t zombie = " << Egeneric::zombies() << endl;
-    cerr << "\t --------------------" << endl;
-    cerr << "\t total  = " << Egeneric::total() << endl <<endl;
-}
-
-static void inattendue()
-{
-    cerr << "###############################################" << endl;
-    cerr << "#   UNEXPECTED EXCEPTION,                     #" << endl;
-    cerr << "#                         E X I T I N G !     #" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "###############################################" << endl;
-    status();
-    cerr << "###############################################" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "#     LIST OF STILL ALIVE EXCEPTIONS :        #" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "###############################################" << endl;
-    Egeneric::display_alive();
-    cerr << "###############################################" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "#     LIST OF LAST DESTROYED EXCEPTIONS :     #" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "###############################################" << endl;
-    Egeneric::display_last_destroyed();
-}
-
-static void notcatched()
-{
-    cerr << "###############################################" << endl;
-    cerr << "#   NOT CAUGHT EXCEPTION,                     #" << endl;
-    cerr << "#                         E X I T I N G !     #" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "###############################################" << endl;
-    status();
-    cerr << "###############################################" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "#     LIST OF STILL ALIVE EXCEPTIONS :        #" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "###############################################" << endl;
-    Egeneric::display_alive();
-    cerr << "###############################################" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "#     LIST OF LAST DESTROYED EXCEPTIONS :     #" << endl;
-    cerr << "#                                             #" << endl;
-    cerr << "###############################################" << endl;
-    Egeneric::display_last_destroyed();
-}
-
-static string int_to_string(S_I i)
-{
-    infinint tmp;
-
-    if(i < 0)
-	tmp = (U_I)-i;
-    else
-	tmp = (U_I)i;
-
-    return (i < 0 ? string("-") : string("")) + deci(tmp).human();
-}
Index: dar/erreurs.hpp
===================================================================
--- dar.orig/erreurs.hpp	2012-05-02 11:23:23.095875852 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,192 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef ERREURS_HPP
-#define ERREURS_HPP
-
-#pragma interface
-
-#include <string>
-#include <list>
-#include "integers.hpp"
-
-using namespace std;
-
-#define E_BEGIN try {
-#define E_END(passage, message)  } catch(Egeneric & e) { e.stack(passage, message); throw; } 
-
-class Egeneric 
-{
-public : 
-    Egeneric(const string &source, const string &message);
-    Egeneric(const Egeneric & ref);
-    virtual ~Egeneric() { all_instances.remove(this); };
-
-    virtual void stack(const string & passage, const string & message = "") { pile.push_back(niveau(passage, message)); };
-    string get_message() const { return pile.front().objet; };
-    void dump() const;
-
-    static U_I total() { return all_instances.size(); };
-    static U_I zombies() { return destroyed.size(); };
-    static U_I alive();
-    static void clear_last_destroyed();
-    static void display_last_destroyed(); // displays and clear the last destroyed exceptions fifo
-    static void display_alive();
-
-protected :
-    bool zombie;
-
-    virtual string exceptionID() const = 0;
-    void add_to_last_destroyed(Egeneric *obj);
-
-private :
-    struct niveau
-    {
-	niveau(const string &ou, const string &quoi) { lieu = ou; objet = quoi; };
-	string lieu, objet;
-    };
-    list<niveau> pile;
-
-    static const U_I fifo_size = 10; // number of last destroyed exceptions recorded
-    static list<Egeneric *> destroyed; // copies of destroyed last execeptions 
-    static list<Egeneric *> all_instances;
-};
-
-class Ememory : public Egeneric
-{
-public:
-    Ememory(const string &source) : Egeneric(source, "Lack of Memory") {};
-    ~Ememory() { if(!zombie) add_to_last_destroyed(new Ememory(*this)); };
-
-protected :
-    string exceptionID() const { return "MEMORY"; };
-    Ememory *dup() const { return new Ememory(*this); };
-};
-
-#define SRC_BUG Ebug(__FILE__, __LINE__)
-#define XMT_BUG(exception, call) exception.stack(call, __FILE__, __LINE__)
-
-class Ebug : public Egeneric 
-{
-public :
-    Ebug(const string & file, S_I line);
-    ~Ebug() { if(!zombie) add_to_last_destroyed(new Ebug(*this)); };
-    
-    void stack(const string & passage, const string & file, const string & line);
-protected :
-    string exceptionID() const { return "BUG"; };
-    Ebug *dup() const { return new Ebug(*this); };
-};
-
-class Einfinint : public Egeneric 
-{
-public :
-    Einfinint(const string & source, const string & message) : Egeneric(source, message) {};
-    ~Einfinint() { if(!zombie) add_to_last_destroyed(new Einfinint(*this)); };
-
-protected :
-    string exceptionID() const { return "INFININT"; };
-    Einfinint *dup() const { return new Einfinint(*this); };
-};
-
-class Erange : public Egeneric 
-{
-public :
-    Erange(const string & source, const string & message) : Egeneric(source, message) {};
-    ~Erange() { if(!zombie) add_to_last_destroyed(new Erange(*this)); };
-
-protected : 
-    string exceptionID() const { return "RANGE"; };
-    Erange *dup() const { return new Erange(*this); };
-};
-
-class Edeci : public Egeneric 
-{
-public :
-    Edeci(const string & source, const string & message) : Egeneric(source, message) {};
-    ~Edeci() { if(!zombie) add_to_last_destroyed(new Edeci(*this)); };
-
-protected :
-    string exceptionID() const { return "DECI"; };
-    Edeci *dup() const { return new Edeci(*this); };
-};
-
-class Efeature : public Egeneric
-{
-public :
-    Efeature(const string & message) : Egeneric("", message) {};
-    ~Efeature() { if(!zombie) add_to_last_destroyed(new Efeature(*this)); };
-
-protected :
-    string exceptionID() const { return "UNIMPLEMENTED FEATURE"; };
-    Efeature *dup() const { return new Efeature(*this); };
-};
-
-class Ehardware : public Egeneric
-{
-public :
-    Ehardware(const string & source, const string & message) : Egeneric(source, message) {};
-    ~Ehardware() { if(!zombie) add_to_last_destroyed(new Ehardware(*this)); };
-
-protected :
-    string exceptionID() const { return "HARDWARE ERROR"; };
-    Ehardware *dup() const { return new Ehardware(*this); };
-};
-
-class Euser_abort : public Egeneric
-{
-public :
-    Euser_abort(const string & msg) : Egeneric("",msg) {};
-    ~Euser_abort() { if(!zombie) add_to_last_destroyed(new Euser_abort(*this)); };
-
-protected :
-    string exceptionID() const { return "USER ABORTED OPERATION"; };
-    Euser_abort *dup() const { return new Euser_abort(*this); };
-};
-
-
-class Edata : public Egeneric
-{
-public :
-    Edata(const string & msg) : Egeneric("", msg) {};
-    ~Edata() { if(!zombie) add_to_last_destroyed(new Edata(*this)); };
-
-protected :
-    string exceptionID() const { return "ERROR IN TREATED DATA"; };
-    Edata *dup() const { return new Edata(*this); };
-};
-
-
-class Escript : public Egeneric
-{
-public :
-    Escript(const string & source, const string & msg) : Egeneric(source ,msg) {};
-    ~Escript() { if(!zombie) add_to_last_destroyed(new Escript(*this)); };
-
-protected :
-    string exceptionID() const { return "USER ABORTED OPERATION"; };
-    Escript *dup() const { return new Escript(*this); };
-};
-
-#endif
Index: dar/etage.cpp
===================================================================
--- dar.orig/etage.cpp	2012-05-02 11:23:23.119876112 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,62 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <dirent.h>
-#include <errno.h>
-#include "etage.hpp"
-
-
-etage::etage(char *dirname)
-{
-    struct dirent *ret;
-    DIR *tmp = opendir(dirname);
-    
-    if(tmp == NULL)
-	throw Erange("filesystem etage::etage" , strerror(errno));
-    
-    fichier.clear();
-    while((ret = readdir(tmp)) != NULL)
-	if(strcmp(ret->d_name, ".") != 0 && strcmp(ret->d_name, "..") != 0) 
-	    fichier.push_back(string(ret->d_name));
-    closedir(tmp);
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-    
-bool etage::read(string & ref)
-{
-    if(fichier.size() > 0)
-    {
-	ref = fichier.front();
-	fichier.pop_front();
-	return true;
-    }
-    else 
-	return false;
-}
Index: dar/etage.hpp
===================================================================
--- dar.orig/etage.hpp	2012-05-02 11:23:23.499876441 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,42 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef ETAGE_HPP
-#define ETAGE_HPP
-
-#include <list>
-#include <string>
-#include "infinint.hpp"
-
-struct etage
-{
-    etage() { fichier.clear(); };
-    etage(char *dirname);
-    bool read(string & ref);
-
-    list<string> fichier;
-    infinint last_mod, last_acc;
-};
-
-#endif
Index: dar/factoriel.cpp
===================================================================
--- dar.orig/factoriel.cpp	2012-05-02 11:23:23.323876384 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,97 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string>
-#include <iostream>
-#include <errno.h>
-#include "infinint.hpp"
-#include "deci.hpp"
-#include "erreurs.hpp"
-#include "test_memory.hpp"
-#include "generic_file.hpp"
-#include "integers.hpp"
-
-S_I main(S_I argc, char *argv[]) throw()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    try
-    {
-	if(argc != 2 && argc != 3)
-	    exit(1);
-	
-	string s = argv[1];
-	deci f = s;
-	infinint max = f.computer();
-	infinint i = 2;
-	infinint p = 1;
-	
-	while(i <= max)
-	    p *= i++;
-
-	cout << "calcul finished, now computing the decimal representation ... " << endl;
-	f = deci(p);
-	cout << f.human() << endl;
-	if(argc == 3)
-	{
-	    S_I fd = open(argv[2], O_RDWR|O_CREAT|O_TRUNC, 0644);
-	    if(fd < 0)
-		cout << "cannot open file for test ! " << strerror(errno) << endl;
-	    else
-	    {
-		fichier fic = fd;
-		infinint cp;
-
-		p.dump(fic);
-		fic.skip(0);
-		cp.read_from_file(fic);
-		cout << "read from file: " << cp << endl;
-	    }
-	}
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-
-    infinint *tmp;
-    {
-	MEM_IN;
-	tmp = new infinint(19237);
-	delete tmp;
-	MEM_OUT;
-    }
-    MEM_OUT; // matches the MEM_IN at the beginning of main
-    MEM_END;
-}    
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
Index: dar/filesystem.cpp
===================================================================
--- dar.orig/filesystem.cpp	2012-05-02 11:23:23.383876696 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,1462 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <errno.h>
-#include <utime.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <map>
-#include <ctype.h>
-
-#ifdef NO_DUMP_FEATURE
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <linux/ext2_fs.h>
-#endif
-
-#include "tools.hpp"
-#include "erreurs.hpp"
-#include "filesystem.hpp"
-#include "user_interaction.hpp"
-#include "catalogue.hpp"
-#include "ea_filesystem.hpp"
-
-#ifndef UNIX_PATH_MAX
-#define UNIX_PATH_MAX 108
-#endif
-
-static void supprime(const path & ref);
-static void make_owner_perm(const inode & ref, const path & ou, bool dir_perm, bool ignore_ownership);
-static void make_date(const string & chemin, infinint access, infinint modif);
-static void attach_ea(const string &chemin, inode *ino, bool ea_root_mode, bool ea_user_mode);
-static void set_back_dir_dates(const string & chem, const infinint & last_acc, const infinint & last_mod);
-static bool is_nodump_flag_set(const path & chem, const string & filename);
-
-///////////////////////////////////////////////////////////////////
-///////////////// filesystem_hard_link_read methods ///////////////
-///////////////////////////////////////////////////////////////////
-
-nomme *filesystem_hard_link_read::make_read_entree(path & lieu, const string & name, bool see_hard_link, bool ea_root_mode, bool ea_user_mode)
-{
-    char *ptr_name = name != "" ? 
-	tools_str2charptr((lieu + path(name)).display())
-	: tools_str2charptr(lieu.display());
-    nomme *ref = NULL;
-    
-    try
-    {
-	struct stat buf;
-
-	if(lstat(ptr_name, &buf) < 0)
-	{
-	    switch(errno)
-	    {
-	    case EACCES:
-		user_interaction_warning(string("error reading inode of ") + ptr_name + " : " + strerror(errno));
-		break;
-	    case ENOENT:
-		break;
-	    default:
-		throw Erange("filesystem_hard_link_read::make_read_entree", string("lstat(") + ptr_name + ") : " + strerror(errno));
-	    }
-		
-		// the function returns NULL (meaning file does not exists)
-	}
-	else
-	{ 
-	    if(S_ISLNK(buf.st_mode))
-	    {
-		const S_I buf_size = 4096;
-		char buffer[buf_size];
-		
-		S_I sz = readlink(ptr_name, buffer, buf_size);
-		if(sz < 0)
-		    throw Erange("filesystem_hard_link_read::make_read_entree", strerror(errno));
-		if(sz == buf_size)
-		    throw Erange("filesystem_hard_link_read::make_read_entree", string("link target name too long, increase buffer size in source code file ") + __FILE__);
-		else
-		    buffer[sz] = '\0';
-		
-		ref = new lien(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-			       buf.st_atime,
-			       buf.st_mtime,
-			       name,
-			       buffer);
-	    }
-	    else if(S_ISREG(buf.st_mode))
-	    {
-		if(buf.st_nlink == 1 || ! see_hard_link) // file without hard link
-		    ref = new file(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-				   buf.st_atime,
-				   buf.st_mtime,
-				   name,
-				   lieu,
-				   buf.st_size);
-		else // file with hard link(s)
-		{
-		    map <ino_t, couple>::iterator it = corres_read.find(buf.st_ino);
-		    
-		    if(it == corres_read.end()) // inode not seen yet, first link on it
-		    { 
-			file_etiquette *ptr = new file_etiquette(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-								 buf.st_atime,
-								 buf.st_mtime,
-								 name,
-								 lieu,
-								 buf.st_size);
-			ref = ptr;
-			if(ref != NULL)
-			{
-			    couple tmp;
-			    tmp.count = buf.st_nlink - 1;
-			    tmp.obj = ptr;
-			    corres_read[buf.st_ino] = tmp;
-			}
-		    }
-		    else  // inode already seen previously
-		    {
-			ref = new hard_link(name, it->second.obj);
-
-			if(ref != NULL)
-			{
-			    it->second.count--;
-			    if(it->second.count == 0)
-				corres_read.erase(it);
-			}
-		    }
-		}
-	    }
-	    else if(S_ISDIR(buf.st_mode))
-	    {
-		ref = new directory(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-				    buf.st_atime,
-				    buf.st_mtime,
-				    name);
-	    }
-	    else if(S_ISCHR(buf.st_mode))
-		ref = new chardev(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-				  buf.st_atime,
-				  buf.st_mtime,
-				  name,
-				  major(buf.st_rdev),
-				  minor(buf.st_rdev)); // makedev(major, minor)
-	    else if(S_ISBLK(buf.st_mode))
-		ref = new blockdev(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-				   buf.st_atime,
-				   buf.st_mtime,
-				   name,
-				   major(buf.st_rdev),
-				   minor(buf.st_rdev)); // makedev(major, minor)
-	    else if(S_ISFIFO(buf.st_mode))
-		ref = new tube(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-			       buf.st_atime,
-			       buf.st_mtime,
-			       name);
-	    else if(S_ISSOCK(buf.st_mode))
-		ref = new prise(buf.st_uid, buf.st_gid, buf.st_mode & 07777,
-				buf.st_atime,
-				buf.st_mtime,
-				name);
-	    else
-		throw Erange("filesystem_hard_link_read::make_read_entree", string("unknown file type ! file is ") + string(ptr_name));
-
-	    if(ref == NULL)
-		throw Ememory("filesystem_hard_link_read::make_read_entree");
-	    
-	    inode *ino = dynamic_cast<inode *>(ref);
-	    if(ino != NULL)
-	    {
-		try
-		{
-		    attach_ea(ptr_name, ino, ea_root_mode, ea_user_mode);
-		    if(ino->ea_get_saved_status() != inode::ea_none)
-			ino->set_last_change(buf.st_ctime);
-		}
-		catch(Ebug & e)
-		{
-		    throw;
-		}
-		catch(Euser_abort & e)
-		{
-		    throw;
-		}
-		catch(Ememory & e)
-		{
-		    throw;
-		}
-		catch(Egeneric & ex)
-		{
-		    user_interaction_warning(string("error reading EA for ")+ptr_name+ " : " + ex.get_message());
-			// no throw !
-			// we must be able to continue without EA
-		}
-	    }
-	}
-    }
-    catch(...)
-    {
-	delete ptr_name;
-	throw;
-    }
-    delete ptr_name;
-
-    return ref;
-
-}
-
-void filesystem_hard_link_read::forget_etiquette(file_etiquette *obj)
-{
-    map<ino_t, couple>::iterator it = corres_read.begin();
-    
-    while(it != corres_read.end() && it->second.obj != obj)
-	it++;
-
-    if(it != corres_read.end())
-	corres_read.erase(it);
-}
-
-
-///////////////////////////////////////////////////////////////////
-///////////////// filesystem_backup methods ///////////////////////
-///////////////////////////////////////////////////////////////////
-
-
-filesystem_backup::filesystem_backup(const path &root, bool x_info_details, bool root_ea, bool user_ea, bool check_no_dump_flag)
-{
-    char *ptr = tools_str2charptr(root.display());
-
-    try
-    {
-	fs_root = new path(root);
-	if(fs_root == NULL)
-	    throw Ememory("filesystem_backup::filesystem_backup");
-	info_details = x_info_details;
-	ea_root = root_ea;
-	ea_user = user_ea;
-	no_dump_check = check_no_dump_flag;
-	current_dir = NULL;
-
-	struct stat buf;
-	if(stat(ptr, &buf) < 0)
-	    throw Erange("filesystem_backup::filesystem_backup", string("can't open directory ")+fs_root->display() + " : " + strerror(errno));
-	if(!S_ISDIR(buf.st_mode))
-	    throw Erange("filesystem_backup::filesystem_backup", fs_root->display() + " is not a directory");
-    }
-    catch(...)
-    {
-	delete ptr;
-	if(fs_root != NULL)
-	{
-	    delete fs_root;
-	    fs_root = NULL;
-	}
-	throw;
-    }
-    delete ptr;
-    
-    reset_read();
-}
-
-void filesystem_backup::detruire()
-{
-    if(fs_root != NULL)
-    {
-	delete fs_root;
-	fs_root = NULL;
-    }
-    if(current_dir != NULL)
-	delete current_dir;
-}
-
-void filesystem_backup::copy_from(const filesystem_backup & ref)
-{
-    if(ref.fs_root != NULL)
-	fs_root = new path(*ref.fs_root);
-    else
-	fs_root = NULL;
-
-    if(ref.current_dir != NULL)
-	current_dir = new path(*ref.current_dir);
-    else
-	current_dir = NULL;
-    info_details = ref.info_details;
-    ea_root = ref.ea_root;
-    ea_user = ref.ea_user;
-    no_dump_check = ref.no_dump_check;
-    filename_pile = ref.filename_pile;
-    pile = ref.pile;
-}
-
-void filesystem_backup::reset_read()
-{
-    char *tmp;	
-
-    corres_reset();
-    file_etiquette::reset_etiquette_counter();
-    if(current_dir != NULL)
-	delete current_dir;
-    current_dir = new path(*fs_root);
-    filename_pile.clear();
-    if(current_dir == NULL)
-	throw Ememory("filesystem_backup::reset_read");
-    pile.clear();
-
-    tmp = tools_str2charptr(current_dir->display());
-    try
-    {
-	entree *ref = make_read_entree(*current_dir, "", true, ea_root, ea_user);
-	directory *ref_dir = dynamic_cast<directory *>(ref);
-	try
-	{
-	    pile.push_back(etage(tmp));
-	    if(ref_dir != NULL)
-	    {
-		filename_struct rfst;
-		
-		rfst.last_acc = pile.back().last_acc = ref_dir->get_last_access();
-		rfst.last_mod = pile.back().last_mod = ref_dir->get_last_modif();
-		filename_pile.push_back(rfst);
-	    }
-	    else
-		if(ref == NULL)
-		    throw Erange("filesystem_backup::reset_read", string("Non existant file: ") + tmp);
-		else
-		    throw Erange("filesystem_backup::reset_read", string("File must be a directory: ")+ tmp);
-	}
-	catch(...)
-	{
-	    if(ref != NULL)
-		delete ref;
-	    throw;
-	}
-	if(ref != NULL)
-	    delete ref;
-    }
-    catch(...)
-    {
-	delete tmp;
-	throw;
-    }
-    delete tmp;
-}
-
-
-bool filesystem_backup::read(entree * & ref)
-{
-    bool once_again;
-    ref = NULL;
-
-    if(current_dir == NULL)
-	throw SRC_BUG; // constructor not called or badly implemented.
-    
-    do
-    {
-	once_again = false;
-
-	if(pile.size() == 0)
-	    return false; // end of filesystem reading
-	else // at least one directory to read
-	{
-	    etage & inner = pile.back();
-	    string name;
-	    
-	    if(!inner.read(name))
-	    {
-		string tmp;
-		
-		set_back_dir_dates(current_dir->display(), inner.last_acc, inner.last_mod);
-		pile.pop_back();
-		if(pile.size() > 0)
-		{
-		    if(! current_dir->pop(tmp))
-			throw SRC_BUG;
-		    ref = new eod();
-		}
-		else
-		    return false; // end of filesystem
-	    }
-	    else // could read a filename in directory
-	    {
-		try
-		{
-			// checking the EXT2 nodump flag (if set ignoring the file)
-
-		    if(!no_dump_check || !is_nodump_flag_set(*current_dir, name))
-		    {
-			ref = make_read_entree(*current_dir, name, true, ea_root, ea_user);
-			directory *ref_dir = dynamic_cast<directory *>(ref);
-			
-			if(ref_dir != NULL)
-			{
-			    char *ptr_name;
-			    
-			    *current_dir += name;
-			    ptr_name = tools_str2charptr(current_dir->display());
-			    
-			    try
-			    {
-				pile.push_back(etage(ptr_name));
-				pile.back().last_acc = ref_dir->get_last_access();
-				pile.back().last_mod = ref_dir->get_last_modif();
-			    }
-			    catch(Erange & e)
-			    {
-				string tmp;
-				
-				user_interaction_warning(string("error openning ") + ptr_name + " : " + e.get_message());
-				try
-				{
-				    pile.push_back(etage());
-				    pile.back().last_acc = 0;
-				    pile.back().last_mod = 0;
-				}
-				catch(Erange & e)
-				{
-				    delete ref;
-				    once_again = true;
-				    ref = NULL;
-				    if(! current_dir->pop(tmp))
-					throw SRC_BUG;
-				}
-			    }
-			    catch(Egeneric & e)
-			    {
-				delete ptr_name;
-				delete ref;
-				throw;
-			    }
-			    
-			    delete ptr_name;
-			}
-		    
-		    
-			if(ref == NULL)
-			    once_again = true;
-			    // the file has been removed between the time
-			    // the directory has been openned, and the time
-			    // we try to read it, so we ignore it.
-		    }
-		    else // EXT2 nodump flag is set, and we must not consider such file for backup
-		    {
-			if(info_details)
-			    user_interaction_warning(string("ignoring file with NODUMP flag set: ") + (*current_dir + name).display());
-			once_again = true;
-		    }
-		}
-		catch(Erange & e)
-		{
-		    user_interaction_warning("error reading directory contents : " + e.get_message() + " . Ignoring file or directory");
-		    once_again = true;
-		}
-	    }
-	}
-    }
-    while(once_again);
-
-    if(ref == NULL)
-	throw Ememory("filesystem_backup::read");
-    else
-	return true;
-}
-
-void filesystem_backup::skip_read_to_parent_dir()
-{
-    string tmp;
-
-    if(pile.size() == 0)
-	throw SRC_BUG;
-    else
-    {
-	set_back_dir_dates(current_dir->display(), pile.back().last_acc, pile.back().last_mod);
-	pile.pop_back();
-    }
-    
-    if(! current_dir->pop(tmp))
-	throw SRC_BUG;
-}
-
-
-///////////////////////////////////////////////////////////////////
-////////////////// filesystem_diff methods  ///////////////////////
-///////////////////////////////////////////////////////////////////
-
-
-filesystem_diff::filesystem_diff(const path &root, bool x_info_details, bool root_ea, bool user_ea)
-{
-    char *ptr = tools_str2charptr(root.display());
-    try
-    {
-	fs_root = new path(root);
-	if(fs_root == NULL)
-	    throw Ememory("filesystem_diff::filesystem_diff");
-	info_details = x_info_details;
-	ea_root = root_ea;
-	ea_user = user_ea;
-	current_dir = NULL;
-	
-	struct stat buf;
-	if(stat(ptr, &buf) < 0)
-	    throw Erange("filesystem_diff::filesystem_diff", string("cannot open directory ")+fs_root->display() + " : " + strerror(errno));
-	if(!S_ISDIR(buf.st_mode))
-	    throw Erange("filesystem_diff::filesystem_diff", fs_root->display() + " is not a directory");
-    }
-    catch(...)
-    {
-	delete ptr;
-	if(fs_root != NULL)
-	{
-	    delete fs_root;
-	    fs_root = NULL;
-	}
-	throw;
-    }
-    delete ptr;
-
-    reset_read();
-}
-
-
-void filesystem_diff::reset_read()
-{
-    char *tmp;	
-
-    corres_reset();
-    file_etiquette::reset_etiquette_counter();
-    if(current_dir != NULL)
-	delete current_dir;
-    current_dir = new path(*fs_root);
-    filename_pile.clear();
-    if(current_dir == NULL)
-	throw Ememory("filesystem_diff::reset_read");
-    tmp = tools_str2charptr(current_dir->display());
-    try
-    {
-	entree *ref = make_read_entree(*current_dir, "", true, ea_root, ea_user);
-	directory *ref_dir = dynamic_cast<directory *>(ref);
-	try
-	{
-	    if(ref_dir != NULL)
-	    {
-		filename_struct rfst;
-		
-		rfst.last_acc = ref_dir->get_last_access();
-		rfst.last_mod = ref_dir->get_last_modif();
-		filename_pile.push_back(rfst);
-	    }
-	    else
-		if(ref == NULL)
-		    throw Erange("filesystem_diff::reset_read", string("Non existant file: ") + tmp);
-		else
-		    throw Erange("filesystem_diff::reset_read", string("File must be a directory: ")+ tmp);
-	}
-	catch(...)
-	{
-	    if(ref != NULL)
-		delete ref;
-	    throw;
-	}
-	if(ref != NULL)
-	    delete ref;
-    }
-    catch(...)
-    {
-	delete tmp;
-	throw;
-    }
-    delete tmp;
-}
-
-bool filesystem_diff::read_filename(const string & name, nomme * &ref)
-{
-    directory *ref_dir = NULL;
-    if(current_dir == NULL)
-	throw SRC_BUG;
-    ref = make_read_entree(*current_dir, name, false, ea_root, ea_user);
-    if(ref == NULL)
-	return false; // no file of that name
-    else
-    {
-	ref_dir = dynamic_cast<directory *>(ref);
-	if(ref_dir != NULL)
-	{
-	    filename_struct rfst;
-
-	    rfst.last_acc = ref_dir->get_last_access();
-	    rfst.last_mod = ref_dir->get_last_modif();
-	    filename_pile.push_back(rfst);
-	    *current_dir += ref_dir->get_name();
-	}
-	return true;
-    }
-}
-
-void filesystem_diff::skip_read_filename_in_parent_dir()
-{
-    if(filename_pile.size() > 0)
-    {
-	string tmp;
-	set_back_dir_dates(current_dir->display(), filename_pile.back().last_acc, filename_pile.back().last_mod);
-	filename_pile.pop_back();
-	current_dir->pop(tmp);
-    }
-    else
-	throw SRC_BUG;
-}
-
-void filesystem_diff::detruire()
-{
-    if(fs_root != NULL)
-	delete fs_root;
-    if(current_dir != NULL)
-	delete current_dir;
-}
-
-void filesystem_diff::copy_from(const filesystem_diff & ref)
-{
-    if(ref.fs_root != NULL)
-	fs_root = new path(*ref.fs_root);
-    else
-	fs_root = NULL;
-    if(ref.current_dir != NULL)
-	current_dir = new path(*ref.current_dir);
-    else
-	current_dir = NULL;
-    info_details = ref.info_details;
-    ea_root = ref.ea_root;
-    ea_user = ref.ea_user;
-    filename_pile = ref.filename_pile;
-}
-
-
-
-///////////////////////////////////////////////////////////////////
-////////////////// filesystem_hard_link_write methods  ////////////
-///////////////////////////////////////////////////////////////////
-
-bool filesystem_hard_link_write::ea_has_been_restored(const hard_link *h)
-{
-    if(h == NULL)
-	throw SRC_BUG;
-    map<infinint, corres_ino_ea>::iterator it = corres_write.find(h->get_etiquette());
-    if(it == corres_write.end())
-	return false;
-    else
-	return it->second.ea_restored;
-}
-
-bool filesystem_hard_link_write::set_ea(const nomme *e, const ea_attributs & l, path spot,
-					bool allow_overwrite, bool warn_overwrite,
-					bool info_details)
-{
-    const etiquette *e_eti = dynamic_cast<const etiquette *>(e);
-    const directory *e_dir = dynamic_cast<const directory *>(e);
-    bool ret = false;
-    bool exists;
-
-    try
-    {
-	if(e == NULL)
-	    throw SRC_BUG;
-	    // buidling the path to file
-	if(e_dir == NULL) // not a directory (directory get a chdir in them so write_current_dir is up to date)
-	    spot += e->get_name();
-	
-	    // checking that we have not already restored the EA of this
-	    // inode throw a hard link
-	if(e_eti != NULL)
-	{
-	    map<infinint, corres_ino_ea>::iterator it;
-	    
-	    it = corres_write.find(e_eti->get_etiquette());
-	    if(it == corres_write.end())
-	    {
-		    // inode never restored; (no data saved just EA)
-		    // we must record it
-		corres_ino_ea tmp;
-		tmp.chemin = spot.display();
-		tmp.ea_restored = true;
-		corres_write[e_eti->get_etiquette()] = tmp;
-	    }
-	    else
-		if(it->second.ea_restored)
-		    return false; // inode already restored
-		else
-		    it->second.ea_restored = true;
-	}
-	
-	string chemin = spot.display();
-
-	    // restoring the root EA 
-	    //
-	exists = ea_filesystem_is_present(chemin, ea_root);
-	if(!exists || allow_overwrite)
-	{
-	    if(ea_root)
-	    {
-		if(exists && warn_overwrite)
-		    user_interaction_pause(string("system EA for ")+chemin+ " are about to be overwriten, continue ? ");
-		ea_filesystem_clear_ea(chemin, ea_root);
-		if(ea_filesystem_write_ea(chemin, l, true, false))
-		{
-		    if(info_details)
-			user_interaction_warning(string("restoring system EA for ")+chemin);
-		    ret = true;
-		}
-		else
-		    if(exists && l.size() == 0)
-			ret = true; // EA have changed, (no more EA)
-	    }
-	}
-	else
-	    if(ea_root)
-		user_interaction_warning(string("system EA for ")+chemin+" will not be restored, (overwriting not allowed)");
-
-	    // restoring the user EA 
-	    //
-	exists = ea_filesystem_is_present(chemin, ea_user);
-	if(!exists || allow_overwrite)
-	{
-	    if(ea_user)
-	    {
-		if(exists && warn_overwrite)
-		    user_interaction_pause(string("user EA for ")+chemin+ " are about to be overwriten, continue ? ");
-		ea_filesystem_clear_ea(chemin, ea_user);
-		if(ea_filesystem_write_ea(chemin, l, false, true))
-		{
-		    if(info_details)
-			user_interaction_warning(string("restoring user EA for ")+chemin);
-		    ret = true;
-		}
-		else
-		    if(exists && l.size() == 0)
-			ret = true; // EA have changed, (no more EA)
-	    }
-	}
-	else
-	    if(ea_user)
-		user_interaction_warning(string("user EA for ")+chemin+" will not be restored, (overwriting not allowed)");
-    }
-    catch(Euser_abort & e)
-    {
-	ret = false;
-    }
-
-    return ret;
-}
-
-void filesystem_hard_link_write::write_hard_linked_target_if_not_set(const etiquette *ref, const string & chemin)
-{
-    if(!known_etiquette(ref->get_etiquette()))
-    {
-	corres_ino_ea tmp;
-	tmp.chemin = chemin;
-	tmp.ea_restored = false; // if EA have to be restored next
-	corres_write[ref->get_etiquette()] = tmp;
-    }
-}
-
-bool filesystem_hard_link_write::known_etiquette(const infinint & eti)
-{
-    return corres_write.find(eti) != corres_write.end();
-}
-
-void filesystem_hard_link_write::make_file(const nomme * ref, const path & ou, bool dir_perm, bool ignore_owner)
-{
-    const directory *ref_dir = dynamic_cast<const directory *>(ref);
-    const file *ref_fil = dynamic_cast<const file *>(ref);
-    const lien *ref_lie = dynamic_cast<const lien *>(ref);
-    const blockdev *ref_blo = dynamic_cast<const blockdev *>(ref);
-    const chardev *ref_cha = dynamic_cast<const chardev *>(ref);
-    const tube *ref_tub = dynamic_cast<const tube *>(ref);
-    const prise *ref_pri = dynamic_cast<const prise *>(ref);
-    const etiquette *ref_eti = dynamic_cast <const etiquette *>(ref);
-    const inode *ref_ino = dynamic_cast <const inode *>(ref);
-
-    if(ref_ino == NULL && ref_eti == NULL)
-	throw SRC_BUG; // neither an inode nor a hard link
-
-    char *name = tools_str2charptr((ou + ref->get_name()).display());
-
-    try
-    {
-	S_I ret;
-	
-	do
-	{
-	    if(ref_eti != NULL) // we potentially have to make a hard link
-	    {
-		bool create_file = false;
-		map<infinint, corres_ino_ea>::iterator it = corres_write.find(ref_eti->get_etiquette());
-		if(it == corres_write.end()) // first time, we have to create the inode
-		{
-		    corres_ino_ea tmp;
-		    tmp.chemin = string(name);
-		    tmp.ea_restored = false;
-		    corres_write[ref_eti->get_etiquette()] = tmp;
-		    create_file = true;
-		}
-		else // the inode already exists, making hard link if possible
-		{
-		    char *old = tools_str2charptr(it->second.chemin);
-		    try
-		    {
-			ret = link(old, name);
-			if(ret < 0)
-			{
-			    switch(errno)
-			    {
-			    case EXDEV:
-			    case EPERM:
-				// can't make hard link, trying to duplicate the inode
-				user_interaction_warning(string("error creating hard link ") + name + " : " + strerror(errno) + "\n Trying to duplicate the inode");
-				create_file = true;
-				clear_corres(ref_eti->get_etiquette()); 
-				    // need to remove this entry to be able
-				    // to restore EA for other copies
-				break;
-			    case ENOENT:
-				if(ref_eti->get_inode()->get_saved_status() == s_saved)
-				{
-				    create_file = true;
-				    clear_corres(ref_eti->get_etiquette());
-					// need to remove this entry to be able
-					// to restore EA for other copies
-				    user_interaction_warning(string("error creating hard link : ") + name + " , the inode to link with [" + old + "] has disapeared, re-creating it");
-				    
-				}
-				else
-				{
-				    create_file = false; // nothing to do;
-				    user_interaction_warning(string("error creating hard link : ") + name + " , the inode to link with [" + old + "] is not present, cannot restore this hard link");
-				}
-				break;
-			    default :
-				// nothing to do (ret < 0 and create_file == false)
-				break;
-			    }
-			}
-			else
-			    create_file = false;
-		    }
-		    catch(...)
-		    {
-			delete old;
-			throw;
-		    }
-		    delete old;
-		}
-
-		if(create_file)
-		{
-		    file remplacant = file(*ref_eti->get_inode());
-
-		    remplacant.change_name(ref->get_name());
-		    make_file(&remplacant, ou, dir_perm, ignore_owner); // recursive call but with a plain file as argument
-		    ref_ino = NULL; // to avoid setting the owner & permission twice (previous line, and below)
-		    ret = 0; // to exist from while loop
-		}
-		else // hard link made
-		    ret = 0; // not necessary, but avoids a warning from compilator (ret might be used uninitialized)
-	    }
-	    else if(ref_dir != NULL)
-	    {
-		ret = mkdir(name, 0777);
-	    } 
-	    else if(ref_fil != NULL)
-	    {
-		generic_file *ou;
-		infinint seek;
-		
-		ret = open(name, O_WRONLY|O_CREAT, 0777);
-		if(ret >= 0)
-		{
-		    fichier dest = ret;
-		    ou = ref_fil->get_data();
-		    try
-		    {
-			crc crc_dyn, crc_ori;
-			ou->skip(0);
-			ou->copy_to(dest, crc_dyn);
-			if(ref_fil->get_crc(crc_ori))  // CRC is not present in format "01"
-			    if(!same_crc(crc_dyn, crc_ori))
-				throw Erange("filesystem_hard_link_write::make_file", "bad CRC, data corruption occured");
-		    }
-		    catch(...)
-		    {
-			delete ou;
-			throw;
-		    }
-		    delete ou;
-		}
-	    }
-	    else if(ref_lie != NULL)
-	    {
-		char *cible = tools_str2charptr(ref_lie->get_target());
-		ret = symlink(cible ,name);
-		delete cible;
-	    }
-	    else if(ref_blo != NULL)
-		ret = mknod(name, S_IFBLK | 0777, makedev(ref_blo->get_major(), ref_blo->get_minor()));
-	    else if(ref_cha != NULL)
-		ret = mknod(name, S_IFCHR | 0777, makedev(ref_cha->get_major(), ref_cha->get_minor()));
-	    else if(ref_tub != NULL)
-		ret = mknod(name, S_IFIFO | 0777, 0);
-	    else if(ref_pri != NULL)
-	    {
-		ret = socket(PF_UNIX, SOCK_STREAM, 0);
-		if(ret >= 0)
-		{
-		    S_I sd = ret;
-		    struct sockaddr_un addr;
-		    addr.sun_family = AF_UNIX;
-		    
-		    try
-		    {
-			strncpy(addr.sun_path, name, UNIX_PATH_MAX - 1);
-			addr.sun_path[UNIX_PATH_MAX - 1] = '\0';
-			if(bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
-			    throw Erange("filesystem_hard_link_write::make_file (socket bind)", strerror(errno));
-		    }
-		    catch(...)
-		    {
-			shutdown(sd, 2);
-			close(sd);
-			throw;
-		    }
-		    shutdown(sd, 2);
-		    close(sd);
-		}
-	    }
-	    else
-		throw SRC_BUG; // unknown inode type
-		
-	    if(ret < 0)
-		if(errno != ENOSPC)
-		    throw Erange("filesystem_hard_link_write::make_file", strerror(errno));
-		else
-		    user_interaction_pause(string("can't create inode : ") + strerror(errno) + " Ready to continue ? ");
-	}
-	while(ret < 0 && errno == ENOSPC);
-
-	if(ref_ino != NULL && ret >= 0)
-	    make_owner_perm(*ref_ino, ou, dir_perm, ignore_owner);
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
-
-void filesystem_hard_link_write::clear_corres(const infinint & ligne)
-{
-    map<infinint, corres_ino_ea>::iterator it = corres_write.find(ligne);
-    if(it != corres_write.end())
-	corres_write.erase(it);
-}
-
-
-///////////////////////////////////////////////////////////////////
-////////////////// filesystem_restore methods  ////////////////////
-///////////////////////////////////////////////////////////////////
-
-
-filesystem_restore::filesystem_restore(const path &root, bool x_allow_overwrite, 
-				       bool x_warn_overwrite, bool x_info_details,
-				       bool root_ea, bool user_ea, bool ignore_owner)
-{
-    char *ptr = tools_str2charptr(root.display());
-    try
-    {
-	fs_root = new path(root);
-	if(fs_root == NULL)
-	    throw Ememory("filesystem_write::filesystem_write");
-	allow_overwrite = x_allow_overwrite;
-	warn_overwrite = x_warn_overwrite;
-	info_details = x_info_details;
-	ea_root = root_ea;
-	ea_user = user_ea;
-	ignore_ownership = ignore_owner;
-	current_dir = NULL;
-	
-	struct stat buf;
-	if(stat(ptr, &buf) < 0)
-	    throw Erange("filesystem_write::filesystem_write", string("cannot open directory ")+fs_root->display() + " : " + strerror(errno));
-	if(!S_ISDIR(buf.st_mode))
-	    throw Erange("filesystem_write::filesystem_write", fs_root->display() + " is not a directory");
-    }
-    catch(...)
-    {
-	delete ptr;
-	if(fs_root != NULL)
-	{
-	    delete fs_root;
-	    fs_root = NULL;
-	}
-	throw;
-    }
-    delete ptr;
-
-    reset_write();
-}
-
-
-void filesystem_restore::reset_write()
-{
-    filesystem_hard_link_write::corres_reset();
-    filesystem_hard_link_read::corres_reset();
-    stack_dir.clear();
-    if(current_dir != NULL)
-	delete current_dir;
-    current_dir = new path(*fs_root);
-    if(current_dir == NULL)
-	throw Ememory("filesystem_write::reset_write"); 
-}
-
-bool filesystem_restore::write(const entree *x)
-{
-    const eod *x_eod = dynamic_cast<const eod *>(x);
-    const nomme *x_nom = dynamic_cast<const nomme *>(x);
-    bool ret = true; 
-
-    try
-    {
-	if(x_eod != NULL)
-	{
-	    string tmp;
-	    current_dir->pop(tmp);
-	    if(stack_dir.size() > 0)
-		make_owner_perm(stack_dir.back(), *current_dir, true, ignore_ownership);
-	    else
-		throw SRC_BUG;
-	    stack_dir.pop_back();
-	}
-	else 
-	    if(x_nom == NULL)
-		throw SRC_BUG; // neither "nomme" nor "eod"
-	    else // nomme
-	    { 
-		path spot = *current_dir + x_nom->get_name();
-		const detruit *x_det = dynamic_cast<const detruit *>(x);
-		const inode *x_ino = dynamic_cast<const inode *>(x);
-		const etiquette *x_eti = dynamic_cast<const etiquette *>(x);
-		const directory *x_dir = dynamic_cast<const directory *>(x);
-		
-		nomme *exists = make_read_entree(*current_dir, x_nom->get_name(), false, ea_root, ea_user);
-		
-		try
-		{
-		    if(x_ino == NULL && x_det == NULL && x_eti == NULL)
-			throw SRC_BUG; // should be either inode or detruit or hard link
-		    
-		    if(x_det != NULL) // this is an object of class "detruit"
-		    {
-			if(exists != NULL) // the file to destroy exists
-			{
-			    if(!allow_overwrite)
-				throw Erange("filesystem_write::write", spot.display() + " will not be remove from filesystem, overwriting not allowed");
-			    if(warn_overwrite)
-				user_interaction_pause(spot.display() + " is about to be removed from filesystem, continue ? ");
-			    
-			    if(tolower(exists->signature()) == tolower(x_det->get_signature()))
-				supprime(spot);
-			    else
-			    {
-				// warning even if just allow_overwite is set (not espetially warn_overwrite)
-				user_interaction_pause(spot.display() + " must be removed, but does not match expected type, remove it anyway ?");
-				supprime(spot);
-			    }
-			}
-		    }
-		    else // hard_link or inode 
-		    {
-			if(exists == NULL) // nothing of this name in filesystem
-			    make_file(x_nom, *current_dir, false, ignore_ownership);
-			else // an entry of this name exists in filesystem
-			{
-			    const inode *exists_ino = dynamic_cast<inode *>(exists);
-			    
-			    if((x_eti == NULL && x_ino == NULL) || exists_ino == NULL)
-				throw SRC_BUG; // should be both of class inode (or hard_link for x)
-			    
-			    if(allow_overwrite)
-			    {
-				if(warn_overwrite && x_dir == NULL)
-				    user_interaction_pause(spot.display() + " is about to be overwritten, OK ?");
-				if(x_dir != NULL && x_ino->same_as(*exists_ino))
-				    make_owner_perm(*x_ino, *current_dir, false, ignore_ownership);
-				else
-				{
-				    ea_attributs ea; // saving original EA of existing inode
-				    bool got_it = true;
-				    try
-				    {
-					ea_filesystem_read_ea(spot.display(), ea, true, true);
-				    }
-				    catch(Egeneric & ex)
-				    {
-					got_it = false;
-					user_interaction_warning(string("existing EA for ") + spot.display() + " could not be read and preserved : " + ex.get_message());
-				    }
-				    supprime(spot); // this destroyes EA
-				    make_file(x_nom, *current_dir, false, ignore_ownership);
-				    try // if possible and available restoring original EA
-				    {
-					if(got_it)
-					    (void)ea_filesystem_write_ea(spot.display(), ea, true, true); 
-					    // we don't care about the return value, here
-				    }
-				    catch(Egeneric & e)
-				    {
-					if(ea.size() >0)
-					    user_interaction_warning(string("existing EA for ")+ spot.display() + " could not be preserved : " + e.get_message());
-				    }
-				}
-			    }
-			    else // overwriting not allowed
-			    {
-				if(x_dir != NULL && !x_ino->same_as(*exists_ino))
-				    throw Erange("filesystem_write::write", string("directory ")+spot.display()+" cannot be restored: overwriting not allowed and a non-directory inode of that name exists");
-				else
-				    if(info_details)
-					user_interaction_warning(spot.display() + " has not been overwritten (action not allowed)");
-				ret = false;
-			    }
-			}
-			
-			if(x_dir != NULL)
-			{
-			    *current_dir += x_dir->get_name();
-			    stack_dir.push_back(directory(*x_dir));
-			}
-		    }
-		}
-		catch(...)
-		{
-		    if(exists != NULL)
-			delete exists;
-		    throw;
-		}
-		if(exists != NULL)
-		    delete exists;
-	    }
-    }
-    catch(Euser_abort & e)
-    {
-	ret = false;
-    }
-
-    return ret;
-}
-
-nomme *filesystem_restore::get_before_write(const nomme *x)
-{
-    return make_read_entree(*current_dir, x->get_name(), false, ea_root, ea_user);
-}
-
-void filesystem_restore::pseudo_write(const directory *dir)
-{
-    if(dir == NULL)
-	throw SRC_BUG;
-
-    path spot = *current_dir + dir->get_name();
-    nomme *exists = make_read_entree(*current_dir, dir->get_name(), false, ea_root, ea_user);
-    
-    try
-    {
-	if(exists == NULL)
-	    make_file(dir, *current_dir, false, ignore_ownership);  // need to create the directory to be able to restore any file in it
-	else
-	{
-	    const directory *e_dir = dynamic_cast<const directory *>(exists);
-	    
-	    if(e_dir == NULL) // an inode of that name exists, but it is not a directory
-	    {
-		if(allow_overwrite)
-		{
-		    if(warn_overwrite)
-			user_interaction_pause(spot.display() + " is about to be removed and replaced by a directory, OK ?");
-		    supprime(spot);
-		    make_file(dir, *current_dir, false, ignore_ownership);
-		}
-		else
-		    throw Erange("filesystem_restore::pseudo_write", 
-				 spot.display() + 
-				 " could not be restored, because a file of that name exists and overwrite is not allowed");
-	    }
-	    else // just setting permission to allow creation of any sub-dir or sub_file
-	    {
-		char *name = tools_str2charptr(spot.display());
-		try
-		{
-		    if(chmod(name, 0777) < 0)
-			throw Erange("filesystem_restore::pseudo_write", spot.display() + " : " + strerror(errno));
-		}
-		catch(...)
-		{
-		    delete name;
-		    throw;
-		}
-		delete name;
-	    }
-	}
-    }
-    catch(...)
-    {
-	if(exists != NULL)
-	    delete exists;
-	throw;
-    }    
-    if(exists != NULL)
-	delete exists;
-		
-    *current_dir += dir->get_name();
-    stack_dir.push_back(directory(*dir));
-}
-
-void filesystem_restore::detruire()
-{
-    if(fs_root != NULL)
-	delete fs_root;
-    if(current_dir != NULL)
-	delete current_dir;
-}
-
-void filesystem_restore::copy_from(const filesystem_restore & ref)
-{
-    if(ref.fs_root != NULL)
-	fs_root = new path(*ref.fs_root);
-    else 
-	fs_root = NULL;
-    if(ref.current_dir != NULL)
-	current_dir = new path(*ref.current_dir);
-    else
-	current_dir = NULL;
-    info_details = ref.info_details;
-    ea_root = ref.ea_root;
-    ea_user = ref.ea_user;
-    allow_overwrite = ref.allow_overwrite;
-    warn_overwrite = ref.warn_overwrite;
-    ignore_ownership = ref.ignore_ownership;
-    stack_dir = ref.stack_dir;
-}
-
-
-
-///////////////////////////////////////////////////////////////////
-////////////////// static functions ///////////////////////////////
-///////////////////////////////////////////////////////////////////
-
-static void supprime(const path & ref)
-{
-    char *s = tools_str2charptr(ref.display());
-
-    try
-    {
-	struct stat buf;
-	if(lstat(s, &buf) < 0)
-	    throw Erange("filesystem supprime", strerror(errno));
-
-	if(S_ISDIR(buf.st_mode))
-	{
-	    etage fils = s;
-	    string tmp;
-	    
-	    while(fils.read(tmp))
-		supprime(ref+tmp);
-	    
-	    if(rmdir(s) < 0)
-		throw Erange("supprime (dir)", strerror(errno));
-	}
-	else
-	    if(unlink(s) < 0)
-		throw Erange("supprime (file)", strerror(errno));
-    }
-    catch(...)
-    {
-	delete s;
-	throw;
-    }
-
-    delete s;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void make_owner_perm(const inode & ref, const path & ou, bool dir_perm, bool ignore_ownership)
-{
-    string chem = (ou + ref.get_name()).display();
-    char *name = tools_str2charptr(chem);
-    const lien *ref_lie = dynamic_cast<const lien *>(&ref);
-    S_I permission;
-
-    if(dynamic_cast<const directory *>(&ref) != NULL && !dir_perm)
-	permission = 0777;
-    else
-	permission = ref.get_perm();
-    
-    try
-    {
-	if(!ignore_ownership)
-	    if(ref.get_saved_status() == s_saved)
-		if(lchown(name, ref.get_uid(), ref.get_gid()) < 0)
-		    user_interaction_warning(string(name) + string(" could not restore original ownership of file : ") + strerror(errno));
-	
-	try
-	{
-	    if(ref_lie == NULL) // not restoring permission for symbolic links 
-		if(chmod(name, permission) < 0)
-		    throw Erange("make_owner_perm (permission)", strerror(errno));
-	}
-	catch(Egeneric &e)
-	{
-	    if(ref_lie == NULL)
-		throw;
-		// else (the inode is a symlink), we simply ignore this error
-	}
-	
-	if(ref_lie == NULL) // not restoring atime & ctime for symbolic links	
-	    make_date(chem, ref.get_last_access(), ref.get_last_modif());
-    }
-    catch(...)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
-
-
-static void make_date(const string & chemin, infinint access, infinint modif)
-{
-    struct utimbuf temps;
-    time_t tmp = 0;
-    char *filename;
-    
-    access.unstack(tmp);
-    temps.actime = tmp;
-    tmp = 0;
-    modif.unstack(tmp);
-    temps.modtime = tmp;
-    
-    filename = tools_str2charptr(chemin);
-    try
-    {
-	if(utime(filename , &temps) < 0)
-	    Erange("make_date", strerror(errno));
-    }
-    catch(...)
-    {
-	delete filename;
-	throw;
-    }
-    delete filename;
-}
-
-static void attach_ea(const string &chemin, inode *ino, bool ea_root_mode, bool ea_user_mode)
-{
-    ea_attributs *eat = new ea_attributs();
-    if(eat == NULL)
-	throw Ememory("filesystem : attach_ea");
-    try
-    {
-	if(ino == NULL)
-	    throw SRC_BUG;
-	ea_filesystem_read_ea(chemin, *eat, ea_root_mode, ea_user_mode);
-	if(eat->size() > 0)
-	{
-	    ino->ea_set_saved_status(inode::ea_full);
-	    ino->ea_attach(eat);
-	    eat = NULL;
-		// allocated memory now managed by the inode object
-	}
-	else
-	    ino->ea_set_saved_status(inode::ea_none);
-    }
-    catch(...)
-    {
-	if(eat != NULL)
-	    delete eat;
-	throw;
-    }
-    if(eat != NULL)
-	delete eat;
-}
-
-static void set_back_dir_dates(const string & chem, const infinint & last_acc, const infinint & last_mod)
-{
-    try
-    {
-	if(last_acc != 0 || last_mod != 0)
-	    make_date(chem, last_acc, last_mod);
-	    // else the directory could not be openned properly
-	    // and time could not be retrieved, so we don't try
-	    // to restore them
-    }
-    catch(Erange & e)
-    {
-	    // cannot restore dates, ignoring
-    }
-}
-
-static bool is_nodump_flag_set(const path & chem, const string & filename)
-{
-#ifdef NO_DUMP_FEATURE
-    S_I fd, f;
-    char *ptr = tools_str2charptr((chem + filename).display());
-    
-    try
-    {
-	fd = open(ptr, O_RDONLY);
-	if(fd < 0)
-	    throw Erange("filesystem.c:is_nodump_flag_set", string("failed to open ") + filename +" : " + strerror(errno));
-	if(ioctl(fd, EXT2_IOC_GETFLAGS, &f) < 0)
-	{
-	    string error = strerror(errno);
-	    
-	    close(fd);
-	    throw Erange("filesystem.c:is_nodump_flag_set", string("cannot get ext2 attributes for ") + filename +" : " + error);
-	}
-	
-	close(fd);
-    }
-    catch(...)
-    {
-	delete ptr;
-	throw;
-    }
-    delete ptr;
-
-    return (f & EXT2_NODUMP_FL) != 0;
-#else
-    return false;
-#endif
-}
Index: dar/filesystem.hpp
===================================================================
--- dar.orig/filesystem.hpp	2012-05-02 11:23:23.363876445 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,218 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef FILESYSTEM_HPP
-#define FILESYSTEM_HPP
-
-#include <map>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <vector>
-#include "catalogue.hpp"
-#include "infinint.hpp"
-#include "etage.hpp"
-
-
-class filesystem_hard_link_read
-{		
-
-	// this class is not to be used directly
-	// it only provides some routine for the inherited classes
-
-public:
-    void forget_etiquette(file_etiquette *obj);
-	// tell the filesystem module that the reference of that etiquette does not
-	// exist anymore (not covered by filter for example)
-    
-protected:
-    void corres_reset() { corres_read.clear(); };
-
-    nomme *make_read_entree(path & lieu, const string & name, bool see_hard_link, bool ea_root_mode, bool ea_user_mode);
-    
-private:
-    struct couple
-    {
-	nlink_t count;
-	file_etiquette *obj;
-    };		
-    map <ino_t, couple> corres_read;
-};
-
-
-class filesystem_backup : public filesystem_hard_link_read
-{
-public:
-    filesystem_backup(const path &root, bool x_info_details, bool root_ea, bool user_ea, bool check_no_dump_flag);
-    filesystem_backup(const filesystem_backup & ref) { copy_from(ref); };
-    filesystem_backup & operator = (const filesystem_backup & ref) { detruire(); copy_from(ref); return *this; };
-    ~filesystem_backup() { detruire(); };
-
-    void reset_read();
-    bool read(entree * & ref);
-    void skip_read_to_parent_dir();
-	//  continue reading in parent directory and
-	// ignore all entry not yet read of current directory
-private:
-
-    struct filename_struct
-    {
-	infinint last_acc;
-	infinint last_mod;
-    };
-
-    path *fs_root;
-    bool info_details;
-    bool ea_root;
-    bool ea_user;
-    bool no_dump_check;
-    path *current_dir;	// to translate from an hard linked inode to an  already allocated object 
-    vector<filename_struct> filename_pile; // to be able to restore last access of directory we open for reading
-    vector<etage> pile; 	// to store the contents of a directory
-
-    void detruire();
-    void copy_from(const filesystem_backup & ref);
-};
-
-class filesystem_diff : public filesystem_hard_link_read
-{
-public:
-    filesystem_diff(const path &root, bool x_info_details, bool root_ea, bool user_ea);
-    filesystem_diff(const filesystem_diff & ref) { copy_from(ref); };
-    filesystem_diff & operator = (const filesystem_diff & ref) { detruire(); copy_from(ref); return *this; };
-    ~filesystem_diff() { detruire(); };
-	
-    void reset_read();
-    bool read_filename(const string & name, nomme * &ref);
-	// looks for a file of name given in argument, in current reading directory
-	// if this is a directory subsequent read are done in it
-    void skip_read_filename_in_parent_dir();
-	// subsequent calls to read_filename will take place in parent directory.
-
-private:
-    struct filename_struct
-    {
-	infinint last_acc;
-	infinint last_mod;
-    };
-
-    path *fs_root;
-    bool info_details;
-    bool ea_root;
-    bool ea_user;
-    path *current_dir;
-    vector<filename_struct> filename_pile;
-
-    void detruire();
-    void copy_from(const filesystem_diff & ref);
-};
-
-class filesystem_hard_link_write
-{
-
-	// this class is not to be used directly
-	// it only provides routines to its inherited classes
-	// this not public part is present.
-
-public:
-    bool ea_has_been_restored(const hard_link *h);
-	// true if the inode pointed to by the arg has already got its EA restored
-    bool set_ea(const nomme *e, const ea_attributs & l, path spot, 
-		bool allow_overwrite, bool warn_overwrite, bool info_details);
-	// check the inode for which to restore EA, is not a hard link to
-	// an already restored inode, else call the proper ea_filesystem call
-    void write_hard_linked_target_if_not_set(const etiquette *ref, const string & chemin);
-	// if a hard linked inode has not been restored (no change, or less recent than the one on filesystem)
-	// it is necessary to inform filesystem, where to hard link on, any future hard_link 
-	// that could be necessary to restore.
-    bool known_etiquette(const infinint & eti);
-	// return true if an inode in filesystem has been seen for that hard linked inode
-
-protected:
-    void corres_reset() { corres_write.clear(); };
-    void make_file(const nomme * ref, const path & ou, bool dir_perm, bool ignore_owner);
-	// generate inode or make a hard link on an already restored inode.
-    void clear_corres(const infinint & ligne);
-
-
-private:
-    struct corres_ino_ea
-    {
-	string chemin;
-	bool ea_restored;
-    };
-
-    map <infinint, corres_ino_ea> corres_write;
-};		
-
-
-class filesystem_restore : public filesystem_hard_link_write, public filesystem_hard_link_read
-{
-public:
-    filesystem_restore(const path &root, bool x_allow_overwrite, bool x_warn_overwrite, bool x_info_details,
-		       bool root_ea, bool user_ea, bool ignore_owner);
-    filesystem_restore(const filesystem_restore  & ref) { copy_from(ref); };
-    filesystem_restore & operator =(const filesystem_restore  & ref) { detruire(); copy_from(ref); return *this; };
-    ~filesystem_restore() { detruire(); };
-	
-    void reset_write();
-    bool write(const entree *x);
-	// the argument may be an object from class destroy
-	// return true upon success, 
-	// false if overwriting not allowed or refused 
-	// throw exception on other errors
-    nomme *get_before_write(const nomme *x);
-	// in this case the target has to be removed from the filesystem
-    void pseudo_write(const directory *dir);	
-	// do not restore the directory, just stores that we are now 
-	// inspecting its contents
-    bool set_ea(const nomme *e, const ea_attributs & l, 
-		bool allow_overwrite, 
-		bool warn_overwrite, 
-		bool info_details)
-	{  return filesystem_hard_link_write::set_ea(e, l, *current_dir, 
-						     allow_overwrite, 
-						     warn_overwrite, 
-						     info_details); 
-	};
-
-
-	
-private:
-    path *fs_root;
-    bool info_details;
-    bool ea_root;
-    bool ea_user;
-    bool allow_overwrite;
-    bool warn_overwrite;
-    bool ignore_ownership;
-    vector<directory> stack_dir;
-    path *current_dir;
-
-    void detruire();
-    void copy_from(const filesystem_restore & ref);
-
-};
-
-
-#endif
Index: dar/filtre.cpp
===================================================================
--- dar.orig/filtre.cpp	2012-05-02 11:23:23.067876233 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,926 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <map>
-#include "user_interaction.hpp"
-#include "erreurs.hpp"
-#include "filtre.hpp"
-#include "filesystem.hpp"
-#include "ea.hpp"
-#include "defile.hpp"
-#include "test_memory.hpp"
-#include "null_file.hpp"
-
-static void save_inode(const string &info_quoi, inode * & ino, compressor *stock, bool info_details, const mask &compr_mask, compression compr_used, const infinint & min_size_compression);
-static bool save_ea(const string & info_quoi, inode * & ino, compressor *stock, const inode * ref, bool info_details, compression compr_used);
-
-void filtre_restore(const mask &filtre, 
-		    const mask & subtree,
-		    catalogue & cat, 
-		    bool detruire, 
-		    const path & fs_racine,
-		    bool fs_allow_overwrite,
-		    bool fs_warn_overwrite,
-		    bool info_details,
-		    statistics & st,
-		    bool only_if_more_recent,
-		    bool restore_ea_root,
-		    bool restore_ea_user,
-		    bool flat, 
-		    bool ignore_owner)
-{
-    defile juillet = fs_racine;
-    const eod tmp_eod;
-    const entree *e;
-    filesystem_restore fs = filesystem_restore(fs_racine, fs_allow_overwrite, fs_warn_overwrite, info_details, restore_ea_root, restore_ea_user,ignore_owner);
-    filesystem_diff fs_flat = filesystem_diff(fs_racine, info_details, restore_ea_root, restore_ea_user);
-    
-    st.clear();
-    cat.reset_read();
-
-    while(cat.read(e))
-    {
-	const nomme *e_nom = dynamic_cast<const nomme *>(e);
-	const directory *e_dir = dynamic_cast<const directory *>(e);
-
-	juillet.enfile(e);
-	if(e_nom != NULL)
-	{
-	    try
-	    {
-		if(subtree.is_covered(juillet.get_string()) && (e_dir != NULL || filtre.is_covered(e_nom->get_name())))
-		{
-		    const detruit *e_det = dynamic_cast<const detruit *>(e);
-		    const inode *e_ino = dynamic_cast<const inode *>(e);
-		    const hard_link *e_hard = dynamic_cast<const hard_link *>(e);
-		    const etiquette *e_eti = dynamic_cast<const etiquette *>(e);
-		    entree *dolly = NULL; // inode of replacement for hard links
-
-		    try
-		    {
-			if(e_hard != NULL)
-			{
-			    inode *tmp = NULL;
-			    dolly = e_hard->get_inode()->clone();
-			    if(dolly == NULL)
-				throw Ememory("filtre_restore");
-			    tmp = dynamic_cast<inode *>(dolly);
-			    if(tmp == NULL)
-				throw SRC_BUG; // should be an inode
-			    tmp->change_name(e_hard->get_name());
-			    e_ino = const_cast<const inode *>(tmp);
-			    if(e_ino == NULL)
-				throw SRC_BUG; // !?! how is this possible ?
-			    st.hard_links++;
-			}
-			
-			if(e_det != NULL)
-			{
-			    if(detruire && !flat)
-			    {
-				if(info_details)
-				    user_interaction_warning(string("removing file ") + juillet.get_string());
-				if(fs.write(e))
-				    st.deleted++;
-			    }
-			}
-			else
-			    if(e_ino != NULL)
-			    {
-				nomme *exists_nom = NULL;
-				inode *exists = NULL;
-								
-				    // checking if file to restore already exists, retreiving info if available
-				if(!flat)
-				    exists_nom = fs.get_before_write(e_ino);
-				else
-				{
-				    string tmp = e_ino->get_name();
-
-				    if(e_dir != NULL || !fs_flat.read_filename(tmp, exists_nom))
-					exists_nom = NULL;
-				}
-
-				exists = dynamic_cast<inode *>(exists_nom);
-				if(exists_nom != NULL && exists == NULL)
-				    throw SRC_BUG; // filesystem should always provide inode or nothing
-				
-				try
-				{
-					// checking the file contents & inode
-				    if(e_ino->get_saved_status() == s_saved || (e_hard != NULL && fs.known_etiquette(e_hard->get_etiquette())))
-				    {
-					if(!only_if_more_recent || exists == NULL || !e_ino->same_as(*exists) || e_ino->is_more_recent_than(*exists))
-					{
-					    if(!flat || e_dir == NULL)
-					    {
-						if(info_details)
-						    user_interaction_warning(string("restoring file ") + juillet.get_string());
-						if(fs.write(e)) // e and not e_ino, it may be a hard link now
-						    st.treated++;
-					    }
-					    else
-						st.ignored++;
-					}
-					else // file is less recent than the one in the filesystem
-					{
-						// if it is a directory, just recording we go in it now
-					    if(e_dir != NULL && !flat)
-						fs.pseudo_write(e_dir);
-					    if(e_eti != NULL) // future hard link will get linked against this file
-						fs.write_hard_linked_target_if_not_set(e_eti, flat ? (fs_racine+e_ino->get_name()).display() : juillet.get_string());
-					    if(e_dir == NULL || !flat)
-						st.tooold++;
-					    else 
-						st.ignored++;
-					}
-				    }
-				    else // no data saved for this entry (no change since reference backup)
-				    {
-					    // if it is a directory, just recording we go in it now
-					if(e_dir != NULL && !flat)
-					    fs.pseudo_write(e_dir);
-					if(e_eti != NULL) // future hard link will get linked against this file
-					    fs.write_hard_linked_target_if_not_set(e_eti, flat ? (fs_racine+e_ino->get_name()).display() : juillet.get_string());
-					if(e_dir == NULL || !flat)
-					    st.skipped++;
-					else
-					    st.ignored++;
-				    }
-				    
-				    if(restore_ea_user || restore_ea_root)
-				    {
-					    // checking the EA list
-					    //
-					    // need to have EA data to restore and an 
-					    // existing inode of the same type in 
-					    // filesystem, to be able to set EA to 
-					    // an existing inode
-					if(e_ino->ea_get_saved_status() == inode::ea_full // we have EA available in archive
-					   && 
-					   (exists != NULL && exists->same_as(*e_ino)  // the file now exists in filesystem
-					    || e_ino->get_saved_status() == s_saved)   // either initially or just restored
-					   && 
-					   (!flat || e_dir == NULL))                   // we are not in flat mode restoring a directory
-					{
-					    try
-					    {
-						if(fs.set_ea(e_nom, *(e_ino->get_ea()), fs_allow_overwrite, fs_warn_overwrite, info_details ))
-						    st.ea_treated++;
-					    }
-					    catch(Erange & e)
-					    {
-						user_interaction_warning(string("Error while restoring EA for ") + juillet.get_string() + ": " + e.get_message());
-					    }
-					    e_ino->ea_detach(); // in any case we clear memory
-					}
-				    } // end of EA considerations
-				}
-				catch(...)
-				{
-				    if(exists_nom != NULL)
-					delete exists_nom;
-				    throw;
-				}
-				if(exists_nom != NULL)
-				    delete exists_nom; 
-			    }
-			    else
-				throw SRC_BUG; // a nomme is neither a detruit nor an inode !
-		    }
-		    catch(...)
-		    {
-			if(dolly != NULL)
-			    delete dolly;
-			throw;
-		    }
-		    if(dolly != NULL)
-			delete dolly;
-		}
-		else // inode not covered 
-		{
-		    st.ignored++;
-		    if(e_dir != NULL)
-		    {
-			cat.skip_read_to_parent_dir();
-			juillet.enfile(&tmp_eod);
-		    }
-		}
-	    }
-	    catch(Ebug & e)
-	    {
-		throw;
-	    }
-	    catch(Euser_abort & e)
-	    {
-		user_interaction_warning(juillet.get_string() + " not restored (user choice)");
-
-		if(e_dir != NULL && !flat)
-		{
-		    user_interaction_warning("No file in this directory will be restored.");
-		    cat.skip_read_to_parent_dir();
-		    juillet.enfile(&tmp_eod);
-		}
-		st.errored++;
-	    }
-	    catch(Escript & e)
-	    {
-		throw;
-	    }
-	    catch(Egeneric & e)
-	    {
-		user_interaction_warning(string("Error while restoring ") + juillet.get_string() + " : " + e.get_message());
-
-		if(e_dir != NULL && !flat)
-		{
-		    user_interaction_warning(string("Warning! No file in that directory will be restored: ") + juillet.get_string());
-		    cat.skip_read_to_parent_dir();
-		    juillet.enfile(&tmp_eod);
-		}
-		st.errored++;
-	    }
-	}
-	else
-	    if(!flat)
-		(void)fs.write(e); // eod; don't care returned value
-    }
-}
-
-void filtre_sauvegarde(const mask &filtre,
-		       const mask &subtree,
-		       compressor *stockage, 
-		       catalogue & cat,
-		       catalogue &ref,
-		       const path & fs_racine,
-		       bool info_details,
-		       statistics & st,
-		       bool make_empty_dir,
-		       bool save_ea_root,
-		       bool save_ea_user,
-		       const mask &compr_mask,
-		       const infinint & min_compr_size,
-		       bool nodump)
-{
-    entree *e;
-    const entree *f;
-    defile juillet = fs_racine;
-    const eod tmp_eod;
-    compression stock_algo = stockage->get_algo();
-    filesystem_backup fs = filesystem_backup(fs_racine, info_details, save_ea_root, save_ea_user, nodump);
-
-    st.clear();
-    cat.reset_add();
-    ref.reset_compare();
-
-    while(fs.read(e))
-    {
-	nomme *nom = dynamic_cast<nomme *>(e);
-	directory *dir = dynamic_cast<directory *>(e);
-	
-	juillet.enfile(e);
-	if(nom != NULL)
-	{
-	    try
-	    {
-		if(subtree.is_covered(juillet.get_string()) && (dir != NULL || filtre.is_covered(nom->get_name())))
-		{
-		    hard_link *e_hard = dynamic_cast<hard_link *>(e);
-
-		    if(e_hard != NULL)
-		    {
-			cat.add(e);
-			st.hard_links++;
-		    }
-		    else // "e" is an inode
-		    {
-			inode *e_ino = dynamic_cast<inode *>(e);
-			bool known = ref.compare(e, f);
-			
-			try
-			{
-			    if(known)
-			    {
-				const inode *f_ino = dynamic_cast<const inode *>(f);
-				
-				if(e_ino == NULL || f_ino == NULL)
-				    throw SRC_BUG; // filesystem has provided a "nomme" which is not a "inode" thus which is a "detruit"
-				
-				if(e_ino->has_changed_since(*f_ino))
-				{
-				    if(e_ino->get_saved_status() != s_saved)
-					throw SRC_BUG; // filsystem should always provide "saved" "entree"
-				    
-				    save_inode(juillet.get_string(), e_ino, stockage, info_details, compr_mask, stock_algo, min_compr_size);
-				    st.treated++;
-				}
-				else // inode has not changed since last backup
-				{
-				    e_ino->set_saved_status(s_not_saved);
-				    st.skipped++;
-				}
-
-				if(save_ea(juillet.get_string(), e_ino, stockage, f_ino, info_details, stock_algo))
-				    st.ea_treated++;
-			    }
-			    else // inode not present in the catalogue of reference
-				if(e_ino != NULL)
-				{
-				    save_inode(juillet.get_string(), e_ino, stockage, info_details, compr_mask, stock_algo, min_compr_size);
-				    st.treated++;
-				    if(save_ea(juillet.get_string(), e_ino, stockage, NULL, info_details, stock_algo))
-					st.ea_treated++;
-				}
-				else
-				    throw SRC_BUG;  // filesystem has provided a "nomme" which is not a "inode" thus which is a "detruit"
-			    
-			    file *tmp = dynamic_cast<file *>(e);
-			    if(tmp != NULL)
-				tmp->clean_data();
-
-			    cat.add(e);
-			}
-			catch(...)
-			{
-			    if(dir != NULL)
-				ref.compare(&tmp_eod, f);
-			    throw;
-			}
-		    }
-		}
-		else // inode not covered
-		{
-		    nomme *ig = NULL;
-		    inode *ignode = NULL;
-		    file_etiquette *eti = dynamic_cast<file_etiquette *>(e);
-
-		    if(dir != NULL && make_empty_dir)
-			ig = ignode = new ignored_dir(*dir);
-		    else
-			ig = new ignored(nom->get_name()); 
-			// necessary to not record deleted files at comparison 
-			// time in case files are just not covered by filters
-		    st.ignored++;
-		    
-		    if(ig == NULL)
-			throw Ememory("filtre_sauvegarde");
-		    else
-			cat.add(ig);
-
-		    if(dir != NULL)
-		    {
-			if(make_empty_dir)
-			{
-			    bool known = ref.compare(dir, f);
-
-			    try
-			    {
-				const inode *f_ino = known ? dynamic_cast<const inode *>(f) : NULL;
-				bool tosave = false;
-
-				if(known)
-				    if(f_ino != NULL)
-					tosave = dir->has_changed_since(*f_ino);
-				    else
-					throw SRC_BUG; 
-				    // catalogue::compare() with a directory should return false or give a directory as
-				    // second argument or here f is not an inode (f_ino == NULL) !
-				    // and known == true
-				else
-				    tosave = true;
-				
-				ignode->set_saved_status(tosave ? s_saved : s_not_saved);
-			    }
-			    catch(...)
-			    {
-				ref.compare(&tmp_eod, f);
-				throw;
-			    }
-			    ref.compare(&tmp_eod, f);
-			}
-			fs.skip_read_to_parent_dir();
-			juillet.enfile(&tmp_eod);
-		    }
-		    if(eti != NULL) // must update filesystem to forget this etiquette
-			fs.forget_etiquette(eti);
-		    delete e;
-		}
-	    }
-	    catch(Ebug & e)
-	    {
-		throw;
-	    }
-	    catch(Euser_abort & e)
-	    {
-		throw;
-	    }
-	    catch(Escript & e)
-	    {
-		throw;
-	    }
-	    catch(Egeneric & ex)
-	    {
-		nomme *tmp = new ignored(nom->get_name());
-		user_interaction_warning(string("Error while saving ") + juillet.get_string() + ": " + ex.get_message());
-		st.errored++;
-		delete e;
-
-		if(tmp == NULL)
-		    throw Ememory("fitre_sauvegarde");
-		cat.add(tmp);
-
-		if(dir != NULL)
-		{
-		    fs.skip_read_to_parent_dir();
-		    juillet.enfile(&tmp_eod);
-		    user_interaction_warning("NO FILE IN THAT DIRECTORY CAN BE SAVED.");
-		}
-	    }    
-	}
-	else // eod
-	{
-	    ref.compare(e, f);
-	    cat.add(e);
-	}
-    }
-    stockage->change_algo(stock_algo);
-}
-
-void filtre_difference(const mask &filtre,
-		       const mask &subtree,
-		       catalogue & cat,
-		       const path & fs_racine,
-		       bool info_details, statistics & st,
-		       bool check_ea_root,
-		       bool check_ea_user)
-{
-    const entree *e;
-    defile juillet = fs_racine;
-    const eod tmp_eod;
-    filesystem_diff fs = filesystem_diff(fs_racine ,info_details, check_ea_root, check_ea_user);
-
-    st.clear();
-    cat.reset_read();
-    while(cat.read(e))
-    {
-	const directory *e_dir = dynamic_cast<const directory *>(e);
-	const nomme *e_nom = dynamic_cast<const nomme *>(e);
-
-	juillet.enfile(e);
-	try
-	{
-	    if(e_nom != NULL)
-	    {
-		if(subtree.is_covered(juillet.get_string()) && (e_dir != NULL || filtre.is_covered(e_nom->get_name())))
-		{
-		    nomme *exists_nom = NULL;
-		    const inode *e_ino = dynamic_cast<const inode *>(e);
-		    
-		    if(e_ino != NULL)
-			if(fs.read_filename(e_ino->get_name(), exists_nom))
-			{
-			    try
-			    {
-				inode *exists = dynamic_cast<inode *>(exists_nom);
-				directory *exists_dir = dynamic_cast<directory *>(exists_nom);
-
-				if(exists != NULL)
-				{
-				    try
-				    {
-					e_ino->compare(*exists, check_ea_root, check_ea_user);
-					if(info_details)
-					    user_interaction_warning(string("OK   ")+juillet.get_string());
-					st.treated++;
-				    }
-				    catch(Erange & e)
-				    {
-					user_interaction_warning(string("DIFF ")+juillet.get_string()+": "+ e.get_message());
-					if(e_dir == NULL && exists_dir != NULL)
-					    fs.skip_read_filename_in_parent_dir();
-					if(e_dir != NULL && exists_dir == NULL)
-					{
-					    cat.skip_read_to_parent_dir();
-					    juillet.enfile(&tmp_eod);
-					}
-
-					st.errored++;
-				    }
-				}
-				else // existing file is not an inode 
-				    throw SRC_BUG; // filesystem, should always return inode with read_filename()
-			    }
-			    catch(...)
-			    {
-				delete exists_nom;
-				throw;
-			    }
-			    delete exists_nom;
-			}
-			else // can't compare, nothing of that name in filesystem
-			{
-			    user_interaction_warning(string("DIFF ")+ juillet.get_string() + ": file not present in filesystem");
-			    if(e_dir != NULL)
-			    {
-				cat.skip_read_to_parent_dir();
-				juillet.enfile(&tmp_eod);
-			    }
-
-			    st.errored++;
-			}
-		    else // not an inode (for example a detruit, hard_link etc...), nothing to do
-			st.treated++;
-		}
-		else // not covered by filters
-		{
-		    st.ignored++;
-		    if(e_dir != NULL)
-		    {
-			cat.skip_read_to_parent_dir();
-			juillet.enfile(&tmp_eod);
-		    }
-		}
-	    }
-	    else // eod ?
-		if(dynamic_cast<const eod *>(e) != NULL) // yes eod
-		    fs.skip_read_filename_in_parent_dir();
-		else // no ?!? 
-		    throw SRC_BUG; // not nomme neither eod ! what's that ?	
-	}
-	catch(Euser_abort &e)
-	{
-	    throw;
-	}
-	catch(Ebug &e)
-	{
-	    throw;
-	}
-	catch(Escript & e)
-	{
-	    throw;
-	}
-	catch(Egeneric & e)
-	{
-	    user_interaction_warning(string("ERR  ")+juillet.get_string()+" : "+e.get_message());
-	    st.deleted++;
-	}
-    }
-    fs.skip_read_filename_in_parent_dir(); 
-	// this call here only to restore dates of the root (-R option) directory
-}
-
-void filtre_test(const mask &filtre,
-		 const mask &subtree,
-		 catalogue & cat,
-		 bool info_details,
-		 statistics & st)
-{
-    const entree *e;
-    defile juillet = path("<ROOT>");
-    null_file black_hole = gf_write_only;
-    ea_attributs ea;
-    infinint offset;
-    crc check, original;
-    const eod tmp_eod;
-
-    st.clear();
-    cat.reset_read();
-    while(cat.read(e))
-    {
-	juillet.enfile(e);
-	try
-	{
-	    const file *e_file = dynamic_cast<const file *>(e);
-	    const inode *e_ino = dynamic_cast<const inode *>(e);
-	    const directory *e_dir = dynamic_cast<const directory *>(e);
-	    const nomme *e_nom = dynamic_cast<const nomme *>(e);
-	    
-	    if(e_nom != NULL)
-	    {
-		if(subtree.is_covered(juillet.get_string()) && (e_dir != NULL || filtre.is_covered(e_nom->get_name())))
-		{
-			// checking data file if any
-		    if(e_file != NULL && e_file->get_saved_status() == s_saved)
-		    {
-			generic_file *dat = e_file->get_data();
-			if(dat == NULL)
-			    throw Erange("filtre_test", "Can't read saved data.");
-			try
-			{
-			    dat->skip(0);
-			    dat->copy_to(black_hole, check);
-			    if(e_file->get_crc(original)) // CRC is not present in format "01"
-				if(!same_crc(check, original))
-				    throw Erange("fitre_test", "CRC error: data corruption.");
-			}
-			catch(...)
-			{
-			    delete dat;
-			    throw;
-			}
-			delete dat;
-		    }
-			// checking inode EA if any
-		    if(e_ino != NULL && e_ino->ea_get_saved_status() == inode::ea_full)
-		    {
-			ea_attributs tmp = *(e_ino->get_ea());
-			tmp.check();
-			e_ino->ea_detach();
-		    }
-		    st.treated++;
-
-			// still no exception raised, this all is fine
-		    if(info_details)
-			user_interaction_warning(string("OK  ") + juillet.get_string());
-		}
-		else // excluded by filter
-		{
-		    if(e_dir != NULL)
-		    {
-			juillet.enfile(&tmp_eod);
-			cat.skip_read_to_parent_dir();
-		    }
-		    st.skipped++;
-		}
-	    }
-	}
-	catch(Euser_abort & e)
-	{
-	    throw;
-	}
-	catch(Ebug & e)
-	{
-	    throw;
-	}
-	catch(Escript & e)
-	{
-	    throw;
-	}
-	catch(Egeneric & e)
-	{
-	    user_interaction_warning(string("ERR ") + juillet.get_string() + " : " + e.get_message());
-	    st.errored++;
-	}
-    }
-}
-
-void filtre_isolate(catalogue & cat,
-		    catalogue & ref,
-		    bool info_details)
-{
-    const entree *e;
-    const eod tmp_eod;
-    map<infinint, file_etiquette *> corres;
-
-    ref.reset_read();
-    cat.reset_add();
-
-    if(info_details)
-	user_interaction_warning("Removing references to saved data from catalogue...");
-
-    while(ref.read(e))
-    {
-	const inode *e_ino = dynamic_cast<const inode *>(e);
-
-	if(e_ino != NULL) // specific treatment for inode
-	{
-	    entree *f = e_ino->clone();
-	    inode *f_ino = dynamic_cast<inode *>(f);
-	    file_etiquette *f_eti = dynamic_cast<file_etiquette *>(f);
-		// note about file_etiquette: the cloned object has the same etiquette
-		// and thus each etiquette correspond to two instances
-	    
-	    try
-	    {
-		if(f_ino == NULL)
-		    throw SRC_BUG; // inode should clone an inode
-		    
-		    // all data must be dropped
-		if(f_ino->get_saved_status() == s_saved)
-		    f_ino->set_saved_status(s_fake); 
-		    // s_fake keep trace that this inode was saved
-		    // in reference catalogue, else it is s_not_saved 
-		
-		    // all EA must be dropped also
-		if(f_ino->ea_get_saved_status() == inode::ea_full)
-		    f_ino->ea_set_saved_status(inode::ea_partial);
-
-		    // mapping each etiquette to its file_etiquette clone address
-		if(f_eti != NULL)
-		{
-		    if(corres.find(f_eti->get_etiquette()) == corres.end()) // not found
-			corres[f_eti->get_etiquette()] = f_eti;
-		    else
-			throw SRC_BUG;
-			// two file_etiquette clones have the same etiquette
-			// this could be caused by a write error
-			// a bit error in an infinint is still possible and 
-			// may make the value of the infinint (= etiquette here)
-			// be changed without incoherence.
-			// But, this error should have been detected at
-			// catalogue reading as some hard_link cannot be associate
-			// with a file_etiquette, thus this is a bug here.
-		}
-		
-		cat.add(f);
-	    }
-	    catch(...)
-	    {
-		if(f != NULL)
-		    delete f;
-		throw;
-	    }
-	}
-	else // other entree than inode 
-	    if(e != NULL)
-	    {
-		entree *f = e->clone();
-		hard_link *f_hard = dynamic_cast<hard_link *>(f);
-
-		try
-		{		    
-		    if(f_hard != NULL)
-		    {
-			map<infinint,file_etiquette *>::iterator it = corres.find(f_hard->get_etiquette());
-			
-			if(it != corres.end())
-			    f_hard->set_reference(it->second);
-			else
-			    throw SRC_BUG; 
-			    // no file_etiquette of that etiquette has ever been cloned,
-			    // the order being respected, an file_etiquette is come always first
-			    // before any hard_link on it, as there is no filter to skip the
-			    // file_etiquette, thus it's a bug.
-		    }
-
-		    cat.add(f);
-		}
-		catch(...)
-		{
-		    if(f != NULL)
-			delete f;
-		    throw;
-		}
-	    }
-	    else 
-		throw SRC_BUG; // read provided NULL while returning true
-    }
-}
-
-
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void save_inode(const string & info_quoi, inode * & ino, compressor *stock, bool info_details, const mask &compr_mask, compression compr_used, const infinint & min_size_compression)
-{
-    if(ino == NULL || stock == NULL)
-	throw SRC_BUG;
-    if(ino->get_saved_status() != s_saved)
-	return;
-    if(info_details)
-	user_interaction_warning(string("Adding file to archive: ") + info_quoi);
-    
-    file *fic = dynamic_cast<file *>(ino);
-
-    if(fic != NULL)
-    {
-	infinint start = stock->get_position();
-	generic_file *source = fic->get_data();
-	crc val;
-
-	fic->set_offset(start);
-	if(source != NULL)
-	{
-	    try
-	    {
-		bool compr_debraye = !compr_mask.is_covered(fic->get_name()) 
-		    || fic->get_size() < min_size_compression;
-
-		if(compr_debraye && stock->get_algo() != none)
-		    stock->change_algo(none);
-		else
-		    if(!compr_debraye && stock->get_algo() == none)
-			stock->change_algo(compr_used);
-
-		source->copy_to(*stock, val);
-		stock->flush_write();
-		fic->set_crc(val);
-
-		if(!compr_debraye)
-		    fic->set_storage_size(stock->get_position() - start);
-		else
-		    fic->set_storage_size(0); 
-		    // means no compression, thus the real storage size is the filesize
-	    }
-	    catch(...)
-	    {
-		delete source;
-		throw;
-	    }
-	    delete source;
-	}
-	else
-	    throw SRC_BUG; // saved_status == s_saved, but no data available, and no exception raised;
-    }
-}
-
-static bool save_ea(const string & info_quoi, inode * & ino, compressor *stock, const inode * ref, bool info_details, compression compr_used)
-{
-    bool ret = false;
-    try
-    {
-	switch(ino->ea_get_saved_status())
-	{
-	case inode::ea_full: // if there is something to save 
-	    if(ref == NULL || ref->ea_get_saved_status() == inode::ea_none || ref->get_last_change() < ino->get_last_change())
-	    {
-		if(ino->get_ea() != NULL)
-		{
-		    crc val;
-
-		    if(info_details)
-			user_interaction_warning(string("Saving Extended Attributes for ") + info_quoi);
-		    ino->ea_set_offset(stock->get_position());
-		    stock->change_algo(compr_used); // always compress EA (no size or filename consideration)
-		    stock->reset_crc(); // start computing CRC for any read/write on stock
-		    try
-		    {
-			ino->get_ea()->dump(*stock);
-		    }
-		    catch(...)
-		    {
-			stock->get_crc(val); // keeps stocks in a coherent status
-			throw;
-		    }
-		    stock->get_crc(val);
-		    ino->ea_set_crc(val);
-		    ino->ea_detach();
-		    stock->flush_write();
-		    ret = true;
-		}
-		else
-		    throw SRC_BUG;
-	    }
-	    else // EA have not changed, dropping the EA infos
-		ino->ea_set_saved_status(inode::ea_partial); 
-	    break;
-	case inode::ea_partial:
-	    throw SRC_BUG; //filesystem, must not provide inode in such a status
-	case inode::ea_none: // no EA has been seen
-	    if(ref != NULL && ref->ea_get_saved_status() != inode::ea_none) // if there was some before
-	    {
-		    // we must record the EA have been dropped since ref backup
-		ea_attributs ea; 
-		ino->ea_set_saved_status(inode::ea_full);
-		ino->ea_set_offset(stock->get_position());
-		ea.clear(); // be sure it is empty
-		if(info_details)
-		    user_interaction_warning(string("Saving Extended Attributes for ") + info_quoi);
-		ea.dump(*stock);
-		stock->flush_write();
-		    // no need to detach, as the brand new ea has not been attached
-		ret = true;
-	    }
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-    catch(Ebug & e)
-    {
-	throw;
-    }
-    catch(Euser_abort & e)
-    {
-	throw;
-    }
-    catch(Egeneric & e)
-    {
-	user_interaction_warning(string("Error saving Extended Attributs for ") + info_quoi + ": " + e.get_message());
-    }	
-    return ret;
-}
Index: dar/filtre.hpp
===================================================================
--- dar.orig/filtre.hpp	2012-05-02 11:23:23.267874232 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,100 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef FILTRE_HPP
-#define FILTRE_HPP
-
-#include <vector>
-#include "mask.hpp"
-#include "compressor.hpp"
-#include "catalogue.hpp"
-#include "path.hpp"
-
-struct statistics
-{
-    infinint treated; // saved | restored
-    infinint hard_links; // hard linked stored
-    infinint skipped; // not changed since last backup | file not restored because not saved in backup
-    infinint ignored; // ignored due to filter
-    infinint tooold; // ignored because less recent than the filesystem entry
-    infinint errored; // could not be saved | could not be restored (filesystem access wrights)
-    infinint deleted; // deleted file seen | number of files deleted
-    infinint ea_treated; // number of EA saved | number of EA restored
-
-    void clear() { treated = hard_links = skipped = ignored = tooold = errored = deleted = ea_treated = 0; };
-    infinint total() const
-	{ 
-	    return treated+skipped+ignored+tooold+errored+deleted; 
-		// hard_link are also counted in other counters 
-	};
-};
-
-extern void filtre_restore(const mask &filtre, 
-			   const mask & subtree,
-			   catalogue & cat, 
-			   bool detruire, 
-			   const path & fs_racine,
-			   bool fs_allow_overwrite,
-			   bool fs_warn_overwrite,
-			   bool info_details, statistics & st,
-			   bool only_if_more_recent,
-			   bool restore_ea_root,
-			   bool restore_ea_user,
-			   bool flat,
-			   bool ignore_owner);
-
-extern void filtre_sauvegarde(const mask &filtre,
-			      const mask &subtree,
-			      compressor *stockage, 
-			      catalogue & cat,
-			      catalogue &ref,
-			      const path & fs_racine,
-			      bool info_details, 
-			      statistics & st,
-			      bool make_empty_dir,
-			      bool save_ea_root,
-			      bool save_ea_user,
-			      const mask &compr_mask,
-			      const infinint & min_compr_size,
-			      bool nodump);
-
-extern void filtre_difference(const mask &filtre,
-			      const mask &subtree,
-			      catalogue & cat,
-			      const path & fs_racine,
-			      bool info_details, statistics & st,
-			      bool check_ea_root,
-			      bool check_ea_user);
-
-extern void filtre_test(const mask &filtre,
-			const mask &subtree,
-			catalogue & cat,
-			bool info_details,
-			statistics & st);
-
-extern void filtre_isolate(catalogue & cat,
-			   catalogue & ref,
-			   bool info_details);
-
-#endif
Index: dar/generic_file.cpp
===================================================================
--- dar.orig/generic_file.cpp	2012-05-02 11:23:23.223876255 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,469 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include "generic_file.hpp"
-#include "erreurs.hpp"
-#include "tools.hpp"
-#include "user_interaction.hpp"
-
-void clear(crc & value)
-{
-    for(S_I i = 0; i < CRC_SIZE; i++)
-	value[i] = '\0';
-}
-
-bool same_crc(const crc &a, const crc &b)
-{
-    S_I i = 0;
-    while(i < CRC_SIZE && a[i] == b[i])
-	i++;
-    return i == CRC_SIZE;
-}
-
-void copy_crc(crc & dst, const crc & src)
-{
-    for(S_I i = 0; i < CRC_SIZE; i++)
-	dst[i] = src[i];
-}
-
-#define BUFFER_SIZE 102400
-
-S_I generic_file::read(char *a, size_t size) 
-{
-    if(rw == gf_write_only) 
-	throw Erange("generic_file::read", "reading a write only generic_file");
-    else 
-	return (this->*active_read)(a, size); 
-}
-
-S_I generic_file::write(char *a, size_t size)
-{ 
-    if(rw == gf_read_only) 
-	throw Erange("generic_file::write", "writing to a read only generic_file");
-    else 
-	return (this->*active_write)(a, size); 
-}
-
-S_I generic_file::read_back(char &a)
-{
-    if(skip_relative(-1))
-    {
-	S_I ret = read(&a,1);
-	skip_relative(-1);
-	return ret;
-    }
-    else
-	return 0;
-}
-
-void generic_file::copy_to(generic_file & ref)
-{
-    char buffer[BUFFER_SIZE];
-    S_I lu, ret = 0;
-
-    do 
-    {
-	lu = this->read(buffer, BUFFER_SIZE);
-	if(lu > 0)
-	    ret = ref.write(buffer, lu);
-    } 
-    while(lu > 0 && ret > 0);
-}
-
-void generic_file::copy_to(generic_file & ref, crc & value)
-{
-    reset_crc();
-    copy_to(ref);
-    get_crc(value);
-}
-
-U_32 generic_file::copy_to(generic_file & ref, U_32 size)
-{
-    char buffer[BUFFER_SIZE];
-    S_I lu = 1, ret = 1, pas;
-    U_32 wrote = 0;
-
-    while(wrote < size && ret > 0 && lu > 0)
-    {
-	pas = size > BUFFER_SIZE ? BUFFER_SIZE : size;
-	lu = read(buffer, pas);
-	if(lu > 0)
-	{
-	    ret = ref.write(buffer, lu);
-	    wrote += lu;
-	}
-    }
-
-    return wrote;
-}
-
-infinint generic_file::copy_to(generic_file & ref, infinint size)
-{
-    U_32 tmp = 0, delta;
-    infinint wrote = 0;
-
-    size.unstack(tmp);
-
-    do 
-    {
-	delta = copy_to(ref, tmp);
-	wrote += delta;
-	tmp -= delta;
-	if(tmp == 0)
-	    size.unstack(tmp);
-    } 
-    while(tmp > 0);
-
-    return wrote;
-}
-
-bool generic_file::diff(generic_file & f)
-{
-    char buffer1[BUFFER_SIZE];
-    char buffer2[BUFFER_SIZE];
-    S_I lu1 = 0, lu2 = 0;
-    bool diff = false;
-
-    if(get_mode() == gf_write_only || f.get_mode() == gf_write_only)
-	throw Erange("generic_file::diff", "cannot compare files in write only mode");
-    skip(0);
-    f.skip(0);
-    do
-    {
-	lu1 = read(buffer1, BUFFER_SIZE);
-	lu2 = f.read(buffer2, BUFFER_SIZE);
-	if(lu1 == lu2)
-	{
-	    register S_I i = 0;
-	    while(i < lu1 && buffer1[i] == buffer2[i])
-		i++;
-	    if(i < lu1)
-		diff = true;
-	}
-	else
-	    diff = true;
-    }
-    while(!diff && lu1 > 0);
-    
-    return diff;
-}
-
-void generic_file::reset_crc() 
-{
-    if(active_read == &generic_file::read_crc)
-	throw SRC_BUG; // crc still active, previous CRC value never read
-    clear(value); 
-    enable_crc(true);
-    crc_offset = 0;
-}
-
-void generic_file::enable_crc(bool mode)
-{
-    if(mode) // routines with crc features
-    {
-	active_read = &generic_file::read_crc;
-	active_write = &generic_file::write_crc;
-    }
-    else
-    {
-	active_read = &generic_file::inherited_read;
-	active_write = &generic_file::inherited_write;
-    }
-}
-
-void generic_file::compute_crc(char *a, S_I size)
-{
-    for(register S_I i = 0; i < size; i++)
-	value[(i+crc_offset)%CRC_SIZE] ^= a[i];
-    crc_offset = (crc_offset + size) % CRC_SIZE;
-}
-
-S_I generic_file::read_crc(char *a, size_t size)
-{
-    S_I ret = inherited_read(a, size);
-    compute_crc(a, ret);
-    return ret;
-}
-
-S_I generic_file::write_crc(char *a, size_t size)
-{
-    S_I ret = inherited_write(a, size);
-    compute_crc(a, ret);
-    return ret;
-}
-
-fichier::fichier(S_I fd) : generic_file(generic_file_get_mode(fd))
-{
-    filedesc = fd;
-}
-
-fichier::fichier(char *name, gf_mode m) : generic_file(m)
-{
-    fichier::open(name, m);
-}
-
-fichier::fichier(const path &chemin, gf_mode m) : generic_file(m)
-{
-    char *name = tools_str2charptr(chemin.display());
-
-    try
-    {
-	open(name, m);
-    }
-    catch(Egeneric & e)
-    {
-	delete name;
-	throw;
-    }
-    delete name;
-}
-
-infinint fichier::get_size() const
-{
-    struct stat dat;
-    infinint filesize;
-
-    if(filedesc < 0)
-	throw SRC_BUG;
-
-    if(fstat(filedesc, &dat) < 0)
-	throw Erange("fichier::get_size()", string("error getting size of file : ") + strerror(errno));
-    else
-	filesize = dat.st_size;
-
-    return filesize;
-}
-
-bool fichier::skip(const infinint &q)
-{
-    off_t delta;
-    infinint pos = q;
-    if(lseek(filedesc, 0, SEEK_SET) < 0)
-	return false;
-    
-    do {
-	delta = 0;
-	pos.unstack(delta);
-	if(delta > 0)
-	    if(lseek(filedesc, delta, SEEK_CUR) < 0)
-		return false;
-    } while(delta > 0);
-
-    return true;
-}
-
-bool fichier::skip_to_eof()
-{
-    return lseek(filedesc, 0, SEEK_END) >= 0;
-}
-
-bool fichier::skip_relative(S_I x)
-{
-    if(x > 0)
-	if(lseek(filedesc, x, SEEK_CUR) < 0)
-	    return false;
-	else
-	    return true;
-
-    if(x < 0)
-    {
-	bool ret = true;
-	off_t actu = lseek(filedesc, 0, SEEK_CUR);
-
-	if(actu < -x)
-	{
-	    actu = 0;
-	    ret = false;
-	}
-	else
-	    actu += x; // x is negative
-	if(lseek(filedesc, actu, SEEK_SET) < 0)
-	    ret = false;
-
-	return ret;
-    }
-
-    return true;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-infinint fichier::get_position()
-{
-    off_t ret = lseek(filedesc, 0, SEEK_CUR);
-
-    if(ret == -1)
-	throw Erange("fichier::get_position", string("error getting file position : ") + strerror(errno));
-    
-    return ret;
-}
-
-S_I fichier::inherited_read(char *a, size_t size)
-{
-    S_I ret;
-    U_I lu = 0;
-
-    do
-    {
-	ret = ::read(filedesc, a+lu, size-lu);
-	if(ret < 0)
-	{
-	    switch(errno)
-	    {
-	    case EINTR:
-		break;
-	    case EAGAIN:
-		throw SRC_BUG; // non blocking read not compatible with
-		    // generic_file
-	    case EIO:
-		throw Ehardware("fichier::inherited_read", "");
-	    default :
-		throw Erange("fichier::inherited_read", string("error while reading from file: ") + strerror(errno));
-	    }
-	}
-	else
-	    lu += ret;
-    } 
-    while(lu < size && ret != 0);
-
-    return lu;
-}
-
-S_I fichier::inherited_write(char *a, size_t size)
-{
-    S_I ret;
-    size_t total = 0;
-    while(total < size)
-    {
-	ret = ::write(filedesc, a+total, size-total);
-	if(ret < 0)
-	{
-	    switch(errno)
-	    {
-	    case EINTR:
-		break;
-	    case EIO:
-		throw Ehardware("fichier::inherited_write", strerror(errno));
-	    case ENOSPC:
-		user_interaction_pause("no space left on device, you have the oportunity to make room now. When ready : can we continue ?");
-		break;
-	    default :
-		throw Erange("fichier::inherited_write", string("error while writing to file: ") + strerror(errno));
-	    }
-	}
-	else
-	    total += ret;
-    }
-
-    return total;
-}
-
-void fichier::open(const char *name, gf_mode m)
-{
-    S_I mode;
-    S_I perm = 0777;
-
-    switch(m)
-    {
-    case gf_read_only :
-	mode = O_RDONLY;
-	break;
-    case gf_write_only :
-	mode = O_WRONLY|O_CREAT;
-	break;
-    case gf_read_write :
-	mode = O_RDWR|O_CREAT;
-	break;
-    default:
-	throw SRC_BUG;
-    }
-
-    do
-    {
-	filedesc = ::open(name, mode, perm);
-	if(filedesc < 0)
-	    if(filedesc == ENOSPC)
-		user_interaction_pause("no space left for inode, you have the oportunity to make some room now. When done : can we continue ?");
-	    else
-		throw Erange("fichier::open", string("can't open file : ") + strerror(errno));
-    }
-    while(filedesc == ENOSPC);
-}
-
-gf_mode generic_file_get_mode(S_I fd)
-{
-    S_I flags = fcntl(fd, F_GETFL) & O_ACCMODE;
-    gf_mode ret;
-
-    switch(flags)
-    {
-    case O_RDONLY:
-	ret = gf_read_only;
-	break;
-    case O_WRONLY:
-	ret = gf_write_only;
-	break;
-    case O_RDWR:
-	ret = gf_read_write;
-	break;
-    default:
-	throw Erange("generic_file_get_mode", "file mode is neither read nor write");
-    }
-
-    return ret;
-}
-
-const string generic_file_get_name(gf_mode mode)
-{
-    string ret;
-
-    switch(mode)
-    {
-    case gf_read_only:
-	ret = "read only";
-	break;
-    case gf_write_only:
-	ret = "write only";
-	break;
-    case gf_read_write:
-	ret = "read and write";
-	break;
-    default:
-	throw SRC_BUG;
-    }
-
-    return ret;
-}
Index: dar/generic_file.hpp
===================================================================
--- dar.orig/generic_file.hpp	2012-05-02 11:23:23.175876248 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,130 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef GENERIC_FILE_HPP
-#define GENERIC_FILE_HPP
-
-#pragma interface
-
-#include <unistd.h>
-#include "infinint.hpp"
-#include "path.hpp"
-#include "integers.hpp"
-
-#define CRC_SIZE 2
-typedef char crc[CRC_SIZE];
-extern void clear(crc & value);
-extern void copy_crc(crc & dst, const crc & src);
-extern bool same_crc(const crc &a, const crc &b);
-
-enum gf_mode { gf_read_only, gf_write_only, gf_read_write };
-
-// note :
-// the read and write method are similar to the read and write system call
-// except that they never return negative values, but throw exception instead
-// returning zero means end of generic_file, and the call is blocking if
-// no data is available
-// write returns the number of bytes written, and never make partial writtingss
-// this it is blocked until all bytes are written or occures an exception
-// thus the returned value is always the value of the size argument.
-
-extern gf_mode generic_file_get_mode(S_I fd);
-extern const string generic_file_get_name(gf_mode mode);
-
-class generic_file
-{
-public :
-    generic_file(gf_mode m) { rw = m; clear(value); crc_offset = 0; enable_crc(false); };
-    virtual ~generic_file() {};
-    
-    gf_mode get_mode() const { return rw; };
-    S_I read(char *a, size_t size);
-    S_I write(char *a, size_t size);
-    S_I read_back(char &a);
-    virtual bool skip(const infinint & pos) = 0;
-    virtual bool skip_to_eof() = 0;
-    virtual bool skip_relative(S_I x) = 0;
-    virtual infinint get_position() = 0;
-    
-    void copy_to(generic_file &ref);
-    void copy_to(generic_file &ref, crc & value);
-	// generates CRC on copied data
-    U_32 copy_to(generic_file &ref, U_32 size); // returns the number of byte effectively copied
-    infinint copy_to(generic_file &ref, infinint size); // returns the number of byte effectively copied
-    bool diff(generic_file & f); // return true if arg differs from "this"
-
-	// CRC on read or writen data
-    void reset_crc();
-    void get_crc(crc & val) { enable_crc(false); copy_crc(val, value); };
-
-protected :
-    void set_mode(gf_mode x) { rw = x; };
-    virtual S_I inherited_read(char *a, size_t size) = 0;
-	// must provide as much byte as requested up to end of file
-	// stay blocked if not enough available
-	// returning zero or less than requested means end of file
-    virtual S_I inherited_write(char *a, size_t size) = 0;
-	// must write all data or block or throw exceptions
-	// thus always returns the second argument
-
-private :
-    gf_mode rw;
-    crc value;
-    S_I crc_offset;
-    S_I (generic_file::* active_read)(char *a, size_t size);
-    S_I (generic_file::* active_write)(char *a, size_t size);
-
-    void enable_crc(bool mode);
-    void compute_crc(char *a, S_I size);
-    S_I read_crc(char *a, size_t size);
-    S_I write_crc(char *a, size_t size);
-};
-
-class fichier : public generic_file
-{
-public :
-    fichier(S_I fd);
-    fichier(char *name, gf_mode m);
-    fichier(const path & chemin, gf_mode m);
-    ~fichier() { close(filedesc); };
-
-    infinint get_size() const;
-
-	// herite de generic_file
-    bool skip(const infinint & pos);
-    bool skip_to_eof();
-    bool skip_relative(S_I x);
-    infinint get_position();
-
-protected :
-    S_I inherited_read(char *a, size_t size);
-    S_I inherited_write(char *a, size_t size);
-
-private :
-    S_I filedesc;
-
-    void open(const char *name, gf_mode m);
-};
-
-#endif
Index: dar/header.cpp
===================================================================
--- dar.orig/header.cpp	2012-05-02 11:23:23.347875647 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,137 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <netinet/in.h>
-#include <time.h>
-#include "header.hpp"
-
-void header::read(generic_file & f)
-{
-    magic_number tmp;
-
-    f.read((char *)&tmp, sizeof(magic_number));
-    magic = ntohl(tmp);
-    f.read(internal_name, LABEL_SIZE);
-    f.read(&flag, 1);
-    f.read(&extension, 1);
-    switch(extension)
-    {
-    case EXTENSION_NO:
-	break;
-    case EXTENSION_SIZE:
-	size_ext.read_from_file(f);
-	break;
-    default :
-	throw Erange("header::read", "badly formated SAR header");
-    }
-}
-
-void header::write(generic_file & f)
-{
-    magic_number tmp;
-
-    tmp = htonl(magic);
-    f.write((char *)&tmp, sizeof(magic));
-    f.write(internal_name, LABEL_SIZE);
-    f.write(&flag, 1);
-    f.write(&extension, 1);
-    switch(extension)
-    {
-    case EXTENSION_NO:
-	break;
-    case EXTENSION_SIZE:
-	size_ext.dump(f);
-	break;
-    default:
-	throw SRC_BUG;
-    }
-}
-
-void header::read(S_I fd)
-{
-    fichier fic = dup(fd);
-    read(fic);
-}
-
-void header::write(S_I fd)
-{
-    fichier fic = dup(fd);
-    write(fic);
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-bool header_label_is_equal(const label &a, const label &b)
-{
-    register S_I i = 0;
-    while(i < LABEL_SIZE && a[i] == b[i])
-	i++;
-    return i >= LABEL_SIZE;
-}
-
-void header_generate_internal_filename(label &ret)
-{
-    time_t src1 = time(NULL);
-    pid_t src2 = getpid();
-    U_I wrote = 0;
-    U_I read = 0;
-
-    while(read < sizeof(src1) && wrote < LABEL_SIZE)
-	ret[wrote++] = ((char *)(&src1))[read++];
-
-    read = 0;
-    while(read < sizeof(src2) && wrote < LABEL_SIZE)
-	ret[wrote++] = ((char *)(&src2))[read++];
-}
-
-header::header()
-{
-    magic = 0;
-    for(S_I i = 0; i < LABEL_SIZE; i++)
-	internal_name[i] = '\0';
-    extension = flag = '\0';
-    size_ext = 0;
-}
-
-void header::copy_from(const header & ref)
-{
-    magic = ref.magic;
-    label_copy(internal_name,ref.internal_name);
-    flag = ref.flag;
-    extension = ref.extension;
-    size_ext = ref.size_ext;
-}
-
-void label_copy(label & left, const label & right)
-{
-    for(S_I i = 0; i < LABEL_SIZE; i++)
-	left[i] = right[i];
-
-}
Index: dar/header.hpp
===================================================================
--- dar.orig/header.hpp	2012-05-02 11:23:23.019875918 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef HEADER_H
-#define HEADER_H
-
-#pragma interface
-
-#include "infinint.hpp"
-#include "generic_file.hpp"
-
-#define LABEL_SIZE 10
-
-#define FLAG_NON_TERMINAL 'N'
-#define FLAG_TERMINAL 'T'
-#define EXTENSION_NO 'N'
-#define EXTENSION_SIZE 'S'
-
-#define SAUV_MAGIC_NUMBER 123
-
-typedef U_32 magic_number;
-typedef char label[LABEL_SIZE];
-
-extern void label_copy(label & left, const label & right);
-extern bool header_label_is_equal(const label &a, const label &b);
-extern void header_generate_internal_filename(label & ret);
-
-struct header
-{
-    magic_number magic;
-    label internal_name;
-    char flag;
-    char extension; // extension rules the use of the following fields
-    infinint size_ext; // if EXTENSION_SIZE
-
-    header();
-    header(const header & ref) { copy_from(ref); };
-    struct header & operator = (const header & ref) { copy_from(ref); return *this; };
-
-    void read(generic_file & f);
-    void write(generic_file & f);
-    void read(S_I fd);
-    void write(S_I fd);
-
-    static U_I size() { return sizeof(magic_number) + sizeof(label) + 2*sizeof(char); };
-    void copy_from(const header & ref);
-};
-        
-#endif
Index: dar/header_version.cpp
===================================================================
--- dar.orig/header_version.cpp	2012-05-02 11:23:23.143877319 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,51 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-
-#pragma implementation
-
-#include "header_version.hpp"
-#include "integers.hpp"
-
-void version_copy(version & left, const version & right)
-{
-    for(S_I i = 0; i < VERSION_SIZE; i++)
-	left[i] = right[i];
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-bool version_greater(const version & left, const version & right)
-{
-    S_I i = 0;
-
-    while(i < VERSION_SIZE && left[i] == right[i])
-	i++;
-    
-    return i < VERSION_SIZE && left[i] > right[i];
-}
Index: dar/header_version.hpp
===================================================================
--- dar.orig/header_version.hpp	2012-05-02 11:23:23.103876237 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,69 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef HEADER_VERSION_HPP
-#define HEADER_VERSION_HPP
-
-#pragma interface
-
-#include "generic_file.hpp"
-#include "tools.hpp"
-
-#define VERSION_FLAG_SAVED_EA_ROOT 0x80
-#define VERSION_FLAG_SAVED_EA_USER 0x40
-#define VERSION_FLAG_SCRAMBLED     0x20
-
-#define VERSION_SIZE 3
-typedef char version[VERSION_SIZE];
-extern void version_copy(version & left, const version & right);
-extern bool version_greater(const version & left, const version & right);
-    // operation left > right
-
-struct header_version
-{
-    version edition;
-    char algo_zip;
-    string cmd_line;
-    unsigned char flag; // added at edition 02
-    
-    void read(generic_file &f) 
-	{ 
-	    f.read(edition, sizeof(edition)); 
-	    f.read(&algo_zip, sizeof(algo_zip)); 
-	    tools_read_string(f, cmd_line); 
-	    if(version_greater(edition, "01"))
-		f.read((char *)&flag, (size_t)1);
-	    else
-		flag = 0;
-	};
-    void write(generic_file &f) 
-	{ 
-	    f.write(edition, sizeof(edition)); 
-	    f.write(&algo_zip, sizeof(algo_zip)); 
-	    tools_write_string(f, cmd_line);
-	    f.write((char *)&flag, (size_t)1);
-	};
-};
-
-#endif
Index: dar/hide_file.cpp
===================================================================
--- dar.orig/hide_file.cpp	2012-05-02 11:23:23.091876203 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,164 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include "hide_file.hpp"
-#include "infinint.hpp"
-
-#define CHECK_INIT if(!is_init) init()
-
-hide_file::hide_file(generic_file &f) : generic_file(gf_read_only)
-{
-    if(f.get_mode() == gf_write_only)
-	throw Erange("hide_file::hide_file", "hide_file cannot be initialized with write only file");
-
-    ref = &f;
-    if(ref == NULL)
-	throw SRC_BUG; // NULL argument given
-    is_init = false;
-    pos_index = 0; 
-    pos_relicat = 0;
-}
-
-bool hide_file::skip(const infinint & pos)
-{
-    CHECK_INIT;
-    U_I it = 0;
-    while(it < morceau.size() && morceau[it].offset + morceau[it].longueur - 1 < pos)
-	it++;
-	
-    if(it >= morceau.size())
-	return false;
-    if(morceau[it].offset > pos)
-	throw SRC_BUG; // morceau has a hole in it.
-	
-    pos_index = it;
-    pos_relicat = pos - morceau[it].offset;
-    return true;
-}
-
-bool hide_file::skip_to_eof()
-{
-    CHECK_INIT;
-    pos_index = morceau.size();
-    return true;
-}
-
-bool hide_file::skip_relative(S_I x)
-{
-    CHECK_INIT;
-    if(x > 0)
-    {
-	infinint my_x = x;
-	while(my_x > 0 && pos_index < morceau.size())
-	{
-	    if(pos_relicat + my_x >= morceau[pos_index].longueur)
-	    {
-		my_x -= morceau[pos_index].longueur - pos_relicat;
-		pos_relicat = 0;
-		pos_index++;
-	    }
-	    else
-	    {
-		pos_relicat += my_x;
-		my_x = 0;
-	    }
-	}
-
-	return pos_index < morceau.size();
-    }
-    else if(x < 0)
-    {
-	infinint my_x = -x; // make x a positive value
-	while(my_x > 0 && (pos_index < morceau.size() || pos_relicat > 0))
-	{
-	    if(my_x > pos_relicat)
-	    {
-		pos_index--;
-		if(pos_index < morceau.size())
-		{
-		    my_x -= pos_relicat;
-		    pos_relicat = morceau[pos_index].longueur;
-		}
-		else
-		{
-		    pos_index = 0;
-		    return false;
-		}
-	    }
-	    else
-		pos_relicat -= my_x;
-	    return true;
-	}
-    }
-    return true;
-}
-
-infinint hide_file::get_position()
-{
-    CHECK_INIT;
-    if(pos_index >= morceau.size())
-	return morceau.back().offset + morceau.back().longueur;
-    else
-	return morceau[pos_index].offset + pos_relicat;
-}
-
-S_I hide_file::inherited_read(char *a, size_t size)
-{
-    CHECK_INIT;
-    U_I lu = 0;
-    size_t maxlire;
-    size_t reste;
-
-    while(lu < size && pos_index < morceau.size())
-    {
-	maxlire = 0;
-	(morceau[pos_index].longueur - pos_relicat).unstack(maxlire);
-	reste = size - lu;
-	maxlire = maxlire > reste ? reste : maxlire;
-		
-	ref->skip(morceau[pos_index].debut+pos_relicat);
-	lu += ref->read(a+lu, maxlire);
-	pos_relicat += lu;
-	if(pos_relicat >= morceau[pos_index].longueur)
-	{
-	    pos_index++;
-	    pos_relicat = 0;
-	}
-    }
-	
-    return lu;
-}
-
-S_I hide_file::inherited_write(char *a, size_t size)
-{
-    CHECK_INIT;
-    throw SRC_BUG; // hide_file alsways is read-only !
-}
-
-
-void hide_file::init()
-{
-    fill_morceau();
-    is_init = true;
-}
Index: dar/hide_file.hpp
===================================================================
--- dar.orig/hide_file.hpp	2012-05-02 11:23:22.987876225 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,69 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef HIDE_FILE_HPP
-#define HIDE_FILE_HPP
-
-
-#include "generic_file.hpp"
-#include <vector>
-
-class hide_file : public generic_file
-{
-public:	
-    hide_file(generic_file &f);
-
-    bool skip(const infinint & pos);
-    bool skip_to_eof();
-    bool skip_relative(S_I x);
-    infinint get_position();
-
-protected:
-    struct partie
-    {
-	infinint debut, longueur; // debut is the offset in ref file
-	infinint offset; // offset in the resulting no commented file
-    };
-	
-    vector <partie> morceau;
-    generic_file *ref;
-
-    S_I inherited_read(char *a, size_t size);
-    S_I inherited_write(char *a, size_t size);
-
-    virtual void fill_morceau() = 0;
-	// the inherited classes have with this method
-	// to fill the "morceau" variable that defines
-	// the portions
-
-private:
-    U_I pos_index;
-    infinint pos_relicat;
-    bool is_init;
-
-    void init();
-};
-
-
-#endif
Index: dar/infinint.cpp
===================================================================
--- dar.orig/infinint.cpp	2012-05-02 11:23:23.483877737 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,955 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <unistd.h>
-#include "infinint.hpp"
-#include "erreurs.hpp"
-#include "generic_file.hpp"
-
-typedef unsigned char bitfield[8];
-
-static void swap_bytes(unsigned char &a, unsigned char &b) throw();
-static void swap_bytes(unsigned char *a, U_I size) throw();
-static void expand_byte(unsigned char a, bitfield &bit) throw();
-static void contract_byte(const bitfield &b, unsigned char & a) throw(Erange);
-
-infinint::endian infinint::used_endian = not_initialized;
-
-void infinint::read_from_file(S_I fd) throw(Erange, Ememory, Ebug)
-{
-    fichier f = dup(fd);
-    read_from_file(f);
-}
-
-void infinint::dump(S_I fd) const throw(Einfinint, Ememory, Erange, Ebug)
-{
-    fichier f = dup(fd);
-    dump(f);
-}
-
-void infinint::read_from_file(generic_file & x) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    unsigned char a;
-    bool fin = false;
-    infinint skip = 0;
-    infinint size = 0;
-    storage::iterator it;
-    S_I lu;
-    
-    while(!fin)
-    {
-	lu = x.read((char *)&a, 1);
-
-	if(lu <= 0)
-	    throw Erange("infinint::read_from_file(generic_file)", "reached end of file before all data could be read");
-	
-	if(a == 0)
-	    skip++;
-	else // end of size field
-	{
-		// computing the size to read
-	    bitfield bf;
-	    U_I pos = 0;
-	    
-	    expand_byte(a, bf);
-	    for(S_I i = 0; i < 8; i++)
-		pos = pos + bf[i];
-	    if(pos != 1)
-		throw Erange("infinint::read_from_file(generic_file)", "badly formed infinint or not supported format"); // more than 1 bit is set to 1
-	    
-	    pos = 0;
-	    while(bf[pos] == 0)
-		pos++;
-	    pos += 1; // bf starts at zero, or bit zero means 1 TG of length
-	    
-	    size = (skip * 8 + pos)*TG;
-	    detruit();
-
-	    try
-	    {
-		field = new storage(x, size);
-	    }
-	    catch(...)
-	    {
-		field = NULL;
-		throw;
-	    }
-
-	    if(field != NULL)
-	    {		
-		it = field->begin();
-		fin = true;
-	    }
-	    else
-		throw Ememory("infinint::read_from_file(generic_file)");		
-	}
-    }
-    reduce(); // necessary to reduce due to TG storage
-    E_END("infinint::read_from_file", "generic_file");
-}
-
- 
-void infinint::dump(generic_file & x) const throw(Einfinint, Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    infinint width;
-    infinint pos;
-    unsigned char last_width;
-    infinint justification;
-    U_32 tmp;
-    
-    if(! is_valid())
-	throw SRC_BUG;
-
-    width = field->size();    // this is the informational field size in byte
-	// TG is the width in TG, thus the number of bit that must have 
-	// the preamble
-    euclide(width, TG, width, justification);
-    if(justification != 0)
-	    // in case we need to add some bytes to have a width multiple of TG
-	width++;  // we need then one more group to have a width multiple of TG
-
-    euclide(width, 8, width, pos);
-    if(pos == 0)
-    {
-	width--; // division is exact, only last bit of the preambule is set
-	last_width = 0x80 >> 7;
-	    // as we add the last byte separately width gets shorter by 1 byte
-    }
-    else // division non exact, the last_width (last byte), make the rounding
-    {
-	U_16 pos_s = 0;
-	pos.unstack(pos_s);
-	last_width = 0x80 >> (pos_s - 1);
-    }
-
-	// now we write the preamble except the last byte. All theses are zeros.
-
-    tmp = 0;
-    unsigned char u = 0x00;
-    width.unstack(tmp);
-    do
-    {
-	while(tmp-- > 0)
-	    if(x.write((char *)(&u), 1) < 1)
-		throw Erange("infinint::dump(generic_file)", "can't write data to file");
-	tmp = 0;
-	width.unstack(tmp);
-    }
-    while(tmp > 0);
-
-	// now we write the last byte of the preambule, which as only one bit set
-
-    if(x.write((char *)&last_width, 1) < 1)
-	throw Erange("infinint::dump(generic_file)", "can't write data to file");
-
-	// we need now to write some justification byte to have an informational field multiple of TG
-
-    if(justification != 0)
-    {
-	U_16 tmp = 0;
-	justification.unstack(tmp);
-	tmp = TG - tmp;
-	while(tmp-- > 0)
-	    if(x.write((char *)(&u), 1) < 1)
-		throw Erange("infinint::dump(generic_file)", "can't write data to file");
-    }
-
-	// now we continue dumping the informational bytes :
-    field->dump(x);
-
-    E_END("infinint::dump", "generic_file");
-}
-
-infinint & infinint::operator += (const infinint & arg) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(! is_valid() || ! arg.is_valid())
-	throw SRC_BUG;
-
-	// enlarge field to be able to receive the result of the operation
-    make_at_least_as_wider_as(arg);
-
-	// now processing the operation
-
-    storage::iterator it_a = arg.field->rbegin();
-    storage::iterator it_res = field->rbegin();
-    U_I retenue = 0, somme;
-
-    while(it_res != field->rend() && (it_a != arg.field->rend() || retenue != 0))
-    {
-	somme = *it_res;
-	if(it_a != arg.field->rend())
-	    somme += *(it_a--);
-	somme += retenue;
-
-	retenue = somme >> 8;
-	somme = somme & 0xFF;
-
-	*(it_res--) = somme;
-    }
-
-    if(retenue != 0)
-    {
-	field->insert_null_bytes_at_iterator(field->begin(), 1); 
-	(*field)[0] = retenue;
-    }
-
-	// reduce(); // not necessary here, as the resulting filed is
-	// not smaller than the one of the two infinint in presence
-
-    return *this;
-    E_END("infinint::operator +=", "");
-}
-
-infinint & infinint::operator -= (const infinint & arg) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(! is_valid() || ! arg.is_valid())
-	throw SRC_BUG;
-
-    if(*this < arg)
-	throw Erange("infinint::operator", "substracting a infinint greater than the first, infinint can't be negative");
-
-	// now processing the operation
-
-    storage::iterator it_a = arg.field->rbegin();
-    storage::iterator it_res = field->rbegin();
-    U_I retenue = 0;
-    S_I somme;
-    U_I tmp;
-
-    while(it_res != field->rend() && (it_a != arg.field->rend() || retenue != 0))
-    {
-	somme = *it_res;
-	if(it_a != arg.field->rend())
-	    somme -= *(it_a--);
-	somme -= retenue;
-
-	if(somme < 0)
-	{
-	    somme = -somme;
-	    
-	    tmp = somme & 0xFF;
-	    retenue = somme >> 8;
-	    if(tmp != 0)
-	    {
-		somme = 0x100 - tmp;
-		retenue++;
-	    }
-	    else
-		somme = 0;
-	}
-	else
-	    retenue = 0;
-	
-	*(it_res--) = somme;
-    }
-
-    reduce(); // it is necessary here !
-    
-    return *this;
-    E_END("infinint::operator -=", "");
-}
-
-infinint & infinint::operator *= (unsigned char arg) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(!is_valid())
-	throw SRC_BUG;
-
-    storage::iterator it = field->rbegin();
-    U_I produit, retenue = 0;
-
-    while(it != field->rend())
-    {
-	produit = (*it) * arg + retenue;
-	retenue = 0;
-	
-	retenue = produit >> 8;
-	produit = produit & 0xFF;
-
-	*(it--) = produit;
-    }
-
-    if(retenue != 0)
-    {
-	field->insert_null_bytes_at_iterator(field->begin(), 1);
-	(*field)[0] = retenue;
-    }
-
-    if(arg == 0)
-	reduce(); // only necessary in that case
-    
-    return *this;
-    E_END("infinint::operator *=", "unsigned char");
-}
-
-infinint & infinint::operator *= (const infinint & arg) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    infinint ret = 0;
-
-    if(!is_valid() || !arg.is_valid())
-	throw SRC_BUG;
-
-    storage::iterator it_t = field->begin();
-
-    while(it_t != field->end())
-    {
-	ret <<= 8; // shift by one byte;
-	ret += arg * (*(it_t++));
-    } 
-
-	//  ret.reduce();  // not necessary because all operations
-	// done on ret, provide reduced infinint
-    *this = ret;
-
-    return *this; // copy constructor
-    E_END("infinint::operator *=", "infinint");
-}
-
-infinint & infinint::operator >>= (U_32 bit) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(! is_valid())
-	throw SRC_BUG;
-
-    U_32 byte = bit/8;
-    storage::iterator it = field->rbegin() - byte + 1;
-    bitfield bf;
-    unsigned char mask, r1 = 0, r2 = 0;
-    U_I shift_retenue;
-
-    bit = bit % 8;
-    shift_retenue = 8 - bit;
-    if(byte >= field->size())
-	*this = 0;
-    else
-    {
-	    // shift right by "byte" bytes
-	field->remove_bytes_at_iterator(it, byte);
-    
-	    // shift right by "bit" bits
-	if(bit != 0)
-	{
-	    for(register U_I i = 0; i < 8; i++)
-		bf[i] = i < shift_retenue ? 0 : 1;
-	    contract_byte(bf, mask);
-	    
-	    it = field->begin();
-	    while(it != field->end())
-	    {
-		r1 = *it & mask;
-		r1 <<= shift_retenue;
-		*it >>= bit;
-		*it |= r2;
-		r2 = r1;
-		it++;
-	    }
-	    reduce(); // necessary here
-	}
-    }
-
-    return *this;
-    E_END("infinint::operator >>=", "U_32");
-}
-
-infinint & infinint::operator >>= (infinint bit) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(! is_valid() || ! bit.is_valid())
-	throw SRC_BUG;
-
-    U_32 delta_bit = 0;
-    bit.unstack(delta_bit);
-
-    do 
-    {
-	*this >>= delta_bit;
-	delta_bit = 0;
-	bit.unstack(delta_bit);
-    }
-    while(delta_bit > 0);
-
-    return *this;
-    E_END("infinint::operator >>=", "infinint");
-}
-
-infinint & infinint::operator <<= (U_32 bit) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    if(! is_valid())
-	throw SRC_BUG;
-
-    U_32 byte = bit/8;
-    storage::iterator it = field->end();
-    U_I shift_retenue, r1 = 0, r2 = 0;
-    bitfield bf;
-    unsigned char mask;
-
-    if(*this == 0)
-	return *this;
-
-    bit = bit % 8;     // bit gives now the remaining translation after the "byte" translation
-
-    if(bit != 0)
-	byte++;        // to prevent the MSB to be lost (in "out of space" ;-) )
-
-	// this is the "byte" translation
-    field->insert_null_bytes_at_iterator(it, byte);
-
-    if(bit != 0)
-    {
-	    // and now the bit translation 
-	shift_retenue = 8 - bit;
-	it = field->rbegin();
-	
-	    // the mask for selecting the retenue
-	for(register U_I i = 0; i < 8; i++)
-	    bf[i] = i < bit ? 1 : 0;
-	contract_byte(bf, mask);
-	
-	while(it != field->rend())
-	{
-	    r1 = (*it) & mask;
-	    r1 >>= shift_retenue;
-	    *it <<= bit;
-	    *it |= r2;
-	    r2 = r1;
-	    it--;
-	}
-	reduce();
-    }
-
-    return *this;
-    E_END("infinint::operator <<=", "U_32");
-}
-
-infinint & infinint::operator <<= (infinint bit) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    U_32 delta_bit = 0;
-    bit.unstack(delta_bit);
-
-    do 
-    {
-	*this <<= delta_bit;
-	delta_bit = 0;
-	bit.unstack(delta_bit);
-    }
-    while(delta_bit > 0);
-
-    return *this;
-    E_END("infinint::operator <<=", "infinint");
-}
-
-template <class T> T infinint::modulo(T arg) const throw(Einfinint, Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    infinint tmp = *this % infinint(arg);
-    T ret = 0;
-    unsigned char *debut = (unsigned char *)(&ret);
-    unsigned char *ptr = debut + sizeof(T) - 1;
-    storage::iterator it = tmp.field->rbegin();
-
-    while(it != tmp.field->rend() && ptr >= debut)
-	*(ptr--) = *(it--);
-
-    if(it != tmp.field->rend())
-	throw SRC_BUG; // could not put all the data in the returned value !
-
-    if(used_endian == big_endian)
-	swap_bytes(debut, sizeof(T));
-    
-    return ret;   
-    E_END("infinint::modulo", "");
-}
-
-S_I infinint::difference(const infinint & b) const throw(Erange, Ebug)
-{
-    E_BEGIN;
-    storage::iterator ita;
-    storage::iterator itb;
-    const infinint & a = *this;
-
-    if(! a.is_valid() || ! b.is_valid())
-	throw SRC_BUG;
-
-    if(*a.field < *b.field) // field is shorter for this than for ref and object are always "reduced" 
-	return -1;
-    else
-	if(*a.field > *b.field) 
-	    return +1;
-	else // *a.field == *b.field 
-	{
-	    ita = a.field->begin();
-	    itb = b.field->begin();
-	    
-	    while(ita != a.field->end() && itb != b.field->end() && *ita == *itb)
-	    {
-		ita++;
-		itb++;
-	    }
-	    
-	    if(ita == a.field->end() && itb == b.field->end())
-		return 0; 
-		    
-	    if(itb == b.field->end()) 
-		return +1; // b can't be greater than a, at most it can be equal to it
-
-	    if(ita == a.field->end())
-		return -1;  // because itb != b.field->end();
-
-	    return *ita - *itb;
-	}
-    E_END("infinint::difference", "");
-}
-
-
-bool infinint::is_valid() const throw()
-{
-    E_BEGIN;
-    return field != NULL;
-    E_END("infinint::is_valid", "");
-}
-
-void infinint::reduce() throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    static const U_I max_a_time = ~ (U_I)(0); // this is the argument type of remove_bytes_at_iterator
-    
-    U_I count = 0;
-    storage::iterator it = field->begin();
-
-    do
-    {
-	while(it != field->end() && (*it) == 0 && count < max_a_time)
-	{
-	    it++;
-	    count++;
-	}
-
-	if(it == field->end()) // all zeros
-	{
-	    if(count == 0) // empty storage;
-		field->insert_null_bytes_at_iterator(field->begin(), 1); // field width is at least one byte
-	    else
-		if(count > 1)
-		    field->remove_bytes_at_iterator(field->begin(), count - 1);
-
-		// it == field->end()  is still true
-	}
-	else
-	{
-	    if(count > 0)
-		field->remove_bytes_at_iterator(field->begin(), count);
-	    count = 0;
-	    it = field->begin();
-	}
-    }
-    while(it != field->end() && (*it) == 0);
-    E_END("infinint::reduce", "");
-}
-
-void infinint::copy_from(const infinint & ref) throw(Ememory, Ebug)
-{
-    E_BEGIN;
-    if(ref.is_valid())
-    {
-	field = new storage(*(ref.field));
-	if(field == NULL)
-	    throw Ememory("infinint::copy_from");
-    }
-    else
-	throw SRC_BUG;
-    E_END("infinint::copy_from", "");
-}
-
-void infinint::detruit() throw(Ebug)
-{
-    E_BEGIN;
-    if(field != NULL)
-    {
-	delete field;
-	field = NULL;
-    }
-    E_END("infinint::detruit", "");
-}
-
-void infinint::make_at_least_as_wider_as(const infinint & ref) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    if(! is_valid() || ! ref.is_valid())
-	throw SRC_BUG;
-
-    field->insert_as_much_as_necessary_const_byte_to_be_as_wider_as(*ref.field, field->begin(), 0x00);
-    E_END("infinint::make_at_least_as_wider_as", "");
-}
-
-template <class T> void infinint::infinint_from(T a) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-    U_I size = sizeof(a);
-    S_I direction = +1;
-    unsigned char *ptr, *fin;
-
-    if(used_endian == not_initialized)
-	setup_endian();
-
-    if(used_endian == big_endian)
-    {
-	direction = -1;
-	ptr = (unsigned char *)(&a) + (size - 1);
-	fin = (unsigned char *)(&a) - 1;
-    }
-    else
-    {
-	direction = +1;
-	ptr = (unsigned char *)(&a);
-	fin = (unsigned char *)(&a) + size;
-    }
-
-    while(ptr != fin && *ptr == 0)
-    {
-	ptr += direction;
-	size--;
-    }
-
-    if(size == 0)
-    {
-	size = 1;
-	ptr -= direction;
-    }
-
-    field = new storage(size);
-    if(field != NULL)
-    {
-	storage::iterator it = field->begin();
-
-	while(ptr != fin)
-	{
-	    *(it++) = *ptr;
-	    ptr += direction;
-	}
-	if(it != field->end())
-	    throw SRC_BUG; // size mismatch in this algorithm
-    }
-    else
-	throw Ememory("template infinint::infinint_from");
-
-    E_END("infinint::infinint_from", "");
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-    // argument must be a regular interger (a bit field).
-template <class T> T rotate_right_one_bit(T v)
-{
-    bool retenue = (v & 1) != 0;
-
-    v >>= 1;
-    if(retenue)
-	v |= 1 << sizeof(v);
-
-    return v;
-}
-
-
-template <class T> void infinint::infinint_unstack_to(T &a) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN;
-	// T is supposed to be an unsigned "integer" 
-	// (ie.: sizeof returns the width of the storage bit field  and no sign bit is present)
-	// Note : static here avoids the recalculation of max_T at each call
-//    static const T max_T = ~ T(0); // negation bit by bit of zero gives max possible value of T (all bits set)
-    static const T max_T = ~T(0) > 0 ? ~ T(0) : ~rotate_right_one_bit(T(1));
-    infinint step = max_T - a;
-    
-    if(*this < step)
-    {
-	T transfert = 0;
-	unsigned char *debut = (unsigned char *)&transfert;
-	unsigned char *ptr = debut + sizeof(transfert) - 1;
-	storage::iterator it = field->rbegin();
-
-	while(ptr >= debut && it != field->rend())
-	    *(ptr--) = *(it--);
-		
-	if(used_endian == big_endian)
-	    swap_bytes(debut, sizeof(transfert));
-	a += transfert;
-	*this = 0;
-    }
-    else
-    {
-	*this -= step;
-	a = max_T;
-    }
-    E_END("infinint::infinint_unstack_to", "");
-}
-
-void infinint::setup_endian()
-{
-    E_BEGIN;
-    U_16 u = 1;
-    unsigned char *ptr = (unsigned char *)(&u);
-
-    if(ptr[0] == 1)
-	used_endian = big_endian;
-    else
-	used_endian = little_endian;
-    E_END("infinint::setup_endian", "");
-}
-
-//////////////////////////////////////////////////////
-///////////////// local functions ////////////////////
-//////////////////////////////////////////////////////
-
-static void swap_bytes(unsigned char &a, unsigned char &b) throw()
-{
-    E_BEGIN;
-    unsigned char c = a;
-    a = b;
-    b = c;
-    E_END("infinint.cpp : swap_bytes", "unsigned char &, unsigned char &");
-}
-
-static void swap_bytes(unsigned char *a, U_I size) throw()
-{
-    E_BEGIN;
-    if(size <= 1)
-	return;
-    else
-    {
-	swap_bytes(a[0], a[size-1]);
-	swap_bytes(a+1, size-2); // terminal recursivity
-    }
-    E_END("infinint.cpp : swap_bytes", "unsigned char *");
-}
-
-static void expand_byte(unsigned char a, bitfield &bit) throw()
-{
-    E_BEGIN;
-    unsigned char mask = 0x80;
-
-    for(register S_I i = 0; i < 8; i++)
-    {
-        bit[i] = (a & mask) >> 7 - i;
-	mask >>= 1;
-    }
-    E_END("infinint.cpp : expand_byte", "");
-}
-
-static void contract_byte(const bitfield &b, unsigned char & a) throw(Erange)
-{
-    E_BEGIN;
-    a = 0;
-    
-    for(register S_I i = 0; i < 8; i++)
-    {
-	a <<= 1;
-	if(b[i] > 1)
-	    throw Erange("infinint.cpp : contract_byte", "a binary digit is either 0 or 1");
-	a += b[i];
-    }
-    E_END("infinint.cpp : contract_byte", "");
-}
-
-///////////////////////////////////////////////////////////////////////
-///////////////// friends and not friends of infinint /////////////////
-///////////////////////////////////////////////////////////////////////
-
-infinint operator + (const infinint & a, const infinint & b) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint ret = a;
-    ret += b;
-
-    return ret;
-    E_END("operator +", "infinint");
-}
-
-infinint operator - (const infinint & a, const infinint & b) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint ret = a;
-    ret -= b;
-
-    return ret;
-    E_END("operator -", "infinint");
-}
-
-infinint operator * (const infinint & a, const infinint & b) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint ret = a;
-    ret *= b;
-    
-    return ret;
-    E_END("operator *", "infinint");
-}
-
-infinint operator * (const infinint &a, const unsigned char b) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint ret = a;
-    ret *= b;
-    
-    return ret;
-    E_END("operator *", "infinint, unsigned char");
-}
-
-infinint operator * (const unsigned char a, const infinint &b) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint ret = b;
-    ret *= a;
-    
-    return ret;
-    E_END("operator *", "unsigned char, infinint");
-}
-
-infinint operator / (const infinint & a, const infinint & b) throw(Einfinint, Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint q, r;
-    euclide(a, b, q, r);
-
-    return q;
-    E_END("operator / ", "infinint");
-}
-
-infinint operator % (const infinint & a, const infinint & b) throw(Einfinint, Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    infinint q, r;
-    euclide(a, b, q, r);
-
-    return r;
-    E_END("operator %", "infinint");
-}
-
-infinint operator >> (const infinint & a, U_32 bit) throw(Erange, Ememory, Ebug)
-{ 
-    E_BEGIN;
-    infinint ret = a;
-    ret >>= bit; 
-    return ret; 
-    E_END("operator >>", "infinint, U_32");
-}
-
-infinint operator >> (const infinint & a, const infinint & bit) throw(Erange, Ememory, Ebug)
-{ 
-    E_BEGIN;
-    infinint ret = a;
-    ret >>= bit; 
-    return ret; 
-    E_END("operator >>", "infinint");
-}
-
-infinint operator << (const infinint & a, U_32 bit) throw(Erange, Ememory, Ebug)
-{ 
-    E_BEGIN;
-    infinint ret = a; 
-    ret <<= bit; 
-    return ret;
-    E_END("operator <<", "infinint, U_32");
-}
-
-infinint operator << (const infinint & a, const infinint & bit) throw(Erange, Ememory, Ebug)
-{ 
-    E_BEGIN;
-    infinint ret = a; 
-    ret <<= bit; 
-    return ret; 
-    E_END("operator <<", "infinint");
-}
-
-void euclide(infinint a, const infinint &b, infinint &q, infinint &r) throw(Einfinint, Erange, Ememory, Ebug)
-{
-    E_BEGIN;
-    if(b == 0)
-	throw Einfinint("infinint.cpp : euclide", "division by zero"); // division by zero
-
-    if(a < b)
-    {
-	q = 0;
-	r = a;
-	return;
-    }
-
-    r = b;
-    while(*a.field >= *r.field)
-	r <<= 8; // one byte
-
-    q = 0;
-    while(b < r)
-    {
-	r >>= 8; // one byte;
-	q <<= 8; // one byte;
-	while(r <= a)
-	{
-	    a -= r;
-	    q++;
-	}
-    }
-
-    r = a;
-    E_END("euclide", "infinint");
-}
-
-
-static void template_instance()
-{
-    infinint t;
-    unsigned char a = 0;
-    U_16 b = 0;
-    U_32 c = 0;
-    U_I d = 0;
-    U_32 e = 0;
-    off_t f = 0;
-    size_t g = 0;
-    time_t h = 0;
- 
-	// this forces template instanciation
-    t.unstack(a);
-    t.unstack(b);
-    t.unstack(c);
-    t.unstack(d);
-    t.unstack(e);
-    t.unstack(f);
-    t.unstack(g);
-    t.unstack(h);
-    template_instance(); // this call is never used, 
-	// this line is only to avoid compilation warning
-	// of ... never used function :-)
-}
Index: dar/infinint.hpp
===================================================================
--- dar.orig/infinint.hpp	2012-05-02 11:23:23.299876260 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,172 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef INFININT_HPP
-#define INFININT_HPP
-
-#pragma interface
-
-#include <sys/types.h>
-#include <typeinfo>
-
-#include "storage.hpp"
-#include "integers.hpp"
-
-class generic_file;
-
-class infinint
-{
-public :
-
-    infinint(off_t a = 0) throw(Ememory, Erange, Ebug)
-	{ E_BEGIN; infinint_from(a); E_END("infinint::infinint", "off_t"); };
-#if time_t != off_t
-    infinint(time_t a = 0) throw(Ememory, Erange, Ebug)
-	{ E_BEGIN; infinint_from(a); E_END("infinint::infinint", "off_t"); };
-#endif
-    infinint(const infinint & ref) throw(Ememory, Ebug) 
-	{ E_BEGIN; copy_from(ref); E_END("infinint::infinint", "const infinint &"); };
-    ~infinint() throw(Ebug) 
-	{ E_BEGIN; detruit(); E_END("infinint::~infinint",""); };
-    
-
-    infinint & operator = (const infinint & ref) throw(Ememory, Ebug) 
-	{ E_BEGIN; detruit(); copy_from(ref); return *this; E_END("infinint::operator =",""); };
-
-    void read_from_file(int fd) throw(Erange, Ememory, Ebug); // read an infinint from a file
-    void dump(int fd) const throw(Einfinint, Ememory, Erange, Ebug); // write byte sequence to file 
-    void read_from_file(generic_file &x) throw(Erange, Ememory, Ebug); // read an infinint from a file
-    void dump(generic_file &x) const throw(Einfinint, Ememory, Erange, Ebug); // write byte sequence to file 
-
-    infinint & operator += (const infinint & ref) throw(Ememory, Erange, Ebug);
-    infinint & operator -= (const infinint & ref) throw(Ememory, Erange, Ebug);
-    infinint & operator *= (unsigned char arg) throw(Ememory, Erange, Ebug);
-    infinint & operator *= (const infinint & ref) throw(Ememory, Erange, Ebug);
-    inline infinint & operator /= (const infinint & ref) throw(Einfinint, Erange, Ememory, Ebug);
-    inline infinint & operator %= (const infinint & ref) throw(Einfinint, Erange, Ememory, Ebug);
-    infinint & operator >>= (U_32 bit) throw(Ememory, Erange, Ebug);
-    infinint & operator >>= (infinint bit) throw(Ememory, Erange, Ebug);
-    infinint & operator <<= (U_32 bit) throw(Ememory, Erange, Ebug);
-    infinint & operator <<= (infinint bit) throw(Ememory, Erange, Ebug);
-    infinint operator ++(int a) throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; infinint ret = *this; ++(*this); return ret; E_END("infinint::operator ++", "int"); };
-    infinint operator --(int a) throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; infinint ret = *this; --(*this); return ret; E_END("infinint::operator --", "int"); };
-    infinint & operator ++() throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; return *this += 1; E_END("infinint::operator ++", "()"); };
-    infinint & operator --() throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; return *this -= 1; E_END("infinint::operator --", "()"); };
-
-    U_32 operator % (U_32 arg) const throw(Einfinint, Ememory, Erange, Ebug) 
-	{ E_BEGIN; return modulo(arg); E_END("infinint::operator %",""); };
-
-	// increment the argument up to a legal value for its storage type and decrement the object in consequence
-	// note that the initial value of the argument is not ignored !
-	// when the object is null the value of the argument stays the same as before
-    template <class T>void unstack(T &v) throw(Ememory, Erange, Ebug) 
-	{ E_BEGIN; infinint_unstack_to(v); E_END("infinint::unstack", typeid(v).name()); };
-
-    friend bool operator < (const infinint &, const infinint &) throw(Erange, Ebug);
-    friend bool operator == (const infinint &, const infinint &) throw(Erange, Ebug);
-    friend bool operator > (const infinint &, const infinint &) throw(Erange, Ebug);
-    friend bool operator <= (const infinint &, const infinint &) throw(Erange, Ebug);
-    friend bool operator != (const infinint &, const infinint &) throw(Erange, Ebug);
-    friend bool operator >= (const infinint &, const infinint &) throw(Erange, Ebug);
-    friend void euclide(infinint a, const infinint &b, infinint &q, infinint &r) throw(Einfinint, Erange, Ememory, Ebug);
-
-private :
-    static const int TG = 4;
-
-    enum endian { big_endian, little_endian, not_initialized };
-    typedef unsigned char group[TG];
-     
-    storage *field;
-
-    bool is_valid() const throw();
-    void reduce() throw(Erange, Ememory, Ebug); // put the object in canonical form : no leading byte equal to zero
-    void copy_from(const infinint & ref) throw(Ememory, Ebug);
-    void detruit() throw(Ebug);
-    void make_at_least_as_wider_as(const infinint & ref) throw(Erange, Ememory, Ebug);
-    template <class T> void infinint_from(T a) throw(Ememory, Erange, Ebug);
-    template <class T> void infinint_unstack_to(T &a) throw(Ememory, Erange, Ebug);
-    template <class T> T modulo(T arg) const throw(Einfinint, Ememory, Erange, Ebug);
-    signed int difference(const infinint & b) const throw(Erange, Ebug); // gives the sign of (*this - arg) but only the sign !
-
-	/////////////////////////
-	// static statments
-	//
-    static endian used_endian;
-    static void setup_endian();
-};
-
-#define OPERATOR(OP) inline bool operator OP (const infinint &a, const infinint &b) throw(Erange, Ebug) \
-{ \
-    E_BEGIN; \
-    return a.difference(b) OP 0; \
-    E_END("operator OP", "infinint, infinint"); \
-}
-
-OPERATOR(<);
-OPERATOR(>);
-OPERATOR(<=);
-OPERATOR(>=);
-OPERATOR(==);
-OPERATOR(!=);
-
-infinint operator + (const infinint &, const infinint &) throw(Erange, Ememory, Ebug);
-infinint operator - (const infinint &, const infinint &) throw(Erange, Ememory, Ebug);
-infinint operator * (const infinint &, const infinint &) throw(Erange, Ememory, Ebug);
-infinint operator * (const infinint &, const unsigned char) throw(Erange, Ememory, Ebug);
-infinint operator * (const unsigned char, const infinint &) throw(Erange, Ememory, Ebug);
-infinint operator / (const infinint &, const infinint &) throw(Einfinint, Erange, Ememory, Ebug);
-infinint operator % (const infinint &, const infinint &) throw(Einfinint, Erange, Ememory, Ebug);
-infinint operator >> (const infinint & a, U_32 bit) throw(Erange, Ememory, Ebug);
-infinint operator >> (const infinint & a, const infinint & bit) throw(Erange, Ememory, Ebug);
-infinint operator << (const infinint & a, U_32 bit) throw(Erange, Ememory, Ebug);
-infinint operator << (const infinint & a, const infinint & bit) throw(Erange, Ememory, Ebug);
-void euclide(infinint a, const infinint &b, infinint &q, infinint &r) throw(Einfinint, Erange, Ememory, Ebug);
-template <class T> inline void euclide(T a, T b, T & q, T &r) 
-{ 
-    E_BEGIN;
-    q = a/b; r = a%b; 
-    E_END("euclide", "");
-};
-
-inline infinint & infinint::operator /= (const infinint & ref) throw(Einfinint, Erange, Ememory, Ebug)
-{ 
-    E_BEGIN;
-    *this = *this / ref;
-    return *this;
-    E_END("infinint::operator /=", "");
-}
-
-inline infinint & infinint::operator %= (const infinint & ref) throw(Einfinint, Erange, Ememory, Ebug)
-{ 
-    E_BEGIN;
-    *this = *this % ref; 
-    return *this;
-    E_END("infinint::operator %=", "");
-}
-
-#endif
Index: dar/integers.hpp
===================================================================
--- dar.orig/integers.hpp	2012-05-02 11:23:23.387877347 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,77 +0,0 @@
-    /*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-
-#ifndef INTEGERS_HPP
-#define INTEGERS_HPP
-
-#ifndef OS_BITS
-
-#include <stdint.h>
-#define U_16 uint16_t
-#define U_32 uint32_t
-#define U_64 uint64_t
-#define U_I  unsigned int
-#define S_16 int16_t
-#define S_32 int32_t
-#define S_64 int64_t
-#define S_I signed int
-
-#else  //  OS_BITS not defined
-#if OS_BITS == 32
-
-#define U_16 unsigned short
-#define U_32 unsigned long
-#define U_64 unsigned long long
-#define U_I unsigned int 
-#define S_16 signed short
-#define S_32 signed long
-#define S_64 signed long long
-#define S_I signed int
-
-#else
-#if "OS_BITS" == 64
-
-#define U_16 unsigned short
-#define U_32 unsigned int
-#define U_64 unsigned long long
-#define U_I  unsigned int
-#define S_16 signed short
-#define S_32 signed int
-#define S_64 signed long long
-#define S_I signed int
-
-#else
-#error // unknown OS_BITS value
-    // the previous line will not compile, this is the expected behaviour
-
-#endif // OS_BITS == 64
-#endif // OS_BITS == 32
-#endif // OS_BITS not defined
-
-#endif // ifndef
-
-
-
-
Index: dar/macro_tools.cpp
===================================================================
--- dar.orig/macro_tools.cpp	2012-05-02 11:23:23.475874020 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,197 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include "macro_tools.hpp"
-#include "terminateur.hpp"
-#include "user_interaction.hpp"
-#include "zapette.hpp"
-#include "sar.hpp"
-#include "dar_suite.hpp"
-
-const version macro_tools_supported_version = "03";
-
-static void version_check(const header_version & ver);
-
-catalogue *macro_tools_get_catalogue_from(generic_file & f, compressor & zip, bool info_details, infinint &cat_size)
-{
-    terminateur term;
-    catalogue *ret;
-	
-    if(info_details)
-	user_interaction_warning("Extracting contents of the archive...");
-
-    term.read_catalogue(f);
-    if(zip.skip(term.get_catalogue_start()))
-    {
-	try
-	{
-	    ret = new catalogue(zip);
-	}
-	catch(Egeneric & e)
-	{
-	    throw Erange("get_catalogue_from", string("cannot open catalogue: ") + e.get_message());
-	}
-	cat_size = zip.get_position() - term.get_catalogue_start();
-    }
-    else
-	throw Erange("get_catalogue_from", "missing catalogue in file.");
-
-    if(ret == NULL)
-	throw Ememory("get_catalogue_from");
-
-    return ret;
-}
-
-void macro_tools_open_archive(const path &sauv_path, 
-			      const string &basename, 
-			      const string &extension, 
-			      S_I options, 
-			      const string & pass, 
-			      generic_file *&ret1, 
-			      scrambler *&scram, 
-			      compressor *&ret2, 
-			      header_version &ver, 
-			      const string &input_pipe, 
-			      const string &output_pipe, 
-			      const string & execute)
-{
-    generic_file *zip_base = NULL;
-    
-    if(basename == "-")
-    {
-	tuyau *in = NULL;
-	tuyau *out = NULL;
-	
-	try
-	{
-	    tools_open_pipes(input_pipe, output_pipe, in, out);
-	    ret1 = new zapette(in, out);
-	    if(ret1 == NULL)
-	    {
-		delete in;
-		delete out;
-	    }
-	    else
-		in = out = NULL; // now managed by the zapette
-	}
-	catch(...)
-	{
-	    if(in != NULL)
-		delete in;
-	    if(out != NULL)
-		delete out;
-	    throw;
-	}
-    }
-    else
-	ret1 = new sar(basename, extension, options, sauv_path, execute);
-
-    if(ret1 == NULL)
-	throw Ememory("open_archive");
-
-    if(pass != "")
-    {
-	scram = new scrambler(pass, *ret1);
-	if(scram == NULL)
-	    throw Ememory("open_archive");
-	zip_base = scram;
-    }
-    else
-    {
-	scram = NULL;
-	zip_base = ret1;
-    }
-
-    ver.read(*ret1);
-    version_check(ver);
-    catalogue_set_reading_version(ver.edition);
-    file::set_compression_algo_used(char2compression(ver.algo_zip));
-    file::set_archive_localisation(zip_base);
-    ret2 = new compressor(char2compression(ver.algo_zip), *zip_base);
-    if((ver.flag & VERSION_FLAG_SCRAMBLED) != 0)
-	user_interaction_warning("Warning, this archive has been \"scrambled\" (-K option). A wrong key is not possible to detect, it will cause DAR to report the archive as corrupted\n");
-
-    if(ret2 == NULL)
-    {
-	delete ret1;
-	throw Ememory("open_archive");
-    }
-}
-
-catalogue *macro_tools_get_catalogue_from(const string &basename)
-{
-    generic_file *ret1 = NULL;
-    scrambler *scram = NULL;
-    compressor *ret2 = NULL;
-    header_version ver;
-    string input_pipe, output_pipe, execute;
-    catalogue *ret = NULL;
-    infinint size;
-    string chemin, base;
-
-    input_pipe = output_pipe = execute = "";
-    tools_split_path_basename(basename, chemin, base);
-    if(chemin == "")
-	chemin = ".";
-    try
-    {
-	path where = chemin;
-	macro_tools_open_archive(where, base, EXTENSION, SAR_OPT_DONT_ERASE, "", 
-				 ret1, scram, ret2, ver, input_pipe, output_pipe, execute);
-	
-	ret = macro_tools_get_catalogue_from(*ret1, *ret2, false, size);
-    }
-    catch(...)
-    {
-	if(ret1 != NULL)
-	    delete ret1;
-	if(ret2 != NULL)
-	    delete ret2;
-	if(scram != NULL)
-	    delete scram;
-	if(ret != NULL)
-	    delete ret;
-	throw;
-    }
-    if(ret1 != NULL)
-	delete ret1;
-    if(ret2 != NULL)
-	delete ret2;
-    if(scram != NULL)
-	delete scram;
-    
-    return ret;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-static void version_check(const header_version & ver)
-{
-    if(atoi(ver.edition) > atoi(macro_tools_supported_version))
-	user_interaction_pause("The format version of the archive is too high for that software version, try reading anyway?");
-}
Index: dar/macro_tools.hpp
===================================================================
--- dar.orig/macro_tools.hpp	2012-05-02 11:23:23.439876606 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,58 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef MACRO_TOOLS_HPP
-#define MACRO_TOOLS_HPP
-
-#include "catalogue.hpp"
-#include "compressor.hpp"
-#include "infinint.hpp"
-#include "header_version.hpp"
-#include "generic_file.hpp"
-#include "scrambler.hpp"
-
-extern const version macro_tools_supported_version;
-
-extern void macro_tools_open_archive(const path &sauv_path,  // path to slices
-				     const string &basename,  // slice basename
-				     const string &extension,  // slice extensions
-				     S_I options,  // options to SAR (see sar.hpp)
-				     const string &pass, // pass key to unscramble
-				     generic_file *&ret1, // level 1 file (raw data) sar or zapette 
-				     scrambler *&scram, // NULL if pass is given an empty string else a scrambler (over raw data)
-				     compressor *&ret2, // compressor over scrambler or raw data (if no scrambler)
-				     header_version &ver, // header read from raw data
-				     const string &input_pipe, // named pipe for input when basename is "-" (dar_slave)
-				     const string &output_pipe, // named pipe for output when basename is "-" (dar_slave)
-				     const string & execute); // command to execute between slices
-    // all allocated objects (ret1, ret2, scram), must be deleted when no more needed
-
-extern catalogue *macro_tools_get_catalogue_from(generic_file & f,  // raw data access object
-						 compressor & zip,  // compressor object over raw data
-						 bool info_details, // verbose display (throught user_interaction)
-						 infinint &cat_size); // return size of archive in file (not in memory !)
-
-extern catalogue *macro_tools_get_catalogue_from(const string &basename);
-
-#endif
Index: dar/mask.cpp
===================================================================
--- dar.orig/mask.cpp	2012-05-02 11:23:23.335876082 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,206 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <fnmatch.h>
-#include "tools.hpp"
-#include "erreurs.hpp"
-#include "mask.hpp"
-
-simple_mask::simple_mask(const string & wilde_card_expression)
-{
-    the_mask = tools_str2charptr(wilde_card_expression);
-    if(the_mask == NULL)
-	throw Ememory("simple_mask::simple_mask");
-}
-
-bool simple_mask::is_covered(const string &expression) const
-{
-    char *tmp = tools_str2charptr(expression);
-    bool ret;
-    
-    if(tmp == NULL)
-	throw Ememory("simple_mask::is_covered");
-
-    ret = fnmatch(the_mask, tmp, FNM_PERIOD) == 0;
-    delete tmp;
-
-    return ret;
-}
-
-void simple_mask::copy_from(const simple_mask & m)
-{
-    the_mask = new char[strlen(m.the_mask)+1];
-    if(the_mask == NULL)
-	throw Ememory("simple_mask::copy_from");
-    strcpy(the_mask, m.the_mask);
-}
-
-regular_mask::regular_mask(const string & wild_card_expression)
-{
-    char *tmp = tools_str2charptr(wild_card_expression);
-
-    try
-    {	
-	S_I ret;
-
-	if((ret = regcomp(&preg, tmp, REG_NOSUB)) != 0)
-	{
-	    const S_I msg_size = 1024;
-	    char msg[msg_size];
-	    regerror(ret, &preg, msg, msg_size);
-	    throw Erange("regular_mask::regular_mask", msg);
-	}
-
-    }
-    catch(...)
-    {
-	delete tmp;
-	throw;
-    }
-    delete tmp;
-}
-
-bool regular_mask::is_covered(const string & expression) const
-{
-    char *tmp = tools_str2charptr(expression);
-    bool matches;
-
-    try
-    {
-	matches = regexec(&preg, tmp, 0, NULL, 0) != REG_NOMATCH;
-    }
-    catch(...)
-    {
-	delete tmp;
-	throw;
-    }
-    delete tmp;
-
-    return matches;
-}
-
-void not_mask::copy_from(const not_mask &m)
-{
-    ref = m.ref->clone();
-    if(ref == NULL)
-	throw Ememory("not_mask::copy_from(not_mask)");
-}
-
-void not_mask::copy_from(const mask &m)
-{
-    ref = m.clone();
-    if(ref == NULL)
-	throw Ememory("not_mask::copy_from(mask)");
-}
-
-void not_mask::detruit()
-{
-    if(ref != NULL)
-    {
-	delete ref;
-	ref = NULL;
-    }
-}
-
-void et_mask::add_mask(const mask& toadd)
-{
-    mask *t = toadd.clone();
-    if(t != NULL)
-	lst.push_back(t);
-    else
-	throw Ememory("et_mask::et_mask");
-}
-
-bool et_mask::is_covered(const string & expression) const 
-{
-    vector<mask *>::iterator it = const_cast<et_mask &>(*this).lst.begin();
-    vector<mask *>::iterator fin = const_cast<et_mask &>(*this).lst.end();
- 
-    if(lst.size() == 0)
-	throw Erange("et_mask::is_covered", "no mask in the list of mask to AND");
-
-    while(it != fin && (*it)->is_covered(expression))
-	it++;
-
-    return it == fin;
-}
-
-void et_mask::copy_from(const et_mask &m)
-{
-    vector<mask *>::iterator it = const_cast<et_mask &>(m).lst.begin();
-    vector<mask *>::iterator fin = const_cast<et_mask &>(m).lst.end();
-    mask *tmp;
-
-    while(it != fin && (tmp = (*it)->clone()) != NULL)
-    {
-	lst.push_back(tmp);
-	it++;
-    }
-
-    if(it != fin)
-    {
-	detruit();
-	throw Ememory("et_mask::copy_from");
-    }
-}
-
-void et_mask::detruit()
-{
-    vector<mask *>::iterator it = lst.begin();
-    
-    while(it != lst.end())
-    {
-	delete *it;
-	it++;
-    }
-    lst.clear();
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-bool ou_mask::is_covered(const string & expression) const 
-{
-    vector<mask *>::iterator it = const_cast<ou_mask &>(*this).lst.begin();
-    vector<mask *>::iterator fin = const_cast<ou_mask &>(*this).lst.end();
-    
-    if(lst.size() == 0)
-	throw Erange("et_mask::is_covered", "no mask in the list of mask to OR");
-
-    while(it != fin && ! (*it)->is_covered(expression))
-	it++;
-
-    return it != fin;
-}
-
-bool simple_path_mask::is_covered(const string &ch) const
-{
-    path p = ch;
-    return p.is_subdir_of(chemin) || chemin.is_subdir_of(p);
-}
Index: dar/mask.hpp
===================================================================
--- dar.orig/mask.hpp	2012-05-02 11:23:22.995876391 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,162 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef MASK_HPP
-#define MASK_HPP
-
-#pragma interface
-
-#include <string.h>
-#include <string>
-#include <vector>
-#include <regex.h>
-#include "path.hpp"
-
-using namespace std;
-
-class mask
-{
-public :
-    virtual ~mask() {};
-
-    virtual bool is_covered(const string &expression) const = 0;
-    virtual mask *clone() const = 0;
-};
-
-class bool_mask : public mask
-{
-public :
-    bool_mask(bool always) { val = always; };
-
-    bool is_covered(const string &exp) const { return val; };
-    mask *clone() const { return new bool_mask(val); };
-
-private :
-    bool val;
-};
-
-class simple_mask : public mask
-{
-public :
-    simple_mask(const string & wilde_card_expression);
-    simple_mask(const simple_mask & m) { copy_from(m); };
-    simple_mask & operator = (const simple_mask & m) { detruit(); copy_from(m); return *this; };
-    virtual ~simple_mask() { detruit(); };
-
-    bool is_covered(const string &expression) const;
-    mask *clone() const { return new simple_mask(*this); };
-
-private :
-    char *the_mask;
-
-    void copy_from(const simple_mask & m);
-    void detruit() { if(the_mask != NULL) delete the_mask; the_mask = NULL; };
-};
-
-
-class regular_mask : public mask
-{
-public :
-    regular_mask(const string & wild_card_expression);
-    virtual ~regular_mask() { regfree(&preg); };
-
-    bool is_covered(const string & expression) const;
-    mask *clone() const { return new regular_mask(*this); };
-
-private :
-    regex_t preg;
-};
-
-class not_mask : public mask
-{
-public :
-    not_mask(const mask &m) { copy_from(m); };
-    not_mask(const not_mask & m) { copy_from(m); };
-    not_mask & operator = (const not_mask & m) { detruit(); copy_from(m); return *this; };
-    ~not_mask() { detruit(); };
-
-    bool is_covered(const string &expression) const { return !ref->is_covered(expression); };
-    mask *clone() const { return new not_mask(*this); };
-
-private :
-    mask *ref;
-
-    void copy_from(const not_mask &m);
-    void copy_from(const mask &m);
-    void detruit();
-};
-    
-class et_mask : public mask
-{
-public :
-    et_mask() {};
-    et_mask(const et_mask &m) { copy_from(m); };
-    et_mask & operator = (const et_mask &m) { detruit(); copy_from(m); return *this; };
-    ~et_mask() { detruit(); };
-
-    void add_mask(const mask & toadd);
-
-    bool is_covered(const string & expression) const;
-    mask *clone() const { return new et_mask(*this); };
-    U_I size() const { return lst.size(); };
-protected :
-    vector<mask *> lst;
-    
-private :
-    void copy_from(const et_mask & m);
-    void detruit();
-};
-
-class ou_mask : public et_mask
-{
-public :
-    bool is_covered(const string & expression) const;
-    mask *clone() const { return new ou_mask(*this); };
-};
-
-class simple_path_mask : public mask
-{
-public :
-    simple_path_mask(const string &p) : chemin(p) {};
-
-    bool is_covered(const string &ch) const;
-    mask *clone() const { return new simple_path_mask(*this); };
-    
-private :
-    path chemin;
-};
-
-class same_path_mask : public mask
-{
-public : 
-    same_path_mask(const string &p) { chemin = p; };
-    
-    bool is_covered(const string &ch) const { return ch == chemin; };
-    mask *clone() const { return new same_path_mask(*this); };
-
-private :
-    string chemin;
-};
-
-#endif
Index: dar/no_comment.cpp
===================================================================
--- dar.orig/no_comment.cpp	2012-05-02 11:23:23.123876755 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,101 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include "no_comment.hpp"
-#include "infinint.hpp"
-
-
-void no_comment::fill_morceau()
-{
-    partie tmp;
-    infinint last_offset = 0;
-    char a;
-    enum { st_unknown, st_command, st_comment } status = st_unknown;
-    bool stop = false;
-    bool last_block_is_comment = true;
-
-    morceau.clear();
-    if(ref == NULL)
-	throw SRC_BUG;
-    ref->skip(0);
-    tmp.longueur = 0;
-
-    while(!stop)
-    {
-	stop = ref->read(&a, 1) != 1;
-	switch(status)
-	{
-	case st_unknown:
-	    switch(a)
-	    {
-	    case ' ':
-	    case '\t':
-		tmp.longueur++;
-		break;
-	    case '#':
-		status = st_comment;
-		break;
-	    default:
-		status = st_command;
-		tmp.debut = ref->get_position() - 1;
-		tmp.offset = last_offset;
-		tmp.longueur++;
-	    }
-	    break;
-	case st_comment:
-	    if(a == '\n')
-	    {
-		status = st_unknown;
-		last_block_is_comment = true;
-		tmp.longueur = 0;
-	    }
-	    break;
-	case st_command:
-	    if(!stop)
-		tmp.longueur++;
-	    if(a == '\n' || stop)
-	    {
-		status = st_unknown;
-
-		if(last_block_is_comment)
-		{
-		    morceau.push_back(tmp);
-		    last_offset = tmp.offset+tmp.longueur;
-		}
-		else
-		{
-		    if(morceau.size() < 1)
-			throw SRC_BUG;
-		    morceau.back().longueur += tmp.longueur;
-		    last_offset = morceau.back().offset+morceau.back().longueur;
-		}
-		last_block_is_comment = false;
-		tmp.longueur = 0;
-	    }
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-    }
-}
Index: dar/no_comment.hpp
===================================================================
--- dar.orig/no_comment.hpp	2012-05-02 11:23:23.423876485 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,41 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef NO_COMMENT_HPP
-#define NO_COMMENT_HPP
-
-
-#include "hide_file.hpp"
-
-class no_comment : public hide_file
-{
-public:	
-    no_comment(generic_file &f) : hide_file(f) {};
-
-protected:
-    void fill_morceau();
-};
-
-
-#endif
Index: dar/null_file.hpp
===================================================================
--- dar.orig/null_file.hpp	2012-05-02 11:23:23.179876241 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,46 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef NULL_FILE_HPP
-#define NULL_FILE_HPP
-
-//#pragma interface
-
-#include "generic_file.hpp"
-
-class null_file : public generic_file
-{
-public :
-    null_file(gf_mode m) : generic_file(m) {};
-    bool skip(const infinint &pos) { return pos == 0; };
-    bool skip_to_eof() { return true; };
-    bool skip_relative(signed int x) { return false; };
-    infinint get_position() { return 0; };
-
-protected :
-    int inherited_read(char *a, size_t size) { return 0; };
-    int inherited_write(char *a, size_t size) { return size; };
-};
-
-#endif
Index: dar/path.cpp
===================================================================
--- dar.orig/path.cpp	2012-05-02 11:23:23.243876475 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,253 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include "path.hpp"
-#include <iostream>
-
-static bool path_get_root(string & p, string & root);
-
-path::path(string s)
-{
-    string tmp;
-    dirs.clear();
-    relative = s[0] != '/';
-    if(s.size() < 1)
-	throw Erange("path::path", "empty string is not a valid path");
-    if(!relative)
-	s = string(s.begin()+1, s.end()); // remove the leading '/'
-    while(path_get_root(s, tmp))
-	dirs.push_back(tmp);
-    if(dirs.size() == 0 && relative)
-	throw Erange("path::path", "empty string is not a valid path");
-    reduce();
-    reading = dirs.begin();
-}
-
-path::path(const path & ref)
-{
-    dirs = ref.dirs;
-    relative = ref.relative;
-    reading = dirs.begin();
-}
-
-path & path::operator = (const path & ref)
-{
-    dirs = ref.dirs;
-    relative = ref.relative;
-    reading = dirs.begin();
-
-    return *this;
-}
-
-bool path::operator == (const path & ref) const
-{
-    if(ref.dirs.size() != dirs.size() || ref.relative != relative)
-	return false;
-    else
-    {
-	list<string>::iterator here = (const_cast<path &>(*this)).dirs.begin();
-	list<string>::iterator there = (const_cast<path &>(ref)).dirs.begin();
-	list<string>::iterator here_fin = (const_cast<path &>(*this)).dirs.end();
-	list<string>::iterator there_fin = (const_cast<path &>(ref)).dirs.end();
-	while(here != here_fin && there != there_fin && *here == *there)
-	{
-	    here++;
-	    there++;
-	}
-
-	return here == here_fin && there == there_fin;
-    }
-}
-
-string path::basename() const
-{
-    if(dirs.size() > 0)
-	return dirs.back();
-    else
-	return "/";
-}
-
-bool path::read_subdir(string & r)
-{
-    if(reading != dirs.end())
-    {
-	r = *reading++;
-	return true;
-    }
-    else
-	return false;
-}
-
-bool path::pop(string &arg)
-{
-    if(relative)
-	if(dirs.size() > 1)
-	{
-	    arg = dirs.back();
-	    dirs.pop_back();
-	    return true;
-	}
-	else
-	    return false;
-    else
-	if(dirs.size() > 0)
-	{
-	    arg = dirs.back();
-	    dirs.pop_back();
-	    return true;
-	}
-	else
-	    return false;
-}
-
-bool path::pop_front(string & arg)
-{
-    if(is_relative())
-	if(dirs.size() > 1)
-	{
-	    arg = dirs.front();
-	    dirs.pop_front();
-	    return true;
-	}
-	else
-	    return false;
-    else
-	if(dirs.size() > 0)
-	{
-	    relative = false;
-	    arg = "/";
-	    return true;
-	}
-	else
-	    return false;
-}
-
-path & path::operator += (const path &arg)
-{
-    if(!arg.is_relative())
-	throw Erange("path::operator +", "can't add an absolute path");
-    list<string>::iterator it = (const_cast<path &>(arg)).dirs.begin();
-    list<string>::iterator it_fin = (const_cast<path &>(arg)).dirs.end();
-    while(it != it_fin)
-	dirs.push_back(*it++);
-    
-    return *this;
-}
-
-bool path::is_subdir_of(const path & p) const
-{
-    list<string>::iterator it_me = (const_cast<path &>(*this)).dirs.begin();
-    list<string>::iterator it_arg = (const_cast<path &>(p)).dirs.begin();
-    list<string>::iterator fin_me = (const_cast<path &>(*this)).dirs.end();
-    list<string>::iterator fin_arg = (const_cast<path &>(p)).dirs.end();
-
-    while(it_me != fin_me && it_arg != fin_arg && *it_me == *it_arg)
-    {
-	it_me++;
-	it_arg++;
-    }
-
-    return it_arg == fin_arg; 
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-string path::display() const
-{
-    string ret = relative ? "" : "/";
-    list<string>::iterator it = (const_cast<path *>(this))->dirs.begin();
-    list<string>::iterator it_fin = (const_cast<path *>(this))->dirs.end();
-
-    if(it != it_fin)
-	ret += *it++;
-    while(it != it_fin)
-	ret = ret + "/" + *it++;
-
-    return ret;
-}
-
-void path::reduce()
-{
-    dirs.remove(".");
-    if(dirs.size() == 0 && relative)
-	dirs.push_back(".");
-    else
-    {
-	list<string>::iterator it = dirs.begin();
-	list<string>::iterator prev = it;
-
-	while(it != dirs.end())
-	{
-	    if(*it == ".." && *prev != "..")
-	    {
-		list<string>::iterator tmp = prev;
-
-		it = dirs.erase(it);
-		if(prev != dirs.begin())
-		{
-		    prev--;
-		    dirs.erase(tmp);
-		}
-		else
-		{
-		    dirs.erase(prev);
-		    prev = dirs.begin();
-		}
-	    }
-	    else
-	    {
-		prev = it;
-		it++;
-	    }
-	}
-	if(dirs.size() == 0 && relative)
-	    dirs.push_back(".");
-    }	
-}
-
-static bool path_get_root(string & p, string & root)
-{
-    string::iterator it = p.begin();
-
-    if(p.size() == 0)
-	return false;
-    while(it != p.end() && *it != '/' )
-	it++;
-
-    root = string(p.begin(), it);
-    if(it != p.end())
-	p = string(it+1, p.end());
-    else
-	p = "";
-    if(root.size() == 0)
-	throw Erange("path_get_root", "empty string as subdirectory does not make a valid path");
-
-    return true;
-}
Index: dar/path.hpp
===================================================================
--- dar.orig/path.hpp	2012-05-02 11:23:23.287875798 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef PATH_HPP
-#define PATH_HPP
-
-#pragma interface
-
-#include <list>
-#include <string>
-#include "erreurs.hpp"
-
-using namespace std;
-
-class path
-{
-public :
-    path(string s); // empty string is not a valid string (exception thrown)
-    path(const char *s) { *this = path(string(s)); };
-    path(const path & ref);
-    path & operator = (const path & ref);
-    bool operator == (const path & ref) const;
-    
-    string basename() const; // name of the innermost directory/file of the path 
-    void reset_read() { reading = dirs.begin(); }; // reset for read_subdir. next call to read_subdir is the most global 
-	// directory 
-    bool read_subdir(string & r); // return the name of the next directory part of the path to basename(), starting at root
-    bool is_relative() const { return relative; };
-    bool pop(string & arg); // remove and return in argument the basename of the path, return false if not possible (no sub-directory)
-    bool pop_front(string & arg); // removes and returns the first directory of the path,
-	// when just the basename is present returns false, if the path is absolute, 
-	// the first call change it to relative (except if equal to "/" then return false)
-
-    path operator + (const path & arg) const { path tmp = *this; tmp += arg; return tmp; }; 
-	// add arg as a subdir of the object, arg can be a string also, which is converted to a path on the fly
-    path & operator += (const path & arg);
-    bool is_subdir_of(const path & p) const;
-    string display() const;
-    unsigned int degre() const { return dirs.size() + (relative ? 0 : 1); };
-    
-private :
-    list<string>::iterator reading;
-    list<string> dirs;
-    bool relative;
-
-    void reduce();
-};
-
-#endif
Index: dar/prime.cpp
===================================================================
--- dar.orig/prime.cpp	2012-05-02 11:23:23.079875920 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,32 +0,0 @@
-#include <iostream.h>
-#include "infinint.hpp"
-#include "deci.hpp"
-#include "integers.hpp"
-
-S_I main(S_I argc, char *argv[])
-{
-    if(argc != 2)
-    {
-	cout << "usage : " << argv[0] <<  " <number>" << endl;
-	exit(1);
-    }
-    
-    deci x = string(argv[1]);
-    cout << "converting string to infinint... " << endl;
-    infinint num = x.computer();
-    cout << "checking if the number is a prime factor... " << endl;
-    infinint max = (num / 2) + 1;
-    infinint i = 2;
-    while(i < max)
-	if(num%i == 0)
-	    break;
-	else 
-	    i++;
-
-    if(i < max)
-	cout << argv[1] << " is NOT prime" << endl;
-    else
-	cout << argv[1] << " is PRIME" << endl;
-}
-
-		
Index: dar/sar.cpp
===================================================================
--- dar.orig/sar.cpp	2012-05-02 11:23:23.139874718 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,846 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <time.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include "sar.hpp"
-#include "deci.hpp"
-#include "user_interaction.hpp"
-#include "tools.hpp"
-#include "erreurs.hpp"
-#include "test_memory.hpp"
-
-static bool sar_extract_num(string filename, string base_name, string ext, infinint & ret);
-static bool sar_get_higher_number_in_dir(path dir ,string base_name, string ext, infinint & ret);
-
-sar::sar(const string & base_name, const string & extension, S_I options, const path & dir, const string & execute) : generic_file(gf_read_only), archive_dir(dir)
-{
-    set_options(options);
-    
-    base = base_name;
-    ext = extension;
-    initial = true;
-    hook = execute;
-    open_file_init();
-    open_file(1);
-}
-
-sar::sar(const string & base_name, const string & extension, const infinint & file_size, const infinint & first_file_size, S_I options, const path & dir, const string & execute) : generic_file(gf_write_only), archive_dir(dir)
-{
-    if(file_size < header::size() + 1)
-	throw Erange("sar::sar", "file size too small");
-
-    initial = true;
-    set_options(options);
-    base = base_name;
-    ext = extension;
-    size = file_size;
-    first_size = first_file_size;
-    hook = execute;
-
-    open_file_init();
-    open_file(1);
-}
-
-sar::~sar()
-{
-    close_file();
-    if(get_mode() == gf_write_only)
-	hook_execute(of_current);
-}
-
-bool sar::skip(const infinint &pos)
-{
-    infinint byte_in_first_file = first_size - first_file_offset;
-    infinint byte_per_file = size - header::size();
-    infinint dest_file, offset;
-
-    
-    if(get_position() == pos)
-	return true; // no need to skip
-
-	///////////////////////////
-	// determination of the file to go and its offset to seek
-	//
-    if(pos < byte_in_first_file)
-    {
-	dest_file = 1;
-	offset = pos + first_file_offset;
-    }
-    else
-    {
-	dest_file = ((pos - byte_in_first_file) / byte_per_file) + 2; 
-	    // "+2" because file number starts to 1 and first file is to be count
-	offset = ((pos - byte_in_first_file) % byte_per_file) + header::size();
-    }
-
-	///////////////////////////
-	// checking wheather the required position is acceptable
-	//
-    if(of_last_file_known && dest_file > of_last_file_num)
-    {
-	    // going to EOF
-	open_file(of_last_file_num);
-	of_fd->skip_to_eof();
-	file_offset = of_fd->get_position();
-	return false;
-    }
-    else
-    {
-	try
-	{
-	    open_file(dest_file);
-	    set_offset(offset);
-	    file_offset = offset;
-	    return true;
-	}
-	catch(Erange & e)
-	{
-	    return false;
-	}
-    }
-}
-
-bool sar::skip_to_eof()
-{
-    bool ret;
-
-    open_last_file();
-    ret = of_fd->skip_to_eof();
-    file_offset = of_fd->get_position();
-    set_offset(file_offset);
-
-    return ret;
-}
-
-bool sar::skip_forward(U_I x)
-{
-    infinint number = of_current;
-    infinint offset = file_offset + x;
-
-    while((number == 1 ? offset >= first_size : offset >= size) 
-	  && (!of_last_file_known || number <= of_last_file_num))
-    {
-	offset -= number == 1 ? first_size : size;
-	offset += header::size();
-	number++;
-    }
-    
-    if(number == 1 ? offset < first_size : offset < size)
-    {
-	open_file(number);
-	file_offset = offset;
-	set_offset(file_offset);
-	return true;
-    }
-    else
-	return false;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-bool sar::skip_backward(U_I x)
-{
-    infinint number = of_current;
-    infinint offset = file_offset;
-    infinint offset_neg = x;
-
-    while(number > 1 && offset_neg + header::size() > offset)
-    {
-	offset_neg -= offset - header::size() + 1;
-	number--;
-	if(number > 1)
-	    offset = size - 1;
-	else
-	    offset = first_size - 1;
-    }
-
-    if((number > 1 ? offset_neg + header::size() : offset_neg + first_file_offset) <= offset)
-    {
-	open_file(number);
-	file_offset = offset - offset_neg;
-	set_offset(file_offset);
-	return true;
-    }
-    else
-    {   // seek to beginning of file
-	open_file(1);
-	set_offset(first_file_offset);
-	return false;
-    }
-}
-          
-bool sar::skip_relative(S_I x)
-{
-    if(x > 0)
-	return skip_forward(x);
-    
-    if(x < 0)
-	return skip_backward(-x);
-
-    return true; // when x == 0
-}		
-
-infinint sar::get_position()
-{	    
-    if(of_current > 1)
-	return first_size - first_file_offset + (of_current-2)*(size-header::size()) + file_offset - header::size();
-    else
-	return file_offset - first_file_offset;
-}
-
-S_I sar::inherited_read(char *a, size_t sz)
-{
-    size_t lu = 0;
-    bool loop = true;
-    
-    while(lu < sz && loop)
-    {
-	S_I tmp = of_fd->read(a+lu, sz-lu);
-	if(tmp < 0)
-	    throw Erange("sar::inherited_read", strerror(errno));
-	if(tmp == 0)
-	    if(of_flag == FLAG_TERMINAL)
-		loop = false;
-	    else
-		open_file(of_current + 1);
-	else
-	{
-	    lu += tmp;
-	    file_offset += tmp;
-	}
-    }
-
-    return lu;
-}
-
-S_I sar::inherited_write(char *a, size_t sz)
-{
-    infinint to_write = sz;
-    infinint max_at_once;
-    infinint tmp_wrote;
-    S_I tmp;
-    U_I micro_wrote;
-
-    while(to_write > 0)
-    {
-	max_at_once = of_current == 1 ? first_size - file_offset : size - file_offset;
-	tmp_wrote = max_at_once > to_write ? to_write : max_at_once;
-	if(tmp_wrote > 0)
-	{
-	    micro_wrote = 0;
-	    tmp_wrote.unstack(micro_wrote);
-	    tmp = of_fd->write(a, micro_wrote);
-	}
-	else
-	{
-	    open_file(of_current + 1);
-	    continue;
-	}
-	if(tmp < 0) // not very usefull, as generic_file::write never returns negative values ... to change
-	    throw Erange("sar::inherited_write", strerror(errno));
-	if(tmp == 0)
-	{
-	    user_interaction_pause("Can't write any byte to file, filesystem is full? Please check!");
-	    continue;
-	}
-	to_write -= tmp;
-	file_offset += tmp;
-	a += tmp;
-    }
-	
-    return sz;
-}
-
-void sar::close_file()
-{
-    if(of_fd != NULL)
-    {
-	delete of_fd;
-	of_fd = NULL;
-    }
-}
-
-void sar::open_readonly(char *fic, const infinint &num)
-{
-    header h;
-
-    while(of_fd == NULL)
-    {
-	    // trying to open the file
-	    //
-	S_I fd = open(fic, O_RDONLY);
-	if(fd < 0)
-	    if(errno == ENOENT)
-	    {
-		user_interaction_pause(string(fic) + " is required for furthur operation, please provide the file.");
-		continue; 
-	    }
-	    else
-		throw Erange("sar::open_readonly", string("error openning ") + fic + " : " + strerror(errno));
-	else
-	    of_fd = new fichier(fd);
-	
-	    // trying to read the header
-	    //
-	try 
-	{
-	    h.read(*of_fd);
-	}
-	catch(Egeneric & e)
-	{
-	    close_file();
-	    user_interaction_pause(string(fic) + string(" has a bad or corrupted header, please provide the correct file."));
-	    continue; 
-	}
-		
-	    // checking agains the magic number
-	    //
-	if(h.magic != SAUV_MAGIC_NUMBER)
-	{
-	    close_file();
-	    user_interaction_pause(string(fic) + " is not a valid file (wrong magic number), please provide the good file.");
-	    continue; 
-	}
-		
-	    // checking the ownership to the set of file
-	    //
-	if(num == 1 && first_file_offset == 0)
-	{
-	    label_copy(of_internal_name, h.internal_name);
-	    try
-	    {
-		first_size = of_fd->get_size();
-		if(h.extension == EXTENSION_SIZE)
-		    size = h.size_ext;
-		else
-		    size = first_size;
-		first_file_offset = of_fd->get_position();
-	    }
-	    catch(Erange & e)
-	    {
-		user_interaction_pause(string("Error openning ") + fic + ": " + e.get_message());
-	    }
-	}
-	else
-	    if(! header_label_is_equal(of_internal_name, h.internal_name))
-	    {
-		close_file();
-		user_interaction_pause(string(fic) + " is a file from another set of backup file, please provide the correct file.");
-		continue;
-	    }
-
-	    // checking the flag
-	    //
-	switch(h.flag)
-	{
-	case FLAG_TERMINAL :
-	    of_last_file_known = true;
-	    of_last_file_num = num;
-	    of_last_file_size = of_fd->get_size();
-	    break;
-	case FLAG_NON_TERMINAL :
-	    break;
-	default :
-	    close_file();
-	    user_interaction_pause(string(fic) + " has an unknown flag (neither terminal nor non_terminal file).");
-	    continue;
-	}
-	of_flag = h.flag;
-    }
-}
-
-void sar::open_writeonly(char *fic, const infinint &num)
-{
-    struct stat buf;
-    header h;
-    S_I open_flag = O_WRONLY;
-    S_I open_mode = 0666; // umask will unset some bits while calling open
-    S_I fd;
-
-	// check if that the file exists
-    if(stat(fic, &buf) < 0)
-	if(errno != ENOENT) // other error than 'file does not exist' occured
-	    throw Erange("sar::open_writeonly stat()", strerror(errno));
-	else
-	    open_flag |= O_CREAT;
-    else // file exists
-    {
-	S_I fd_tmp = open(fic, O_RDONLY);
-
-	if(fd_tmp >= 0)
-	{
-	    try
-	    {
-		try
-		{
-		    h.read(fd_tmp);
-		}
-		catch(Erange & e)
-		{
-		    label_copy(h.internal_name, of_internal_name);
-		    h.internal_name[0] = ~h.internal_name[0];
-			// this way we are shure that the file is not considered as part of the SAR
-		}
-		if(h.internal_name != of_internal_name)
-		{
-		    open_flag |= O_TRUNC;
-		    if(opt_dont_erase)
-			throw Erange("sar::open_writeonly", "file exists, and DONT_ERASE option is set.");
-		    if(opt_warn_overwrite)
-			user_interaction_pause(string(fic) + " is about to be overwritten.");
-		}
-	    }
-	    catch(Egeneric & e)
-	    {		 
-		close(fd_tmp);
-		throw;
-	    }
-	    close(fd_tmp);
-	}
-	else // file exists but could not be openned
-	{
-	    if(opt_dont_erase)
-		throw Erange("sar::open_writeonly", "file exists, and DONT_ERASE option is set");
-	    if(opt_warn_overwrite)
-		user_interaction_pause(string(fic) + " is about to be overwritten");
-	    open_flag |= O_TRUNC;
-	}
-    }	 
-
-    fd = open(fic, open_flag, open_mode);
-    of_flag = FLAG_NON_TERMINAL;
-    if(fd < 0)
-	throw Erange("sar::open_writeonly open()", strerror(errno));    
-    else
-	of_fd = new fichier(fd);
-
-    h = make_write_header(num, FLAG_TERMINAL);
-    h.write(*of_fd);
-    if(num == 1)
-    {
-	first_file_offset = of_fd->get_position();
-	if(first_file_offset == 0)
-	    throw SRC_BUG;
-    }
-}
-
-void sar::open_file_init()
-{
-    of_max_seen = 0;
-    of_last_file_known = false;
-    of_fd = NULL;
-    first_file_offset = 0; // means that the sizes have to be determined from file or wrote to file
-}
-
-void sar::open_file(infinint num)
-{
-    if(of_fd == NULL || of_current != num) 
-    {
-	char *fic = tools_str2charptr((archive_dir + path(sar_make_filename(base, num, ext))).display());
-	
-	try
-	{
-	    switch(get_mode())
-	    {
-	    case gf_read_only :
-		close_file();
-		    // launch the shell command before reading a slice
-		hook_execute(num);
-		open_readonly(fic, num);
-		break;
-	    case gf_write_only :
-		if(of_fd != NULL && (num > of_current || of_max_seen > of_current))
-		{    // actually openned file is not the last file of the set, thus changing the flag before closing
-		    header h = make_write_header(of_current, FLAG_NON_TERMINAL);
-
-		    of_fd->skip(0);
-		    h.write(*of_fd);
-		}
-		close_file();
-
-		if(!initial)
-		{
-
-			// launch the shell command after the slice has been written
-		    hook_execute(of_current);
-		    if(opt_pause)
-		    {
-			deci conv = of_current;
-			user_interaction_pause(string("Finished writing to file ") + conv.human() + ", ready to continue ? ");
-		    }
-		}
-		else
-		    initial = false;
-		
-		open_writeonly(fic, num);
-		break;
-	    default :
-		close_file();
-		throw SRC_BUG;
-	    }
-	    of_current = num;
-	    if(of_max_seen < of_current)
-		of_max_seen = of_current;
-	    file_offset = of_current == 1 ? first_file_offset : header::size();
-	}
-	catch(Egeneric & e)
-	{
-	    delete fic;
-	    throw;
-	}
-	delete fic;
-    }
-}
-
-void sar::set_options(S_I opt)
-{
-    opt_warn_overwrite = (opt & SAR_OPT_WARN_OVERWRITE) != 0;
-    opt_dont_erase = (opt & SAR_OPT_DONT_ERASE) != 0;
-    opt_pause = (opt & SAR_OPT_PAUSE) != 0;
-}
-
-void sar::set_offset(infinint offset)
-{
-    if(of_fd == NULL)
-	throw Erange("sar::set_offset", "file not open");
-    else
-	of_fd->skip(offset);
-}
-
-void sar::open_last_file()
-{
-    infinint num; 
-
-    if(of_last_file_known)
-	open_file(of_last_file_num);
-    else // last slice number is not known
-    {
-	bool ask_user = false; 
-
-	while(of_flag != FLAG_TERMINAL)
-	{
-	    if(sar_get_higher_number_in_dir(archive_dir, base, ext, num))
-	    {
-		open_file(num);
-		if(of_flag != FLAG_TERMINAL)
-		    if(!ask_user)
-		    {
-			hook_execute(0); // %n replaced by 0 means last file is about to be requested
-			ask_user = true;
-		    }
-		    else
-		    {
-			close_file();
-			user_interaction_pause(string("The last file of the set is not present in ") + archive_dir.display() + " , please provide it.");
-		    }
-	    }
-	    else // not slice available in the directory
-		if(!ask_user)
-		{
-		    hook_execute(0); // %n replaced by 0 means last file is about to be requested
-		    ask_user = true;
-		}
-		else
-		{
-		    close_file();
-		    user_interaction_pause(string("No backup file is present in ") + archive_dir.display() + " , please provide the last file of the set.");
-		}
-	}
-    }
-}
-
-header sar::make_write_header(const infinint & num, char flag)
-{
-    header h;
-
-    label_copy(h.internal_name, of_internal_name);
-    h.magic = SAUV_MAGIC_NUMBER;
-    h.flag = flag;
-    h.extension = EXTENSION_NO;
-    if(num == 1)
-    {
-	if(first_file_offset == 0)
-	{
-	    header_generate_internal_filename(of_internal_name);
-	    label_copy(h.internal_name, of_internal_name);
-	}
-	if(size != first_size)
-	{
-	    h.extension = EXTENSION_SIZE;
-	    h.size_ext = size;
-	}
-    }
-
-    return h;
-}
-
-string sar::hook_substitute(const string & path, const string & basename, const string & num)
-{
-    string ret = "";
-    string::iterator it = hook.begin();
-
-    while(it != hook.end())
-    {
-	if(*it == '%')
-	{
-	    it++;
-	    if(it != hook.end())
-	    {
-		switch(*it)
-		{
-		case '%': // the % character
-		    ret += '%';
-		    break;
-		case 'p': // path to slices
-		    ret += path;
-		    break;
-		case 'b': // slice basename
-		    ret += basename;
-		    break;
-		case 'n': // slice number
-		    ret += num;
-		    break;
-		default:
-		    try
-		    {
-			user_interaction_pause(string("unknown substitution string in user command-line: %")+ *it + " . Ignore it and continue ?");
-		    }
-		    catch(Euser_abort & e)
-		    {
-			throw Escript("sar::hook_substitute", string("unknown substitution string: %")+ *it);
-		    }
-		}
-		it++;
-	    }
-	    else
-	    {
-		try
-		{
-		    user_interaction_pause("last char of user command-line to execute is '%', (use '%%' instead to avoid this message). Ignore it and continue ?");
-		}
-		catch(Euser_abort)
-		{
-		    throw Escript("sar::hook_substitute","unknown substitution string at end of string: %");
-		}
-	    }
-	}
-	else
-	{
-	    ret += *it;
-	    it++;
-	}
-    }
-
-    return ret;
-}
-
-void sar::hook_execute(const infinint &num)
-{
-    MEM_IN;
-    if(hook != "")
-    {
-	string cmd_line = hook_substitute(archive_dir.display(), base, deci(num).human());
-	char *ptr = tools_str2charptr(cmd_line);
-	try
-	{
-	    bool loop = false;
-	    do
-	    {
-		try
-		{
-		    S_I code = system(ptr);
-		    switch(code)
-		    {
-		    case 0:
-			loop = false;
-			break; // All is fine, script did not report error
-		    case 127:
-			throw Erange("sar::hook_execute", "execve() failed. (process table is full ?)");
-		    case -1:
-			throw Erange("sar::hook_execute", string("system() call failed: ") + strerror(errno));
-		    default:
-			throw Erange("sar::hook_execute", string("execution of [") + cmd_line + "] returned error code: " + tools_int2str(code));
-		    }
-		}
-		catch(Erange & e)
-		{
-		    try
-		    {
-			user_interaction_pause(string("Erreur during user command-line execution: ") + e.get_message() + " . Retry command-line ?");
-			loop = true;
-		    }
-		    catch(Euser_abort & f)
-		    {
-			try
-			{
-			    user_interaction_pause("Ignore previous error on user command-line and continue ?");
-			    loop = false;
-			}
-			catch(Euser_abort & g)
-			{
-			    throw Escript("sar::hook_execute", string("Fatal error on user command-line: ") + e.get_message());
-			}
-		    }
-		}
-	    }
-	    while(loop);    
-	}
-	catch(...)
-	{
-	    delete ptr;
-	    MEM_OUT;
-	    throw;
-	}
-	delete ptr;
-    }
-    MEM_OUT;
-}
-	
-
-string sar_make_filename(string base_name, infinint num, string ext)
-{
-    deci conv = num;
-
-    return base_name + '.' + conv.human() + '.' + ext;
-}
-
-static bool sar_extract_num(string filename, string base_name, string ext, infinint & ret)
-{
-    try
-    {
-	if(filename.size() <= base_name.size() + ext.size() + 2) // 2 for two dots beside number
-	    return false;
-	
-	if(filename.find(base_name) != 0) // checking that base_name is present at the beginning
-	    return false;
-	
-	if(filename.rfind(ext) != filename.size() - ext.size()) // checking that extension is at the end
-	    return false;
-
-	deci conv = string(filename.begin()+base_name.size()+1, filename.begin() + (filename.size() - ext.size()-1));
-	ret = conv.computer();
-	return true;
-    }
-    catch(Egeneric &e)
-    {
-	return false;
-    }
-}
-
-static bool sar_get_higher_number_in_dir(path dir, string base_name, string ext, infinint & ret)
-{
-    infinint cur;
-    bool somme = false;
-    struct dirent *entry;
-    char *folder = tools_str2charptr(dir.display());
-    DIR *ptr = opendir(folder);
-
-    try
-    {
-	if(ptr == NULL)
-	    throw Erange("sar_get_higher_number_in_dir", strerror(errno));
-	
-	ret = 0; 
-	somme = false;
-	while((entry = readdir(ptr)) != NULL)
-	    if(sar_extract_num(entry->d_name, base_name, ext, cur))
-	    {
-		if(cur > ret)
-		    ret = cur;
-		somme = true;
-	    }
-    }
-    catch(Egeneric & e)
-    {
-	delete folder;
-	if(ptr != NULL)
-	    closedir(ptr);
-	throw;
-    }
-
-    delete folder;
-    if(ptr != NULL)
-	closedir(ptr);
-    return somme;
-}
-
-trivial_sar::trivial_sar(generic_file *ref) : generic_file(gf_read_write)
-{
-    header tete;
-
-    if(ref == NULL)
-	throw SRC_BUG;
-    if(ref->get_mode() == gf_read_write)
-	throw Efeature("read_write mode not supported for trivial_sar");
-    reference = ref;
-    set_mode(ref->get_mode());
-    if(get_mode() == gf_write_only)
-    {
-	tete.magic = SAUV_MAGIC_NUMBER;
-	header_generate_internal_filename(tete.internal_name);
-	tete.flag = FLAG_TERMINAL;
-	tete.extension = EXTENSION_NO;
-	tete.write(*reference);
-	offset = reference->get_position();
-    }
-    else
-	if(get_mode() == gf_read_only)
-	{
-	    tete.read(*reference);
-	    if(tete.flag == FLAG_NON_TERMINAL)
-		throw Erange("trivial_sar::trivial_sar", "this archive has slices and is not suited to be read from a pipe");
-	    offset = reference->get_position();
-	}
-	else
-	    throw SRC_BUG; // not implemented ! I said ! ;-) (Efeature)
-}
-
-bool trivial_sar::skip_relative(S_I x)
-{
-    if(x > 0 || reference->get_position() > offset - x) // -x is positive
-	return reference->skip_relative(x);
-    else
-	return reference->skip(offset); // start of file
-}
-
-infinint trivial_sar::get_position()
-{
-    if(reference->get_position() >= offset)
-	return reference->get_position() - offset; 
-    else
-	throw Erange("trivial_sar::get_position", "position out of range, call skip from trivial_sar object not from its reference");
-}
Index: dar/sar.hpp
===================================================================
--- dar.orig/sar.hpp	2012-05-02 11:23:23.403876333 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,130 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef SAR_HPP
-#define SAR_HPP
-
-#pragma interface
-
-#include <string>
-#include "generic_file.hpp"
-#include "header.hpp"
-#include "path.hpp"
-#include "integers.hpp"
-
-#define SAR_OPT_DEFAULT (SAR_OPT_WARN_OVERWRITE)
-#define SAR_OPT_WARN_OVERWRITE 0x01
-#define SAR_OPT_DONT_ERASE 0x02
-#define SAR_OPT_PAUSE 0x04
-
-class sar : public generic_file
-{
-public:
-    sar(const string & base_name, const string & extension, S_I options, const path & dir, const string & execute = "");
-    sar(const string & base_name, const string & extension, const infinint & file_size, const infinint & first_file_size, S_I options, const path & dir, const string & execute = "");
-    ~sar();
-
-	// inherited from generic_file
-    bool skip(const infinint &pos);
-    bool skip_to_eof();
-    bool skip_relative(S_I x);
-    infinint get_position();
-
-	// informational routines
-    infinint get_sub_file_size() const { return size; };
-    infinint get_first_sub_file_size() const { return first_size; };
-    bool get_total_file_number(infinint &num) const { num = of_last_file_num; return of_last_file_known; };
-    bool get_last_file_size(infinint &num) const { num = of_last_file_size; return of_last_file_known; };
-
-protected :
-    S_I inherited_read(char *a, size_t sz);
-    S_I inherited_write(char *a, size_t sz);
-
-private :
-    path archive_dir;
-    string base, ext;
-    string hook;
-    infinint size;
-    infinint first_size;
-    infinint first_file_offset;
-    infinint file_offset;
-
-	// theses following variables are modified by open_file
-	// else the are used only for reading
-    infinint of_current;
-    infinint of_max_seen;
-    bool of_last_file_known;
-    infinint of_last_file_num;
-    infinint of_last_file_size;
-    label of_internal_name;
-    fichier *of_fd;
-    char of_flag;
-    bool initial;
-
-	// theses are the option flags
-    bool opt_warn_overwrite;
-    bool opt_dont_erase;
-    bool opt_pause;
-
-    bool skip_forward(U_I x);
-    bool skip_backward(U_I x);
-    void close_file();
-    void open_readonly(char *fic, const infinint &num);
-    void open_writeonly(char *fic, const infinint &num);
-    void open_file_init();
-    void open_file(infinint num);
-    void set_options(S_I opt);
-    void set_offset(infinint offset);
-    void open_last_file();
-    header make_write_header(const infinint &num, char flag);
-
-	// hook to attach a command to execute after each slice
-    string hook_substitute(const string & path, const string & basename, const string & num);
-    void hook_execute(const infinint &num);
-};
-
-
-class trivial_sar : public generic_file
-{
-public:
-    trivial_sar(generic_file *ref); // trivial_sar own the argument
-    ~trivial_sar() { if(reference != NULL) delete reference; };
-
-    bool skip(const infinint & pos) { return reference->skip(pos + offset); };
-    bool skip_to_eof() { return reference->skip_to_eof(); };
-    bool skip_relative(S_I x);
-    infinint get_position();
-
-protected:
-    S_I inherited_read(char *a, size_t size) { return reference->read(a, size); };
-    S_I inherited_write(char *a, size_t size) { return reference->write(a, size); };
-    
-private:
-    generic_file *reference;
-    infinint offset;
-};
-
-extern string sar_make_filename(string base_name, infinint num, string ext);
-
-#endif
Index: dar/sar_tools.cpp
===================================================================
--- dar.orig/sar_tools.cpp	2012-05-02 11:23:23.023876301 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,119 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include "erreurs.hpp"
-#include "user_interaction.hpp"
-#include "sar.hpp"
-#include "tools.hpp"
-#include "tuyau.hpp"
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-generic_file *sar_tools_open_archive_fichier(const string &filename, bool allow_over, bool warn_over)
-{
-    char *name = tools_str2charptr(filename);
-    generic_file *ret = NULL;
-    generic_file *tmp = NULL;
-    
-    try
-    {
-	S_I fd;
-
-	if(!allow_over || warn_over)
-	{
-	    struct stat buf;
-	    if(lstat(name, &buf) < 0)
-	    {
-		if(errno != ENOENT)
-		    throw Erange("open_archive_fichier", strerror(errno));
-	    }
-	    else
-	    {
-		if(!allow_over)
-		    throw Erange("open_archive_fichier", filename + " already exists, and overwritten is forbidden, aborting");
-		if(warn_over)
-		    user_interaction_pause(filename + " is about to be overwritten, continue ?");
-	    }
-	}
-	    
-	fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666);
-	if(fd < 0)
-	    throw Erange("open_archive_fichier", strerror(errno));
-	tmp = new fichier(fd);
-	if(tmp == NULL)
-	    throw Ememory("open_archive_fichier");
-	ret = new trivial_sar(tmp);
-	if(ret == NULL) 
-	    throw Ememory("open_archive_fichier");
-    }
-    catch(...)
-    {
-	delete name;
-	if(ret != NULL)
-	    delete ret;
-	else // tmp is not managed by ret, which does not exist
-	    if(tmp != NULL)
-		delete tmp;
-	throw;
-    }
-    delete name;
-
-    return ret;
-}
-
-generic_file *sar_tools_open_archive_tuyau(S_I fd, gf_mode mode)
-{
-    generic_file *tmp = NULL;
-    generic_file *ret = NULL;
-    
-    try
-    {
-	tmp = new tuyau(fd, mode);
-	if(tmp == NULL)
-	    throw Ememory("sar_tools_open_archive_tuyau");
-	ret = new trivial_sar(tmp);
-	if(ret == NULL)
-	    throw Ememory("sar_tools_open_archive_tuyau");
-    }    
-    catch(...)
-    {
-	if(ret != NULL)
-	    delete ret;
-	else // tmp is not managed by ret, which does not exist
-	    if(tmp != NULL)
-		delete tmp;
-	throw;
-    }
-
-    return ret;
-}
Index: dar/sar_tools.hpp
===================================================================
--- dar.orig/sar_tools.hpp	2012-05-02 11:23:23.099876323 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,34 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-
-#ifndef SAR_TOOLS_HPP
-#define SAR_TOOLS_HPP
-
-#include "integers.hpp"
-
-extern generic_file *sar_tools_open_archive_fichier(const string &filename, bool allow_over, bool warn_over);
-extern generic_file *sar_tools_open_archive_tuyau(S_I fd, gf_mode mode);
-
-#endif
Index: dar/scrambler.cpp
===================================================================
--- dar.orig/scrambler.cpp	2012-05-02 11:23:23.255876628 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,94 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include "scrambler.hpp"
-
-
-scrambler::scrambler(const string & pass, generic_file & hidden_side) : generic_file(hidden_side.get_mode())
-{
-    if(pass == "")
-	throw Erange("scrambler::scrambler", "key cannot be an empty string");
-    key = pass;
-    len = pass.size();
-    ref = & hidden_side;
-    buffer = NULL;
-    buf_size = 0;
-}
-
-S_I scrambler::inherited_read(char *a, size_t size)
-{
-    unsigned char *ptr = (unsigned char *)a;
-    if(ref == NULL)
-	throw SRC_BUG;
-
-    U_32 index = ref->get_position() % len;
-    S_I ret = ref->read(a, size);    
-
-    for(register S_I i = 0; i < ret; i++)
-    {
-	ptr[i] = ((S_I)(ptr[i]) - (unsigned char)(key[index])) % 256;
-	index = (index + 1)%len;
-    }
-    return ret;
-}
-
-S_I scrambler::inherited_write(char *a, size_t size)
-{
-    unsigned char *ptr = (unsigned char *)a;
-    if(ref == NULL)
-	throw SRC_BUG;
-
-    U_32 index = ref->get_position() % len;
-    if(size > buf_size)
-    {
-	if(buffer != NULL)
-	{
-	    delete buffer;
-	    buffer = NULL;
-	}
-	buffer = new unsigned char[size];
-	if(buffer != NULL)
-	    buf_size = size;
-	else
-	{
-	    buf_size = 0;
-	    throw Ememory("scramble::inherited_write");
-	}
-    }
-    
-    for(register size_t i = 0; i < size; i++)
-    {
-	buffer[i] = (ptr[i] + (unsigned char)(key[index])) % 256;
-	index = (index + 1)%len;
-    }
-
-    return ref->write((char *)buffer, size);
-}
-
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
Index: dar/scrambler.hpp
===================================================================
--- dar.orig/scrambler.hpp	2012-05-02 11:23:23.015876190 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,55 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef SCRAMBLER_HPP
-#define SCRAMBLER_HPP
-
-#include "generic_file.hpp"
-#include "erreurs.hpp"
-#include "infinint.hpp"
-
-class scrambler : public generic_file
-{
-public:
-    scrambler(const string & pass, generic_file & hidden_side);
-    ~scrambler() { if(buffer != NULL) delete buffer; };
-    
-    bool skip(const infinint & pos) { if(ref == NULL) throw SRC_BUG; return ref->skip(pos); };
-    bool skip_to_eof() { if(ref==NULL) throw SRC_BUG; return ref->skip_to_eof(); };
-    bool skip_relative(S_I x) { if(ref == NULL) throw SRC_BUG; return ref->skip_relative(x); };
-    infinint get_position() { if(ref == NULL) throw SRC_BUG; return ref->get_position(); };
-
-protected:
-    S_I inherited_read(char *a, size_t size);
-    S_I inherited_write(char *a, size_t size);
-
-private:
-    string key;
-    U_32 len;
-    generic_file *ref;
-    unsigned char *buffer;
-    size_t buf_size;
-};
-
-#endif
Index: dar/storage.cpp
===================================================================
--- dar.orig/storage.cpp	2012-05-02 11:23:23.467875919 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,804 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include "storage.hpp"
-#include "infinint.hpp"
-#include "generic_file.hpp"
-#include "integers.hpp"
-
-U_32 storage::alloc_size = 120000;
-    // must be less than the third of the maxmimum value of a U_32
-
-storage::storage(const infinint & size) throw(Ememory, Erange, Ebug) 
-{ 
-    E_BEGIN; 
-    make_alloc(size, first, last); 
-    E_END("storage::storage","infinint"); 
-}
-
-storage::storage(generic_file & f, const infinint & size)
-{
-    E_BEGIN;
-    U_32 lu, tmp;
-    make_alloc(size, first, last);
-    struct cellule *ptr = first;
-
-    try
-    {
-	while(ptr != NULL)
-	{
-	    lu = 0;
-	    
-	    do
-	    {
-		tmp = f.read(((char *)(ptr->data))+lu, ptr->size - lu);
-		lu += tmp;
-	    }
-	    while(lu < ptr->size && tmp != 0);
-
-	    if(lu < ptr->size)
-		throw Erange("storage::storage", "not enought data to initialize storage field");
-	    ptr = ptr->next;
-	}
-    }
-    catch(...)
-    {
-	detruit(first);
-	throw;
-    }
-    E_END("storage::storage", "generic_file, U_32");
-}
-
-unsigned char storage::operator [](const infinint &position) const throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN; 
-    return const_cast<storage &>(*this)[position];
-    E_END("storage::operator []","const"); 
-}
-
-unsigned char & storage::operator [](infinint position) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN; 
-    U_32 offset = 0;
-    struct cellule *ptr = first;
-
-    do {
-        if(ptr == NULL)
-	    throw Erange("storage::operator[]", "asking for an element out of array");
-        if(offset > ptr->size)
-	{
-	    offset -= ptr->size;
-	    ptr = ptr->next;
-        }
-        else
-	    position.unstack(offset); 
-    } while(offset > ptr->size);
-
-    return ptr->data[offset];
-    E_END("storage::operator []",""); 
-}
-      
-infinint storage::size() const throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN; 
-    infinint ret = 0;
-    struct cellule *ptr = first;
-
-    while(ptr != NULL)
-    {
-	ret += ptr->size;
-	ptr = ptr->next;
-    }
-
-    return ret;    
-    E_END("storage::size",""); 
-}
-
-void storage::clear(unsigned char val) throw()
-{
-    E_BEGIN; 
-    register struct cellule *cur = first;
-    register U_32 i;
-
-    while(cur != NULL)
-    {
-	i = 0;
-	while(i < cur->size)
-	    cur->data[i++] = val;
-	cur = cur->next;
-    }
-    E_END("storage::clear",""); 
-}
-
-void storage::dump(generic_file & f) const
-{
-    E_BEGIN;
-    const struct cellule *ptr = first;
-
-    while(ptr != NULL)
-    {
-	f.write((char *)(ptr->data), ptr->size);
-	ptr = ptr->next;
-    }
-    E_END("storage::dump", "");
-}
-
-U_I storage::write(iterator & it, unsigned char *a, U_I size) throw(Erange)
-{
-    E_BEGIN; 
-    register U_I i;
-
-    if(it.ref != this)
-	throw Erange("storage::write", "the iterator is not indexing the object it has been asked to write to");
-
-    for(i = 0; i < size && it != end(); i++)
-	*(it++) = a[i];
-
-    return i;
-    E_END("storage::write",""); 
-} 
-
-U_I storage::read(iterator & it, unsigned char *a, U_I size) const throw(Erange)
-{
-    E_BEGIN; 
-    register U_I i;
-    
-    if(it.ref != this)
-	throw Erange("storage::read", "the iterator is not indexing the object it has been asked to read from");
-
-    for(i = 0; i < size && it != end(); i++)
-	a[i] = *(it++);
-
-    return i;
-    E_END("storage::read",""); 
-} 
-
-void storage::insert_null_bytes_at_iterator(iterator it, U_I size) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN; 
-    unsigned char a = 0;
-
-    insert_bytes_at_iterator_cmn(it, true, &a, size);
-    E_END("storage::insert_null_bytes_at_iterator",""); 
-}
-
-void storage::insert_const_bytes_at_iterator(iterator it, unsigned char a, U_I size) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN; 
-    insert_bytes_at_iterator_cmn(it, true, &a, size);
-    E_END("storage::insert_const_bytes_at_iterator",""); 
-}
-
-void storage::insert_bytes_at_iterator(iterator it, unsigned char *a, U_I size) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN; 
-    insert_bytes_at_iterator_cmn(it, false, a, size);
-    E_END("storage::insert_bytes_at_iterator",""); 
-}
-
-void storage::insert_as_much_as_necessary_const_byte_to_be_as_wider_as(const storage & ref, const iterator &it, unsigned char value)
-{
-    S_32 to_add = 0;
-    const cellule *c_ref = ref.first;
-    cellule *c_me = first;
-
-    while((c_ref != NULL || to_add > 0) && (c_me != NULL || to_add <= 0))
-    {
-	if(to_add > 0)
-	{
-	    to_add -= c_me->size;
-	    c_me = c_me->next;
-	}
-	else
-	{
-	    to_add += c_ref->size;
-	    c_ref = c_ref->next;
-	}
-    }
-    
-    while(to_add > 0)
-    {
-	insert_const_bytes_at_iterator(it, value, to_add);
-	if(c_ref != NULL)
-	{
-	    to_add = c_ref->size;
-	    c_ref = c_ref->next;
-	}
-	else
-	    to_add = 0;
-    }
-}
-
-void storage::remove_bytes_at_iterator(iterator it, U_I number) throw(Ememory, Ebug)
-{
-    E_BEGIN; 
-    while(number > 0 && it.cell != NULL)
-    {
-	U_I can_rem = it.cell->size - it.offset;
-        
-        if(can_rem < number)
-        {
-	    if(it.offset > 0)
-	    {
-  	        unsigned char *p = new unsigned char[it.offset];
-		
-  	        if(p != NULL)
-    	        {
-		    for(register U_I i = 0; i < it.offset; i++)
-		        p[i] = it.cell->data[i];
-  		    delete it.cell->data;
-		    it.cell->data = p;
-		    it.cell->size -= can_rem;
-		    it.cell = it.cell->next;
-		    it.offset = 0;
-		    number -= can_rem;
-                }
-	        else
-		    throw Ememory("storage::remove_bytes_at_iterator");
-            }
-            else
-            {
-                struct cellule *t = it.cell->next;
- 		
-		if(t != NULL)
- 		    it.cell->next->prev = it.cell->prev;
-		else
-		    last = it.cell->prev;
-
-		if(it.cell->prev != NULL)
-		    it.cell->prev->next = t;
-		else
-		    first = t;
-		
-		number -= it.cell->size;
-		it.cell->next = NULL;
-		it.cell->prev = NULL;
-		detruit(it.cell);
-		it.cell = t;
-            }
-	}
-	else // can_rem >= number
-	{
- 	    unsigned char *p = new unsigned char[it.cell->size - number];
-
-	    if(p != NULL)
-	    {
-  	    	for(register U_I i = 0; i < it.offset; i++)
-		    p[i] = it.cell->data[i];
-		for(register U_I i = it.offset+number ; i < it.cell->size ; i++)	
-		    p[i-number] = it.cell->data[i];
-		delete it.cell->data;
-		it.cell->data = p;
-		it.cell->size -= number;
-		number = 0;
-	    }
-	    else
-	        throw Ememory("storage::remove_bytes_at_iterator");
-	}
-    }
-    reduce();
-    E_END("storage::remove_bytes_at_iterator","U_I"); 
-}
-
-void storage::remove_bytes_at_iterator(iterator it, infinint number) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN; 
-    U_32 sz = 0;
-    number.unstack(sz);
-
-    while(sz > 0)
-    {
-	remove_bytes_at_iterator(it, sz);
-	sz = 0;
-	number.unstack(sz);
-    }
-    E_END("storage::remove_bytes_at_iterator","infinint"); 
-}
-
-void storage::fusionne(struct cellule *a_first, struct cellule *a_last, struct cellule *b_first, struct cellule *b_last, 
-		       struct cellule *&res_first, struct cellule * & res_last) throw(Ebug)
-{
-    E_BEGIN; 
-    if(a_first == NULL ^ a_last == NULL)
-	throw SRC_BUG;
-
-    if(b_first == NULL ^ b_last == NULL)
-	throw SRC_BUG;
-
-    if(a_last != NULL && b_first != NULL)
-    {
-	a_last->next = b_first;
-	b_first->prev = a_last;
-	res_first = a_first;
-	res_last = b_last;
-    }
-    else
-	if(a_first == NULL)
-	{
-	    res_first = b_first;
-	    res_last = b_last;
-	}
-	else
-	{
-	    res_first = a_first;
-	    res_last = a_last;
-	}
-    E_END("storage::fusionne",""); 
-}
-
-void storage::copy_from(const storage & ref) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN; 
-    U_32 pas = 0, delta;
-    struct cellule *ptr = ref.first;
-    first = last = NULL;
-    
-    try 
-    {
-	while(ptr != NULL || pas > 0)
-	{
-	    if(ptr != NULL)
-	    {
-		delta = pas + ptr->size;
-		ptr = ptr->next;
-	    }
-	    else
-		delta = 0;
-	    if(delta < pas) // must make the allocation
-	    {
-		struct cellule *debut, *fin;
-		make_alloc(pas, debut, fin);
-		fusionne(first, last, debut, fin, first, last);
-		pas = delta;
-	    }
-	    else
-		pas = delta;
-	}
-    }
-    catch(Ememory & e)
-    {
-	detruit(first);
-	first = last = NULL;
-	throw;
-    }
-    
-    iterator i_ref = ref.begin();
-    iterator i_new = begin();
-    
-    while(i_ref != ref.end())
-	*(i_new++) = *(i_ref++);
-    E_END("storage::copy_from",""); 
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-S_32 storage::difference(const storage & ref) const throw()
-{
-    E_BEGIN; 
-    struct cellule *b = last, *a = ref.last;
-    S_32 superior = 0;
-
-    while((a != NULL || superior <= 0) && (b != NULL || superior >= 0) && (a != NULL || b != NULL))
-    {
-	if(superior >= 0 && a != NULL)
-	{
-	    superior -= a->size;
-	    a = a->next;
-	}
-	if(superior <= 0 && b != NULL)
-	{
-	    superior += b->size;
-	    b = b->next;
-	}
-    }
-    return superior;
-    E_END("storage::difference",""); 
-}
-
-void storage::reduce() throw(Ebug)
-{
-    E_BEGIN; 
-    struct cellule *glisseur = first;
-
-    while(glisseur != NULL)
-    {
-	if(glisseur->next != NULL)
-	{
-	    U_I somme = glisseur->next->size + glisseur->size;
-	    
-	    if(somme < alloc_size)
-	    {
-		unsigned char *p = new unsigned char[somme];
-		
-		if(p != NULL)
-		{
-		    struct cellule *tmp = glisseur->next;
-		    
-		    for(register U_I i = 0; i < glisseur->size; i++)
-			p[i] = glisseur->data[i];
-		    
-		    for(register U_I i = glisseur->size; i < somme; i++)
-			p[i] = tmp->data[i - glisseur->size];
-		    
-		    delete glisseur->data;
-		    glisseur->data = p;
-		    glisseur->size = somme;
-		    
-		    glisseur->next = tmp->next;
-		    if(glisseur->next != NULL)
-			glisseur->next->prev = glisseur;
-		    else
-			last = glisseur;
-		    
-		    tmp->next = tmp->prev = NULL;
-		    detruit(tmp);
-		}
-		else // alloc failed
-		    glisseur = glisseur->next;
-	    }
-	    else // no fusion possible
-		glisseur = glisseur->next;
-	}
-	else // no next cellule
-	    glisseur = glisseur->next;
-    }
-    E_END("storage::reduce",""); 
-}
-
-void storage::insert_bytes_at_iterator_cmn(iterator it, bool constant, unsigned char *a, U_I size) throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN; 
-    if(it.ref != this)
-	throw Erange("storage::insert_bytes_at_iterator_cmn", "the iterator is not indexing the object it has been asked to insert byte into");
-
-    if(it.cell != NULL)
-    {
-	storage temp = size+it.cell->size;
-	struct cellule *before, *after;
-	iterator gliss = temp.begin();
-
-	if(constant)
-	    temp.clear(*a);
-	temp.write(gliss, it.cell->data, it.offset);
-	if(!constant)
-	    temp.write(gliss, a, size);
-	else
-	    gliss += size;
-	temp.write(gliss, it.cell->data+it.offset, it.cell->size-it.offset);
-
-	before = it.cell->prev;
-	after = it.cell->next;
-	it.cell->prev = NULL;
-	it.cell->next = NULL;
-
-	if(temp.first == NULL || temp.last == NULL)
-	    throw SRC_BUG;
-
-	detruit(it.cell);
-
-	if(before != NULL)
-	    before->next = temp.first;
-	else
-	    first = temp.first;
-	temp.first->prev = before;
-
-	if(after != NULL)
-	    after->prev = temp.last;
-	else
-	    last = temp.last;
-	temp.last->next = after;
-
-	temp.first = temp.last = NULL; // to make automatic destruction of "temp" while exiting of the block, keep the data untouched
-    }
-    else // it_cell == NULL
-    {
-	storage temp = size;
-
-	if(constant)
-	    temp.clear(*a);
-	else
-	{
-	    iterator ut = temp.begin();
-	    temp.write(ut, a,size);
-	}
-
-	switch(it.offset)
-	{
-	case iterator::OFF_END :
-	    if(last != NULL)
-		last->next = temp.first;
-	    else
-		first = temp.first;
-	    if(temp.first == NULL)
-		throw SRC_BUG;
-	    temp.first->prev = last;
-	    last = temp.last;
-	    break;
-	case iterator::OFF_BEGIN :
-	    if(first != NULL)
-		first->prev = temp.last;
-	    else
-		last = temp.last;
-	    if(temp.last == NULL)
-		throw SRC_BUG;
-	    temp.last->next = first;
-	    first = temp.first;
-	    break;
-	default:
-	    throw SRC_BUG;
-	}
-	
-	temp.last = temp.first = NULL;
-    }
-    reduce();
-    E_END("storage::insert_bytes_at_iterator_cmn",""); 
-}
-
-void storage::detruit(struct cellule *c) throw(Ebug)
-{
-    E_BEGIN; 
-    struct cellule *t;
-	
-    while(c != NULL)
-    {
-	if(c->size == 0 && c->data != NULL)
-	    throw SRC_BUG;
-	if(alloc_size < c->size)
-	    alloc_size = c->size;
-	if(c->data != NULL)
-	    delete c->data;
-	t = c->next;
-	delete c;
-	c = t;
-    }
-    E_END("storage::detruit",""); 
-}	
-
-void storage::make_alloc(U_32 size, struct cellule * & begin, struct cellule * & end) throw (Ememory, Ebug)
-{
-    E_BEGIN; 
-    struct cellule *newone;
-    struct cellule *previous = NULL;
-	
-    do
-    {
-	U_32 dsize = alloc_size < size ? alloc_size : size;
-
-	newone = new struct cellule;
-	if(newone != NULL)
-	{
-	    newone->prev = previous;
-	    newone->next = NULL;
-	    if(previous != NULL)
-		previous->next = newone;
-	    else
-		begin = newone; 
-	}
-	else
-	{
-	    detruit(begin); 
-	    throw Ememory("storage::make_alloc");
-	}
-	   
-	newone->data = new unsigned char[dsize];
-	if(newone->data != NULL)
-	{
-	    size -= dsize;
-	    newone->size = dsize;
-	    previous = newone;
-	}
-	else
-	    if(alloc_size > 2)
-		alloc_size /= 2;
-	    else 
-	    {
-		newone->size = 0;
-		detruit(begin);
-		throw Ememory("storage::make_alloc");
-	    }
-    } 
-    while (size > 0);
-    
-    end = newone;
-    E_END("storage::make_alloc","U_32"); 
-}
-
-void storage::make_alloc(infinint size, struct cellule * & begin, struct cellule * &end) throw(Ememory, Erange, Ebug)
-{
-    E_BEGIN; 
-    struct cellule *debut;
-    struct cellule *fin;
-    U_32 sz = 0;
-
-    size.unstack(sz);
-    begin = end = NULL;
-
-    do
-    {
-	try {
-	    make_alloc(sz, debut, fin);
-	    if(end != NULL)
-	    {
-		end->next = debut;
-		debut->prev = end;
-		end = fin;
-	    }
-	    else
-		if(begin != NULL)
-		    throw SRC_BUG;
-		else
-		{
-		    begin = debut;
-		    end = fin;
-		}
-	}
-	catch(Ememory & e)
-	{
-	    if(begin != NULL)
-		detruit(begin);
-
-	    throw;
-	}
-	sz = 0;
-	size.unstack(sz);
-    } 
-    while(sz > 0);
-    E_END("storage::make_alloc","infinint"); 
-}
-
-///////////////////////////////////////////////////////////
-//////////////////////// ITERATOR /////////////////////////
-///////////////////////////////////////////////////////////
-
-
-storage::iterator & storage::iterator::operator += (U_32 s) throw ()
-{ 
-    E_BEGIN;
-    S_32 t = s >> 1;
-    S_32 r = s & 0x1;
-    
-    relative_skip_to(t); 
-    relative_skip_to(t+r); 
-    return *this; 
-    E_END("storage::iterator::operator +=", ""); 
-} 
-
-storage::iterator & storage::iterator::operator -= (U_32 s) throw()
-{ 
-    E_BEGIN; 
-    static const U_32 max = (U_32)(~0) >> 1;  // maximum U_32 that can also be S_32
-    if(s > max)
-    {
-	S_32 t = s >> 1; // equivalent to s/2;
-	S_32 r = s & 0x01; // equivalent to s%2;
-	relative_skip_to(-t); 
-	relative_skip_to(-t); 
-	relative_skip_to(-r); 
-    }
-    else
-	relative_skip_to(-(S_32)(s));
-
-    return *this; 
-    E_END("storage::iterator::operator -=",""); 
-};
-
-unsigned char & storage::iterator::operator *() const throw(Erange)
-{
-    E_BEGIN; 
-    if(points_on_data())
-	return cell->data[offset];
-    else
-	throw Erange("storage::iterator::operator *()", "iterator does not point on data");
-    E_END("storage::iterator::operator *","unary operator"); 
-}
-
-void storage::iterator::skip_to(const storage & st, infinint val) throw()
-{
-    E_BEGIN; 
-    U_16 pas = 0; // relative_skip_to has S_32 as argument, cannot call it with U_32
-
-    *this = st.begin();
-    val.unstack(pas);
-    do 
-    {
-	relative_skip_to(pas);
-	pas = 0;
-	val.unstack(pas);
-    } 
-    while(pas > 0);
-    E_END("storage::iterator::skip_to","infinint"); 
-}
-        
-void storage::iterator::relative_skip_to(S_32 val) throw()
-{
-    E_BEGIN; 
-    if(val >= 0)
-    {
-	while(val > 0 && cell != NULL)
-	{
-	    if(offset + val >= cell->size)
-	    {
-		val -= cell->size - offset;
-		cell = cell->next;
-		offset = 0;
-	    } 
-	    else
-	    {
-		offset += val;
-		val = 0;
-	    }
-	}
-	if(cell == NULL)
-	    offset = OFF_END;
-    }
-    else
-	while(val < 0 && cell != NULL)
-	{         
-	    val += offset;
-	    if(val < 0)
-	    {
-		cell = cell->prev;
-		if(cell != NULL)
-		    offset = cell->size;
-		else
-		    offset = OFF_BEGIN;
-	    }
-	    else
-		offset = val;
-	}
-    E_END("storage::iterator::relative_skip_to","S_32"); 
-}
-
-infinint storage::iterator::get_position() const throw(Erange, Ememory, Ebug)
-{
-    E_BEGIN; 
-    if(ref == NULL || ref->first == NULL)
-	throw Erange("storage::iterator::get_position", "reference storage of the iterator is empty or non existant");
-
-    struct cellule *p = ref->first;
-    infinint ret = 0;
-
-    if(cell == NULL)
-	throw Erange("storage::iterator::get_position", "iterator does not point on data");
-
-    while(p != NULL && p != cell)
-    {
-	ret += p->size;
-	p = p->next;
-    }
-
-    if(p != NULL)
-	ret += offset;
-    else
-	throw Erange("storage::iterator::get_position", "the iterator position is not inside the storage of reference");
-
-    return ret;
-    E_END("storage::iterator::get_position",""); 
-}
Index: dar/storage.hpp
===================================================================
--- dar.orig/storage.hpp	2012-05-02 11:23:23.211874427 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,212 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef STORAGE_HPP
-#define STORAGE_HPP
-
-#pragma interface
-
-#include "erreurs.hpp"
-#include "integers.hpp"
-
-class infinint;
-class generic_file;
-
-class storage
-{
-private:
-    struct cellule
-    {
-	struct cellule *next, *prev;
-	unsigned char *data;
-	U_32 size;
-    };
-
-public:
-    storage(U_32 size) throw(Ememory, Ebug)
-	{ E_BEGIN; make_alloc(size, first, last); E_END("storage::storage","U_32"); };
-    storage(const infinint & size) throw(Ememory, Erange, Ebug);
-    storage(const storage & ref) throw(Ememory, Ebug) 
-	{ E_BEGIN; copy_from(ref); E_END("storage::storage", "storage &"); };
-    storage(generic_file & f, const infinint &size);
-    ~storage() throw(Ebug) 
-	{ E_BEGIN; detruit(first); E_END("storage::~storage", ""); };
-
-    storage & operator = (const storage & val) throw(Ememory, Ebug) 
-	{ E_BEGIN; detruit(first); copy_from(val); return *this; E_END("storage::operator=",""); };
-
-    bool operator < (const storage & ref) const throw()
-	{ E_BEGIN; return difference(ref) < 0; E_END("storage::operator <",""); }; // true if arg uses more space than this
-    bool operator == (const storage & ref) const throw() 
-	{ E_BEGIN; return difference(ref) == 0; E_END("storage::operator ==",""); }; //true if arg have same space than this
-    bool operator > (const storage & ref) const throw()
-	{ E_BEGIN; return difference(ref) > 0; E_END("storage::operator >", ""); }; 
-    bool operator <= (const storage & ref) const throw()
-	{ E_BEGIN; return difference(ref) <= 0; E_END("storage::operator <=", ""); };
-    bool operator >= (const storage & ref) const throw()
-	{ E_BEGIN; return difference(ref) >= 0; E_END("storage::operator >=", ""); };
-    bool operator != (const storage & ref) const throw()
-	{ E_BEGIN; return difference(ref) != 0; E_END("storage::operator !=", ""); };
-    unsigned char & operator [](infinint position) throw(Ememory, Erange, Ebug); 
-    unsigned char operator [](const infinint & position) const throw(Ememory, Erange, Ebug); 
-    infinint size() const throw(Ememory, Erange, Ebug);
-    void clear(unsigned char val = 0) throw();
-    void dump(generic_file & f) const;
-
-    class iterator
-    {
-    public :
-	iterator() { ref = NULL; cell = NULL; offset = 0; };
-	    // default constructor by reference is OK
-	    // default destructor is OK
-	    // default operator = is OK
-
-	iterator operator ++ (S_I x) throw()
-	    { E_BEGIN; iterator ret = *this; skip_plus_one(); return ret;  E_END("storage::iterator::operator++", "(S_I)"); };
-	iterator operator -- (S_I x) throw() 
-	    { E_BEGIN; iterator ret = *this; skip_less_one(); return ret; E_END("storage::iterator::operator--", "(S_I)");}; 
-	iterator & operator ++ () throw() 
-	    { E_BEGIN; skip_plus_one(); return *this; E_END("storage::iterator::operator++", "()"); }; 
-	iterator & operator -- () throw()
-	    { E_BEGIN; skip_less_one(); return *this; E_END("storage::iterator::operator--", "()"); }; 
-	iterator operator + (U_32 s) const throw() 
-	    { E_BEGIN; iterator ret = *this; ret += s; return ret; E_END("storage::iterator::operator +", ""); }; 
-	iterator operator - (U_32 s) const throw()
-	    { E_BEGIN; iterator ret = *this; ret -= s; return ret; E_END("storage::iterator::operator -", ""); };
-	iterator & operator += (U_32 s) throw();
-	iterator & operator -= (U_32 s) throw();
-	unsigned char &operator *() const throw(Erange);
-
-	void skip_to(const storage & st, infinint val) throw(); // absolute position in st
-	infinint get_position() const throw(Erange, Ememory, Ebug);
-
-	bool operator == (const iterator & cmp) const throw()
-	    { E_BEGIN; return ref == cmp.ref && cell == cmp.cell && offset == cmp.offset; E_END("storage::iterator::operator ==", ""); };
-	bool operator != (const iterator & cmp) const throw()
-	    { E_BEGIN; return ! (*this == cmp); E_END("storage::iterator::operator !=", ""); };
-
-    private:
-	static const U_32 OFF_BEGIN = 1;
-	static const U_32 OFF_END = 2;
-
-	const storage *ref;
-	struct cellule *cell;
-	U_32 offset; 
-
-	void relative_skip_to(S_32 val) throw();
-	bool points_on_data() const throw()
-	    { E_BEGIN; return ref != NULL && cell != NULL && offset < cell->size; E_END("storage::iterator::point_on_data", "");};
-
-	inline void skip_plus_one();
-	inline void skip_less_one();
-	
-	friend class storage;
-    };
-
-	// public storage methode using iterator
-
-    iterator begin() const throw() 
-	{ E_BEGIN; iterator ret; ret.cell = first; ret.offset = 0; ret.ref = this; return ret; E_END("storage::begin", ""); };
-    iterator end() const throw()
-	{ E_BEGIN; iterator ret; ret.cell = NULL; ret.offset = iterator::OFF_END; ret.ref = this; return ret; E_END("storage::end", ""); };
-
-	// WARNING for the two following methods :
-	// there is no "reverse_iterator" type, unlike the standart lib, 
-	// thus when going from rbegin() to rend(), you must use the -- operator 
-	// unlike the stdlib, that uses the ++ operator. this is the only difference in use with stdlib.
-    iterator rbegin() const throw()
-	{ E_BEGIN; iterator ret; ret.cell = last; ret.offset = last != NULL ? last->size-1 : 0; ret.ref = this; return ret; E_END("storage::rbegin", ""); };
-    iterator rend() const throw()
-	{ E_BEGIN; iterator ret; ret.cell = NULL, ret.offset = iterator::OFF_BEGIN; ret.ref = this; return ret; E_END("storage::rend", ""); };
-    
-    U_I write(iterator & it, unsigned char *a, U_I size) throw(Erange);
-    U_I read(iterator & it, unsigned char *a, U_I size) const throw(Erange);
-    bool write(iterator & it, unsigned char a) throw(Erange) 
-	{ E_BEGIN; return write(it, &a, 1) == 1; E_END("storage::write", "unsigned char"); };
-    bool read(iterator & it, unsigned char &a) const throw(Erange) 
-	{ E_BEGIN; return read(it, &a, 1) == 1; E_END("storage::read", "unsigned char"); }; 
-
-	// after one of theses 3 calls, the iterator given in argument are undefined (they may point nowhere)
-    void insert_null_bytes_at_iterator(iterator it, U_I size) throw(Erange, Ememory, Ebug);
-    void insert_const_bytes_at_iterator(iterator it, unsigned char a, U_I size) throw(Erange, Ememory, Ebug);
-    void insert_bytes_at_iterator(iterator it, unsigned char *a, U_I size) throw(Erange, Ememory, Ebug); 
-    void insert_as_much_as_necessary_const_byte_to_be_as_wider_as(const storage & ref, const iterator & it, unsigned char value);
-    void remove_bytes_at_iterator(iterator it, U_I number) throw(Ememory, Ebug);
-    void remove_bytes_at_iterator(iterator it, infinint number) throw(Ememory, Erange, Ebug);
-private:
-    struct cellule *first, *last;   
-
-    void copy_from(const storage & ref) throw(Ememory, Erange, Ebug);
-    S_32 difference(const storage & ref) const throw();
-    void reduce() throw(Ebug); // heuristic that tries to free some memory;
-    void insert_bytes_at_iterator_cmn(iterator it, bool constant, unsigned char *a, U_I size) throw(Erange, Ememory, Ebug); 
-    void fusionne(struct cellule *a_first, struct cellule *a_last, struct cellule *b_first, struct cellule *b_last, 
-		  struct cellule *&res_first, struct cellule * & res_last) throw(Ebug);
-
-	///////////////////////////////
-	// STATIC statments :
-	//
-
-    static U_32 alloc_size; // stores the last biggest memory allocation successfully realized
-
-    static void detruit(struct cellule *c) throw(Ebug);
-    static void make_alloc(U_32 size, struct cellule * & begin, struct cellule * & end) throw(Ememory, Ebug);
-    static void make_alloc(infinint size, cellule * & begin, struct cellule * & end) throw(Ememory, Erange, Ebug);
-
-    friend class storage::iterator;
-};
-
-inline void storage::iterator::skip_plus_one()
-{
-    E_BEGIN;
-    if(cell != NULL)
-	if(++offset >= cell->size)
-	{ 
-	    cell = cell->next;
-	    if(cell != NULL)
-		offset = 0;
-	    else
-		offset = OFF_END;
-	}
-    E_END("storage::iterator::slik_plus_one", "");
-}
-
-inline void storage::iterator::skip_less_one()
-{
-    E_BEGIN;
-    if(cell != NULL)
-	if(offset > 0)
-	    offset--;
-	else
-	{ 
-	    cell = cell->prev;
-	    if(cell != NULL)
-		offset = cell->size - 1;
-	    else
-		offset = OFF_BEGIN;
-	}
-    E_END("storage::iterator::slik_plus_one", "");
-}
-
-#endif
Index: dar/terminateur.cpp
===================================================================
--- dar.orig/terminateur.cpp	2012-05-02 11:23:23.331876064 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,129 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include "terminateur.hpp"
-
-#define BLOCK_SIZE 4
-
-void terminateur::dump(generic_file & f)
-{
-    infinint size = f.get_position(), nbbit, reste;
-    S_I last_byte;
-    unsigned char a;
-
-    pos.dump(f);
-    size = f.get_position() - size;
-
-    euclide(size, BLOCK_SIZE, nbbit, reste);
- 
-    if(reste != 0)
-    {
-	    // adding some non informational bytes to get a multiple of BLOCK_SIZE
-	S_I bourrage = reste % BLOCK_SIZE;
-	a = 0;
-	for(S_I i = bourrage; i < BLOCK_SIZE; i++)
-	    f.write((char *)&a, 1);
-
-	    // one more for remaing bytes and non informational bytes.
-	nbbit++;
-    }
-	
-    last_byte = nbbit % 8;
-    nbbit /= 8; // now, nbbit is the number of byte of terminator string (more or less 1)
-
-    if(last_byte != 0)
-    {                // making the last byte (starting eof) of the terminator string
-	a = 0;
-	for(S_I i = 0; i < last_byte; i++)
-	{
-	    a >>= 1;
-	    a |= 0x80;
-	}
-	f.write((char *)&a, 1);
-    }
-
-	// writing down all the other bytes of the terminator string
-    a = 0xff;
-    while(nbbit > 0)
-    {
-	f.write((char *)&a, 1);
-	nbbit--;
-    }
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void terminateur::read_catalogue(generic_file & f)
-{
-    S_I offset = 0;
-    unsigned char a;
-
-    f.skip_to_eof();
-    try
-    {
-	    // reading & counting the terminator string
-	char b;
-	do 
-	{
-	    if(f.read_back(b) != 1)
-		throw Erange("",""); // exception used locally
-	    a = (unsigned char)b;
-	    if(a == 0xFF)
-		offset++;
-	}
-	while(a == 0xFF);
-	offset *= 8; // offset is now a number of bits
-
-	    // considering the first non 0xFF byte of the terminator string (backward reading)
-	while(a != 0)
-	{
-	    if(a & 0x80 == 0)
-		throw Erange("","");
-	    offset++;
-	    a <<= 1;
-	}
-
-	offset *= BLOCK_SIZE; // offset is now the byte offset of the position start
-	    // now we know where is located the position structure pointing to the start of the catalogue
-	if(offset < 0)
-	    throw SRC_BUG; // signed int overflow
-
-	    // skipping the start of "location" 
-	if(! f.skip_relative(-offset))
-	    throw Erange("","");
-    }
-    catch(Erange &e)
-    {
-	throw Erange("terminateur::get_catalogue", "badly formated terminator, can't extract catalogue location");
-    }
-
-	// reading and returning the position
-    pos.read_from_file(f);
-}
Index: dar/terminateur.hpp
===================================================================
--- dar.orig/terminateur.hpp	2012-05-02 11:23:23.059876728 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,44 +0,0 @@
-    /*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef TERMINATEUR_HPP
-#define TERMINATEUR_HPP
-
-#pragma interface
-
-#include "generic_file.hpp"
-
-class terminateur
-{
-public :
-    void set_catalogue_start(infinint xpos) { pos = xpos; };
-    void dump(generic_file &f);
-    void read_catalogue(generic_file &f);
-    infinint get_catalogue_start() { return pos; };
-
-private :
-    infinint pos;
-};
-
-#endif
Index: dar/test_catalogue.cpp
===================================================================
--- dar.orig/test_catalogue.cpp	2012-05-02 11:23:22.979876532 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,272 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include <unistd.h>
-#include "testtools.hpp"
-#include "catalogue.hpp"
-#include "user_interaction.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-#include "macro_tools.hpp"
-
-#define FIC1 "test/dump.bin"
-#define FIC2 "test/dump2.bin"
-
-void f1();
-void f2();
-void f3();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    user_interaction_init(&cout, &cerr);
-    catalogue_set_reading_version("03");
-    try
-    {
-	MEM_IN;
-//	f1();
-	MEM_OUT;
-//	f2();
-	MEM_OUT;
-//	f3();
-	MEM_OUT;
-    }
-    catch(Egeneric & e)
-    {
-	throw SRC_BUG;
-    }
-
-    user_interaction_close();
-    MEM_OUT;
-    MEM_END;
-    return 0;
-}
- 
-void f1()
-{
-    unlink(FIC1);
-    unlink(FIC2);
-    try
-    {
-	fichier *dump = new fichier(FIC1, gf_read_write);
-	fichier *dump2 = new fichier(FIC2, gf_write_only);
-	
-	eod *v_eod = new eod();
-	file *v_file = new file(1024, 102, 0644, 1, 2, "fichier", "." , 1024);
-	lien *v_lien = new lien(1025, 103, 0645, 4, 5, "lien", "fichier");
-	directory *v_dir = new directory(1026, 104, 0646, 7, 8, "repertoire");
-	chardev *v_char = new chardev(1027, 105, 0647, 10, 11, "char device", 104, 202);
-	blockdev *v_block = new blockdev(1028, 106, 0651, 13, 14, "block device", 105, 203);
-	tube *v_tube = new tube(1029, 107, 0652, 16, 17, "tuyau");
-	prise *v_prise = new prise(1030, 108, 0650, 19, 20, "prise");
-	detruit *v_detruit = new detruit("ancien fichier", 'f');
-	directory *v_sub_dir = new directory(200,20, 0777, 100, 101, "sous-repertoire");
-	
-	entree *liste[] = { v_eod, v_file, v_lien, v_dir, v_char, v_block, v_tube, v_prise, v_detruit, v_sub_dir, NULL };
-	
-	for(S_I i = 0; liste[i] != NULL; i++)
-	{
-	    inode *ino = dynamic_cast<inode *>(liste[i]);
-
-	    if(ino != NULL)
-		ino->set_saved_status(s_saved);
-	    liste[i]->dump(*dump);
-	}
-
-	dump->skip(0);
-	entree *ref = (entree *)1; // != NULL
-	for(S_I i = 0; ref != NULL; i++)
-	{
-	    ref = entree::read(*dump);
-	    if(ref != NULL)
-	    {
-		ref->dump(*dump2);
-		delete ref;
-	    }
-	}
-	delete dump;
-	delete dump2;
-	delete v_eod;
-
-	v_dir->add_children(v_file);
-	v_dir->add_children(v_lien);
-	v_sub_dir->add_children(v_char);
-	v_dir->add_children(v_sub_dir);
-	v_sub_dir->add_children(v_block);
-	v_dir->add_children(v_tube);
-	v_dir->add_children(v_detruit);
-	v_dir->add_children(v_prise);
-	
-	v_dir->listing(cout);
-	
-	unlink(FIC1);
-	unlink(FIC2);
-
-	dump = new fichier(FIC1, gf_read_write);
-	v_dir->dump(*dump);
-	dump->skip(0);
-	ref = entree::read(*dump);
-	v_sub_dir = dynamic_cast<directory *>(ref);
-	v_sub_dir->listing(cout);
-
-	delete ref;
-	delete dump;	
-	delete v_dir;
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-}
-
-void f2()
-{
-	/// test catalogue a proprement parler
-
-    try
-    {
-	catalogue cat;
-	const entree *ref;
-
-	cat.listing(cout);
-
-	cat.reset_add();
-	try
-	{
-	    cat.add(new eod());
-	}
-	catch(Egeneric & e)
-	{
-	    e.dump();
-	}
-	cat.add(new file(1024, 102, 0644, 1, 2, "fichier", ".", 1024));
-	cat.add(new lien(1025, 103, 0645, 4, 5, "lien", "fichier"));
-	cat.add(new directory(1026, 104, 0646, 7, 8, "repertoire"));
-	cat.add(new chardev(1027, 105, 0647, 10, 11,  "char device", 104, 202));
-	cat.add(new blockdev(1028, 106, 0651, 13, 14, "block device", 105, 203));
-	cat.add(new eod());
-	cat.add(new tube(1029, 107, 0652, 16, 17, "tuyau"));
-	cat.add(new prise(1030, 108, 0650, 19, 20, "prise"));
-	cat.add(new detruit("ancien fichier", 'f'));
-	
-	cat.listing(cout);
-
-	cat.reset_read();
-	while(cat.read(ref))
-	{
-	    const eod *e = dynamic_cast<const eod *>(ref);
-	    const nomme *n = dynamic_cast<const nomme *>(ref);
-	    const directory *d = dynamic_cast<const directory *>(ref);
-	    string type = "file";
-	    
-	    if(e != NULL)
-		cout << " EOF "<< endl;
-	    if(d != NULL)
-		type = "directory";
-	    if(n != NULL)
-		cout << type << " name = " << n->get_name() << endl;
-	}
-
-	unlink(FIC1);
-	fichier f = fichier(FIC1, gf_read_write);
-
-	cat.dump(f);
-	f.skip(0);
-	catalogue lst = f;
-	lst.listing(cout);
-	bool ok;
-
-	lst.reset_read();
-	cat.reset_compare();
-	while(lst.read(ref))
-	{
-	    const eod *e = dynamic_cast<const eod *>(ref);
-	    const detruit *d = dynamic_cast<const detruit *>(ref);
-	    const inode *i = dynamic_cast<const inode *>(ref);
-	    const entree *was;
-	    
-	    if(e != NULL)
-		ok = cat.compare(e, was);
-	    else
-		if(d != NULL)
-		    cout << "fichier detruit ["<< d->get_signature() << "] name = " << d->get_name() << endl;
-		else
-		    if(i != NULL)
-		    {
-			ok = cat.compare(i, was);
-			const inode *w;
-			if(ok)
-			    w = dynamic_cast<const inode *>(was);
-			if(ok && w != NULL)
-			    if(i->same_as(*w))
-				if(i->is_more_recent_than(*w))
-				    cout << "plus recent" << endl;
-				else
-				    cout << "pas plus recent" << endl;
-			    else
-				cout << "pas meme ou pas inode" << endl;
-		    }
-		    else
-			cout << "objet inconnu" << endl;
-	}
-    }
-    catch(Egeneric &e)
-    {
-	e.dump();
-    }
-}
-
-void f3()
-{
-    catalogue cat;
-    catalogue dif;
-
-    cat.reset_add();
-    dif.reset_add();
-
-    cat.add(new file(1024, 102, 0644, 1, 2, "fichier", ".", 1024));
-    cat.add(new lien(1025, 103, 0645, 4, 5, "lien", "fichier"));
-    cat.add(new directory(1026, 104, 0646, 7, 8, "repertoire"));
-    cat.add(new chardev(1027, 105, 0647, 10, 11, "char device", 104, 202));
-    cat.add(new blockdev(1028, 106, 0651, 13, 14, "block device", 105, 203));
-    cat.add(new eod());
-    cat.add(new tube(1029, 107, 0652, 16, 17, "tuyau"));
-    cat.add(new prise(1030, 108, 0650, 19, 20, "prise"));
-    cat.add(new detruit("ancien fichier", 'f'));
-
-
-    dif.add(new file(1024, 102, 0644, 1, 2, "fichier", ".",  1024));
-    dif.add(new lien(1025, 103, 0645, 4, 5, "lien", "fichier"));
-    dif.add(new tube(1029, 107, 0652, 16, 17, "tuyau"));
-    dif.add(new prise(1030, 108, 0650, 19, 20, "prise"));
-    dif.add(new detruit("ancien fichier", 'f'));
-
-    dif.update_destroyed_with(cat);
-    
-    cat.listing(cout);
-    dif.listing(cout);
-}
- 
Index: dar/test_compressor.cpp
===================================================================
--- dar.orig/test_compressor.cpp	2012-05-02 11:23:23.271875708 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,141 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "compressor.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-static void f1();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    f1();
-    MEM_OUT;
-    MEM_END;
-}
-
-static void f1()
-{
-    infinint pos2, pos3;
-
-    try
-    {
-	fichier src1 = fichier("toto", gf_read_only);
-	fichier src2 = fichier("toto", gf_read_only);
-	fichier src3 = fichier("toto", gf_read_only);
-	fichier dst1 = open("tutu.none", O_WRONLY|O_CREAT|O_TRUNC, 0644);
-	fichier dst2 = open("tutu.gz",O_WRONLY|O_CREAT|O_TRUNC, 0644);
-	fichier dst3 = open("tutu.bz",O_WRONLY|O_CREAT|O_TRUNC, 0644);
-	
-	compressor c1 = compressor(none, dst1);
-	compressor c2 = compressor(gzip, dst2);
-	compressor c3 = compressor(bzip2, dst3);
-	
-	src1.copy_to(c1);
-	src2.copy_to(c2);
-	src3.copy_to(c3);
-
-	    // ajout d'un deuxieme block de donnees indentiques
-	c2.flush_write();
-	pos2 = c2.get_position();
-	src2.skip(0);
-	src2.copy_to(c2);
-
-	    // ajout d'un deuxieme block de donnees indentiques
-	c3.flush_write();
-	pos3 = c3.get_position();
-	src3.skip(0);
-	src3.copy_to(c3);
-
-	    // alteration du premier block de donnees compresses
-	c2.flush_write(); // to be sure all data is written to file
-	dst2.skip(pos2 / 2);
-	dst2.write("A", 1);
-
-	    // alteration du premier block de donnees compresses
-	c3.flush_write(); // to be sure all data is written to file
-	dst3.skip(pos3 / 2);
-	dst3.write("A", 1);
-
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-
-    try
-    {
-	fichier src1 = fichier("tutu.none", gf_read_only);
-	fichier src2 = fichier("tutu.gz", gf_read_only);
-	fichier src3 = fichier("tutu.bz", gf_read_only);
-	fichier dst1 = open("tutu.none.bak", O_WRONLY|O_CREAT|O_TRUNC, 0644);
-	fichier dst2 = open("tutu.gz.bak", O_WRONLY|O_CREAT|O_TRUNC, 0644);
-	fichier dst3 = open("tutu.bz.bak", O_WRONLY|O_CREAT|O_TRUNC, 0644);
-	
-	compressor c1 = compressor(none, src1);
-	compressor c2 = compressor(gzip, src2);
-	compressor c3 = compressor(bzip2, src3);
-	
-	c1.copy_to(dst1);
-	try
-	{
-	    c2.copy_to(dst2);
-	}
-	catch(Erange &e)
-	{
-	    e.dump();
-	    c2.skip(pos2);
-	}
-
-	try
-	{
-	    c3.copy_to(dst3);
-	}
-	catch(Erange &e)
-	{
-	    e.dump();
-	    c3.skip(pos3);
-	}
-
-	c2.flush_read();
-	c2.copy_to(dst2);
-	c3.flush_read();
-	c3.copy_to(dst3);
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-    unlink("tutu.none");
-    unlink("tutu.gz");
-    unlink("tutu.none.bak");
-    unlink("tutu.gz.bak");
-    unlink("tutu.bz");
-    unlink("tutu.bz.bak");
-}
Index: dar/test_deci.cpp
===================================================================
--- dar.orig/test_deci.cpp	2012-05-02 11:23:23.147876093 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,55 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include "deci.hpp"
-#include <iostream>
-#include "test_memory.hpp"
-
-static void f1();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    f1();
-    MEM_OUT;
-    MEM_END;
-}
-
-static void f1()
-{
-    deci d1 = string("00001");
-    infinint t = 3;
-    deci d2 = t;
-    deci d3 = infinint(125);
-    U_I c;
-    
-    cout << d1.human() << endl;
-    cout << d2.human() << endl;
-    cout << d3.human() << endl;
-
-    c = d1.computer() % 200;
-    c = d2.computer() % 200;
-    c = d3.computer() % 200;
-}
Index: dar/test_erreurs.cpp
===================================================================
--- dar.orig/test_erreurs.cpp	2012-05-02 11:23:23.379876739 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,150 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include "erreurs.hpp"
-#include "integers.hpp"
-
-void f1(S_I i);
-void f2(S_I i, S_I j) throw(Erange);
-
-void status()
-{
-    cout << "nombre total d'exceptions : " << Egeneric::total() << "   dont  " << Egeneric::alive() << " vivante(s) " << " et " << Egeneric::zombies() << " zombie(s) " << endl;
-}
-
-void f1(S_I i) 
-{
-    try
-    {
-	if(i < 0)
-	    throw Erange("f1", "i < 0");
-	if(i == 0)
-	    throw Edeci("f1", "i == 0");
-    }
-    catch(Egeneric & e)
-    {
-	e.stack("f1", "essai");
-	throw;
-    }
-}
-
-void f2(S_I i, S_I j) throw(Erange)
-{
-    try
-    {
-	if(j > 0)
-	    f2(i, j-1);
-	else
-	    f1(i);
-    }
-    catch(Erange & e)
-    {
-	e.stack("f2", "calling f1");
-	throw;
-    }
-    catch(Egeneric & e)
-    {
-	e.stack("f2", "unexpected");
-	throw;
-    }
-}
-
-void f3()
-{
-    try
-    {
-	Ememory *x;
-	Ebug y = SRC_BUG;
-	string s;
-	
-	status();
-	x = new Ememory("f3");
-	status();
-	Egeneric::display_last_destroyed();
-	delete x;
-	status();
-    }
-    catch(Egeneric & e)
-    {
-	e.stack("f3", "");
-	throw;
-    }
-}
-
-void f4()
-{
-    Erange *y;
-    Erange x = Erange("essai", "coucou");
-
-    status();
-    Egeneric::display_last_destroyed();
-    x.stack("ajout", "par ici");
-    x.stack("crotte", "par ila");
-    
-    y = new Erange(x);
-    y->dump();
-    y->dump();
-    status();
-    Egeneric::display_last_destroyed();
-    delete y;
-    status();
-    Egeneric::display_last_destroyed();
-}
-
-S_I main()
-{
-    status();
-    f4();
-    f4();
-    f4();
-    try
-    {
-	f3();
-	f2(3, 3);
-	f2(-3, 3);
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-	status();
-    }
-    status();
-    
-    try
-    {
-	f2(0, 10);
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-
-    status();
-    Egeneric::display_alive();
-    Egeneric::display_last_destroyed();
-    status();
-    Egeneric::clear_last_destroyed();
-    status();
-}
Index: dar/test_filesystem.cpp
===================================================================
--- dar.orig/test_filesystem.cpp	2012-05-02 11:23:23.503876279 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,159 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <string.h>
-#include <iostream>
-#include "filesystem.hpp"
-#include "user_interaction.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-static void build();
-static void test();
-static void del();
-static void re_test();
-
-static catalogue *cat;
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    user_interaction_init(&cout, &cerr);
-    catalogue_set_reading_version("03");
-    cat = new catalogue();
-    MEM_OUT;
-    build();
-    MEM_OUT;
-    test();
-    MEM_OUT;
-    {
-	MEM_IN;
-	re_test();
-	MEM_OUT;
-	del();
-	MEM_OUT;
-    }
-    delete cat;
-    MEM_OUT;
-    user_interaction_close();
-    MEM_OUT;
-    MEM_END;
-}
-
-static void build()
-{
-    S_I fd;
-    char phrase[] = "bonjour les amis il fait chaud il fait beau !";
-    struct sockaddr_un name;
-    name.sun_family = AF_UNIX;
-    strcpy(name.sun_path, "arbo/sub/prise");
-
-    mkdir("arbo", 0777);
-    mknod("arbo/dev1", 0777 | S_IFCHR, makedev(20, 30));
-    mkdir("arbo/sub", 0777);
-    fd = socket(PF_UNIX, SOCK_STREAM, 0);
-    if(fd >= 0)
-    {
-	bind(fd, (const sockaddr *)&name, sizeof(name));
-	close(fd);
-    }
-    mknod("arbo/sub/tube", 0777 | S_IFIFO, 0);
-    fd = open("arbo/sub/fichier", O_WRONLY|O_CREAT, 0777);
-    if(fd >= 0)
-    {
-	write(fd, phrase, strlen(phrase));
-	close(fd);
-    }
-    mknod("arbo/dev2", 0777 | S_IFBLK, makedev(20, 30));
-    symlink("/yoyo/crotte", "arbo/lien");
-}
-
-static void del()
-{
-    unlink("arbo/sub/fichier");
-    unlink("arbo/sub/tube");
-    unlink("arbo/sub/prise");
-    rmdir("arbo/sub");
-    unlink("arbo/dev1");
-    unlink("arbo/dev2");
-    unlink("arbo/lien");
-    rmdir("arbo");
-}
-
-static void test()
-{
-    entree *p;
-    filesystem_backup fs = filesystem_backup(path("arbo"), true, true, true, false);
-
-    while(fs.read(p))
-    {
-	file *f = dynamic_cast<file *>(p);
-	cat->add(p);
-	if(f != NULL)
-	{
-	    generic_file *entree = f->get_data();
-
-	    try
-	    {
-                crc val;
-
-		fichier sortie = dup(1);
-		entree->copy_to(sortie, val);
-		f->set_crc(val);
-	    }
-	    catch(...)
-	    {
-		delete entree;
-		throw;
-	    }
-	    delete entree;
-	}
-    }
-    cat->listing(cout);
-}
-
-static void re_test()
-{
-    const entree *e;
-    detruit det1 = detruit("lien", 'l' | 0x80);
-    detruit det2 = detruit("dev1", 'd');
-    filesystem_restore fs = filesystem_restore("algi", true, true, true, true, true, false);
-
-    cat->reset_read();
-    
-    while(cat->read(e))
-	fs.write(e);
-    
-    fs.reset_write();
-    fs.write(&det1);
-    fs.write(&det2);
-}
Index: dar/test_generic_file.cpp
===================================================================
--- dar.orig/test_generic_file.cpp	2012-05-02 11:23:22.991877430 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,69 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <iostream>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "generic_file.hpp"
-#include "null_file.hpp"
-#include "integers.hpp"
-
-S_I main(S_I argc, char *argv[])
-{
-    if(argc < 3)
-    {
-	cout << "usage " << argv[0] << " <filename> <filename>" << endl;
-	return -1;
-    }
-    
-    fichier f1 = fichier(argv[1], gf_read_only);
-    S_I fd = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC);
-    if(fd < 0)
-    {
-	cout << "cannot open "<< argv[2] << endl;
-	return -1;
-    }
-    fichier f2 = fd;
-
-    f1.reset_crc();
-    f2.reset_crc();
-    f1.copy_to(f2);
-    crc crc1;
-    crc crc2;
-    f1.get_crc(crc1);    
-    f2.get_crc(crc2);
-    if(same_crc(crc1, crc2))
-	cout << "CRC OK" << endl;
-    else
-	cout << "CRC PROBLEM" << endl;
-    f1.skip(0);
-    null_file f3 = gf_write_only;
-    crc crc3;
-    f1.copy_to(f3, crc3);
-    if(same_crc(crc1, crc3))
-	cout << "CRC OK" << endl;
-    else
-	cout << "CRC PROBLEM" << endl;
-}
Index: dar/test_hide_file.cpp
===================================================================
--- dar.orig/test_hide_file.cpp	2012-05-02 11:23:23.283876445 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,64 +0,0 @@
-//*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-
-#include <fcntl.h>
-#include "no_comment.hpp"
-#include "config_file.hpp"
-
-void f1();
-void f2();
-
-int main()
-{
-    f1();
-    f2();
-}
-
-void f1()
-{
-    fichier src = fichier("toto", gf_read_only);
-    no_comment strip = src;
-    int fd = open("titi", O_WRONLY|O_TRUNC|O_CREAT, 0644);
-    fichier dst = fd;
-
-    strip.copy_to(dst);
-}
-
-void f2()
-{
-    vector<string> cibles;
-
-    cibles.push_back("coucou");
-    cibles.push_back("all");
-    cibles.push_back("default");
-
-    fichier src = fichier("toto", gf_read_only);
-    config_file strip = config_file(cibles, src);
-
-    int fd = open("tutu", O_WRONLY|O_TRUNC|O_CREAT, 0644);
-    fichier dst = fd;
-
-    strip.copy_to(dst);
-}
Index: dar/test_infinint.cpp
===================================================================
--- dar.orig/test_infinint.cpp	2012-05-02 11:23:23.171876286 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,130 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include "infinint.hpp"
-#include "deci.hpp"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <iostream>
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-static void routine1();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    routine1();
-    MEM_OUT;
-    MEM_END;
-}
-
-static void routine1()
-{
-    infinint f1 = 123;
-    infinint f2 = f1;
-    infinint f3 = 0;
-    
-    deci d1 = f1;
-    deci d2 = f2;
-    deci d3 = f3;
-
-    cout << d1.human() << " " << d2.human() << " " << d3.human() << endl;
-
-    S_I fd = open("toto", O_RDWR | O_CREAT | O_TRUNC, 0644);
-    if(fd >= 0)
-    {
-	f1.dump(fd);
-	close(fd);
-	fd = open("toto", O_RDONLY);
-	if(fd >= 0)
-	{
-	    f3.read_from_file(fd);
-	    d3 = deci(f3);
-	    cout << d3.human() << endl;
-	}
-	close(fd);
-	fd = -1;
-    }
-
-    f1 += 3;
-    d1 = deci(f1);
-    cout << d1.human() << endl;
-
-    f1 -= 2;
-    d1 = deci(f1);
-    cout << d1.human() << endl;
-
-    f1 *= 10;
-    d1 = deci(f1);
-    cout << d1.human() << endl;
-
-    f2 = f1;
-    f1 /= 3;
-    d1 = deci(f1);
-    cout << d1.human() << endl;
-
-    f2 %= 3;
-    d2 = deci(f2);
-    cout << d2.human() << endl;
-    
-    f2 >>= 12;
-    d2 = deci(f2);
-    cout << d2.human() << endl;
-
-    f1 = 4;
-    f2 >>= f1;
-    d2 = deci(f2);
-    cout << d2.human() << endl;
-
-    f1 = 4+12;
-    f2 = f3;
-    f3 <<= f1;
-    f2 <<= 4+12;
-    d2 = deci(f2);
-    cout << d2.human() << endl;
-    d3 = deci(f3);
-    cout << d3.human() << endl;
-    
-
-    f1 = 21;
-    f2 = 1;
-    for(f3 = 2; f3 <= f1; f3++)
-    {
-	d1 = deci(f1);
-	d2 = deci(f2);
-	d3 = deci(f3);
-	cout << d1.human() << " " << d2.human() << " " << d3.human() << endl;
-	f2 *= f3;
-	d2 = deci(f2);
-	cout << d2.human() << endl;
-    }
-
-    d2 = deci(f2);
-    d1 = deci(f1);
-    cout << "factoriel(" <<d1.human() << ") = " << d2.human() << endl;
-}
Index: dar/test_mask.cpp
===================================================================
--- dar.orig/test_mask.cpp	2012-05-02 11:23:23.447876169 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,45 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include "mask.hpp"
-#include "integers.hpp"
-
-static void display_res(mask *m, string s)
-{
-    cout << s << " : " << (m->is_covered(s) ? "OUI" : "non") << endl;
-}
-
-S_I main()
-{
-    simple_mask m1 = string("*.toto");
-    simple_mask m2 = string("a?.toto");
-    simple_mask m3 = string("a?.toto");
-    simple_mask m4 = string("*.toto");
-
-    display_res(&m1, "tutu.toto");
-    display_res(&m2, "a1.toto");
-    display_res(&m3, "b1.toto");
-    display_res(&m4, "toto");
-}
Index: dar/test_memory.cpp
===================================================================
--- dar.orig/test_memory.cpp	2012-05-02 11:23:23.491876572 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,117 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <list>
-#include "user_interaction.hpp"
-#include "test_memory.hpp"
-#include "erreurs.hpp"
-
-#ifdef TEST_MEMORY
-
-using namespace std;
-
-struct my_alloc
-{
-    void *address;
-    U_32 size;
-
-    bool operator == (const struct my_alloc & x) { return x.address == address; };
-};
-
-static U_32 total_size = 0;
-static U_32 initial_offset = 0;
-static U_32 initial_size = 0;
-static list <my_alloc> liste;
-
-void * operator new(size_t size) throw (bad_alloc)
-{
-    void *ret = malloc(size);
-
-    if(ret != NULL)
-    {
-	my_alloc al;
-	al.address = ret;
-	al.size = size;
-	liste.push_back(al);
-	total_size += size;
-    }
-    
-    return ret;
-}
-
-void operator delete(void *p) throw ()
-{
-    list<my_alloc>::iterator it = liste.begin();
-    while(it != liste.end() && it->address != p)
-	it++;
-
-    if(it != liste.end())
-    {
-	total_size -= it->size;
-	liste.remove(*it);
-    }
-    else
-	throw SRC_BUG;
-    
-    free(p);
-}
-
-U_32 get_total_alloc_size() 
-{ 
-    Egeneric::clear_last_destroyed();
-    return total_size; 
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void record_offset()
-{
-    initial_offset = liste.size();
-    initial_size = total_size;
-}
-
-void all_delete_done()
-{
-    if(liste.size() != initial_offset || initial_size != total_size)
-	user_interaction_stream() << liste.size() - initial_offset << " memory allocation(s) not released ! " << " total size = " << total_size - initial_size << endl;
-    else
-	if(liste.size() < initial_offset)
-	    throw SRC_BUG;
-}
-
-void memory_check(U_32 ref, const char *fichier, S_I ligne)
-{
-    Egeneric::clear_last_destroyed();
-    
-    U_32 current = get_total_alloc_size();
-    S_32 diff = current - ref;
-    if(diff != 0)
-	user_interaction_stream() << "file " << fichier << " line " << ligne << " : memory leakage detected : initial = " << ref << "   final = " << current << "  DELTA =  " << diff << endl;
-}
-
-#endif
Index: dar/test_memory.hpp
===================================================================
--- dar.orig/test_memory.hpp	2012-05-02 11:23:23.163877632 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,54 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef TEST_MEMORY_HPP
-#define TEST_MEMORY_HPP
-
-#include <stdlib.h>
-#include "integers.hpp"
-
-#ifdef TEST_MEMORY
-
-#define MEM_BEGIN record_offset()
-
-#define MEM_IN U_32 local_total_alloc_size = get_total_alloc_size()
-#define MEM_OUT memory_check(local_total_alloc_size, __FILE__, __LINE__)
-
-#define MEM_END all_delete_done()
-
-extern void record_offset();
-extern U_32 get_total_alloc_size();
-extern void all_delete_done();
-extern void memory_check(U_32 ref, const char *fichier, S_I ligne);
-
-#else
-
-#define MEM_BEGIN // does nothing
-#define MEM_IN    // does nothing 
-#define MEM_OUT   // does nothing
-#define MEM_END   // does nothing
-
-#endif
-
-#endif
Index: dar/test_path.cpp
===================================================================
--- dar.orig/test_path.cpp	2012-05-02 11:23:23.071876447 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,119 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include "path.hpp"
-#include "test_memory.hpp"
-
-void f2();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    try
-    {
-	path p1 = "/";
-	path p2 = "toto";
-	path p3 = "/titi";
-	path p4 = "toto/titi/tutu/tata";
-	path p5 = "/zozo/zizi/zuzu/zaza";
-
-	cout << p2.display() << endl;
-	
-	path *p[5] = { &p1, &p2, &p3, &p4, &p5 };
-
-	for(S_I i = 0; i < 5; i++)
-	{
-	    string s;
-
-	    cout << "base name = " << p[i]->basename() << endl;
-	    p[i]->reset_read();
-	    cout << "reading  : ";
-	    while(p[i]->read_subdir(s))
-		cout << " | " << s;
-	    cout << endl;
-
-	    cout << (p[i]->is_relative() ? "relative" : "absolute") << endl;
-	    cout << "display = [" << p[i]->display() << "]" << endl;
-
-	    if(p[i]->pop(s))
-		cout << "pop = [" << p[i]->display() << "] [" << s << "]" << endl;
-	    else
-		cout << "no popable" << endl;
-	}
-	path tmp = p1 + p2;
-	cout << tmp.display() << endl;
-	tmp = p5 + p4;
-	cout << tmp.display() << endl;
-	bool res = p1 == p2;
-	res = p1 == p1;
-	res = p4 == p5;
-	res = p5 == p5;
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-    
-    try
-    {
-	path tmp = "";
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-    
-    try
-    {
-	path t1 = "/toto/tutu";
-	path t2 = "zozo/zuzu";
-	path t3 = t2 + t1;
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-    f2();
-    Egeneric::clear_last_destroyed();
-    MEM_OUT;
-    MEM_END;
-}
-
-void f2()
-{
-    char *src[] = { "toto", "/titi", "toto/./titi", "/./titi", 
-		    "toto/titi/tutu/../../..", "/toto/titi/tutu/../../..", 
-		    "././././toto/././././..", "/././././toto/././././..", 
-		    "../../../titi/./tutu", "/../../../../toto/../../tutu",
-		    NULL };
-    path conv = "/";
-
-    for(S_I i = 0; src[i] != NULL; i++)
-    {
-	conv = path(src[i]);
-	cout << string(src[i]) << " --> " << conv.display() << endl;
-    }
-}
Index: dar/test_sar.cpp
===================================================================
--- dar.orig/test_sar.cpp	2012-05-02 11:23:23.235876443 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,144 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-#include <iostream>
-#include "sar.hpp"
-#include "deci.hpp"
-#include "testtools.hpp"
-#include "user_interaction.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-static void f1();
-static void f2();
-static void f3();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    user_interaction_init(&cout, &cerr);
-    MEM_OUT;
-    f1();
-    MEM_OUT;
-    f2();
-    MEM_OUT;
-    f3();
-    MEM_OUT;
-    MEM_END;
-}
-
-static void f1()
-{
-    try
-    {
-	sar sar1 = sar("destination", "txt", 100, 110, SAR_OPT_DEFAULT/*&~SAR_OPT_DONT_ERASE&~SAR_OPT_WARN_OVERWRITE*/, path("./test"));
-	fichier src = fichier("./test/source.txt", gf_read_only);
-	src.copy_to(sar1);
-    }
-    catch(Egeneric &e)
-    {
-	e.dump();
-    }
-}
-
-static void f2()
-{
-    try
-    {
-	sar sar2 = sar("destination", "txt", SAR_OPT_DEFAULT, path("./test"));
-	fichier dst = fichier("./test/destination.txt", gf_write_only);
-
-	sar2.copy_to(dst);
-    }
-    catch(Egeneric &e)
-    {
-	e.dump();
-    }
-}
-
-static void f3()
-{
-    try 
-    {
-	sar sar3 = sar("destination", "txt", SAR_OPT_DEFAULT, path("./test"));
-	fichier src = fichier("./test/source.txt", gf_read_only);
-	
-	display(sar3.get_position());
-	display(src.get_position());
-
-	sar3.skip(210);
-	src.skip(210);
-	display(sar3.get_position());
-	display(src.get_position());
-	display_read(sar3);
-	display_read(src);
-	display(sar3.get_position());
-	display(src.get_position());
-
-	sar3.skip_to_eof();
-	src.skip_to_eof();
-	display(sar3.get_position());
-	display(src.get_position());
-	display_read(sar3);
-	display_read(src);
-	display_back_read(sar3);
-	display_back_read(src);
-
-	display(sar3.get_position());
-	display(src.get_position());
-	sar3.skip_relative(-20);
-	src.skip_relative(-20);
-	display(sar3.get_position());
-	display(src.get_position());
-	display_read(sar3);
-	display_read(src);
-	display_back_read(sar3);
-	display_back_read(src);
-	display(sar3.get_position());
-	display(src.get_position());
-
-	sar3.skip(3);
-	src.skip(3);
-	display_back_read(sar3);
-	display_back_read(src);
-	display(sar3.get_position());
-	display(src.get_position());
-	display_read(sar3);
-	display_read(src);
-	display(sar3.get_position());
-	display(src.get_position());
-
-	sar3.skip(0);
-	src.skip(0);
-	display_back_read(sar3);
-	display_back_read(src);
-	display_read(sar3);
-	display_read(src);
-    }
-    catch(Egeneric & e)
-    {
-	e.dump();
-    }
-    user_interaction_close();
-}
Index: dar/test_scrambler.cpp
===================================================================
--- dar.orig/test_scrambler.cpp	2012-05-02 11:23:23.407876026 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <stdio.h>
-#include "scrambler.hpp"
-#include "dar_suite.hpp"
-#include "generic_file.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-S_I little_main(S_I argc, char *argv[], const char **env);
-
-S_I main(S_I argc, char *argv[])
-{
-    return dar_suite_global(argc, argv, NULL, &little_main);
-}
-
-S_I little_main(S_I argc, char *argv[], const char **env)
-{
-    MEM_IN;
-    if(argc != 4)
-    {
-	printf("usage: %s <source> <destination_scrambled> <destination_clear>\n", argv[0]);
-	return EXIT_SYNTAX;
-    }
-    
-    fichier *src = new fichier(argv[1], gf_read_only);
-    fichier *dst = new fichier(argv[2], gf_write_only);
-    scrambler *scr = new scrambler("bonjour", *dst);
-    
-    src->copy_to(*scr);
-    
-    delete scr; scr = NULL;
-    delete dst; dst = NULL;
-    delete src; src = NULL;
-
-    src = new fichier(argv[2], gf_read_only);
-    scr = new scrambler("bonjour", *src);
-    dst = new fichier(argv[3], gf_write_only);
-
-    scr->copy_to(*dst);
-
-    delete scr;
-    delete src;
-    delete dst;
-
-    MEM_OUT;
-    return EXIT_OK;
-}    
Index: dar/test_storage.cpp
===================================================================
--- dar.orig/test_storage.cpp	2012-05-02 11:23:23.295876123 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,195 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include "storage.hpp"
-#include "infinint.hpp"
-#include "erreurs.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-void f1();
-void f2();
-
-void affiche(infinint x)
-{
-    U_32 l = 0;
-    x.unstack(l);
-    do {
-	cout <<  "+" << (U_I)l ;
-	l = 0;
-	x.unstack(l);
-    } while( l > 0);
-    cout << endl;
-}
-
-void affiche(const storage & ref)
-{
-    storage::iterator it = ref.begin();
-    while(it != ref.end())
-	cout << *(it++);
-    cout << endl;
-}
-
-S_I main(S_I argc, char *argv[])
-{
-    MEM_BEGIN;
-    MEM_IN;
-    f1();
-    MEM_OUT;
-    f2();
-    MEM_OUT;
-    MEM_END;
-}
-
-void f1()
-{
-    try
-    {
-	storage st1(10), st2(12);
-	storage *test;
-	infinint u;
-	
-	test = new storage(st1);
-	delete test;
-	
-	u = 10;
-	affiche(u);
-	
-	test = new storage(u);
-	u = test->size();
-	affiche(u);
-	
-	if(*test < st1)
-	    cout << "vrai" << endl;
-	else
-	    cout << "faux" << endl;
-	
-	if(*test == st2)
-	    cout << "vrai" << endl;
-	else
-	    cout << "faux" << endl;
-	
-	
-	if(*test == st1)
-	    cout << "vrai" << endl;
-	else
-	    cout << "faux" << endl;
-	
-	if(st2 < *test)
-	    cout << "vrai" << endl;
-	else
-	    cout << "faux" << endl;
-
-	unsigned char b = 'a' + 3;
-	cout << b << endl;
-
-	for(S_I i = 0; i < st1.size(); i++)
-	    st1[i] = 'a' + i;
-	affiche(st1);
-
-	storage::iterator it = st1.begin();
-	
-	while(it != st1.end())
-	    cout << *(it++);
-	cout << endl;
-	
-	it = st1.rbegin();
-	while(it != st1.rend())
-	    cout << *(it--);
-	cout << endl;
-	
-	const storage cst = st1;
-	cout << cst[3] << endl;
-
-	st2 = st1;
-	st1.clear();
-	affiche(st1);
-	affiche(st2);
-
-	it = st2.rbegin();
-	affiche(it.get_position());
-	it = st2.begin();
-	st2.write(it, (unsigned char *)"coucou les amis il fait chaud il fait beau, les mouches pettent et les cailloux fleurissent", st2.size() % 100);
-	affiche(st2);
-	char buffer[100];
-
-	it = ++(st2.begin());
-	st2.read(it, (unsigned char *)buffer, st2.size() % 100);
-	
-	delete test;
-
-	it = st2.begin() + 3;
-	affiche(it.get_position());
-
-	st2.insert_null_bytes_at_iterator(it, 5);
-	affiche(st2);
-
-	it = st2.rbegin() - 5;
-	st2.remove_bytes_at_iterator(it, 10);
-	affiche(st2);
-	it = st2.rbegin() - 5;
-	st2.insert_bytes_at_iterator(it,(unsigned char *)buffer, st2.size() % 100);
-	affiche(st2);
-    }
-    catch(Egeneric &r)
-    {
-	cout << "exception connue attrappee" << endl;
-    }
-    catch(...)
-    {	
-	cout << "exception NON connue attrappee" << endl;
-    }
-}
-
-void f2()
-{
-    infinint u = 1;
-    infinint s, size;
-    S_I i;
-
-    for(i = 2; i < 10; i++)
-	u *= i;
-
-    affiche(u);
-
-    storage x = u;
-    storage::iterator it;
-
-    it = x.begin();
-    i = 0;
-    while(it != x.end())
-	*(it++) = (unsigned char)('A' + (i++ % 70));
-    
-    affiche(x);
-    size = x.size();
-    u = size / 2;
-    it.skip_to(x, u);
-    
-    x.remove_bytes_at_iterator(it, 2000);
-    
-    u = x.size();
-    affiche(u);
-    affiche(x);
-}
Index: dar/test_terminateur.cpp
===================================================================
--- dar.orig/test_terminateur.cpp	2012-05-02 11:23:23.167877644 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,64 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <iostream>
-#include "terminateur.hpp"
-#include "generic_file.hpp"
-#include "deci.hpp"
-#include "test_memory.hpp"
-#include "integers.hpp"
-
-static void f1();
-
-S_I main()
-{
-    MEM_BEGIN;
-    MEM_IN;
-    f1();
-    MEM_OUT;
-    MEM_END;
-}
-
-static void f1()
-{
-    fichier toto = open("toto", O_RDWR|O_CREAT|O_TRUNC, 0644);
-    terminateur term;
-    
-    infinint grand = 1;
-    
-    for(S_I i=2;i<30;i++)
-	grand *= i;
-
-    deci conv = grand;
-    cout << conv.human() << endl;
-    term.set_catalogue_start(grand);
-    term.dump(toto);
-    toto.skip(0);
-    term.read_catalogue(toto);
-    conv = term.get_catalogue_start();
-    cout << conv.human() << endl;
-}
Index: dar/test_tronc.cpp
===================================================================
--- dar.orig/test_tronc.cpp	2012-05-02 11:23:23.359877930 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,107 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "tronc.hpp"
-#include "deci.hpp"
-#include "testtools.hpp"
-#include "user_interaction.hpp"
-#include "integers.hpp"
-
-S_I main()
-{
-    path p = "test/source.txt";
-    fichier h = fichier(p, gf_read_only);
-
-    user_interaction_init(&cout, &cerr);
-    display_read(h);
-    
-    try
-    {
-	fichier f = fichier("test/source.txt", gf_read_only);
-	tronc *t;
-	
-	t = new tronc(&f, 0, 10);
-	t->skip(0);
-	cout << t->get_position() << endl;
-	cout << f.get_position() << endl;
-	
-	display_read(*t);
-	cout << t->get_position() << endl;
-	cout << f.get_position() << endl;
-	
-	display_read(*t);
-	cout << t->get_position() << endl;
-	cout << f.get_position() << endl;
-	
-	delete t;
-	t = new tronc(&f, 50, 5);
-	cout << t->get_position() << endl;
-	cout << f.get_position() << endl;
-
-	display_read(*t);
-	cout << t->get_position() << endl;
-	cout << f.get_position() << endl;
-
-	delete t;
-	S_I fd = open("test/destination.txt", O_RDWR|O_CREAT|O_TRUNC);
-	fichier g = fd;
-	f.skip(0);
-	f.copy_to(g);
-	t = new tronc(&g, 10, 10);
-
-	try
-	{
-	    f.skip(0);
-	    f.copy_to(*t);
-	}
-	catch(Egeneric & e)
-	{
-	    e.dump();
-	}
-
-	t->skip_to_eof();
-	display_back_read(*t);
-	display_back_read(*t);	
-	g.skip(0);
-	display_read(g);
-	display_read(g);
-	
-	t->skip_relative(-5);
-	display_read(*t);
-	t->skip(3);
-	display_read(*t);
-	t->skip_relative(2);
-	display_read(*t);
-
-	delete t;
-    }
-    catch(Egeneric &f)
-    {
-	f.dump();
-    }
-}
Index: dar/test_tuyau.cpp
===================================================================
--- dar.orig/test_tuyau.cpp	2012-05-02 11:23:23.279876279 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,137 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#include <iostream>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include "tuyau.hpp"
-#include "tools.hpp"
-#include "user_interaction.hpp"
-#include "dar_suite.hpp"
-
-static const unsigned int buffer_size = 10000;
-static bool xmit = true;
-
-static int little_main(int argc, char *argv[], const char **env);
-static void action_xmit(tuyau *in, tuyau *out, U_32 duration);
-static void action_loop(tuyau *in, tuyau *out);
-static void stop_xmit(int l);
-
-int main(int argc, char *argv[])
-{
-    return dar_suite_global(argc, argv, NULL, &little_main);
-}
-
-static int little_main(int argc, char *argv[], const char **env)
-{
-    tuyau *in = NULL, *out = NULL;
-    U_32 duration;
-
-    user_interaction_change_non_interactive_output(&cout);
-    if(argc != 4)
-    {
-	ui_printf("usage : %s <input> <output> <seconds>\n", argv[0]);
-	ui_printf("usage : %s <input> <output> loop\n", argv[0]);
-	user_interaction_close();
-	return 0;
-    }
-    
-    tools_open_pipes(argv[1], argv[2], in, out);
-    if(strcmp(argv[3],"loop") == 0)
-	action_loop(in, out);
-    else
-    {
-	duration = atol(argv[3]);
-	action_xmit(in, out, duration);
-    }
-    return 0;
-}
-
-static void action_xmit(tuyau *in, tuyau *out, U_32 duration)
-{
-    char out_buffer[buffer_size];
-    char in_buffer[buffer_size];
-    unsigned int lu;
-    bool xmit_error = false;
-    
-    signal(SIGALRM, &stop_xmit);
-    alarm(duration);
-    srand((unsigned int)getpid());
-
-    while(xmit)
-    {
-	    // generate data to send;
-	for(register unsigned int i = 0; i < buffer_size; i++)
-	    out_buffer[i] = rand() % 256;
-	
-	    // sending data
-	out->write(out_buffer, buffer_size);
-
-	    // reading it through pipes
-	lu = 0;
-	while(lu < buffer_size)
-	    lu += in->read(in_buffer+lu, buffer_size-lu);
-	
-	    // compairing received data with sent one
-
-	lu = 0;
-	for(register unsigned int i = 0; i < buffer_size; i++)
-	    if(out_buffer[i] != in_buffer[i])
-		lu++;
-	if(lu > 0)
-	{
-	    ui_printf("ERROR: on %d bytes transfered %d byte(s) had error\n", buffer_size, lu);
-	    xmit_error = true;
-	}
-    }
-    
-    if(xmit_error)
-	ui_printf("TEST FAILED: some transmission error occured\n");
-    else
-	ui_printf("TEST PASSED SUCCESSFULLY\n");
-    
-    ui_printf("you can stop the loop instance with Control-C\n");
-}
-
-static void stop_xmit(int l)
-{
-    xmit = false;
-}
-
-static void action_loop(tuyau *in, tuyau *out)
-{
-    char buffer[buffer_size];
-    U_32 lu;
-
-    while(1)
-    {
-	lu = 0;
-	while(lu < buffer_size)
-	    lu += in->read(buffer+lu, buffer_size-lu);
-	
-	out->write(buffer, buffer_size);
-    }
-}
Index: dar/testtools.cpp
===================================================================
--- dar.orig/testtools.cpp	2012-05-02 11:23:23.155876416 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,61 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include "deci.hpp"
-#include "testtools.hpp"
-#include "user_interaction.hpp"
-#include "integers.hpp"
-
-void display(const infinint & x)
-{
-    deci vu = x;
-    cout << vu.human() << endl;
-}
-
-void display_read(generic_file & f)
-{
-    const S_I size = 10;
-    char buffer[size];
-    S_I lu = f.read(buffer, size);
-    if(lu < size)
-	buffer[lu] = '\0';
-    else
-	buffer[size-1] = '\0';
-    ui_printf("lu = %d : [%s]\n", lu, buffer);
-}
-
-void display_back_read(generic_file & f)
-{
-    const S_I size = 10;
-    char buffer[size];
-    S_I lu = 0;
-    while(lu < size && f.read_back(buffer[lu]) == 1 )
-	lu++;
-    if(lu < size)
-	buffer[lu] = '\0';
-    else
-	buffer[size-1] = '\0';
-    ui_printf("lu = %d : [%s]\n", lu, buffer);
-}
Index: dar/testtools.hpp
===================================================================
--- dar.orig/testtools.hpp	2012-05-02 11:23:23.115876397 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,35 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef TESTTOOLS_HPP
-#define TESTTOOLS_HPP
-
-#include "infinint.hpp"
-#include "generic_file.hpp"
-
-extern void display(const infinint & x);
-extern void display_read(generic_file & f);
-extern void display_back_read(generic_file & f);
-
-#endif
Index: dar/tools.cpp
===================================================================
--- dar.orig/tools.cpp	2012-05-02 11:23:23.011876076 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,561 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <grp.h>
-#include <signal.h>
-#include "tools.hpp"
-#include "erreurs.hpp"
-#include "deci.hpp"
-#include "user_interaction.hpp"
-#include "dar_suite.hpp"
-#include "integers.hpp"
-
-static void runson(char *argv[]);
-static void deadson(S_I sig);
-
-char *tools_str2charptr(string x)
-{
-    U_I size = x.size();
-    char *ret = new char[size+1];
- 
-    if(ret == NULL)
-	throw Ememory("tools_str2charptr");
-    for(register unsigned int i = 0; i < size; i++)
-	ret[i] = x[i];
-    ret[size] = '\0';
-    
-    return ret;
-}
-
-void tools_write_string(generic_file & f, const string & s)
-{
-    tools_write_string_all(f, s);
-    f.write("", 1); // adding a '\0' at the end;
-}
-
-void tools_read_string(generic_file & f, string & s)
-{
-    char a[2] = { 0, 0 };
-    S_I lu;
-    
-    s = "";
-    do
-    {
-	lu = f.read(a, 1);
-	if(lu == 1  && a[0] != '\0')
-	    s += a;
-    }
-    while(lu == 1 && a[0] != '\0');
-
-    if(lu != 1 || a[0] != '\0')
-	throw Erange("tools_read_string", "not a zero terminated string in file");
-}
-
-void tools_write_string_all(generic_file & f, const string & s)
-{
-    char *tmp = tools_str2charptr(s);
-
-    if(tmp == NULL)
-	throw Ememory("tools_write_string_all");
-    try
-    {
-	U_I len = s.size();
-	U_I wrote = 0;
-
-	while(wrote < len)
-	    wrote += f.write(tmp+wrote, len-wrote);
-    }
-    catch(...)
-    {
-	delete tmp;
-    }
-    delete tmp;
-}
-
-void tools_read_string_size(generic_file & f, string & s, infinint taille)
-{
-    U_16 small_read = 0;
-    size_t max_read = 0;
-    S_I lu = 0;
-    const U_I buf_size = 10240;
-    char buffer[buf_size];
-    
-    s = "";
-    do
-    {
-	if(small_read > 0)
-	{
-	    max_read = small_read > buf_size ? buf_size : small_read;
-	    lu = f.read(buffer, max_read);
-	    small_read -= lu;
-	    s += string((char *)buffer, (char *)buffer+lu);
-	}
-	taille.unstack(small_read);
-    }
-    while(small_read > 0);
-}
-
-infinint tools_get_filesize(const path &p)
-{
-    struct stat buf;
-    char *name = tools_str2charptr(p.display());
-    
-    if(name == NULL)
-	throw Ememory("tools_get_filesize");
-
-    try
-    {
-	if(lstat(name, &buf) < 0)
-	    throw Erange("tools_get_filesize", strerror(errno));
-    }
-    catch(...)
-    {
-	delete name;
-    }
-
-    delete name;
-    return (U_32)buf.st_size;
-}
-
-infinint tools_get_extended_size(string s)
-{
-    U_I len = s.size();
-    infinint factor = 1;
-
-    if(len < 1)
-	return false;
-    switch(s[len-1])
-    {
-    case 'K':
-    case 'k': // kilobyte
-	factor = 1024;
-	break;
-    case 'M': // megabyte
-	factor = infinint(1024)*infinint(1024);
-	break;
-    case 'G': // gigabyte
-	factor = infinint(1024)*infinint(1024)*infinint(1024);
-	break;
-    case 'T': // terabyte
-	factor = infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024);
-	break;
-    case 'P': // petabyte
-	factor = infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024);
-	break;
-    case 'E': // exabyte
-	factor = infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024);
-	break;
-    case 'Z': // zettabyte
-	factor = infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024);
-	break;
-    case 'Y':  // yottabyte
-	factor = infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024)*infinint(1024);
-	break;
-    case '0':
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9':
-	break;
-    default :
-	throw Erange("command_line get_extended_size", string("unknown sufix in string : ")+s);
-    }
-
-    if(factor != 1)
-	s = string(s.begin(), s.end()-1);
-
-    deci tmp = s;
-    factor *= tmp.computer();
-
-    return factor;
-}
-
-char *tools_extract_basename(const char *command_name)
-{
-    path commande = command_name;
-    string tmp = commande.basename();
-    char *name = tools_str2charptr(tmp);
-    
-    return name;
-}
-
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void tools_split_path_basename(const char *all, path * &chemin, string & base)
-{
-    chemin = new path(all);
-    if(chemin == NULL)
-	throw Ememory("tools_split_path_basename");
-
-    try
-    {
-	if(chemin->degre() > 1)
-	{
-	    if(!chemin->pop(base))
-		throw SRC_BUG; // a path of degree > 1 should be able to pop()
-	}
-	else
-	{
-	    base = chemin->basename();
-	    delete chemin;
-	    chemin = new path(".");
-	    if(chemin == NULL)
-		throw Ememory("tools_split_path_basename");
-	}
-    }
-    catch(...)
-    {
-	if(chemin != NULL)
-	    delete chemin;
-	throw;
-    }
-}
-
-void tools_split_path_basename(const string & all, string & chemin, string & base)
-{
-    path tmp = all;
-
-    if(!tmp.pop(base))
-    {
-	chemin = "";
-	base = all;
-    }
-    else
-	chemin = tmp.display();
-}
-
-void tools_open_pipes(const string &input, const string & output, tuyau *&in, tuyau *&out)
-{
-    in = out = NULL;
-    try
-    {
-	if(input != "")
-	    in = new tuyau(input, gf_read_only);
-	else
-	    in = new tuyau(0, gf_read_only); // stdin by default
-	if(in == NULL)
-	    throw Ememory("tools_open_pipes");
-	
-	if(output != "")
-	    out = new tuyau(output, gf_write_only);
-	else
-	    out = new tuyau(1, gf_write_only); // stdout by default
-	if(out == NULL)
-	    throw Ememory("tools_open_pipes");
-
-    }
-    catch(...)
-    {
-	if(in != NULL)
-	    delete in;
-	if(out != NULL)
-	    delete out;
-	throw;
-    }
-}
-
-void tools_blocking_read(S_I fd, bool mode)
-{
-    S_I flags = fcntl(fd, F_GETFL, 0);
-    if(!mode)
-	flags |= O_NDELAY;
-    else
-	flags &= ~O_NDELAY;
-    fcntl(fd, F_SETFL, flags);
-}
-
-string tools_name_of_uid(U_16 uid)
-{
-    struct passwd *pwd = getpwuid(uid);
-
-    if(pwd == NULL) // uid not associated with a name
-    {
-	infinint tmp = uid;
-	deci d = tmp;
-	return d.human();
-    }
-    else
-	return pwd->pw_name;
-}
-
-string tools_name_of_gid(U_16 gid)
-{
-    struct group *gr = getgrgid(gid);
-
-    if(gr == NULL) // uid not associated with a name
-    {
-	infinint tmp = gid;
-	deci d = tmp;
-	return d.human();
-    }
-    else
-	return gr->gr_name;
-}
-
-string tools_int2str(S_I x)
-{
-    infinint tmp = x >= 0 ? x : -x;
-    deci d = tmp;
-    
-    return (x >= 0 ? string("") : string("-")) + d.human();
-}    
-
-U_32 tools_str2int(const string & x)
-{
-    deci d = x;
-    infinint t = d.computer();
-    U_32 ret = 0;
-    
-    t.unstack(ret);
-    if(t != 0)
-	throw Erange("tools_str2int", "cannot convert the string to integer, overflow");
-
-    return ret;
-}
-
-string tools_addspacebefore(string s, U_I expected_size)
-{
-    while(s.size() < expected_size)
-	s = string(" ") + s;
-
-    return s;
-}
-
-string tools_display_date(infinint date)
-{
-    time_t pas = 0;
-    string ret;
- 
-    date.unstack(pas);
-    ret = ctime(&pas);
-
-    return string(ret.begin(), ret.end() - 1); // -1 to remove the ending '\n' 
-}
-
-void tools_system(const vector<string> & argvector)
-{
-    if(argvector.size() == 0)
-	return; // nothing to do
-    else
-    {
-	char **argv = new char *[argvector.size()+1];
-	
-	if(argv == NULL)
-	    throw Ememory("tools_system");
-	try
-	{
-		// make an (S_I, char *[]) couple
-	    for(register U_I i = 0; i <= argvector.size(); i++)
-		argv[i] = NULL;
-	    
-	    try
-	    {
-		S_I status;
-		bool loop;
-		
-		for(register U_I i = 0; i < argvector.size(); i++)
-		    argv[i] = tools_str2charptr(argvector[i]);
-		
-		do
-		{
-		    deadson(0);
-		    loop = false;
-		    S_I pid = fork();
-		    
-		    switch(pid)
-		    {
-		    case -1:
-			throw Erange("tools_system", string("Error while calling fork() to launch dar: ") + strerror(errno));
-		    case 0: // fork has succeeded, we are the child process
-			runson(argv);
-			    // function that never returns
-		    default:
-			if(wait(&status) <= 0)
-			    throw Erange("tools_system", 
-					 string("Unexpected error while waiting for dar to terminate: ") + strerror(errno));
-			else // checking the way dar has exit
-			    if(!WIFEXITED(status)) // not a normal ending
-				if(WIFSIGNALED(status)) // exited because of a signal
-				{
-				    try
-				    {
-					user_interaction_pause(string("DAR terminated upon signal reception: ")
-#ifdef USE_SYS_SIGLIST 
-							       + (WTERMSIG(status) < NSIG ? sys_siglist[WTERMSIG(status)] : tools_int2str(WTERMSIG(status)))
-#else
-							       + tools_int2str(WTERMSIG(status))
-#endif
-							       + " . Retry to launch dar as previously ?");
-					loop = true;
-				    }
-				    catch(Euser_abort & e)
-				    {
-					user_interaction_pause("Continue anyway ?");
-				    }
-				}
-				else // normal terminaison but exit code not zero
-				    user_interaction_pause(string("DAR has terminated with exit code ")
-							   + tools_int2str(WEXITSTATUS(status))
-							   + " Continue anyway ?");
-		    }
-		}
-		while(loop);
-	    }
-	    catch(...)
-	    {
-		for(register U_I i = 0; i < argvector.size(); i++)
-		    if(argv[i] != NULL)
-			delete argv[i];
-		throw;
-	    }
-	    for(register U_I i = 0; i < argvector.size(); i++)
-		if(argv[i] != NULL)
-		    delete argv[i];
-	}
-	catch(...)
-	{
-	    delete argv;
-	    throw;
-	}
-	delete argv;
-    }
-}
-
-void tools_write_vector(generic_file & f, const vector<string> & x)
-{
-    infinint tmp = x.size();
-    vector<string>::iterator it = const_cast<vector<string> *>(&x)->begin();
-    vector<string>::iterator fin = const_cast<vector<string> *>(&x)->end();
-
-    tmp.dump(f);
-    while(it != fin)
-	tools_write_string(f, *it++);
-}
-
-void tools_read_vector(generic_file & f, vector<string> & x)
-{
-    infinint tmp;
-    string elem;
-
-    x.clear();
-    tmp.read_from_file(f);
-    while(tmp > 0)
-    {
-	tools_read_string(f, elem);
-	x.push_back(elem);
-	tmp--;
-    }
-}
-
-string tools_concat_vector(const string & separator, const vector<string> & x)
-{
-    string ret = separator;
-    vector<string>::iterator it = const_cast<vector<string> *>(&x)->begin();
-    vector<string>::iterator fin = const_cast<vector<string> *>(&x)->end();
-
-    while(it != fin)
-	ret += *it++ + separator;
-    
-    return ret;
-}
-
-vector<string> operator + (vector<string> a, vector<string> b)
-{
-    vector<string>::iterator it = b.begin();
-
-    while(it != b.end())
-	a.push_back(*it++);
-
-    return a;
-}
-
-
-static void deadson(S_I sig)
-{
-    signal(SIGCHLD, &deadson);
-}
-
-static void runson(char *argv[])
-{
-    if(execvp(argv[0], argv) < 0)
-	user_interaction_warning(string("Error while calling execvp:") + strerror(errno));
-    else
-	user_interaction_warning("execvp failed but did not returned error code");
-    exit(EXIT_SYNTAX);
-}
-
-const char *tools_get_from_env(const char **env, char *clef)
-{
-    unsigned int index = 0;
-    const char *ret = NULL;
-	
-    if(env == NULL || clef == NULL)
-	return NULL;
-
-    while(ret == NULL && env[index] != NULL)
-    {
-	unsigned int letter = 0;
-	while(clef[letter] != '\0' 
-	      && env[index][letter] != '\0'
-	      && env[index][letter] != '=' 
-	      && clef[letter] == env[index][letter])
-	    letter++;
-	if(clef[letter] == '\0' && env[index][letter] == '=')
-	    ret = env[index]+letter+1;
-	else
-	    index++;
-    }
-
-    return ret;
-}
-	
-	
-bool tools_is_member(const string & val, const vector<string> & liste)
-{
-    U_I index = 0;
-	
-    while(index < liste.size() && liste[index] != val)
-	index++;
-
-    return index <liste.size();
-}
Index: dar/tools.hpp
===================================================================
--- dar.orig/tools.hpp	2012-05-02 11:23:23.355877723 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,75 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef TOOLS_HPP
-#define TOOLS_HPP
-
-#include <string>
-#include <vector>
-#include "path.hpp"
-#include "generic_file.hpp"
-#include "tuyau.hpp"
-#include "integers.hpp"
-
-using namespace std;
-
-extern char *tools_str2charptr(string x);
-extern void tools_write_string(generic_file & f, const string & s); 
-    // add a '\0' at the end
-extern void tools_read_string(generic_file & f, string & s); 
-    // read up to '\0' char
-extern void tools_write_string_all(generic_file & f, const string & s); 
-    // '\0' has no special meaning no '\0' at the end
-extern void tools_read_string_size(generic_file & f, string & s, infinint taille); 
-    // '\0' has no special meaning
-extern infinint tools_get_filesize(const path &p);
-extern infinint tools_get_extended_size(string s);
-extern char *tools_extract_basename(const char *command_name); 
-extern void tools_split_path_basename(const char *all, path * &chemin, string & base);
-extern void tools_split_path_basename(const string &all, string & chemin, string & base);
-extern void tools_open_pipes(const string &input, const string & output, tuyau *&in, tuyau *&out);
-extern void tools_blocking_read(int fd, bool mode);
-extern string tools_name_of_uid(U_16 uid);
-extern string tools_name_of_gid(U_16 gid);
-extern string tools_int2str(int x);
-extern U_32 tools_str2int(const string & x);
-extern string tools_addspacebefore(string s, unsigned int expected_size);
-extern string tools_display_date(infinint date);
-extern void tools_system(const vector<string> & argvector);
-extern void tools_write_vector(generic_file & f, const vector<string> & x);
-extern void tools_read_vector(generic_file & f, vector<string> & x);
-extern string tools_concat_vector(const string & separator, 
-				  const vector<string> & x);
-vector<string> operator + (vector<string> a, vector<string> b);
-extern bool tools_is_member(const string & val, const vector<string> & liste);
-
-
-template <class T> vector<T> operator +=(vector<T> & a, const vector<T> & b)
-{
-    a = a + b;
-    return a;
-}
-extern const char *tools_get_from_env(const char **env, char *clef);
-
-#endif
Index: dar/tronc.cpp
===================================================================
--- dar.orig/tronc.cpp	2012-05-02 11:23:23.327876073 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,180 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include "tronc.hpp"
-#include <errno.h>
-
-tronc::tronc(generic_file *f, const infinint & offset, const infinint &size) : generic_file(f->get_mode()) 
-{ 
-    ref = f; 
-    sz = size;
-    start = offset;
-    current = size; // forces skipping the first time
-}
-
-tronc::tronc(generic_file *f, const infinint & offset, const infinint &size, gf_mode mode) : generic_file(mode) 
-{ 
-    ref = f; 
-    sz = size;
-    start = offset;
-    current = size; // forces skipping the firt time
-}
-
-bool tronc::skip(const infinint & pos)
-{
-    if(current == pos)
-	return true;
-
-    if(pos > sz)
-    {
-	current = sz;
-	ref->skip(start + sz);
-	return false;
-    }
-    else
-    {
-	current = pos;
-	return ref->skip(start + pos);
-    }
-}
-
-bool tronc::skip_to_eof()
-{
-    current = sz;
-    return ref->skip(start + sz);
-}
-
-bool tronc::skip_relative(S_I x)
-{
-    if(x < 0)
-	if(current < -x)
-	{
-	    ref->skip(start);
-	    current = 0;
-	    return false;
-	}
-	else
-	{
-	    bool r = ref->skip_relative(x); 
-	    if(r)
-		current -= -x;
-	    else
-	    {
-		ref->skip(start);
-		current = 0;
-	    }
-	    return r;
-	}
-    
-    if(x > 0)
-	if(current + x >= sz)
-	{
-	    current = sz;
-	    ref->skip(start+sz);
-	    return false;
-	}
-	else
-	{
-	    bool r = ref->skip_relative(x);
-	    if(r)
-		current += x;
-	    else
-	    {
-		ref->skip(start+sz);
-		current = sz;
-	    }   
-	    return r;
-	}
-
-    return true;
-}
-
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-S_I tronc::inherited_read(char *a, size_t size)
-{
-    infinint avail = sz - current;
-    U_32 macro_pas = 0, micro_pas;
-    U_32 lu = 0;
-    S_I ret;
-
-    do
-    {
-	avail.unstack(macro_pas);
-	micro_pas = size - lu > macro_pas ? macro_pas : size - lu;
-	if(micro_pas > 0)
-	{
-	    ret = ref->read(a+lu, micro_pas);
-	    if(ret > 0)
-	    {
-		lu += ret;
-		macro_pas -= ret;
-	    }
-	    if(ret < 0)
-		throw Erange("tronc::inherited_read", strerror(errno));
-	}
-	else
-	    ret = 0;
-    }
-    while(ret > 0);
-    current += lu;
-
-    return lu;
-}
-
-S_I tronc::inherited_write(char *a, size_t size)
-{
-    infinint avail = sz - current;
-    U_32 macro_pas = 0, micro_pas;
-    U_32 wrote = 0;
-    S_I ret;
-
-    ref->skip(start + current);
-    do
-    {
-	avail.unstack(macro_pas);
-	if(macro_pas == 0 && wrote < size)
-	    throw Erange("tronc::inherited_write", "tried to write out of size limited file");
-	micro_pas = size - wrote > macro_pas ? macro_pas : size - wrote;
-	ret = ref->write(a+wrote, micro_pas);
-	if( ret > 0)
-	{
-	    wrote += ret;
-	    macro_pas -= ret;
-	}
-	if(ret < 0)
-	    throw Erange("tronc::inherited_write", strerror(errno));
-    }
-    while(ret > 0);
-    current += wrote;
-    
-    return wrote;
-}
Index: dar/tronc.hpp
===================================================================
--- dar.orig/tronc.hpp	2012-05-02 11:23:23.191876336 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,53 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef TRONC_HPP
-#define TRONC_HPP
-
-#pragma interface
-
-#include "generic_file.hpp"
-
-class tronc : public generic_file
-{
-public :
-    tronc(generic_file *f, const infinint &offset, const infinint &size);
-    tronc(generic_file *f, const infinint &offset, const infinint &size, gf_mode mode);
-    
-    bool skip(const infinint & pos);
-    bool skip_to_eof();
-    bool skip_relative(S_I x);
-    infinint get_position() { return current; };
-
-protected :
-    S_I inherited_read(char *a, size_t size);
-    S_I inherited_write(char *a, size_t size);
-
-private :
-    infinint start, sz;
-    generic_file *ref;
-    infinint current;
-};
-
-#endif
Index: dar/tuyau.cpp
===================================================================
--- dar.orig/tuyau.cpp	2012-05-02 11:23:23.487878122 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,194 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#pragma implementation
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "tuyau.hpp"
-#include "erreurs.hpp"
-#include "tools.hpp"
-#include "user_interaction.hpp"
-#include "integers.hpp"
-
-tuyau::tuyau(S_I fd) : generic_file(generic_file_get_mode(fd))
-{
-    if(filedesc < 0)
-	throw Erange("tuyau::tuyau", "bad file descriptor given");
-    filedesc = fd;
-    position = 0;
-    chemin = "";
-}
-
-tuyau::tuyau(S_I fd, gf_mode mode) : generic_file(mode)
-{
-    gf_mode tmp;
-
-    if(filedesc < 0)
-	throw Erange("tuyau::tuyau", "bad file descriptor given");
-    tmp = generic_file_get_mode(fd);
-    if(tmp != gf_read_write && tmp != mode)
-	throw Erange("tuyau::tuyau", generic_file_get_name(tmp)+" cannot be restricted to "+generic_file_get_name(mode));
-    filedesc = fd;
-    position = 0;
-    chemin = "";
-}
-
-tuyau::tuyau(const string & filename, gf_mode mode) : generic_file(mode)
-{
-    chemin = filename;
-    position = 0;
-    filedesc = -1; // not yet openned
-}
-
-bool tuyau::skip(const infinint & pos)
-{
-    if(pos != position)
-	throw Erange("tuyau::skip", "skipping is not possible on a tuyau (= pipe)");
-    return true;
-}
-
-bool tuyau::skip_to_eof()
-{
-    throw Erange("tuyau::skip", "skipping is not possible on a tuyau (= pipe)");
-}
-
-bool tuyau::skip_relative(S_I x)
-{
-    if(x != 0)
-	throw Erange("tuyau::skip", "skipping is not possible on a tuyau (= pipe)");
-    return true;
-}
-
-S_I tuyau::inherited_read(char *a, size_t size)
-{
-    S_I ret;
-    U_I lu = 0;
-
-    if(filedesc < 0)
-	ouverture();
-
-    do
-    {
-	ret = ::read(filedesc, a+lu, size-lu);
-	if(ret < 0)
-	{
-	    switch(errno)
-	    {
-	    case EINTR:
-		break;
-	    case EIO:
-		throw Ehardware("tuyau::inherited_read", "");
-	    default:
-		throw Erange("tuyau::inherited_read", string("error while reading from pipe: ")+strerror(errno));
-	    }
-	}
-	else
-	    if(ret > 0)
-		lu += ret;
-    }
-    while(lu < size && ret != 0);
-    position += lu;
-
-    return lu;
-}
-
-S_I tuyau::inherited_write(char *a, size_t size)
-{
-    size_t total = 0;
-
-    if(filedesc < 0)
-	ouverture();
-
-    while(total < size)
-    {
-	S_I ret = ::write(filedesc, a+total, size-total);
-	if(ret < 0)
-	{
-	    switch(errno)
-	    {
-	    case EINTR:
-		break;
-	    case EIO:
-		throw Ehardware("tuyau::inherited_write", strerror(errno));
-	    case ENOSPC:
-		user_interaction_pause("no space left on device, you have the oportunity to make room now. When ready : can we continue ?");
-		break;
-	    default :
-		throw Erange("tuyau::inherited_write", string("error while writing to pipe: ") + strerror(errno));
-	    }
-	}
-	else
-	    total += (U_I)ret;
-    }
-
-    position += total;
-    return total;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void tuyau::ouverture()
-{
-    if(chemin != "")
-    {
-	char *ch = tools_str2charptr(chemin);
-	try
-	{
-	    S_I flag;
-
-	    switch(get_mode())
-	    {
-	    case gf_read_only:
-		flag = O_RDONLY;
-		break;
-	    case gf_write_only:
-		flag = O_WRONLY;
-		break;
-	    case gf_read_write:
-		flag = O_RDWR;
-		break;
-	    default:
-		throw SRC_BUG;
-	    }
-	    filedesc = ::open(ch, flag);
-	    if(filedesc < 0)
-		throw Erange("tuyau::ouverture", string("error openning pipe: ")+strerror(errno));
-	}
-	catch(...)
-	{
-	    delete ch;
-	    throw;
-	}
-	delete ch;
-    }
-    else
-	throw SRC_BUG; // no path nor file descriptor
-}
Index: dar/tuyau.hpp
===================================================================
--- dar.orig/tuyau.hpp	2012-05-02 11:23:22.967876271 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,58 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef TUYAU_HPP
-#define TUYAU_HPP
-
-#pragma interface
-
-#include "generic_file.hpp"
-
-class tuyau : public generic_file
-{
-public:
-    tuyau(int fd); // fd is the filedescriptor of a pipe extremity
-    tuyau(int fd, gf_mode mode); // forces the mode of possible
-    tuyau(const string &filename, gf_mode mode);
-    ~tuyau() { close(filedesc); };
-    
-	// inherited from generic_file
-    bool skip(const infinint & pos);
-    bool skip_to_eof();
-    bool skip_relative(signed int x);
-    infinint get_position() { return position; };
-
-protected:
-    virtual int inherited_read(char *a, size_t size);
-    virtual int inherited_write(char *a, size_t size);
-
-private:
-    infinint position;
-    int filedesc;
-    string chemin; // named pipe open later
-
-    void ouverture();
-};
-
-#endif
Index: dar/user_interaction.cpp
===================================================================
--- dar.orig/user_interaction.cpp	2012-05-02 11:23:23.399876366 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,264 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#include <iostream>
-#include <sys/ioctl.h>
-#include <termios.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdio.h>
-#include "user_interaction.hpp"
-#include "erreurs.hpp"
-#include "tools.hpp"
-#include "integers.hpp"
-
-using namespace std;
-
-static S_I input = -1;
-static ostream *output = NULL;
-static ostream *inter = NULL;
-static bool beep = false;
-static termio initial;
-static termio interaction;
-static bool has_terminal = false;
-
-static void set_term_mod(const struct termio & etat);
-
-void user_interaction_init(ostream *out, ostream *interact)
-{
-    has_terminal = false;
-
-	// checking and recording parameters to static variable
-    if(out != NULL)
-	output = out;
-    else 
-	throw SRC_BUG;
-    if(interact != NULL)
-	inter = interact;
-    else
-	throw SRC_BUG;
-
-	// looking for an input terminal
-	//
-	// we do not use anymore standart input but open a new descriptor 
-	// from the controlling terminal. This allow in some case to use
-	// standart input for piping data while keeping user interaction
-	// possible.
-    
-    if(input < 0)
-	close(input);
-
-    char *tty = ctermid(NULL);
-    if(tty == NULL)
-	user_interaction_warning("No terminal found for user interaction. All questions will abort the program.");
-    else // no filesystem path to tty
-    {
-	struct termio term;
-	
-	input = open(tty, O_RDONLY);
-	if(input < 0)
-	    user_interaction_warning("No terminal found for user interaction. All questions will abort the program.");
-	else
-	{
-		// preparing input for swaping between char mode and line mode (terminal settings)
-	    if(ioctl(input, TCGETA, &term) >= 0)
-	    {
-		initial = term;
-		term.c_lflag &= ~ICANON;
-		term.c_lflag &= ~ECHO;
-		term.c_lflag &= ~ECHOE;
-		interaction = term;
-		
-		    // checking now that we can change to character mode
-		set_term_mod(interaction); 
-		set_term_mod(initial);
-		    // but we don't need it right now, so swapping back to line mode
-		has_terminal = true;
-	    }
-	    else // failed to retrieve parameters from tty
-		user_interaction_warning("No terminal found for user interaction. All questions will abort the program.");
-	}
-    }
-}
-
-void user_interaction_change_non_interactive_output(ostream *out)
-{
-    if(out != NULL)
-	output = out;
-    else 
-	throw SRC_BUG;
-}
-
-static void set_term_mod(const struct termio & etat)
-{
-    if(ioctl(input, TCSETA, &etat) < 0)
-	throw Erange("user_interaction : set_term_mod", string("Error while changing user terminal properties: ") + strerror(errno));
-}
-
-void user_interaction_close()
-{
-    if(has_terminal)
-	ioctl(input, TCSETA, &initial);
-}
-
-void user_interaction_pause(string message)
-{
-    const S_I bufsize = 1024;
-    char buffer[bufsize];
-    char & a = buffer[0];
-
-    if(!has_terminal) 
-    {
-	user_interaction_warning("No terminal found and user interaction needed, aborting.");
-	throw Euser_abort(message);
-    }
-
-    if(input < 0)
-	throw SRC_BUG;
-
-    set_term_mod(interaction);
-    try
-    {
-	    // flushing any character remaining in the input stream
-	tools_blocking_read(input, false);
-	while(read(input, buffer, bufsize) >= 0)
-	    ;
-	tools_blocking_read(input, true);
-	
-	    // now asking the user
-	do
-	{
-	    *inter << message << " [return = OK | esc = cancel]" << (beep ? "\007\007\007" : "") << endl;
-	    if(read(input, &a, 1) < 0)
-		throw Erange("user_interaction_pause", string("Error while reading user answer from terminal: ") + strerror(errno));
-	}
-	while(a != 27 && a != '\n');
-	
-	if(a == 27) // escape key
-	    throw Euser_abort(message);
-	else
-	    *inter << "Continuing..." << endl;
-    }
-    catch(...)
-    {
-	set_term_mod(initial);
-	throw;
-    }
-}
-
-void user_interaction_warning(string message)
-{
-    if(output == NULL)
-	throw SRC_BUG; // user_interaction has not been properly initialized
-    *output << message << endl;
-}
-
-ostream &user_interaction_stream()
-{
-    return *output; 
-}
-
-void user_interaction_set_beep(bool mode)
-{
-    beep = mode;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-void ui_printf(char *format, ...)
-{
-    va_list ap;
-    bool end;
-    U_32 taille = strlen(format)+1;
-    char *copie;
-    
-    if(output == NULL)
-	throw Erange("ui_printf", "user_interaction  module is not initialized");
-
-    copie = new char[taille];
-    if(copie == NULL)
-	throw Ememory("ui_printf");
-
-    va_start(ap, format);
-    try
-    {
-	char *ptr = copie, *start = copie;
-
-	strcpy(copie, format);
-	copie[taille-1] = '\0';
-
-	do
-	{
-	    while(*ptr != '%' && *ptr != '\0')
-		ptr++;
-	    if(*ptr == '%')
-	    {
-		*ptr = '\0';
-		end = false;
-	    }
-	    else 
-		end = true;
-	    *output << start;
-	    if(!end)
-	    {
-		ptr++;
-		switch(*ptr)
-		{
-		case '%':
-		    *output << "%";
-		    break;
-		case 'd':
-		    *output << va_arg(ap, S_I);
-		    break;
-		case 's':
-		    *output << va_arg(ap, char *);
-		    break;
-		case 'c':
-		    *output << static_cast<char>(va_arg(ap, S_I));
-		    break;
-		default:
-		    throw Efeature(string("%") + (*ptr) + " is not implemented in ui_printf format argument");
-		}
-		ptr++;
-		start = ptr;
-	    }
-	}
-	while(!end);
-    }
-    catch(...)
-    {
-	va_end(ap);
-	delete copie;
-	throw;
-    }
-    delete copie;
-    va_end(ap);
-}
Index: dar/user_interaction.hpp
===================================================================
--- dar.orig/user_interaction.hpp	2012-05-02 11:23:23.247878601 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,45 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef USER_INTERACTION_HPP
-#define USER_INTERACTION_HPP
-
-#include <string>
-
-using namespace std;
-
-extern void user_interaction_init(ostream *out, ostream *interact);
-    // arg are the input file descriptor, output ostream object (on which are sent non interactive messages)
-    // and intereact ostream object on which are sent message that require a user interaction
-extern void user_interaction_change_non_interactive_output(ostream *out);
-extern void user_interaction_pause(string message);
-extern void user_interaction_warning(string message);
-extern ostream &user_interaction_stream();
-extern void user_interaction_set_beep(bool mode);
-extern void ui_printf(char *format, ...);
-    // sometimes easier to use printf-like call than iostream (cout << etc.)
-    //////
-extern void user_interaction_close();
-
-#endif
Index: dar/wrapperlib.cpp
===================================================================
--- dar.orig/wrapperlib.cpp	2012-05-02 11:23:23.107875107 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,381 +0,0 @@
-#include <zlib.h>
-#include <bzlib.h>
-#include "erreurs.hpp"
-#include "wrapperlib.hpp"
-
-#define CHECK_Z if(z_ptr == NULL) throw SRC_BUG
-#define CHECK_BZ if(bz_ptr == NULL) throw SRC_BUG
-
-static S_I zlib2wrap_code(S_I code);
-static S_I bzlib2wrap_code(S_I code);
-static S_I wrap2zlib_code(S_I code);
-static S_I wrap2bzlib_code(S_I code);
-
-wrapperlib::wrapperlib(wrapperlib_mode mode)
-{
-    switch(mode)
-    {
-    case zlib_mode:
-	z_ptr = new z_stream;
-	if(z_ptr == NULL)
-	    throw Ememory("wrapperlib::wrapperlib");
-	bz_ptr = NULL;
-	z_ptr->zalloc = NULL;
-	z_ptr->zfree = NULL;
-	z_ptr->opaque = NULL;
-	x_compressInit = & wrapperlib::z_compressInit;
-	x_decompressInit = & wrapperlib::z_decompressInit;
-	x_compressEnd = & wrapperlib::z_compressEnd;
-	x_decompressEnd = & wrapperlib::z_decompressEnd;
-	x_compress = & wrapperlib::z_compress;
-	x_decompress = & wrapperlib::z_decompress;
-	x_set_next_in = & wrapperlib::z_set_next_in;
-	x_set_avail_in = & wrapperlib::z_set_avail_in;
-	x_get_avail_in = & wrapperlib::z_get_avail_in;
-	x_get_total_in = & wrapperlib::z_get_total_in;
-	x_set_next_out = & wrapperlib::z_set_next_out;
-	x_get_next_out = & wrapperlib::z_get_next_out;
-	x_set_avail_out = & wrapperlib::z_set_avail_out;
-	x_get_avail_out = & wrapperlib::z_get_avail_out;
-	x_get_total_out = & wrapperlib::z_get_total_out;
-	break;
-    case bzlib_mode:
-	bz_ptr = new bz_stream;
-	if(bz_ptr == NULL)
-	    throw Ememory("wrapperlib::wrapperlib");
-	z_ptr = NULL;
-	bz_ptr->bzalloc = NULL;
-	bz_ptr->bzfree = NULL;
-	bz_ptr->opaque = NULL;
-	x_compressInit = & wrapperlib::bz_compressInit;
-	x_decompressInit = & wrapperlib::bz_decompressInit;
-	x_compressEnd = & wrapperlib::bz_compressEnd;
-	x_decompressEnd = & wrapperlib::bz_decompressEnd;
-	x_compress = & wrapperlib::bz_compress;
-	x_decompress = & wrapperlib::bz_decompress;
-	x_set_next_in = & wrapperlib::bz_set_next_in;
-	x_set_avail_in = & wrapperlib::bz_set_avail_in;
-	x_get_avail_in = & wrapperlib::bz_get_avail_in;
-	x_get_total_in = & wrapperlib::bz_get_total_in;
-	x_set_next_out = & wrapperlib::bz_set_next_out;
-	x_get_next_out = & wrapperlib::bz_get_next_out;
-	x_set_avail_out = & wrapperlib::bz_set_avail_out;
-	x_get_avail_out = & wrapperlib::bz_get_avail_out;
-	x_get_total_out = & wrapperlib::bz_get_total_out;
-	break;
-    default:
-	throw SRC_BUG;
-    }
-    level = -1;
-}
-
-wrapperlib::wrapperlib(const wrapperlib & ref)
-{
-    throw Efeature("cannot copy a wrapperlib object (NOT IMPLEMENTED)");
-}
-
-wrapperlib & wrapperlib::operator = (const wrapperlib & ref)
-{
-    throw Efeature("cannot copy a wrapperlib object (NOT IMPLEMENTED)");
-}
-
-wrapperlib::~wrapperlib()
-{
-    if(z_ptr != NULL)
-	delete z_ptr;
-    if(bz_ptr != NULL)
-	delete bz_ptr;
-}
-
-////////////// Zlib routines /////////////
-
-S_I wrapperlib::z_compressInit(U_I compression_level)
-{
-    CHECK_Z;
-    return zlib2wrap_code(deflateInit(z_ptr, compression_level));
-}
-
-S_I wrapperlib::z_decompressInit()
-{
-    CHECK_Z;
-    return zlib2wrap_code(inflateInit(z_ptr));
-}
-
-S_I wrapperlib::z_compressEnd()
-{
-    CHECK_Z;
-    return zlib2wrap_code(deflateEnd(z_ptr));
-}
-
-S_I wrapperlib::z_decompressEnd()
-{
-    CHECK_Z;
-    return zlib2wrap_code(inflateEnd(z_ptr));
-}
-
-S_I wrapperlib::z_compress(S_I flag)
-{
-    CHECK_Z;
-    return zlib2wrap_code(deflate(z_ptr, wrap2zlib_code(flag)));
-}
-
-S_I wrapperlib::z_decompress(S_I flag)
-{
-    CHECK_Z;
-    return zlib2wrap_code(inflate(z_ptr, wrap2zlib_code(flag)));
-}
-
-void wrapperlib::z_set_next_in(char *x)
-{
-    CHECK_Z;
-    z_ptr->next_in = (Bytef *)x;
-}
-
-void wrapperlib::z_set_avail_in(U_I x)
-{
-    CHECK_Z;
-    z_ptr->avail_in = x;
-}
-
-U_I wrapperlib::z_get_avail_in() const
-{
-    CHECK_Z;
-    return z_ptr->avail_in;
-}
-
-U_64 wrapperlib::z_get_total_in() const
-{
-    CHECK_Z;
-    return z_ptr->total_in;
-}
-
-void wrapperlib::z_set_next_out(char *x)
-{
-    CHECK_Z;
-    z_ptr->next_out = (Bytef *)x;
-}
-
-char *wrapperlib::z_get_next_out() const
-{
-    CHECK_Z;
-    return (char *)z_ptr->next_out;
-}
-
-void wrapperlib::z_set_avail_out(U_I x)
-{
-    CHECK_Z;
-    z_ptr->avail_out = x;
-}
-
-U_I wrapperlib::z_get_avail_out() const
-{
-    CHECK_Z;
-    return z_ptr->avail_out;
-}
-    
-U_64 wrapperlib::z_get_total_out() const
-{
-    CHECK_Z;
-    return z_ptr->total_out;
-}
-
-
-////////////// BZlib routines /////////////
-
-
-void wrapperlib::bz_set_next_in(char *x)
-{
-    CHECK_BZ;
-    bz_ptr->next_in = x;
-}
-
-void wrapperlib::bz_set_avail_in(U_I x)
-{
-    CHECK_BZ;
-    bz_ptr->avail_in = x;
-}
-
-U_I wrapperlib::bz_get_avail_in() const
-{
-    CHECK_BZ;
-    return bz_ptr->avail_in;
-}
-
-U_64 wrapperlib::bz_get_total_in() const
-{
-    CHECK_BZ;
-    return (U_64(bz_ptr->total_in_hi32) << 32) | (U_64(bz_ptr->total_in_lo32));
-}
-
-void wrapperlib::bz_set_next_out(char *x)
-{
-    CHECK_BZ;
-    bz_ptr->next_out = x;
-}
-
-char *wrapperlib::bz_get_next_out() const
-{
-    CHECK_BZ;
-    return bz_ptr->next_out;
-}
-
-void wrapperlib::bz_set_avail_out(U_I x)
-{
-    CHECK_BZ;
-    bz_ptr->avail_out = x;
-}
-
-U_I wrapperlib::bz_get_avail_out() const
-{
-    CHECK_BZ;
-    return bz_ptr->avail_out;
-}
-
-U_64 wrapperlib::bz_get_total_out() const
-{
-    CHECK_BZ;
-        return (U_64(bz_ptr->total_out_hi32) << 32) | (U_64(bz_ptr->total_out_lo32));
-}
-
-
-S_I wrapperlib::bz_compressInit(U_I compression_level)
-{
-    CHECK_BZ;
-    return bzlib2wrap_code(BZ2_bzCompressInit(bz_ptr, compression_level, 0, 30));
-}
-
-S_I wrapperlib::bz_decompressInit()
-{
-    CHECK_BZ;
-    return bzlib2wrap_code(BZ2_bzDecompressInit(bz_ptr, 0,0));
-}
-
-S_I wrapperlib::bz_compressEnd()
-{
-    CHECK_BZ;
-    return bzlib2wrap_code(BZ2_bzCompressEnd(bz_ptr));
-}
-
-S_I wrapperlib::bz_decompressEnd()
-{
-    CHECK_BZ;
-    return bzlib2wrap_code(BZ2_bzDecompressEnd(bz_ptr));
-}
-
-S_I wrapperlib::bz_compress(S_I flag)
-{
-    CHECK_BZ;
-    return bzlib2wrap_code(BZ2_bzCompress(bz_ptr, wrap2bzlib_code(flag)));
-}
-
-S_I wrapperlib::bz_decompress(S_I flag)
-{
-	// flag is not used here.
-    S_I ret;
-    CHECK_BZ;
-    ret = BZ2_bzDecompress(bz_ptr);
-    if(ret == BZ_SEQUENCE_ERROR)
-	ret = BZ_STREAM_END;
-    return bzlib2wrap_code(ret);
-}
-
-S_I wrapperlib::compressReset()
-{
-    S_I ret;
-
-    if(level < 0)
-	throw Erange("wrapperlib::compressReset", "compressReset called but compressInit never called before");
-    ret = compressEnd();
-    if(ret == WR_OK)
-	return compressInit(level);
-    else
-	return ret;
-}
-
-S_I wrapperlib::decompressReset() 
-{ 
-    S_I ret = decompressEnd(); 
-
-    if(ret == WR_OK)
-	return decompressInit();
-    else
-	return ret;
-}
-    
-static S_I zlib2wrap_code(S_I code)
-{
-    switch(code)
-    {
-    case Z_OK:
-	return WR_OK;
-    case Z_MEM_ERROR:
-	return WR_MEM_ERROR;
-    case Z_VERSION_ERROR:
-	return WR_VERSION_ERROR;
-    case Z_STREAM_END:
-	return WR_STREAM_END;
-    case Z_DATA_ERROR:
-	return WR_DATA_ERROR;
-    case Z_BUF_ERROR:
-	return WR_BUF_ERROR;
-    case Z_STREAM_ERROR:
-	return WR_STREAM_ERROR;
-    case Z_NEED_DICT:
-	throw SRC_BUG; // unexpected error code
-    default:
-	throw SRC_BUG; // unexpected error code
-    }
-}
-
-static S_I bzlib2wrap_code(S_I code)
-{
-    switch(code)
-    {
-    case BZ_OK:
-    case BZ_RUN_OK:
-    case BZ_FLUSH_OK:
-    case BZ_FINISH_OK:
-	return WR_OK;
-    case BZ_PARAM_ERROR:
-	return WR_STREAM_ERROR;
-    case BZ_CONFIG_ERROR:
-	return WR_VERSION_ERROR;
-    case BZ_MEM_ERROR:
-	return WR_MEM_ERROR;
-    case BZ_DATA_ERROR:
-    case BZ_DATA_ERROR_MAGIC:
-	return WR_DATA_ERROR;
-    case BZ_STREAM_END:
-	return WR_STREAM_END;
-    case BZ_SEQUENCE_ERROR:
-    default:
-	throw SRC_BUG;
-    }
-}
-
-static S_I wrap2zlib_code(S_I code)
-{
-    switch(code)
-    {
-    case WR_NO_FLUSH:
-	return Z_NO_FLUSH;
-    case WR_FINISH:
-	return Z_FINISH;
-    default:
-	throw SRC_BUG;
-    }
-}
-
-static S_I wrap2bzlib_code(S_I code)
-{
-    switch(code)
-    {
-    case WR_NO_FLUSH:
-	return BZ_RUN;
-    case WR_FINISH:
-	return BZ_FINISH;
-    default:
-	throw SRC_BUG;
-    }
-}
-
Index: dar/wrapperlib.hpp
===================================================================
--- dar.orig/wrapperlib.hpp	2012-05-02 11:23:23.007876433 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,132 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-#ifndef WRAPPERLIB_HPP
-#define WRAPPERLIB_HPP
-
-#include <zlib.h>
-#include <bzlib.h>
-
-#define WR_OK            0
-#define WR_MEM_ERROR     1
-#define WR_VERSION_ERROR 2
-#define WR_STREAM_ERROR  3
-#define WR_DATA_ERROR    4
-#define WR_NO_FLUSH      5
-#define WR_BUF_ERROR     6
-#define WR_STREAM_END    7
-#define WR_FINISH        8
-
-enum wrapperlib_mode { zlib_mode, bzlib_mode };
-
-class wrapperlib
-{
-public:
-    wrapperlib(wrapperlib_mode mode);
-    wrapperlib(const wrapperlib & ref);
-    wrapperlib & operator = (const wrapperlib & ref);
-    ~wrapperlib();
-        
-    void set_next_in(char *x) { return (this->*x_set_next_in)(x); };
-    void set_avail_in(U_I x) { return (this->*x_set_avail_in)(x); };
-    U_I get_avail_in() const { return (this->*x_get_avail_in)(); };
-    U_64 get_total_in() const { return (this->*x_get_total_in)(); };
-    
-    void set_next_out(char *x) { return (this->*x_set_next_out)(x); };
-    char *get_next_out() const { return (this->*x_get_next_out)(); };
-    void set_avail_out(U_I x) { return (this->*x_set_avail_out)(x); };
-    U_I get_avail_out() const { return (this->*x_get_avail_out)(); };
-    U_64 get_total_out() const { return (this->*x_get_total_out)(); };
-
-    S_I compressInit(U_I compression_level) { level = compression_level; return (this->*x_compressInit)(compression_level); };
-    S_I decompressInit() { return (this->*x_decompressInit)(); };
-    S_I compressEnd() { return (this->*x_compressEnd)(); };
-    S_I decompressEnd() { return (this->*x_decompressEnd)(); };
-    S_I compress(S_I flag) { return (this->*x_compress)(flag); };
-    S_I decompress(S_I flag) { return (this->*x_decompress)(flag);};
-    S_I compressReset(); 
-    S_I decompressReset();
-
-private:
-    z_stream *z_ptr;
-    bz_stream *bz_ptr;
-    S_I level;
-
-    void (wrapperlib::*x_set_next_in)(char *x);
-    void (wrapperlib::*x_set_avail_in)(U_I x);
-    U_I (wrapperlib::*x_get_avail_in)() const;
-    U_64 (wrapperlib::*x_get_total_in)() const;
-    
-    void (wrapperlib::*x_set_next_out)(char *x);
-    char *(wrapperlib::*x_get_next_out)() const;
-    void (wrapperlib::*x_set_avail_out)(U_I x);
-    U_I (wrapperlib::*x_get_avail_out)() const;
-    U_64 (wrapperlib::*x_get_total_out)() const;
-
-    S_I (wrapperlib::*x_compressInit)(U_I compression_level);
-    S_I (wrapperlib::*x_decompressInit)();
-    S_I (wrapperlib::*x_compressEnd)();
-    S_I (wrapperlib::*x_decompressEnd)();
-    S_I (wrapperlib::*x_compress)(S_I flag);
-    S_I (wrapperlib::*x_decompress)(S_I flag);
-
-
-	// set of routines for zlib
-
-    S_I z_compressInit(U_I compression_level);
-    S_I z_decompressInit();
-    S_I z_compressEnd();
-    S_I z_decompressEnd();
-    S_I z_compress(S_I flag);
-    S_I z_decompress(S_I flag);
-    void z_set_next_in(char *x);
-    void z_set_avail_in(U_I x);
-    U_I z_get_avail_in() const;
-    U_64 z_get_total_in() const;
-    void z_set_next_out(char *x);
-    char *z_get_next_out() const;
-    void z_set_avail_out(U_I x);
-    U_I z_get_avail_out() const;
-    U_64 z_get_total_out() const;
-
-	// set of routines for bzlib
-    
-    S_I bz_compressInit(U_I compression_level);
-    S_I bz_decompressInit();
-    S_I bz_compressEnd();
-    S_I bz_decompressEnd();
-    S_I bz_compress(S_I flag);
-    S_I bz_decompress(S_I flag);
-    void bz_set_next_in(char *x);
-    void bz_set_avail_in(U_I x);
-    U_I bz_get_avail_in() const;
-    U_64 bz_get_total_in() const;
-    void bz_set_next_out(char *x);
-    char *bz_get_next_out() const;
-    void bz_set_avail_out(U_I x);
-    U_I bz_get_avail_out() const;
-    U_64 bz_get_total_out() const;
-};
-
-#endif
Index: dar/zapette.cpp
===================================================================
--- dar.orig/zapette.cpp	2012-05-02 11:23:23.035877567 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,406 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-#pragma implementation
-
-#include <netinet/in.h>
-#include "zapette.hpp"
-#include "infinint.hpp"
-#include "user_interaction.hpp"
-
-#define ANSWER_TYPE_DATA 'D'
-#define ANSWER_TYPE_INFININT 'I'
-
-#define REQUEST_SIZE_SPECIAL_ORDER 0
-#define REQUEST_OFFSET_END_TRANSMIT 0
-#define REQUEST_OFFSET_GET_FILESIZE 1
-
-struct request
-{
-    char serial_num;
-    U_16 size; // size or REQUEST_SIZE_SPECIAL_ORDER
-    infinint offset; // offset or REQUEST_OFFSET_END_TRANSMIT or REQUEST_OFFSET_GET_FILESIZE
- 
-    void write(generic_file *f); // master side
-    void read(generic_file *f);  // slave side
-};
-
-struct answer
-{
-    char serial_num;
-    char type;
-    U_16 size;
-    infinint arg;
-    
-    void write(generic_file *f, char *data); // slave side
-    void read(generic_file *f, char *data, U_16 max);  // master side
-};
-
-void request::write(generic_file *f)
-{
-    U_16 tmp = htons(size);
-
-    f->write(&serial_num, 1);
-    offset.dump(*f);
-    f->write((char *)&tmp, sizeof(tmp));
-}
-
-void request::read(generic_file *f)
-{
-    U_16 tmp;
-    U_16 pas;
-
-    if(f->read(&serial_num, 1) == 0)
-	throw Erange("request::read", "uncompleted request received, aborting\n");
-    offset.read_from_file(*f);
-    pas = 0;
-    while(pas < sizeof(tmp))
-	pas += f->read((char *)&tmp+pas, sizeof(tmp)-pas);
-    size = ntohs(tmp);
-}
-
-void answer::write(generic_file *f, char *data)
-{
-    U_16 tmp = htons(size);
-
-    f->write(&serial_num, 1);
-    f->write(&type, 1);
-    switch(type)
-    {
-    case ANSWER_TYPE_DATA:
-	f->write((char *)&tmp, sizeof(tmp));
-	if(data != NULL)
-	    f->write(data, size);
-	else
-	    if(size != 0)
-		throw SRC_BUG;
-	break;
-    case ANSWER_TYPE_INFININT:
-	arg.dump(*f);
-	break;
-    default:
-	throw SRC_BUG;
-    }
-}
-
-void answer::read(generic_file *f, char *data, U_16 max)
-{
-    U_16 tmp;
-    U_16 pas;
-
-    f->read(&serial_num, 1);
-    f->read(&type, 1);
-    switch(type)
-    {
-    case ANSWER_TYPE_DATA:
-	pas = 0;
-	while(pas < sizeof(tmp))
-	    pas += f->read((char *)&tmp+pas, sizeof(tmp)-pas);
-	size = ntohs(tmp);
-	pas = 0;
-	while(pas < size)
-	    pas += f->read(data+pas, size-pas);
-	
-	if(size > max) // need to drop the remaining data
-	{
-	    char black_hole;
-	    
-	    for(tmp = max; tmp < size; tmp++)
-		f->read(&black_hole, 1); 
-		// might not be very performant code
-	}
-	arg = 0;
-	break;
-    case ANSWER_TYPE_INFININT:
-	arg.read_from_file(*f);
-	size = 0;
-	break;
-    default:
-	throw Erange("answer::read", "corrupted data read on pipe");
-    }
-}
-
-slave_zapette::slave_zapette(generic_file *input, generic_file *output, generic_file *data)
-{
-    if(input == NULL)
-	throw SRC_BUG;
-    if(output == NULL)
-	throw SRC_BUG;
-    if(data == NULL)
-	throw SRC_BUG;
-
-    if(input->get_mode() == gf_write_only)
-	throw Erange("slave_zapette::slave_zapette", "input cannot be read");
-    if(output->get_mode() == gf_read_only)
-	throw Erange("slave_zapette::slave_zapette", "cannot write to output");
-    if(data->get_mode() != gf_read_only)
-	throw Erange("slave_zapette::slave_zapette", "data should be read-only");
-    in = input;
-    out = output;
-    src = data;
-}
-
-slave_zapette::~slave_zapette()
-{ 
-    if(in != NULL)
-	delete in; 
-    if(out != NULL)
-	delete out; 
-    if(src != NULL)
-	delete src;
-}
-
-void slave_zapette::action()
-{
-    request req;
-    answer ans;
-    char *buffer = NULL;
-    U_16 buf_size = 0;
-
-    try
-    {
-	do
-	{
-	    req.read(in);
-	    ans.serial_num = req.serial_num;
-	    
-	    if(req.size != REQUEST_SIZE_SPECIAL_ORDER)
-	    {
-		ans.type = ANSWER_TYPE_DATA;
-		if(src->skip(req.offset))
-		{
-			// enlarge buffer if necessary
-		    if(req.size > buf_size) 
-		    {
-			if(buffer != NULL)
-			    delete buffer;
-			buffer = new char[req.size];
-			if(buffer == NULL)
-			    throw Ememory("slave_zapette::action");
-			else
-			    buf_size = req.size;
-		    }   
-
-		    ans.size = src->read(buffer, req.size);
-		    ans.write(out, buffer);
-		}
-		else // bad position
-		{
-		    ans.size = 0;
-		    ans.write(out, NULL);
-		}
-	    }
-	    else // special orders
-	    {
-		if(req.offset == REQUEST_OFFSET_END_TRANSMIT) // stop communication
-		{
-		    ans.type = ANSWER_TYPE_DATA;
-		    ans.size = 0;
-		    ans.write(out, NULL);
-		}
-		else if(req.offset == REQUEST_OFFSET_GET_FILESIZE) // return file size
-		{
-		    ans.type = ANSWER_TYPE_INFININT;
-		    if(!src->skip_to_eof())
-			throw Erange("slave_zapette::action", "cannot skip at end of file");
-		    ans.arg = src->get_position();
-		    ans.write(out, NULL);
-		}
-		else 
-		    throw Erange("zapette::action", "received unkown special order");
-	    }
-	}
-	while(req.size != REQUEST_SIZE_SPECIAL_ORDER || req.offset != REQUEST_OFFSET_END_TRANSMIT);
-    }
-    catch(...)
-    {
-	if(buffer != NULL)
-	    delete buffer;
-	throw;
-    }
-    if(buffer != NULL)
-	delete buffer;
-}
-
-zapette::zapette(generic_file *input, generic_file *output) : generic_file(gf_read_only)
-{
-    if(input == NULL)
-	throw SRC_BUG;
-    if(output == NULL)
-	throw SRC_BUG;
-    if(input->get_mode() == gf_write_only)
-	throw Erange("zapette::zapette", "cannot read on input");
-    if(output->get_mode() == gf_read_only)
-	throw Erange("zapette::zapette", "cannot write on output");
-
-    in = input;
-    out = output;
-    position = 0;
-    serial_counter = 0;
-    
-	//////////////////////////////
-	// retreiving the file size
-	//
-    S_I tmp = 0;
-    make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_OFFSET_GET_FILESIZE, NULL, tmp, file_size);
-}
-    
-zapette::~zapette()
-{
-    S_I tmp = 0;
-    make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_OFFSET_END_TRANSMIT, NULL, tmp, file_size);
-
-    delete in;
-    delete out;
-}
-
-static void dummy_call(char *x)
-{
-    static char id[]="$Id$";
-    dummy_call(id);
-}
-
-bool zapette::skip(const infinint & pos)
-{
-    if(pos >= file_size)
-    {
-	position = file_size;
-	return false;
-    }
-    else
-    {
-	position = pos;
-	return true;
-    }
-}
-
-bool zapette::skip_relative(S_I x)
-{
-    if(x >= 0)
-    {
-	position += x;
-	if(position > file_size)
-	{
-	    position = file_size;
-	    return false;
-	}
-	else 
-	    return true;
-    }
-    else
-	if(-x > position)
-	{
-	    position = 0;
-	    return false;
-	}
-	else
-	{
-	    position -= (-x); // implicit conversion of "-x" to infinint (positive)	    
-	    return true;
-	}
-}
-
-S_I zapette::inherited_read(char *a, size_t size)
-{
-    static U_16 max_short = ~0;
-    U_I lu = 0;
-    
-    if(size > 0)
-    {
-	infinint not_used;
-	U_16 pas;
-	S_I ret;
-
-	do
-	{
-	    if(size - lu > max_short)
-		pas = max_short;
-	    else
-		pas = size - lu;
-	    make_transfert(pas, position, a+lu, ret, not_used);
-	    position += ret;
-	    lu += ret;
-	}
-	while(lu < size && ret != 0);
-    }
-
-    return lu;
-}
-
-S_I zapette::inherited_write(char *a, size_t size)
-{
-    throw SRC_BUG; // zapette is read-only
-}
-
-void zapette::make_transfert(U_16 size, const infinint &offset, char *data, S_I & lu, infinint & arg)
-{
-    request req;
-    answer ans;
-
-	// building the request
-    req.serial_num = serial_counter++; // may loopback to 0
-    req.offset = offset;
-    req.size = size;
-    req.write(out);
-
-	// reading the answer
-    do
-    {
-	ans.read(in, data, size);
-	if(ans.serial_num != req.serial_num)
-	    user_interaction_pause("communication problem with peer, retry ?");    }
-    while(ans.serial_num != req.serial_num);
-
-	// argument affectation
-    switch(ans.type)
-    {
-    case ANSWER_TYPE_DATA:
-	lu = ans.size;
-	arg = 0;
-	break;
-    case ANSWER_TYPE_INFININT:
-	lu = 0;
-	arg = ans.arg;
-	break;
-    default:  // might be a transmission error do to weak transport layer
-	throw Erange("zapette::make_transfert", "incoherent answer from peer");
-    }
-    
-	// sanity checks
-    if(req.size == REQUEST_SIZE_SPECIAL_ORDER)
-    {
-	if(req.offset == REQUEST_OFFSET_END_TRANSMIT)
-	{
-	    if(ans.size != 0 && ans.type != ANSWER_TYPE_DATA)
-		user_interaction_warning("bad answer from peer, to connexion close");
-	}
-	else if(req.offset == REQUEST_OFFSET_GET_FILESIZE)
-	{
-	    if(ans.size != 0 && ans.type != ANSWER_TYPE_INFININT)
-		throw Erange("zapette::make_transfert", "incoherent answer from peer");
-	}
-	else
-	    throw Erange("zapette::make_transfert", "corrupted data read from pipe");
-    }
-}
Index: dar/zapette.hpp
===================================================================
--- dar.orig/zapette.hpp	2012-05-02 11:23:22.971875921 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,71 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002-2052 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-//
-
-#ifndef ZAPETTE_HPP
-#define ZAPETTE_HPP
-
-#pragma interface
-
-#include "generic_file.hpp"
-#include "integers.hpp"
-
-class zapette: public generic_file
-{
-public:
-
-    zapette(generic_file *input, generic_file *output);
-    ~zapette();
-
-	// inherited methods
-    bool skip(const infinint &pos);
-    bool skip_to_eof() { position = file_size; return true; };
-    bool skip_relative(S_I x);
-    infinint get_position() { return position; };
-
-protected:
-    S_I inherited_read(char *a, size_t size);
-    S_I inherited_write(char *a, size_t size);
-
-private:
-    generic_file *in, *out;
-    infinint position, file_size;
-    char serial_counter;
-
-    void make_transfert(U_16 size, const infinint &offset, char *data, S_I & lu, infinint & arg);
-};
-
-class slave_zapette
-{
-public:
-    slave_zapette(generic_file *input, generic_file *output, generic_file *data);
-    ~slave_zapette();
-
-    void action();
-    
-private:
-    generic_file *in, *out, *src;
-};
-
-#endif
Index: dar/dar-help.c
===================================================================
--- dar.orig/dar-help.c	2012-05-02 11:23:23.207876635 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,959 +0,0 @@
-/*********************************************************************/
-// dar - disk archive - a backup/restoration program
-// Copyright (C) 2002 Denis Corbin
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-// 
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-//
-// to contact the author : dar.linux@free.fr
-/*********************************************************************/
-// $Id$
-//
-/*********************************************************************/
-
-static char rcsid[] =
-  "$Id$";
-/*
- * Using libxml2 to format the DAR help text.
- *
- * Influenced by gjobsread.c, the libxml2 example.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-
-#include <syslog.h>
-
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-
-int verbose = 0;
-
-typedef enum { FALSE, TRUE } boolean;
-
-#define NO_INDENT 0
-/* The default values which can be overridden by the DTD
- *
- * These values are the column in which the flag, desc or continuation
- * line is to start.
- *
- * The continuation line for a desc starts in column
- *      (DESC_INDENT+CONT_INDENT-1).
- *
- *  The continuation line for a hdr (the only other one) starts in
- *  column CONT_INDENT.
- */
-#define FLAG_INDENT    9
-#define DESC_INDENT   17
-#define CONT_INDENT    3
-#define WORD_WRAP_COL 79
-
-static unsigned flag_indent, desc_indent, cont_indent, word_wrap_col;
-
-#define INIT_LGTH 1024
-char *line = NULL;
-    /* the allocated length of line at present */
-unsigned line_alloc = 0;
-    /* the next unused position in line (line[line_col]) */
-unsigned line_col;
-
-static xmlChar *
-xrealloc(xmlChar * buf, int *alloc, int request)
-{
-  buf = realloc(buf, request);
-  if (buf == NULL) {
-    fprintf(stderr, "xrealloc: can't extend from %d to %d bytes.\n",
-	    *alloc, request);
-    exit(1);
-  }
-  *alloc = request;
-  return buf;
-}
-
-static xmlChar *
-xmalloc(int request)
-{
-  xmlChar *buf = malloc(request);
-  if (buf == NULL) {
-    fprintf(stderr, "xmalloc: can't allocate %d bytes.\n", request);
-    exit(1);
-  }
-  return buf;
-}
-
-static xmlChar *
-xstrdup(xmlChar * s)
-{
-  xmlChar *str = strdup(s);
-  if (str == NULL) {
-    fprintf(stderr, "can't strdup str (length %d).\n", strlen(s));
-    exit(1);
-  }
-  return str;
-}
-
-static void
-xfree(xmlChar * s)
-{
-  if (s)
-    free(s);
-}
-
-static void
-init_line(void)
-{
-  if (line)
-    *line = '\0';
-
-  line_col = 0;
-}
-
-/*
- * From the glibc man page, in the standard C locale
- */
-#define WHITE_SPACE " \f\n\r\t\v"
-
-static void
-append_to_line_with_indent(const xmlChar * s, const char c, unsigned indent)
-{
-  static char *piece = NULL;
-  static unsigned piece_alloc = 0;
-  int i, indent_needed;
-  unsigned len;
-
-  if (s == NULL)
-    return;
-
-  len = strlen(s);
-
-  /* Allow for a possible character suffix ('<' or '[') */
-  if (len + 2 > piece_alloc)
-    piece = xrealloc(piece, &piece_alloc, len + 16);
-  strcpy(piece, s);
-
-  /* Remove leading spaces */
-  i = (int)strspn(piece, WHITE_SPACE);
-  memmove(piece, &piece[i], strlen(piece) - i + 1);
-
-  if (c) {
-    if (piece_alloc < strlen(piece) + 1 + 1)
-      piece = xrealloc(piece, &piece_alloc, strlen(piece) + 16);
-    memmove(&piece[1], piece, strlen(piece) + 1);
-    piece[0] = c;
-  }
-
-  /* Trim trailing space. */
-  while (isspace(piece[strlen(piece) - 1]))
-    piece[strlen(piece) - 1] = '\0';
-
-  if (verbose)
-    printf("append: trailing spaces removed:\n  '%s'\n", piece);
-
-  /* 
-   * indent is in columns, line_col is a char array index: 
-   *  indent=8 <=> line_col=7
-   */
-  if (line_col < indent - 1)	/* indentation needed */
-    indent_needed = (indent - 1) - line_col;
-  else
-    /* no more indentation, just a space separator */
-  if (line_col > 0 &&
-	!(isspace(line[line_col - 1]) || (line[line_col - 1] == '<')))
-    indent_needed = 1;
-  else
-    indent_needed = 0;
-
-  if (line_alloc < line_col + indent_needed + strlen(piece) + 1) {
-    line =
-      xrealloc(line, &line_alloc,
-	       line_col + indent_needed + strlen(piece) + 16);
-  }
-
-  for (i = 0; i < indent_needed; i++)
-    line[line_col++] = ' ';
-
-  strcpy(&line[line_col], piece);
-  line_col += strlen(piece);
-
-}
-
-static void
-append_to_line_asis(const xmlChar * s)
-{
-  if (line_alloc < line_col + strlen(s) + 1) {
-    line = xrealloc(line, &line_alloc, line_col + strlen(s) + 16);
-  }
-  strcpy(&line[line_col], s);
-  line_col += strlen(s);
-}
-
-/*
- * Remove leading, trailing and embedded white space.
- *
- * Leading and trailing white space (defined by isspace(c)) is removed
- * completely, the first and last character of the resulting string
- * will not be white space -- the string may, however, only contain
- * the zero byte terminator.
- *
- * The string WHITE_SPACE contains the list of characters isspace()
- * considers to be white space.
- *
- * Embedded white space other than the space character is, notionally,
- * replaced by the space character and then runs of spaces are reduced
- * to a single space.
- *
- * last_was_space  isspace(*p)  action
- *   true           true      character ignored
- *   true           false     last_was_space set false, character copied
- *   false          true      last_was_space set true, space character copied
- *   false          false     character copied
- *
- */
-static void
-remove_white_space(xmlChar * content)
-{
-  size_t initial_sp;
-  xmlChar *p, *q, *dup;
-  boolean last_was_space;
-
-  /* Trim trailing space. */
-  while (isspace(content[strlen(content) - 1]))
-    content[strlen(content) - 1] = '\0';
-
-  if (strlen(content) == 0)
-    return;
-
-  /* Trim leading space */
-  if ((initial_sp = strspn(content, WHITE_SPACE)))
-    memmove(content, content + initial_sp, strlen(content) - initial_sp + 1);
-
-  /* 
-   * Now go through the content removing embedded white space, replacing
-   * two or more spaces in sequence by a single space.
-   */
-  dup = p = xstrdup(content);
-  q = content;
-  last_was_space = FALSE;
-  for (; *p; p++) {
-    if (last_was_space) {
-      if (isspace(*p))
-	continue;
-      else {
-	last_was_space = FALSE;
-	*q++ = *p;
-      }
-    } else {
-      if (isspace(*p)) {
-	last_was_space = TRUE;
-	*q++ = ' ';
-      } else
-	*q++ = *p;
-    }
-  }
-  *q = '\0';
-  xfree(dup);
-}
-
-static void
-show_line(char *line)
-{
-  char *p = line;
-
-  fputs("  '", stdout);
-  while (*p) {
-    if (isprint(*p))
-      putc(*p, stdout);
-    else if (*p == '\n')
-      fputs("\\n", stdout);
-    else if (*p == '\t')
-      fputs("\\t", stdout);
-    else if (*p == ' ')
-      putc(' ', stdout);
-    else
-      fprintf(stdout, "\\%03o", *p);
-    p++;
-  }
-  fputs("'\n", stdout);
-}
-
-static void
-lineout(char *line)
-{
-  char *p = line;
-
-  fputs("\tui_printf(\"", stdout);
-  while (*p) {
-    if (isprint(*p))
-      putc(*p, stdout);
-    else if (*p == '\n')
-      fputs("\\n", stdout);
-    else if (*p == '\t')
-      fputs("\\t", stdout);
-    else if (*p == ' ')
-      putc(' ', stdout);
-    else
-      fprintf(stdout, "\\%03o", *p);
-    p++;
-  }
-  if (*(p - 1) != '\n')
-    fputs("\\n", stdout);
-  fputs("\");\n", stdout);
-}
-
-/*
- * Assume tab stops are set at 8 column intervals, that is, a tab
- * character appearing in the 8 columns preceding the tab stop will
- * move the cursor to the tab stop column.
- *
- * a picture...
- *
- * column          1         2         3
- * 	  123456789012345678901234567890...
- * 	          T       T      T...
- * 	  YYYYYYYNYYYYYYYNYYYYYYYN...
- * i      01234567890
- * 
- *
- * If there are no non-space characters (that is, c == ' ') between
- * the Y furthest away from T and T, replace all these space
- * characters by a tab character ('\t').
- *
- * Continue until the end of the string.
- * 
- */
-static char *
-spaces_to_tabs(char *line)
-{
-  char *p = line;
-  char *sqzd = xstrdup(line);
-  char *q;
-  unsigned i, j;
-  unsigned pending = 0;		/* just like unexpand... */
-
-  if (verbose > 1) {
-    printf("                1         2         3\n");
-    printf("      0123456789012345678901234567890\n");
-    printf("line: '%s'\n", line);
-  }
-  q = sqzd;
-  for (i = 1; *p; i++, p++) {
-    if (*p == '\n') {		/* a newline is a new line */
-      pending = 0;
-      i = 0;
-      *q++ = *p;
-      continue;
-    }
-    if ((i % 8) == 1) {
-      if (pending > 1)
-	*q++ = '\t';
-      else if (pending)
-	*q++ = ' ';
-      pending = 0;
-      *q = '\0';		/* for debugging printf */
-    }
-    if (*p == ' ')
-      pending++;
-    else {
-      if (pending)
-	for (j = 0; j < pending; j++)
-	  *q++ = ' ';
-      *q++ = *p;
-      pending = 0;
-      *q = '\0';		/* for debugging printf */
-    }
-  }
-  *q = '\0';
-  if (verbose > 1) {
-    printf("                1         2         3\n");
-    printf("      0123456789012345678901234567890\n");
-    printf("sqzd: '%s'\n", line);
-  }
-  return sqzd;
-
-}
-
-static void
-output_string(char *s)
-{
-  char line[128], *sqzd;
-  char *str;
-  char *tok;
-  size_t start, follow_on, indent;
-  boolean eol, end_line;
-
-  str = xstrdup(s);
-  if (verbose) {
-    printf("output_string: str \n");
-    show_line(str);
-  }
-
-  /*
-   * The only lines which may be broken with the second piece
-   * "following on" are <hdr> lines -- indented from the left margin
-   * by cont_indent -- and <desc> lines -- indented from the
-   * left margin by desc_indent + cont_indent.
-   *
-   * Since both desc_indent and cont_indent represent columns,
-   * the continuation indent for a <desc> is
-   * desc_indent+cont_indent-1.
-   */
-  follow_on = cont_indent;
-  /* it is assumed that hdr lines don't begin with space */
-  if (*str == ' ')
-    follow_on += desc_indent - 1;
-
-  if (verbose)
-    printf("output_string: follow_on %u, s:\n  '%s'\n", follow_on, s);
-
-  /*
-   * Find the first space after column desc_indent and start word
-   * wrapping from there.
-   */
-  start = strcspn(str + desc_indent, " ");
-  strncpy(line, str, desc_indent + start);
-  line[desc_indent + start] = '\0';
-  tok = strtok(str + desc_indent + start, " ");
-  while (tok) {
-    int lgth_reqd = strlen(tok);
-    if (line[strlen(line) - 1] != ' ')
-      lgth_reqd++;
-    eol = (strlen(tok) == 1) && (*tok == '\n');
-    if (eol)
-      indent = desc_indent;
-    else
-      indent = follow_on;
-    end_line = eol || (strlen(line) + lgth_reqd > word_wrap_col);
-    if (end_line) {
-      if (verbose)
-	printf("output_string (end_line): line:\n  '%s'\n", line);
-      sqzd = spaces_to_tabs(line);
-      lineout(sqzd);
-      xfree(sqzd);
-      /* so it starts in in column "indent" */
-      memset(line, ' ', indent - 1);
-      line[indent - 1] = '\0';
-    }
-    if (!eol) {
-      /* There may be a space there now, it doesn't matter */
-      if (line[strlen(line) - 1] != ' ')
-	strcat(line, " ");
-      strcat(line, tok);
-    }
-    tok = strtok(NULL, " ");
-  }
-
-  if (verbose)
-    printf("output_string (exit): line:\n  '%s'\n", line);
-  sqzd = spaces_to_tabs(line);
-  /*
-   * Is there anything in line to output?
-   *
-   * ...could a line of white space appear here?
-   */
-  if (strlen(sqzd)) {
-    lineout(sqzd);
-    xfree(sqzd);
-  }
-
-  xfree(str);
-}
-
-/*
- * Extract the content from the current element if it is a text
- * element otherwise from the child text element of the current element.
- */
-static xmlChar *
-get_text(xmlNodePtr cur)
-{
-  xmlChar *content, *trimmed;
-
-  if (!xmlStrcmp(cur->name, (const xmlChar *)"text"))
-    content = cur->content;
-  else if (cur->children &&
-	   !xmlStrcmp(cur->children->name, (const xmlChar *)"text"))
-    content = cur->children->content;
-  else {
-    xmlNodePtr n;
-    if (cur->children == NULL)
-      printf("get_text: no children\n");
-    else {
-      n = cur->children;
-      while (n) {
-	printf("get_text: %s\n", n->name);
-	n = n->next;
-      }
-    }
-    return NULL;
-  }
-  trimmed = xstrdup(content);
-  remove_white_space(trimmed);
-  return trimmed;
-}
-
-/*
-typedef xmlBuffer *xmlBufferPtr; struct xmlNode
-struct xmlNode {
-    void           *_private;/ * application data * /
-    xmlElementType   type;/ * type number, must be second ! * /
-    const xmlChar   *name;      / * the name of the node, or the entity * /
-    struct _xmlNode *children;/ * parent->childs link * /
-    struct _xmlNode *last;/ * last child link * /
-    struct _xmlNode *parent;/ * child->parent link * /
-    struct _xmlNode *next;/ * next sibling link  * /
-    struct _xmlNode *prev;/ * previous sibling link  * /
-    struct _xmlDoc  *doc;/ * the containing document * /
-     / * End of common part * /
-    xmlNs           *ns;        / * pointer to the associated namespace * /
-    xmlChar         *content;   / * the content * /
-    struct _xmlAttr *properties;/ * properties list * /
-    xmlNs           *nsDef;     / * namespace definitions on this node * /
-};
-
-*/
-
-static void
-vspace(char *name, char *s)
-{
-  char *tail;
-  int number = strtol(s, &tail, 0);
-  int i;
-  char *newlines;
-
-  if (*tail != '\0') {
-    fprintf(stderr, "vspace: error converting '%s', tail is '%s'.\n", s,
-	    tail);
-    return;
-  }
-
-  if (number <= 0) {
-    fprintf(stderr, "vspace: won't insert %d blank lines...\n", number);
-    return;
-  }
-
-  if (verbose)
-    fprintf(stderr, "vspace: inserting %d blank %s before %s.\n",
-	    number, number == 1 ? "line" : "lines", name);
-
-  newlines = xmalloc(number + 1);
-  for (i = 0; i < number; i++)
-    newlines[i] = '\n';
-  newlines[number] = '\0';
-  lineout(newlines);
-  xfree(newlines);
-}
-
-static void
-set_var(char *name, unsigned *var, char *value)
-{
-  char *tail;
-  int number = strtol(value, &tail, 0);
-
-  if (*tail != '\0') {
-    fprintf(stderr, "set_var (%s): error converting '%s', tail is '%s'.\n",
-	    name, value, tail);
-    return;
-  }
-
-  if (number <= 0) {
-    fprintf(stderr, "set_var: won't set %s to %d...\n", name, number);
-    return;
-  }
-
-  if (verbose == 0)
-    fprintf(stderr, "set_var: setting %s to %d.\n", name, number);
-
-  *var = number;
-}
-
-static void
-arg_handler(const xmlChar * name, xmlChar * content, int indent)
-{
-  xmlChar *str;
-
-  if (!xmlStrcmp(name, (const xmlChar *)"repl")) {
-    str = xmalloc(strlen(content) + 3);
-    strcpy(str, "<");
-    strcat(str, content);
-    strcat(str, ">");
-    append_to_line_with_indent(str, '\0', indent);
-    xfree(str);
-  } else if (!xmlStrcmp(name, (const xmlChar *)"p")) {
-    /*
-     * content is NULL, add space-newline-space to line so strtok in
-     * output_string will pick up the newline by itself.
-     */
-    append_to_line_asis(" \n ");
-  } else
-    append_to_line_with_indent(content, '\0', indent);
-}
-
-static void
-get_hdr_attr(xmlNodePtr cur)
-{
-  xmlChar *trimmed;
-  xmlAttr *attr;
-
-  attr = cur->properties;
-  while (attr) {
-    if (!xmlStrcmp(attr->name, (const xmlChar *)"vspace")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	vspace("hdr", trimmed);
-	xfree(trimmed);
-      }
-    }
-    attr = attr->next;
-  }
-}
-
-static void
-get_arg_attr(xmlNodePtr cur)
-{
-  xmlChar *content, *trimmed, *opt, *repl;
-  xmlAttr *attr;
-
-  attr = cur->properties;
-  opt = repl = NULL;
-  while (attr) {
-    if (!xmlStrcmp(attr->name, (const xmlChar *)"vspace")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	vspace("arg", trimmed);
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"flag")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	arg_handler(attr->name, trimmed, flag_indent);
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"opt")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	if (*trimmed) {
-	  opt = xmalloc(strlen(trimmed) + 1 + 2);
-	  strcpy(opt, "[");
-	  strcat(opt, trimmed);
-	  strcat(opt, "]");
-	}
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"repl")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	if (*trimmed) {
-	  repl = xmalloc(strlen(trimmed) + 1 + 2);
-	  strcpy(repl, "<");
-	  strcat(repl, trimmed);
-	  strcat(repl, ">");
-	}
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"text")) {
-      if (attr->children->content)
-	printf("get_attr: text node with content '%s'.\n",
-	       attr->children->content);
-    }
-    attr = attr->next;
-  }
-
-  if (opt || repl) {
-    unsigned lgth = 1;
-    if (opt)
-      lgth += strlen(opt);
-    if (repl)
-      lgth += strlen(repl);
-    content = xmalloc(lgth);
-    *content = '\0';
-    if (opt && *opt)
-      strcat(content, opt);
-    if (repl && *repl)
-      strcat(content, repl);
-    arg_handler(cur->name, content, flag_indent);
-    xfree(opt);
-    xfree(repl);
-    xfree(content);
-  }
-}
-
-static void
-display_line(const char *name)
-{
-  if (*line) {
-    if (verbose) {
-      printf("\nLine to output:\n");
-      show_line(line);
-    }
-    output_string(line);
-    init_line();
-  } else
-    fprintf(stdout, "At end tag %s: line is empty.\n", name);
-
-}
-
-static void
-desc_handler(xmlNodePtr cur)
-{
-  xmlChar *content;
-
-  /* get desc:text content */
-  content = get_text(cur);
-  arg_handler(cur->name, content, desc_indent);
-  xfree(content);
-
-  cur = cur->children;
-  cur = cur->next;
-
-  while (cur != NULL) {
-    if (!xmlStrcmp(cur->name, (const xmlChar *)"p")) {
-      /* no content expected */
-      if (cur->content) {
-	if (verbose)
-	  printf("desc_handler: <p> content is not NULL '%s'.\n",
-		 cur->content);
-	continue;
-      }
-      arg_handler(cur->name, NULL, desc_indent);
-    } else if (!xmlStrcmp(cur->name, (const xmlChar *)"repl")) {
-      content = get_text(cur);
-      arg_handler(cur->name, content, desc_indent);
-      xfree(content);
-    } else if (!xmlStrcmp(cur->name, (const xmlChar *)"opt")) {
-      content = get_text(cur);
-      arg_handler(cur->name, content, desc_indent);
-      xfree(content);
-    } else if (!xmlStrcmp(cur->name, (const xmlChar *)"text")) {
-      content = get_text(cur);
-      arg_handler(cur->name, content, desc_indent);
-      xfree(content);
-    } else {
-      content = get_text(cur);
-      arg_handler(cur->name, content, desc_indent);
-      xfree(content);
-    }
-    cur = cur->next;
-  }
-
-}
-
-static void
-indents_handler(xmlNodePtr cur)
-{
-  /*
-   * Set flag_indent, desc_indent, cont_indent and word_wrap if the
-   * corresponding attrtibutes are present.
-   */
-  xmlChar *trimmed;
-  xmlAttr *attr;
-
-  attr = cur->properties;
-  while (attr) {
-    if (!xmlStrcmp(attr->name, (const xmlChar *)"flag")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	set_var("flag_indent", &flag_indent, trimmed);
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"desc")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	set_var("desc_indent", &desc_indent, trimmed);
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"cont")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	set_var("cont_indent", &cont_indent, trimmed);
-	xfree(trimmed);
-      }
-    } else if (!xmlStrcmp(attr->name, (const xmlChar *)"wrap")) {
-      if (attr->children->content) {
-	trimmed = xstrdup(attr->children->content);
-	remove_white_space(trimmed);
-	set_var("word_wrap_col", &word_wrap_col, trimmed);
-	xfree(trimmed);
-      }
-    }
-    attr = attr->next;
-  }
-
-}
-
-static void
-hdr_handler(xmlNodePtr cur)
-{
-  xmlChar *content;
-
-  /* Only vspace, processed entirely in get_hdr_attr() */
-  get_hdr_attr(cur);
-
-  content = get_text(cur);
-  append_to_line_with_indent(content, '\0', NO_INDENT);
-  display_line("hdr");
-  xfree(content);
-}
-
-static void
-select_handler(xmlNodePtr cur)
-{
-  const xmlChar *top = cur->name;
-  xmlChar *content;
-
-  if (!xmlStrcmp(cur->name, (const xmlChar *)"indents"))
-    indents_handler(cur);
-  else if (!xmlStrcmp(cur->name, (const xmlChar *)"hdr"))
-    hdr_handler(cur);
-  else if (!xmlStrcmp(cur->name, (const xmlChar *)"arg")) {
-    /* get arg:attribute content -- this calls arg_handler directly */
-    get_arg_attr(cur);
-    /* get arg:text content */
-    content = get_text(cur);
-    arg_handler(cur->name, content, flag_indent);
-    xfree(content);
-
-    cur = cur->children;
-    cur = cur->next;
-
-    while (cur != NULL) {
-      if (!xmlStrcmp(cur->name, (const xmlChar *)"desc"))
-	desc_handler(cur);
-      else {
-	if (xmlIsBlankNode(cur)) {
-	  if (verbose)
-	    printf("select_handler (%s:%s): no content (xmlIsBlankNode(cur) "
-		   "is true)\n", top, cur->name);
-	} else {
-	  if (verbose)
-	    printf("select_handler (%s:%s): content '%s'\n",
-		   top, cur->name, cur->content);
-	}
-      }
-      cur = cur->next;
-    }
-    display_line("arg");
-  } else if (xmlIsBlankNode(cur)) {
-    if (verbose)
-      printf
-	("select_handler (%s): no content (xmlIsBlankNode(cur) is true)\n",
-	 top);
-  } else {
-    if (verbose)
-      printf("select_handler (%s): content '%s'\n", top, cur->content);
-  }
-}
-
-static void
-parse_xml(char *filename)
-{
-  xmlDocPtr doc;
-  xmlNodePtr cur;
-
-  /*
-   * build an XML tree from a the file;
-   */
-  doc = xmlParseFile(filename);
-  if (doc == NULL)
-    return;
-
-  /*
-   * Check the document is of the right kind
-   */
-
-  cur = xmlDocGetRootElement(doc);
-  if (cur == NULL) {
-    fprintf(stderr, "empty document\n");
-    xmlFreeDoc(doc);
-    return;
-  }
-
-  if (xmlStrcmp(cur->name, (const xmlChar *)"help")) {
-    fprintf(stderr, "document of the wrong type, root node != help");
-    xmlFreeDoc(doc);
-    return;
-  }
-
-  /*
-   * Now, walk the tree.
-   */
-  cur = cur->children;
-
-  if (cur == 0)
-    return;
-
-  while (cur != NULL) {
-    if (xmlIsBlankNode(cur)) {
-      if (verbose)
-	printf("parse_xml (%s): node is blank "
-	       "(xmlIsBlankNode(cur) true).\n", cur->name);
-    } else
-      select_handler(cur);
-
-    cur = cur->next;
-  }
-
-}
-
-int
-main(int argc, char **argv)
-{
-  char *fn;
-
-#ifdef MEMWATCH
-  mwInit();
-#endif
-
-  if (argc < 2)
-    fn = "dar.xml";
-  else
-    fn = argv[1];
-  fprintf(stderr, "%s: parsing XML in file %s.\n", argv[0], fn);
-
-  /*
-   * Initial settings, may be overridden by the DTD.
-   */
-  flag_indent = FLAG_INDENT;
-  desc_indent = DESC_INDENT;
-  cont_indent = CONT_INDENT;
-  word_wrap_col = WORD_WRAP_COL;
-
-  line = xrealloc(line, &line_alloc, INIT_LGTH);
-  line_col = 0;
-
-  parse_xml(fn);
-
-#ifdef MEMWATCH
-  mwTerm();
-#endif
-
-  return (0);
-}
-
-/*
-Local Variables:
-compile-command: "gcc -O2 -g -Wall -W -fexceptions -I/opt/include/libxml2 -L/opt/lib -lxml2 dar-help.c -o dar-help"
-End:
-*/
Index: dar/dar.1
===================================================================
--- dar.orig/dar.1	2012-05-02 11:23:23.435877875 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,402 +0,0 @@
-.TH DAR 1 "JAN 11, 2003"
-.UC 8
-.SH NAME
-dar \- disk archive
-.SH SYNOPSIS
-.B dar [-c | -x | -l | -d | -t | -C] [<path>/]<basename> [options] [list of paths]
-.P
-.B dar -h
-.P
-.B dar -V 
-.SH DESCRIPTION
-.B dar 
-is a full featured backup tool, aimed for disks (floppy, CD-R(W), DVD-R(W), zip, jazz, etc.)
-
-.PP
-.B dar
-can store a backup in several files (called "slices" in the following) of a given size, eventually pausing before starting the next slice. This can allow for example, the burning of the last generated slice on a CD-R, or changing a floppy disk before continuing on the next one. 
-Like its grand-brother, the great "tar" command, 
-.B dar
-may also use compression, at the difference that compression is used inside the archive to be able to have compressed slices of the defined size. But the most important feature of
-.B dar 
-is its ability to make differential backups. In other words, backups that contain only new files or files that have changed from a backup of reference. 
-Moreover with differential backup,
-.B dar
-also stores files that have been deleted since the backup of reference. Thus, when restoring, first a full backup, then additional differential backups, at each restoration you get the exact state of the filesystem at the time of the backup. And of course, the reference backup may be a full or a differential backup itself.
-.PP
-.B dar
-is the first backup program I know that can also remove files during restoration! By the way, in this document, "archive" and "backup" design the same thing, and are used interchangeably.
-.PP
-At the difference of the 
-.B tar
-command, 
-.B dar
-is not suited to directly use tapes. So keep using tar for tape archives. Because, even using tar to write a slice on a tape, you will loose all the interest of another feature of 
-.B dar
-which is its ability to directly access the data of saved file even when compression is used. This way and in contrast to the tar command, dar is able to extract a given file much faster from a backup and to also recover files that follow a data corruption (loosing just the file in which data corruption occurred).
-.PP
- This has of course its limitations, in particular when a data corruption occurs in the vital part of the backup, i.e. the few first bytes of each slice, and the last part of the archive (the catalogue).
-.PP
-Slices have a base name given on the command line, which is completed by a dot, a number, a dot and the extension (dar) to form a filename. On command line you will never have to give the full file name of a slice.
-.RS
-.TP 20
-Let's take an example :
-
-considering the base name "joe", dar will make one or several slices during backup. Theses are files with the names joe.1.dar joe.2.dar ... joe.10.dar ... etc.
-If you want to extract, list, or use these backup as reference, you will only have to use the base name which is the string "joe" here.
-.RE
-
-.SH OPTIONS
-
-.PP
-COMMANDS :
-.RS
-.TP 20
--c, --create [<path>/]<basename> 
-creates a backup with the name based on <basename>. All the slices will be created in the directory <path> if specified, else in the current directory. If the destination filesystem is too small to contain all the slices of the backup, the -p option (pausing before starting new slices) might be of interest. Else, in the case the filesystem is full, dar will suspend the operation, asking for the user to make free space, then continue its operation. To make free space, the only thing you cannot do is to touch the slice being written. If the filename is "-" *and* no slice is asked for (no -s) the archive is produced on the standard output.
-.TP 20
--x, --extract [<path>/]<basename>
-extracts files from the given backup. Slices are expected to be in the current directory or in the directory given by <path>. It is also possible to use symbolic links to gather slices that are not in the same directory. Path may also point to a removable device (floppy, CD, etc.), in this case, to be able to mount/unmount the device, you must not launch dar from that directory. In other words, the current directory must not be that directory (see tutorial for details).
-.TP 20
--l, --list [<path>/]<basename>
-lists the contents of the given backup. In general
-.B dar 
-will only require the first and the last slice of the archive.
-.TP 20
--t, --test [<path>/]<basename>
-checks the backup integrity. Even without compression, dar is able to detect at least one error by data file, thanks to a 16 bits CRC recorded in the catalogue. If one error occurred in file's data stored the archive, dar will report it in 100% of all cases. If two error occurred, dar will see them in 93,8% of all cases. If three error occurred, dar will see them in 100% of all cases. If four errors occurred, dar will see them in 90.6% of all cases, etc. 
-.TP 20
--d, --diff [<path>/]<basename>
-compares saved files in the backup with those in the filesystem.
-.TP 20
--C, --isolate [<path>/]<basename>
-isolate a catalogue from its archive. The argument is the basename of the file that will contain the catalogue. The -A option is mandatory here to give the name of the archive to extract the catalogue from. Slicing is available (-s -S -p -b etc.). If the filename is "-" *and* no slice is asked (no -s) the catalogue is produced on the standard output, allowing to send the resulting catalogue through a pipe. Note that there is no difference in concept between a catalogue and an archive. Thus you can do all operation on a catalogue, in particular take it as reference for a differential archive. A catalogue produced with -C is just like a differential archive done right after a full backup, (no data in it).
-.TP 20
--h, --help
-displays help usage.
-.TP 20
--V, --version
-displays version information.
-.PP
-.RE
-GENERAL OPTIONS:
-.RS
-.TP 20
--v, --verbose
-verbose output
-.TP 20
--b, --beep
-makes the terminal ring when user action is required (like for example the creation of a new slice using the -p option)
-.TP 20
--n, --no-overwrite
-do not allow overwriting of any file of slice.
-.TP 20
--w, --no-warn
-Do not warn before overwriting file or slice. By default (no -n and no -w) overwriting is allowed but a warning is issued before proceeding.
-.TP 20
--X, --exclude <mask>
-The mask is a string with wild cards (like * and ?) which is applied to filenames which are not directories. If a given file matches the mask, it is excluded from the operation. By default (no -X on the command line), no file is excluded from the operation. -X may be present several times on the command line, in that case a file will not be considered for the given operation if it matches at least one -Z mask.
-.TP 20
--I, --include <mask>
-The mask is applied to filenames which are not directories. If a given file matches the mask and does not match any mask given with -X, the file is selected for the operation. By default (no -I and no -X on the command line), all files are included for the operation. -I may be present several times on the command line, in that case all file that match one of the -I mask will be considered for the given operation, if they do not also match one of the -X mask. 
-.TP 20
--R, --fs-root <path>
-The path points to the directory tree containing all the files that will be enrolled in the operation (backup or restoration). By default the current directory is used. All other paths used in -P option or in the [list of paths] on the command line are and must be relative to this path (or to current directory if -R is not present).
-.TP 20
--P, --prune <path>
-Do not consider file or directory sub-tree given by the path. -P may be present several time on the command line. By default no sub-tree of file is excluded from the operation, and all the directory tree as indicated by -R is considered.
-.TP 20
-[list of paths]
-files or directory to only take in account, as opposed to -P. By default all files under the -R directory are considered. Else, if one or more file are given, just those are selected (if they do not match any -P option). All paths given this way must be relative to the -R directory. 
-.TP 20
--u, --no-user-EA
-Do not consider the Extended Attributes (EA) of the user namespace. By default, they are saved and restored, if the support for EA has been activated at compilation time. If not, this option is forced internally (you need not specify it).
-.TP 20
--U, --no-system-EA
-Do not consider the EA of the root (or system) namespace. By default, they are saved and restored, if the support for EA has been activated at compilation time. If not, this option is forced internally (you need not specify it).
-.P
-Note concerning Extended Attributes (EA): support for EA must be activated at compilation time, if your system supports it. Thus you can get two binaries of dar (of the same version), one supporting EA and another which does not (dar -V to see whether EA support is activated). The archives they produce are the same and can be read by each other. The only difference is that the binary without EA support is not able to save or restore EAs, but is still able to test them and list their presence.
-.TP 20
--i, --input <path>
-is available when reading from pipe (basename is "-" for -x, -l, -t, -d or for -A when -c or -C is used). When reading from pipe, standard input is used, but with this option, the file <path> (usually a named pipe) is used instead.  This option is to receive output from dar_slave program.
-.TP 20
--o, --output <path>
-iq available when reading from pipe (basename is "-" for -x, -l, -t, -d or for -A when -c or -C is used). When reading from pipe, standard output is used to send request to dar_slave, but with this option, the file <path> (usually a named pipe) is used instead. When standard output is used, all messages goes to standard error (not only interactive messages). 
-.TP 20 
--O, --ignore-owner
-Do not consider user ID (uid) or group ID (gid), when comparing with archive of reference (-c -A) while doing a differential backup, when extracting (-x) or when comparing (-d). This is useful when dar is used by a non-priviledged user. It will not consider a file has changed just because it has only the uid or gid changed, nor report a comparison mismatch if only
-uid or gid is different.
-.TP 20
--E, --execute <string>
-the string is a
-.B user command-line
-to be launched between slices. For reading (thus using -t, -d, -l or -x options), the command is executed before the slice is read or even asked, for writing, (thus using -c or -C option), the command is executed once the slice has been completed. Some substitution string can be used in the string:
-.RS
-.TP 10 
-%%
-will be replaced by %
-.TP 10
-%p
-will be replaced by the slice path
-.TP 10
-%b
-will be replaced by the slice basename
-.TP 10
-%n
-will be replaced by the slice number (to be read or just written). For reading, dar often needs the last slice, but initially it does not know its number. If it cannot be found in the current directory, the user command-line is then called with %n equal to 0 askin the user (via the user command-line to provide the last slice). If after it is still not present, dar asks the user (as usually) with a message on the terminal. Once the last slice is found, the user command-line is called a second time, with %n equal to the value of the last slice number.
-.RE
-.TP 20
--F, --execute-ref <string>
-same as -E but is applied between slices of the reference archive (-A option).
-.TP 20
--K, --key <string>
-scramble or unscramble the archive using <string> as pass phrase. A scrambled archive can only be read if the same pass phrase is given. OK, that's a very weak scheme, I don't even speak about encryption. So why this feature ? Because I needed it. Without any tool, it is really difficult for a human to crack the scramble (if the key is long enough and is not the repetition of a shorter sequence. For not very important data you it might be useful to avoid unexperimented people to have a look at you data.
-
-.TP 20
--J, --key-ref <string>
-same as -K but the given key is used to unscramble the archive of reference (given with -A option).
-.TP 20
--B, --batch <filename>
-You can put in the file any option or argument as used on command line, that will be parsed as if they were in place of the "-B <filename>" option. This way you can overcome the command line size limitation. Commands in the file may be disposed on several lines, and -B option can also be used inside files, leading a file to include other files. But an error occures in case of loop (a file includes itself) and DAR aborts immediately. Comments are now allowed, and must start by a hash `#' character on each line. Note that for a line to be considered as comment the hash caracter must be the first character of the line (space or tab can still preceed the hash). See
-.B Conditional Syntax
-bellow for a more rich syntax in configuration files.
-.TP 20
--N, --noconf
-Do not try to read neither ~/.darrc nor /etc/darrc configuration files. See
-.B files
-section bellow.
-
-.PP
-.RE
-SAVING AND ISOLATION OPTIONS (to use with -c or -C)
-.RS
-.PP
-.TP 20
--z, --gzip[level]
-compresses within slices using gzip algorithm (if not specified, no compression is performed). The compression level (an integer from 0 to 9) is optional. -z is equivalent to -z9 which is max compression/slow processing. At the oposit, 0 is equivalent to no compression, which is also the case when no -z and no -y is given on the command line.
-.TP 20
--y, --bzip2[level]
-compresses using bzip2 algorithm. See -z above for usage details.
-.TP 20
--s, --slice <number>
-Size of the slices in bytes. If the number is appended by k (or K), M, G, T, P E, Z or Y the size is in kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, zettabytes or yottabytes respectively. Example: "20M" means 20 megabytes it is the same as giving 20971520 as argument. If -s is not present the backup will be written to a single slice whatever the size of the backup may be (there is probably some filesystem limitation, thus you might expect problems for file size over 2 gigabytes, depending on your filesystem, but this is not a limitation of dar).
-.TP 20
--S, --first-slice <number>
--S gives the size of the first slice which may be chosen independently of the size of following slices. This option needs -s and by default, the size of the first slice is the same as the one of the following slices.
-.TP 20
--p, --pause 
-pauses before writing to a new slice (this requires -s). By default there is no pause, all slices are written in the same directory, up to the end of the backup or until the filesystem is full. In this later case, the user is informed of the lack of disk space and dar stops for user action. As soon as some disk space is available, the user can continue the backup.
-.TP 20
--A, --ref [<path>]/<basebame>
-specifies the archive to use as reference (mandatory with -C). By default no archive is used and all files are saved (in regards to -I -X -P and the "list of paths"). All slices of the reference backup are expected to be on the same directory given by <path> or the current directory by default. Usually only the first and the last slice are required to extract the catalogue of reference and the use of symbolic links is also possible here to gather slices that do not reside in the same directory. You can also point <path> to a floppy or any other mounted directory, because
-.B dar
-will pause and ask the user for required slices if they are not present.
-.TP 20
--D, --empty-dir
-When excluding directories either explicitly using -P option, or implicitly giving a [list of paths], 
-.B dar
-does not store anything about theses. But with -D option, dar stores them as empty directories. This can be useful, if excluding a mount point (like /proc or /dev/pts). At restoration time, dar will then recreate theses directories (if necessary). This option has no meaning with -C and is ignored in that case.
-.TP 20
--Z, --exclude-compression <mask>
-Filenames covered by this mask are not compressed. It is only useful with -z or -y. By default, all file are compressed (if compression is used). This option can be used several times, in that case a file that matches one of the -Z mask will not be compressed.
-.TP 20
--Y, --include-compression <mask>
-Filenames covered by this mask (and not covered by -Z) are the only to be compressed. It is only available with -z no -y. By default all files are compressed. This option can be used several times, in that case all files that match one of the -Y will be compressed, if they do not also match on of the -Z masks.
-.TP 20
--m, --mincompr <number>
-files which size is below this value will not be compressed. If -m is not specified it is equivalent to giving 
-.B -m 100 
-as argument. If you want to compress all file whatever their size is you thus need to type 
-.B -m 0
-on the command line. The same number extensions as those used with -s or -S are available here, if you want to specify the size in kilobyte, megabyte, gigabyte etc.
-.TP 20 
---nodump
-do not save files which have the 'd' flag set (see chattr(1) lsattr(1) ext2 commands). This option is available only if the dar binary has been compiled with the USE_NODUMP_FEATURE macro uncommented in the Makefile.
-.PP
-.PP
-.RE
-RESTORATION OPTIONS (to use with -x)
-.RS
-.TP 20
--k, --no-deleted
-Do not delete files that have been deleted since the backup of reference (file overwriting can still occur). By default, files that have been destroyed since the backup of reference are deleted during restoration, but a warning is issued before proceeding, except if -w is used. If -n is used, no file will be deleted (nor overwritten), thus -k is useless when using -n.
-.TP 20
--r, --recent
-restore only files that are absent or more recent than those present in filesystem. -r is useless if -n is present.
-.TP 20
--f, --flat
-do not restore directory structure. All file will be restored in the directory given to -R, if two files of the same name have to be restored, the usual scheme for warning (-w option) and overwriting (-n option) is used. No rename scheme is planned atually. When this option is set, dar does not remove files that have been stored as deleted since last backup. (-f implicitly implies -k).
-.RE
-.PP
-.RE
-TESTING AND DIFFERENCE OPTIONS (to use with -t or -d)
-.RS
-.PP
-No specific option, but all general options are available except -n and -w which are useless, as testing and comparing only read data.
-.PP
-.RE
-LISTING OPTIONS (to use with -l)
-.RS
-.PP
-.TP 20
- -T, --tar-format
-can be used to have a listing that displays the tree structure.
-.TP 20
--I and -X
-can be used to filter file to list base on their name. With -T the tree structure is not filtered unlike without -T. Note that -P and [list of path] is not available while listing.
-.P
-Else only -v and -b from general options are useful. Note that -v displays an archive summary first, where a lot of information about the archive can be obtained.
-.TP 10
-displayed 
-fields
-.RS
-.TP 10
-[data]
-possible values are [     ] or [Saved] or [InRef] . [     ] means that the data has not been saved because there is no change since backup of reference. [Saved] means that the data has been saved, and thus this archive is able to restore the file. [InRef] is used when isolating a catalogue from an archive, and means the file was saved in the reference archive.
-.TP 10
-[EA]
-possible values are " " (empty string) or [Saved] or [     ]. It Shows if Extended Attributes are present and saved ([Saved]), are present but not saved ([     ]) which means there is no change since backup of reference, or if there is no EA saved for this file (empty string).
-.TP 10
-[compr]
-possible values are [....%] or [-----] or [     ] or [worse]. Shows if the file has been compressed and the compression rate reached ([...%]), or if the file is stored without compression ([    ] see -Y and -Z options) or if the file is not subject to compression because it is not a saved regular file ([----]), or if the file takes more space compressed than its original size ([worse]), due to compression overhead.
-.TP 10
-permission
-see ls man page
-.TP 10
-user
-owner of the file
-.TP 10
-group
-group owner of the file
-.TP 10
-size
-size in byte of the file (if compression is enabled, the real size in the archive is "compression rate" time smaller).
-.TP 10
-date
-the last modification date of the file. The last access time is also saved and restored, but not displayed.
-.TP 10
-filename
-The name of the file.
-.RE
-
-.SH EXIT CODES
-.B dar
-exits with the following code:
-.TP 10
-0
-Operation successful.
-.TP 10
-1
-Syntax error on command-line.
-.TP 10
-2
-Error due to a hardware problem or a lack of memory.
-.TP 10
-3
-Detection of a condition that should never happen, and which is considered as a bug of the application.
-.TP 10
-4
-Code issued when the user has aborted the program upon dar question from dar. This also happens when dar is not run from a terminal (for example launched from crontab) and dar has a question to the user. In that case, dar aborts the same way as if the user pressed the escape key at the question prompt.
-.TP 10
-5
-is returned when an error concerning the treated data has been detected. While saving, this is the case when a file could not be opened or read. While restoring, it is the case when a file could not be created or replaced. While comparing, it is the case when a file in the archive does not match the one in the filesystem. While testing, it is the case when a file is corrupted in the archive.
-.TP 10
-6
-an error occured while executing user command (given with -E or -F option). Mainly because the creation of a new process is not possible (process table is full) or the user command returned an error code (exit status different of zero).
-
-.SH FILES
-.B $HOME/.darrc
-and
-.B /etc/darrc
-if present are read for configuration option. They share the same syntax as file given to -B option. If $HOME/.darrc is not present and only in that case, /etc/darrc is consulted. You can still launch /etc/darrc from .darrc using a statment like 
-.B -B /etc/darrc.
-None of theses file need to be present, but if they are they are parsed AFTER any option on the command line and AFTER included files from the command line (files given to the -B option). NOTE: if $HOME is not defined $HOME/.darrc default to /.darrc (at the root of the filesystem).
-
-Else you can see 
-.B conditional syntax
-bellow, and -N option above that leads dar to ignore the /etc/darrc and $HOME/.darrc files.
-
-.SH CONDITIONAL SYNTAX
-configuration files (-B option, $HOME/.darrc and /etc/darrc) usually contain a simple list of command-line arguments, split or not over several lines, and eventually mixed with comments (see -B option for more). But, you can also use make-like targets to ask for a particular set of commands to be used in certain conditions. 
-
-A condition takes the form of reserved word immediately followed by a colon ':'. This word + colon must stand alone on its line, eventually with spaces or tabs beside it. The available conditions are:
-.TP 20
-extract:
-all option listed after this condition get used if previously on command line or file the -x option has been used
-.TP 20
-create:
-all option listed after this condition get used if previously on command line or file (-B option) the -c option has been used
-.TP 20
-list:
-if -l option has been used
-.TP 20
-test:
-if -t option has been used
-.TP 20
-diff:
-if -d option has been used
-.TP 20
-isolate:
-if -C option has been used
-.TP 20
-all:
-in any case
-.TP 20
-default:
-if no -c, -d, -x, -t, -C or -l has been used at this point of the parsing.
-.P
-The condition stops when the next condition starts, or at End of File. The commands inserted before any condition are equivalent to those inserted after the "all:" condition. Remark : -c -d -x -t -C and -l are mutual exclusive, only one of them can be used while calling dar.
-.P 
-Here is an example of conditional syntax
-.RS
-.P
-create:
-  # upon creation exclude the
-.br
-  # following files from compression
-.br
--Z "*.mp3" -Z "*.mpg"
-.P
-all:
-.br
--b
-.br
--p
-.P
-default:
-.br
-# this will get read if not
-.br
-# command has been set yet
-.br
--V 
-.br
-# thus by default dar shows its version
-.P
-all:
-.br
--v
-.br
-# for any command we also ask to be verbose
-.br
-# this is added to the previous all: condition
-.RE 
-.P
-Last point, you may have several time the same condition (several
-.B all:
-) for example. They will be concatenated together.
-
-.SH SEE ALSO
-dar_xform(1), dar_slave(1), dar_manager(1)
-
-.SH KNOWN BUGS
-dar cannot restore time of symbolic links. Many (all ?) UNIX do not provide any way to do that, the utime() system call changes the file pointed to by the link rather than the date of the link itself.
-.P
-dar saves and restores atime and mtime, but cannot restore ctime (last inode change), there does not seems to be a standard call to do that under UNIX.
-
-.SH AUTHOR
-.nf
-http://dar.linux.free.fr/
-Denis Corbin (dar.linux@free.fr)
-France
-Europe
Index: dar/dar.rpm.spec
===================================================================
--- dar.orig/dar.rpm.spec	2012-05-02 11:23:23.027876033 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-summary: DAR - Disk ARchive
-Name: dar
-Version: 1.2.1
-Release: 3
-Copyright: GPL
-Icon: dar.gif
-Group: Applications/Archiving
-Source: http://dar.linux.free.fr/dar-1.2.1.tar.gz
-URL: http://dar.linux.free.fr/
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: zlib-devel >= 1.1.3, gcc-c++
-
-%description
-DAR is a command line tool to backup a directory tree and files. DAR is
-able to make differential backups, split them over a set of disks or files
-of a given size, use compression, filter files or subtrees to be saved or 
-not saved, directly access and restore given files. DAR is also able
-to handle extented attributes, and can make remote backups through an
-ssh session for example. Finally, DAR handles save and restore of hard
-and symbolic links.
-
-%prep
-%setup
-
-%clean 
-make clean
-rm -rf %{buildroot}
- 
-%build
-%ifarch alpha
-make OPTIMIZATION="%{optflags} -O0" FILEOFFSET=yes
-%else
-make OPTIMIZATION="%{optflags} -O"
-%endif
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/usr
-make INSTALL_ROOT_DIR=%{buildroot}/usr MAN_DIR=share/man INSTALL=install install
-
-%post
-
-%files
-%defattr(-,root,root,-)
-/usr/bin/dar
-/usr/bin/dar_slave
-/usr/bin/dar_xform
-/usr/bin/dar_manager
-/usr/bin/dar_static
-/usr/share/man/man1/dar.1
-/usr/share/man/man1/dar_slave.1
-/usr/share/man/man1/dar_xform.1
-/usr/share/man/man1/dar_manager.1
-%doc README TUTORIAL CHANGES LICENSE BUGS INSTALL TODO NOTES RESUME THANKS
-
-%changelog
-
-* Thu Jan  9 2003 Denis Corbin <dar.linux@free.fr>
-- removed the OS_BITS flag, which is no more necessary 
-- added dar_static in %files
-
-* Thu Nov  7 2002 Axel Kohlmeyer <axel.kohlmeyer@theochem.ruhr-uni-bochum.de>
-- modified the spec file to comply with standard redhat rpms
-- allow building of rpm as non-root user
-- add build dependency on zlib and c++
-- handle x86/alpha arch from specfile.
-
-* Thu Jun 27 2002 Denis Corbin
-
-  - see file named "CHANGES"
Index: dar/dar.usage
===================================================================
--- dar.orig/dar.usage	2012-05-02 11:23:23.043875300 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,99 +0,0 @@
-	ui_printf("\n");
-	ui_printf("Commands are:\n");
-	ui_printf("   -c  creates an archive\n");
-	ui_printf("   -x  extracts files from the archive\n");
-	ui_printf("   -d  compares the archive with the existing filesystem\n");
-	ui_printf("   -t  tests the archive integrity\n");
-	ui_printf("   -l  lists the contents of the archive\n");
-	ui_printf("   -C  isolates the catalogue from an archive\n");
-	ui_printf("\n");
-	ui_printf("   -h  displays this help information\n");
-	ui_printf("   -V  displays version information\n");
-	ui_printf("\n");
-	ui_printf("Common options:\n");
-	ui_printf("   -v\t\t   verbose output\n");
-	ui_printf("   -R <path>\t   filesystem root directory for saving or restoring (current\n");
-	ui_printf("\t\t   dir by default)\n");
-	ui_printf("   -X <mask>\t   files to exclude from the operation (none by default)\n");
-	ui_printf("   -I <mask>\t   files to include in the operation (all by default)\n");
-	ui_printf("\t\t   -X and -I do not affect directories (see -P and the path\n");
-	ui_printf("\t\t   list for that)\n");
-	ui_printf("\t\t   -X, -I and -P may appear more than once on the command line\n");
-	ui_printf("   -P <path>\t   subdirectory of the filesystem root (-R) to exclude from the\n");
-	ui_printf("\t\t   operation\n");
-	ui_printf("   -n\t\t   don't overwrite files\n");
-	ui_printf("   -w\t\t   don't warn before overwriting files\n");
-	ui_printf("\t\t   by default overwriting is allowed but a warning is issued\n");
-	ui_printf("\t\t   first\n");
-	ui_printf("   -b\t\t   ring the terminal bell when user action is required\n");
-	ui_printf("   -O\t\t   do not consider user and group ownership\n");
-	ui_printf("   -E <string>\t   command line to execute between slices\n");
-	ui_printf("   -F <string>\t   command line to execute between the slices of the archive of\n");
-	ui_printf("\t\t   reference\n");
-	ui_printf("\n");
-	ui_printf("   -u\t\t   do not save/restore EA of the user namespace.\n");
-	ui_printf("   -U\t\t   do not save/restore EA of the root namespace (needs root\n");
-	ui_printf("\t\t   privileges).\n");
-	ui_printf("\t\t   -U and -u are only available if EA_SUPPORT has been set at\n");
-	ui_printf("\t\t   compilation time. Check with -V to know compilation option\n");
-	ui_printf("\t\t   used.\n");
-	ui_printf("   -K <string>\t   use the <string> to scramble/unscramble (i.e.: hide/decode)\n");
-	ui_printf("\t\t   the contents of the archive.\n");
-	ui_printf("   -J <string>\t   same as -K but it does concern the archive of reference\n");
-	ui_printf("\t\t   (given with -A option)\n");
-	ui_printf("   -B <filename>   read options from given file\n");
-	ui_printf("   -N\t\t   do not read ~/.darrc nor /etc/darrc configuration file\n");
-	ui_printf("\n");
-	ui_printf("   [path list]\t   subdirectories of the filesystem root (-R) to consider (all\n");
-	ui_printf("\t\t   by default) -- see also -P\n");
-	ui_printf("\n");
-	ui_printf("Saving or Isolation options (to use with -c or -C) :\n");
-	ui_printf("   -A [path/]<basename> archive to take as reference (mandatory with -C)\n");
-	ui_printf("   -z [level]\t   compress data in archive using gzip algorithm. The optionnal\n");
-	ui_printf("\t\t   argument is the gzip compression to use: it ranges from 0\n");
-	ui_printf("\t\t   (no compression, fast processing) to 9 (max compression,\n");
-	ui_printf("\t\t   slow processing). Note: there is no space ! Example: -z6\n");
-	ui_printf("   -y [level]\t   compress data in archive using bzip2 algorithm.\n");
-	ui_printf("\t\t   by default the archive is not compressed\n");
-	ui_printf("   -s <integer>    split the archive in several files of size <integer>\n");
-	ui_printf("   -S <integer>    first file size (if different from following ones) --\n");
-	ui_printf("\t\t   requires -s\n");
-	ui_printf("   -p\t\t   pauses before writing to a new file -- requires -s\n");
-	ui_printf("   -D\t\t   stores directories excluded by the -P option or absent from\n");
-	ui_printf("\t\t   <path list> as empty directories\n");
-	ui_printf("   -Z <mask>\t   Filenames covered by this <mask> are not compressed. By\n");
-	ui_printf("\t\t   default all files are compressed (if compression is used)\n");
-	ui_printf("   -Y <mask>\t   Filenames covered by this <mask> and not covered by -Z\n");
-	ui_printf("\t\t   <mask> are the only to be compressed. By default all files\n");
-	ui_printf("\t\t   are compressed.\n");
-	ui_printf("   -m <number>\t   file size under which data is not compressed. By default -m\n");
-	ui_printf("\t\t   100 is assumed. If you want all file to be compressed\n");
-	ui_printf("\t\t   whatever their size is use -m 0\n");
-	ui_printf("   --nodump\t   do not consider for backup file with nodump 'd' flag set\n");
-	ui_printf("\t\t   (see lsattr/chattr).\n");
-	ui_printf("\n");
-	ui_printf("Restoring options (to use with -x) :\n");
-	ui_printf("   -k\t\t   do not remove files marked as destroyed since the reference\n");
-	ui_printf("\t\t   backup (see also -A)\n");
-	ui_printf("\t\t   -k has no effect when used with -n\n");
-	ui_printf("   -r\t\t   restores files only if they are absent or more recent than\n");
-	ui_printf("\t\t   those on the filesystem\n");
-	ui_printf("   -f\t\t   do not restore directory structure. All files get restored\n");
-	ui_printf("\t\t   in the directory specified by -R\n");
-	ui_printf("\n");
-	ui_printf("Reading options (to use with -x, -d, -t, -l, -C, -c)\n");
-	ui_printf("   -i <named pipe> use the given pipe instead of standard input to read data\n");
-	ui_printf("\t\t   from dar_slave\n");
-	ui_printf("   -o <named pipe> use the given pipe instead of standard output to send orders\n");
-	ui_printf("\t\t   to dar_slave.\n");
-	ui_printf("\t\t   These two options are only available if the basename of the\n");
-	ui_printf("\t\t   archive to read is -, which means reading the archive from a\n");
-	ui_printf("\t\t   pipe. For -C and -c options the archive to read is the one\n");
-	ui_printf("\t\t   given with -A option: the archive of reference\n");
-	ui_printf("\n");
-	ui_printf("Listing options (to use with -l):\n");
-	ui_printf("   -T\t\t   tree output format. This was the default format used before\n");
-	ui_printf("\t\t   version 1.2.0\n");
-	ui_printf("\n\n");
-	ui_printf("See man page for more details, not all common options are available for each\n");
-	ui_printf(" mode of operation.\n");
Index: dar/dar.xml
===================================================================
--- dar.orig/dar.xml	2012-05-02 11:23:22.983876370 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,359 +0,0 @@
-<?xml  version="1.0"  standalone="yes"?>
-<!DOCTYPE help [
-<!ELEMENT help (indents | hdr | arg )*>
-<!ELEMENT indents EMPTY>
-<!ATTLIST indents
-  flag CDATA #IMPLIED
-  desc CDATA #IMPLIED
-  cont CDATA #IMPLIED
-  wrap CDATA #IMPLIED>
-<!ELEMENT hdr (#PCDATA)>
-<!ATTLIST hdr
-  vspace CDATA #IMPLIED>
-<!ELEMENT arg (desc)>
-<!ATTLIST arg 
-  vspace CDATA #IMPLIED
-  flag 	 CDATA #IMPLIED
-  opt  	 CDATA #IMPLIED
-  repl 	 CDATA #IMPLIED>
-<!ELEMENT desc (#PCDATA | p | repl)*>
-<!ELEMENT repl (#PCDATA)>
-<!ELEMENT p EMPTY>
-]>
-<help>
-
-  <indents flag="4" desc="8" cont="1" wrap="79"/>
-
-  <hdr vspace="1">Commands are:</hdr>
-
-  <arg flag="-c">
-    <desc>
-      creates an archive
-    </desc>
-  </arg>
-
-  <arg flag=" -x">
-    <desc>
-      extracts files from the archive
-    </desc>
-  </arg>
-
-  <arg flag="-d">
-    <desc>
-      compares the archive with the existing filesystem
-    </desc>
-  </arg>
-
-  <arg flag="-t">
-    <desc>
-      tests the archive integrity
-    </desc>
-  </arg>
-
-  <arg flag="-l">
-    <desc>
-      lists the contents of the archive
-    </desc>
-  </arg>
-
-  <arg flag="-C">
-    <desc>
-      isolates the catalogue from an archive
-    </desc>
-  </arg>
-
-  <arg vspace="1" flag="-h">
-    <desc>
-      displays this help information
-    </desc>
-  </arg>
-
-  <arg flag="-V">
-    <desc>
-      displays version information
-    </desc>
-  </arg>
-
-  <indents desc="20"/>
-
-  <hdr vspace="1">Common options:</hdr>
-
-  <arg flag="-v"> <desc> verbose output </desc> </arg>
-
-  <arg flag="-R" repl="path">
-    <desc>
-      filesystem root directory for saving or restoring (current dir by
-      default) 
-    </desc>
-  </arg>
-
-  <arg flag="-X" repl=" mask ">
-    <desc>
-      files to exclude from the operation (none by default)
-    </desc>
-  </arg>
-
-  <arg flag="-I" repl="mask">
-    <desc>
-      files to include in the operation (all by default)
-      <p/>
-      -X and -I do not affect directories (see -P and the path list for
-      that)
-      <p/>
-      -X, -I and -P may appear more than once on the command line
-    </desc>
-  </arg>
-
-  <arg flag="-P" repl="path">
-    <desc>
-       subdirectory of the filesystem root (-R) to exclude from the
-       operation
-    </desc>
-  </arg>
-
-  <arg flag="-n">
-    <desc>
-      don't overwrite files
-    </desc>
-  </arg>
-
-  <arg flag="-w">
-    <desc>
-       don't warn before overwriting files
-       <p/> 
-       by default overwriting is allowed but a warning is issued first
-    </desc>
-  </arg>
-
-  <arg flag="-b">
-    <desc>
-       ring the terminal bell when user action is required
-    </desc>
-  </arg>
-
-  <arg flag="-O">
-    <desc>
-       do not consider user and group ownership
-    </desc>
-  </arg>
-
-  <arg flag="-E" repl="string">
-    <desc>
-       command line to execute between slices
-    </desc>
-  </arg>
-
-  <arg flag="-F" repl="string">
-    <desc>
-       command line to execute between the slices of the archive of reference
-    </desc>
-  </arg>
-
-  <arg vspace="1" flag="-u">
-    <desc>
-      do not save/restore EA of the user namespace. 
-    </desc>
-  </arg>
-
-  <arg flag="-U">
-    <desc>
-      do not save/restore EA of the root namespace
-      (needs root privileges).
-      <p/>
-      -U and -u are only available if EA_SUPPORT has been set at compilation time.
-      Check with -V to know compilation option used.
-    </desc>
-  </arg>
-
-  <arg flag="-K" repl="string">
-    <desc>
-       use the <repl>string</repl> to scramble/unscramble (i.e.: hide/decode) the contents of the archive. 
-    </desc>   
-  </arg>
-
-  <arg flag="-J" repl="string">
-    <desc>
-       same as -K but it does concern the archive of reference (given with -A option)
-    </desc>
-  </arg>
-
-  <arg flag="-B" repl="filename">
-    <desc>
-       read options from given file
-    </desc>
-  </arg>
-
-  <arg flag="-N">
-    <desc>
-        do not read ~/.darrc nor /etc/darrc configuration file
-    </desc>
-  </arg>
-
-  <arg vspace="1" opt="path list">
-    <desc>
-      subdirectories of the filesystem root (-R) to consider (all by
-      default) -- see also -P
-    </desc>
-  </arg>
-
-  <hdr vspace="1">
-    Saving or Isolation options (to use with -c or -C) :
-  </hdr>
-
-  <arg flag="-A" opt="path/" repl="basename">
-    <desc> archive to take as reference (mandatory with -C)
-    </desc>
-  </arg>
-
-  <arg flag="-z" opt="level">
-    <desc>
-      compress data in archive using gzip algorithm. The optionnal argument is the gzip 
-      compression to use: it ranges from 0 (no compression, fast processing) to 9 
-      (max compression, slow processing). Note: there is no space ! Example: -z6 
-    </desc>
-  </arg>
-
-  <arg flag="-y" opt="level">
-    <desc>
-      compress data in archive using bzip2 algorithm.
-      <p/> by default the archive is not compressed
-    </desc>
-  </arg>
-
-  <arg flag="-s" repl="integer">
-    <desc>
-      split the archive in several files of size <repl>integer</repl>
-    </desc>
-  </arg>
-
-  <arg flag="-S" repl="integer">
-    <desc>
-      first file size (if different from following ones) -- requires -s
-    </desc>
-  </arg>
-
-  <arg flag="-p">
-    <desc>
-      pauses before writing to a new file -- requires -s
-    </desc>
-  </arg>
-
-  <arg flag="-D">
-    <desc>
-      stores directories excluded by the -P option or absent 
-      from <repl>path list</repl> as empty directories
-    </desc>
-  </arg>
-
-  <arg flag="-Z" repl="mask">
-    <desc>
-      Filenames covered by this <repl>mask</repl> are not compressed. By default all 
-      files are compressed (if compression is used)
-    </desc>  
-  </arg>
-
-  <arg flag="-Y" repl="mask">
-    <desc>
-       Filenames covered by this <repl>mask</repl> and not covered by -Z <repl>mask</repl>
-       are the only to be compressed. By default all files are compressed.
-    </desc>
-  </arg>
-
-  <arg flag="-m" repl="number">
-    <desc>
-       file size under which data is not compressed. By default -m 100 is 
-       assumed. If you want all file to be compressed whatever their size is 
-       use -m 0
-    </desc>
-  </arg>
-
-  <arg flag="--nodump">
-    <desc>
-    do not consider for backup file with nodump 'd' flag set (see lsattr/chattr).
-    </desc>
-  </arg>
-
-
-  <hdr vspace="1">
-  Restoring options (to use with -x) :
-  </hdr>
-
-  <arg flag="-k">
-    <desc>
-      do not remove files marked as destroyed since the reference backup
-      (see also -A)
-      <p/>
-      -k has no effect when used with -n
-    </desc>
-  </arg>
-
-  <arg flag="-r">
-    <desc>
-      restores files only if they are absent or more recent than those on
-      the filesystem
-    </desc>
-  </arg>
-
-  <arg flag="-f">
-    <desc>
-      do not restore directory structure. All files get restored in the 
-      directory specified by -R
-    </desc>
-  </arg>
-
-  <hdr vspace="1">
-    Reading options (to use with -x, -d, -t, -l, -C, -c)
-  </hdr>
-
-  <arg flag="-i" repl="named pipe">
-    <desc>
-      use the given pipe instead of standard input to read data from dar_slave 
-    </desc>
-  </arg>
-
-  <arg flag="-o" repl="named pipe">
-    <desc>
-      use the given pipe instead of standard output to send orders to dar_slave. 
-      <p/>
-      These two options are only 
-      available if the
-      basename of the archive to read is -, which means reading the
-      archive from a pipe. For -C and -c options the archive to read 
-      is the one given with -A option: the archive of reference
-    </desc>
-  </arg>
-
-  <hdr vspace="1">
-    Listing options (to use with -l):
-  </hdr>
-
-  <arg flag="-T">
-    <desc>
-        tree output format. This was the default format used before version 1.2.0
-    </desc>
-  </arg>
-
-
-  <hdr vspace="2">
-    See man page for more details, not all common options are available
-    for each mode of operation.
-  </hdr>
-
-<!--
-$Id$
-
-Revision 1.3  2002/08/20 13:44:08  cs1cwm
-Added DTD and removed the #ifdef and #endif.
-
-It now passes xmllint validation.
-
-Revision 1.2  2002/08/17 13:41:48  cs1cwm
-Changed to use arg flag, opt and repl attributes.
-
-Some changes to text.
-
-Revision 1.1  2002/08/17 13:13:31  cs1cwm
-Initial revision
-
--->
-</help>
Index: dar/dar_manager.1
===================================================================
--- dar.orig/dar_manager.1	2012-05-02 11:23:23.319875356 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,144 +0,0 @@
-.TH DAR_MANAGER 1 "SEPT 13, 2002"
-.UC 8
-.SH NAME
-dar_manager \- disk archive manager
-.SH SYNOPSIS
-.B dar_manager -C [<path>/]<database>
-.P
-.B dar_manager -B [<path>/]<database> -A [<path>/]<basename> [[<path>/]<archive_basename>]
-.P
-.B dar_manager -B [<path>/]<database> -l
-.P
-.B dar_manager -B [<path>/]<database> -D <number>
-.P
-.B dar_manager -B [<path>/]<database> -b <number> <new_archive_basename>
-.P
-.B dar_manager -B [<path>/]<database> -p <number> <path>
-.P
-.B dar_manager -B [<path>/]<database> -o [list of options to pass to dar]
-.P
-.B dar_manager -B [<path>/]<database> -d [<path to dar command>]
-.P
-.B dar_manager -B [<path>/]<database> -r [list of files to restore]
-.P
-.B dar_manager -B [<path>/]<database> -u <number>
-.P
-.B dar_manager -B [<path>/]<database> -f file
-.P 
-.B dar_manager -B [<path>/]<database> -s 
-.P
-.B dar_manager -B [<path>/]<database> -m <number> <number>
-.P
-.B dar_manager -h
-.P
-.B dar_manager -V
-.P
-.SH DESCRIPTION
-.B dar_manager 
-is part of the Disk Archive suite. Its purpose is to simplify the restoration of a few files over many backup, full or differential. This is achieved by gathering the catalogue of each archive (this has to be done once). At any time you just have to give the relative path to the files you want to restore, dar_manager will call dar with proper options and restore the last version of each file.
-.PP
-you can restore any file by hand without
-.B dar_manager
-, but if you make a lot of differential backup, you may spend many time to find the archive that contains the last version of your file, as dar will not save it if it has not changed since previous backup.
-.B 
-dar_manager
-simplify the process by looking in its internal database, built from archive "catalogues". 
-.RE
-.SH OPTIONS
-.RS
-.TP 20
--C, --create [<path>/]<database>
-creates an empty database that will collect informations about several archives. The <database> is a filename that is required for -B option. To destroy a <database> just remove the file.
-.TP 20
--B, --base [<path>/]<database>
-specify the database to read or modify. The <database> file must exist, and have a database structure (see -C option).
-.TP 20
--A, --add [<path>/]<basename> [<archive_basename>] 
-add an archive to the database. An isolated catalogue can also be used only if it has been produced by dar version 1.2.0 or above. Why ? Because, an isolated catalogue produced by older version will always tell that no files are saved in the archive of reference, in that case the solution is to provide the archive itself as argument. An optional second argument is the basename of the archive if it is different from the first argument (need for extraction of files). For example you could have an isolated catalogue in first argument and the basename of the original archive (where is stored the data) as second argument. By default, 
-.B dar_manager
-will look for an archive of reference in the command line used to create each archive, but in some cases, it may be necessary to specify the archive name (for example if you've changed its name).
-.TP 20
--l, --list
-displays the informations about the archives compiled in the database. In particular, a number is given to each archive, which is required to some other option to design a particular archive within the database. Nothing avoids you to feed the database with several archive of the same basename ! You will just have to guess which one is asked under this name. :-)
-.TP 20
--D, --delete <number> 
-removes an archive from the database. The number of the archive is given by the -l option. Note that all archive number greater than the one to be delete will be decremented by one. This keeps the order of the archive, in regards to time they have been added (-A option) to the database.
-.TP 20
--b, --base <number> <new_archive_basename>
-this option allows you to rename the archive basename (used when restoring files from it)
-.TP 20
--p, --path <number> <path>
-this option allows you to change the location of a given archive (used when restoring files from it)
-.TP 20
--o, --options [list of option to pass to dar]
-Specify the option to use when calling dar. Each call erases the previous setting. Possible 
-.B dar
-options are all the available ones except "-x"  and simple arguments (the [list of path]) which will be added by 
-.B dar_manager
-itself.
-.TP 20
--d, --dar [<path>]
-Set the path to dar. If no argument is given, dar is expected to be located in the PATH
-.TP 20
--r, --restore [ist of files to restore]
-.B dar_manager
-will restore all (an only) the given files, asking for the proper archive only. Last version of each file over several archive is based on the modification time of the inode, thus if you have a more recent backup that contains an old version of a given file, a older archive could be used to restore the file, if its last modification time (mtime) is more recent. 
-Note that files listed after -r option, must never have an absolute path. They will be restored under the directory specified with -R option of dar (thus using -o option), or by default, in subdirectories of the current directory.
-.TP 20
--u, --used [<number>]
-list the files that the given archive owns as last version available. Thus when no file is listed, the given archive is no more useful in database, and can be removed safely (-D option). If <number> is omitted, all available file are listed.
-.TP 20
--f, --file <file>
-displays in which archive the given file is saved, and what are the modification date (mtime) and change date (ctime).
-.TP 20
--s, --stats
-show the number of most recent files by archive. This helps to determine which archive can be safely removed from the database.
-.TP 20
--m, --move <number> <number>
-changes the ordrer of archives in the database. The first number is the number of the archive to move, while the second is the place where it must be shifted.
-
-Archvie order is important only in the case a file to be restored has EA that has been saved in an archive and data saved in another archive. This takes place when making a differential backup for file that have no change in data but changes in EA. In that case, the database must be feeded (-A option) with archive in the order they have been created. If 
-.B dar_manager
-detects such a desorder, it issues a warning is giving the name of the file that could not be restored properly (only EA have not been restored with the last version). Note that, if you don't use EA the ordrer of archives in the database has no importance. 
-.TP 20
--h, --help
-display help usage
-.TP 20
--V, --version
-display software version
-.RE
-.SH EXIT CODES
-.B dar_manager
-exits with the following code:
-.TP 10
-0
-Operation successful.
-.TP 10
-1
-Syntax error on command-line.
-.TP 10
-2
-Error due to a hardware problem or a lack of memory.
-.TP 10
-3
-Detection of a condition that should never happen, and which is considered as a bug of the application.
-.TP 10
-11 and above
-.B dar
-has exited with non zero status. Substract 10 to this exit code to get dar's exit code.
-
-.SH SEE ALSO
-dar(1), dar_xform(1), dar_slave(1)
-
-.SH LIMITATIONS
-at most 65534 archives can be compiled in a given database, which should be enought for most users.
-
-.SH KNOWN BUGS
-none actually
-
-.SH AUTHOR
-.nf
-http://dar.linux.free.fr/
-Denis Corbin (dar.linux@free.fr)
-France
-Europe
Index: dar/dar_manager.usage
===================================================================
--- dar.orig/dar_manager.usage	2012-05-02 11:23:23.427876415 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,25 +0,0 @@
-	ui_printf("\n");
-	ui_printf("options:\n");
-	ui_printf("   -C <database>   creates an empty database\n");
-	ui_printf("   -B <database>   specify the database to use (read or modify)\n");
-	ui_printf("   -A <archive>    add an archive to the database\n");
-	ui_printf("   -l\t\t   give informations about the archive compiled in the database\n");
-	ui_printf("   -D <number>\t   delete an archive from the database (use -l to get archive\n");
-	ui_printf("\t\t   numbers)\n");
-	ui_printf("   -b <number>\t   change the basename to use for the give archive number\n");
-	ui_printf("   -p <number>\t   change the path to use for the given archive number\n");
-	ui_printf("   -o <options>    specify a list of option to always pass to dar\n");
-	ui_printf("   -d <dar's path> specify the path to dar (else dar must be located in a\n");
-	ui_printf("\t\t   directory covered by the PATH variable)\n");
-	ui_printf("   -r <files>\t   restores the given files\n");
-	ui_printf("   -u <number>\t   list the most recent files contained in the given archive\n");
-	ui_printf("   -f <file>\t   list the archives where is saved the data and/or EA of that\n");
-	ui_printf("\t\t   file\n");
-	ui_printf("   -s\t\t   shows the number of most recent file by archive\n");
-	ui_printf("   -m <number>\t   change an archive position within a given database. First\n");
-	ui_printf("\t\t   <number> is the archive to move, second <number> is where to\n");
-	ui_printf("\t\t   move it.\n");
-	ui_printf("   -h\t\t   displays this help information\n");
-	ui_printf("   -V\t\t   displays software version\n");
-	ui_printf("\n");
-	ui_printf("See man page for more details.\n");
Index: dar/dar_manager.xml
===================================================================
--- dar.orig/dar_manager.xml	2012-05-02 11:23:23.415875611 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,146 +0,0 @@
-<?xml  version="1.0"  standalone="yes"?>
-<!DOCTYPE help [
-<!ELEMENT help (indents | hdr | arg )*>
-<!ELEMENT indents EMPTY>
-<!ATTLIST indents
-  flag CDATA #IMPLIED
-  desc CDATA #IMPLIED
-  cont CDATA #IMPLIED
-  wrap CDATA #IMPLIED>
-<!ELEMENT hdr (#PCDATA)>
-<!ATTLIST hdr
-  vspace CDATA #IMPLIED>
-<!ELEMENT arg (desc)>
-<!ATTLIST arg 
-  vspace CDATA #IMPLIED
-  flag 	 CDATA #IMPLIED
-  opt  	 CDATA #IMPLIED
-  repl 	 CDATA #IMPLIED>
-<!ELEMENT desc (#PCDATA | p | repl)*>
-<!ELEMENT repl (#PCDATA)>
-<!ELEMENT p EMPTY>
-]>
-<help>
-
-  <indents flag="4" desc="20" cont="1" wrap="79"/>
-
-  <hdr vspace="1">options:</hdr>
-
-  <arg flag="-C" repl="database">
-    <desc>
-        creates an empty database
-    </desc>
-  </arg>
-
-  <arg flag="-B" repl="database">
-    <desc>
-        specify the database to use (read or modify)
-    </desc>
-  </arg>
-
-  <arg flag="-A" repl="archive">
-    <desc>
-        add an archive to the database
-    </desc>
-  </arg>
-
-  <arg flag="-l">
-    <desc>
-        give informations about the archive compiled in the database
-    </desc>
-  </arg>
-
-  <arg flag="-D" repl="number">
-    <desc>
-        delete an archive from the database (use -l to get archive numbers)
-    </desc>
-  </arg>
-
-  <arg flag="-b" repl="number">
-    <desc>
-        change the basename to use for the give archive number
-    </desc>
-  </arg>
-
-  <arg flag="-p" repl="number">
-    <desc>
-        change the path to use for the given archive number
-    </desc>
-  </arg>
-
-  <arg flag="-o" repl="options">
-    <desc>
-        specify a list of option to always pass to dar
-    </desc>
-  </arg>
-
-  <arg flag="-d" repl="dar's path">
-    <desc>
-       specify the path to dar (else dar must be located in a directory covered by the PATH variable)   
-    </desc>
-  </arg>
-
-  <arg flag="-r" repl="files">
-    <desc>
-       restores the given files
-    </desc>
-  </arg>
-
-  <arg flag="-u" repl="number">
-    <desc>
-        list the most recent files contained in the given archive
-    </desc>
-  </arg>
-
-  <arg flag="-f" repl="file">
-    <desc>
-        list the archives where is saved the data and/or EA of that file
-    </desc>
-  </arg>
-
-  <arg flag="-s">
-    <desc>
-        shows the number of most recent file by archive
-    </desc>
-  </arg>
-
-  <arg flag="-m" repl="number">
-    <desc>
-        change an archive position within a given database. First <repl>number</repl> 
-        is the archive to move, second <repl>number</repl> is where to move it.
-    </desc>
-  </arg>
-
-  <arg flag="-h">
-    <desc>
-        displays this help information
-    </desc>
-  </arg>
-
-  <arg flag="-V">
-    <desc>
-        displays software version
-    </desc>
-  </arg>
-
-   <hdr vspace="1">
-    See man page for more details.
-  </hdr>
-<!--
-$id:$
-
-Revision 1.3  2002/08/20 13:44:08  cs1cwm
-Added DTD and removed the #ifdef and #endif.
-
-It now passes xmllint validation.
-
-Revision 1.2  2002/08/17 13:41:48  cs1cwm
-Changed to use arg flag, opt and repl attributes.
-
-Some changes to text.
-
-Revision 1.1  2002/08/17 13:13:31  cs1cwm
-Initial revision
-
--->
-</help>
Index: dar/dar_slave.1
===================================================================
--- dar.orig/dar_slave.1	2012-05-02 11:23:23.219877666 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,60 +0,0 @@
-.TH DAR_SLAVE 1 "SEPT 28, 2002"
-.UC 8
-.SH NAME
-dar_slave \- disk archive slave
-.SH SYNOPSIS
-.B dar_slave [options] [<path>/]source
-.P
-.B dar_slave -h
-.P
-.B dar_slave -V
-.SH DESCRIPTION
-.B dar_slave  
-reads an archive and listens for 
-.B dar
-orders on standard input, sending asked parts of the archive on standard output.
-.PP
-Source is the basename of the archive to read. By default, 
-.B dar_slave 
-uses standard input and output to communicate with a
-.B dar
-process, which may be running on the local host or on a remote host. It is possible to change the behaviour of
-.B dar_slave
-to use named pipe instead of standard input and output
-
-.SH OPTIONS
-
-.PP
-.TP 20
--h
-Displays help usage.
-.TP 20
--V 
-Displays version information.
-.TP 20
--i <filename> 
-reads the orders from the named file instead of standard input. In most cases the filename will be a named pipe.
-.TP 20
--o <filename>
-sends the data to the named file <filename> instead of standard output. In most cases the filename will be a named pipe.
-.TP 20
--E <string>
-string is a command to be launched between slices. See dar(1) man page (same option) for more informations.
-
-.SH EXIT CODES
-.B dar_slaves 
-exists with the same codes as dar does, see dar(1) man page.
-
-.SH SEE ALSO
-dar(1), dar_xform(1), dar_manager(1)
-
-.SH KNOWN BUGS
-None actually.
-
-.SH AUTHOR
-.nf
-http://dar.linux.free.fr/
-Denis Corbin (dar.linux@free.fr)
-France
-Europe
-
Index: dar/dar_slave.usage
===================================================================
--- dar.orig/dar_slave.usage	2012-05-02 11:23:23.275876175 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,9 +0,0 @@
-	ui_printf("\n");
-	ui_printf("options:\n");
-	ui_printf("   -i <named pipe> use the given pipe instead of standard input to read orders\n");
-	ui_printf("\t\t   from dar\n");
-	ui_printf("   -o <named pipe> use the given pipe instead of standard output to write data\n");
-	ui_printf("\t\t   to dar\n");
-	ui_printf("   -E <string>\t   command line to execute between slices of the archive\n");
-	ui_printf("\n");
-	ui_printf("See man page for more details.\n");
Index: dar/dar_slave.xml
===================================================================
--- dar.orig/dar_slave.xml	2012-05-02 11:23:23.371876484 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,67 +0,0 @@
-<?xml  version="1.0"  standalone="yes"?>
-<!DOCTYPE help [
-<!ELEMENT help (indents | hdr | arg )*>
-<!ELEMENT indents EMPTY>
-<!ATTLIST indents
-  flag CDATA #IMPLIED
-  desc CDATA #IMPLIED
-  cont CDATA #IMPLIED
-  wrap CDATA #IMPLIED>
-<!ELEMENT hdr (#PCDATA)>
-<!ATTLIST hdr
-  vspace CDATA #IMPLIED>
-<!ELEMENT arg (desc)>
-<!ATTLIST arg 
-  vspace CDATA #IMPLIED
-  flag 	 CDATA #IMPLIED
-  opt  	 CDATA #IMPLIED
-  repl 	 CDATA #IMPLIED>
-<!ELEMENT desc (#PCDATA | p | repl)*>
-<!ELEMENT repl (#PCDATA)>
-<!ELEMENT p EMPTY>
-]>
-<help>
-
-  <indents flag="4" desc="20" cont="1" wrap="79"/>
-
-  <hdr vspace="1">options:</hdr>
-
-  <arg flag="-i" repl="named pipe">
-    <desc>
-      use the given pipe instead of standard input to read orders from dar 
-    </desc>
-  </arg>
-
-  <arg flag="-o" repl="named pipe">
-    <desc>
-      use the given pipe instead of standard output to write data to dar 
-    </desc>
-  </arg>
-
-  <arg flag="-E" repl="string">
-    <desc>
-       command line to execute between slices of the archive
-    </desc>
-  </arg>
-
-   <hdr vspace="1">
-    See man page for more details.
-  </hdr>
-<!--
-$Id$
-
-Revision 1.3  2002/08/20 13:44:08  cs1cwm
-Added DTD and removed the #ifdef and #endif.
-
-It now passes xmllint validation.
-
-Revision 1.2  2002/08/17 13:41:48  cs1cwm
-Changed to use arg flag, opt and repl attributes.
-
-Some changes to text.
-
-Revision 1.1  2002/08/17 13:13:31  cs1cwm
-Initial revision
-
--->
-</help>
Index: dar/dar_xform.1
===================================================================
--- dar.orig/dar_xform.1	2012-05-02 11:23:23.307876557 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-.TH DAR_XFORM 1 "SEPT 28, 2002"
-.UC 8
-.SH NAME
-dar_xform \- disk archive "re-slicer"
-.SH SYNOPSIS
-.B dar_xform [options] [<path>/]source [<path>/]destination
-.P
-.B dar_xform -h
-.P
-.B dar_xform -V
-.SH DESCRIPTION
-.B dar_xform  
-changes the size of slices of an existing archive.
-.PP
-Source is the basename of the existing archive, destination is the basename of the archive to be created. If source basename is "-", the archive is read from standard input. If the destination basename is "-", the archive is written to standard output and -s option is not available.
-
-.SH OPTIONS
-
-.PP
-.TP 20
--h
-displays help usage.
-.TP 20
--V 
-displays version information.
-.TP 20
--b 
-make the terminal ring when user interaction is required (like for example the creation of a new slice when using the -p option)
-.TP 20
--s <number>
-Size of the slices in bytes. If the number is followed by k (or K), M, G, T or P the size is in kilobytes, megabytes, gigabytes, terabytes or petabytes respectively. Example: "20M" means 20 megabytes it is the same as giving 20971520 as argument. If -s is not present the backup will be written to a single slice whatever the size of the backup may be (there is probably some filesystem limitation, thus you might expect problems with file size over 2 gigabytes, depending on your filesystem).
-.TP 20
--S <number>
--S gives the size of the first slice which may be chosen independently of the size of following slices. This option needs -s and by default, the size of the first slice is the same as the one of the following slices.
-.TP 20
--p 
-pauses before writing to a new slice (this requires -s). By default there is no pause, all slices are output in the same directory, up to the end of the backup or until the filesystem is full. In this later case, the user is informed of the lack of disk space and dar stops for user interaction. As soon as some disk space is available, the user can continue the backup.
-.TP 20
--n
-Do not allow overwriting of any slice.
-.TP 20
--w
-Do not warn before overwriting slice. By default (no -n and no -w) overwriting is allowed but a warning is issued before proceeding.
-.TP 20
--E <string>
-the string is a command-line to be launched between the slices of the destination archive. See dar(1) man page (same option) for more informations.
-.TP
--F <string>
-the string is a command-line to be launched between the slices of the source archive. See dar(1) man page (same option) for more informations.
-
-.SH NOTES
-Dar is not concerned by scrambling. It does not need to be aware of it to be able to change the slice scheme. Thus, it is not able to scramble a clear archive or unscramble an already scrambled archive.
-
-.SH EXIT CODES
-
-.B dar_xform
-uses the same exit status as dar does, see dar(1) man page.
-
-.SH SEE ALSO
-dar(1), dar_slave(1), dar_manager(1)
-
-.SH KNOWN BUGS
-None actually.
-
-.SH AUTHOR
-.nf
-http://dar.linux.free.fr/
-Denis Corbin (dar.linux@free.fr)
-France
-Europe
Index: dar/dar_xform.usage
===================================================================
--- dar.orig/dar_xform.usage	2012-05-02 11:23:23.227877599 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,22 +0,0 @@
-	ui_printf("\n");
-	ui_printf("\t\t   the first non options argument is the name of the archive to\n");
-	ui_printf("\t\t   read while the second non option argument is the name of the\n");
-	ui_printf("\t\t   new archive to create. Both are mandatory.\n");
-	ui_printf("\n");
-	ui_printf("options:\n");
-	ui_printf("   -h\t\t   displays this help information\n");
-	ui_printf("   -V\t\t   displays version information\n");
-	ui_printf("   -s <integer>    split the archive in several files of size <integer>\n");
-	ui_printf("   -S <integer>    first file size (if different from following ones) --\n");
-	ui_printf("\t\t   requires -s\n");
-	ui_printf("   -p\t\t   pauses before writing to a new file -- requires -s\n");
-	ui_printf("   -n\t\t   don't overwrite files\n");
-	ui_printf("   -w\t\t   don't warn before overwriting files\n");
-	ui_printf("\t\t   by default overwriting is allowed but a warning is issued\n");
-	ui_printf("\t\t   first\n");
-	ui_printf("   -b\t\t   ring the terminal bell when user action is required\n");
-	ui_printf("   -E <string>\t   command line to execute between slices of destination\n");
-	ui_printf("\t\t   archive\n");
-	ui_printf("   -F <string>\t   command line to execute between slice of source archive\n");
-	ui_printf("\n");
-	ui_printf("See man page for more details.\n");
Index: dar/dar_xform.xml
===================================================================
--- dar.orig/dar_xform.xml	2012-05-02 11:23:23.039876125 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,118 +0,0 @@
-<?xml  version="1.0"  standalone="yes"?>
-<!DOCTYPE help [
-<!ELEMENT help (indents | hdr | arg )*>
-<!ELEMENT indents EMPTY>
-<!ATTLIST indents
-  flag CDATA #IMPLIED
-  desc CDATA #IMPLIED
-  cont CDATA #IMPLIED
-  wrap CDATA #IMPLIED>
-<!ELEMENT hdr (#PCDATA)>
-<!ATTLIST hdr
-  vspace CDATA #IMPLIED>
-<!ELEMENT arg (desc)>
-<!ATTLIST arg 
-  vspace CDATA #IMPLIED
-  flag 	 CDATA #IMPLIED
-  opt  	 CDATA #IMPLIED
-  repl 	 CDATA #IMPLIED>
-<!ELEMENT desc (#PCDATA | p | repl)*>
-<!ELEMENT repl (#PCDATA)>
-<!ELEMENT p EMPTY>
-]>
-<help>
-
-  <indents flag="4" desc="20" cont="1" wrap="79"/>
-
-  <arg vspace="1" flag=" ">
-    <desc>
-        the first non options argument is the name of the archive to read while the
-	second non option argument is the name of the new archive to create. Both are mandatory.
-    </desc>
-  </arg>
-
-  <hdr vspace="1">options:</hdr>
-
-  <arg flag="-h">
-    <desc>
-      displays this help information
-    </desc>
-  </arg>
-
-  <arg flag="-V">
-    <desc>
-      displays version information
-    </desc>
-  </arg>
-
-  <arg flag="-s" repl="integer">
-    <desc>
-      split the archive in several files of size <repl>integer</repl>
-    </desc>
-  </arg>
-
-  <arg flag="-S" repl="integer">
-    <desc>
-      first file size (if different from following ones) -- requires -s
-    </desc>
-  </arg>
-
-  <arg flag="-p">
-    <desc>
-      pauses before writing to a new file -- requires -s
-    </desc>
-  </arg>
-
-  <arg flag="-n">
-    <desc>
-      don't overwrite files
-    </desc>
-  </arg>
-
-  <arg flag="-w">
-    <desc>
-       don't warn before overwriting files
-       <p/> 
-       by default overwriting is allowed but a warning is issued first
-    </desc>
-  </arg>
-
-  <arg flag="-b">
-    <desc>
-       ring the terminal bell when user action is required
-    </desc>
-  </arg>
-
-  <arg flag="-E" repl="string">
-    <desc>
-       command line to execute between slices of destination archive
-    </desc>
-  </arg>
-
-  <arg flag="-F" repl="string">
-    <desc>
-       command line to execute between slice of source archive
-    </desc>
-  </arg>
-
-  <hdr vspace="1">
-    See man page for more details.
-  </hdr>
-<!--
-$Id$
-
-Revision 1.3  2002/08/20 13:44:08  cs1cwm
-Added DTD and removed the #ifdef and #endif.
-
-It now passes xmllint validation.
-
-Revision 1.2  2002/08/17 13:41:48  cs1cwm
-Changed to use arg flag, opt and repl attributes.
-
-Some changes to text.
-
-Revision 1.1  2002/08/17 13:13:31  cs1cwm
-Initial revision
-
--->
-</help>
Index: dar/LICENSING_EXCEPTION_FOR_OPENSSL
===================================================================
--- dar.orig/LICENSING_EXCEPTION_FOR_OPENSSL	2012-05-02 11:24:02.151876327 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-DELETED
Index: dar/cygwin_adapt.hpp
===================================================================
--- dar.orig/cygwin_adapt.hpp	2012-05-02 11:24:02.159876224 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-DELETED
Index: dar/dar-help
===================================================================
--- dar.orig/dar-help	2012-05-02 11:24:02.167876411 +1000
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-DELETED
