]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/cpio/src/defer.c
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / cpio / src / defer.c
1 /* defer.c - handle "defered" links in newc and crc archives
2    Copyright (C) 1993,2003,2004 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2, or (at your option)
7    any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License along
15    with this program; if not, write to the Free Software Foundation, Inc.,
16    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
17
18 #include <system.h>
19
20 #include <stdio.h>
21 #include <sys/types.h>
22 #include "cpiohdr.h"
23 #include "extern.h"
24 #include "defer.h"
25
26 struct deferment *
27 create_deferment (struct new_cpio_header *file_hdr)
28 {
29   struct deferment *d;
30   d = (struct deferment *) xmalloc (sizeof (struct deferment) );
31   d->header = *file_hdr;
32   d->header.c_name = (char *) xmalloc (strlen (file_hdr->c_name) + 1);
33   strcpy (d->header.c_name, file_hdr->c_name);
34   return d;
35 }
36
37 void
38 free_deferment (struct deferment *d)
39 {
40   free (d->header.c_name);
41   free (d);
42 }