/* * tardy - a tar post-processor * Copyright (C) 1998, 1999, 2002 Peter Miller; * All rights reserved. * * 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, USA. * * MANIFEST: functions to manipulate tar output lists */ #include #include tar_output_list::~tar_output_list() { delete fp; } tar_output_list::tar_output_list(tar_output *arg) : fp(arg) { } void tar_output_list::write_data(const void *buffer, int buflen) { fp->write_data(buffer, buflen); } void tar_output_list::write_data_padding() { fp->write_data_padding(); } void tar_output_list::write_header(const tar_header &h) { rcstring name = h.name; if (h.type == tar_header::type_directory) name += "/"; fprintf ( stderr, "%04lo %3ld %3ld %5ld %s\n", h.mode, h.user_id, h.group_id, h.size, name.to_c_string() ); fp->write_header(h); } void tar_output_list::write_header_padding() { fp->write_header_padding(); } const char * tar_output_list::filename() const { return fp->filename(); } tar_output_list::tar_output_list() { fatal("bug %s %d", __FILE__, __LINE__); } tar_output_list::tar_output_list(const tar_output_list &) { fatal("bug %s %d", __FILE__, __LINE__); } tar_output_list & tar_output_list::operator = (const tar_output_list &) { fatal("bug %s %d", __FILE__, __LINE__); return *this; }