diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-02-27 13:28:40 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2004-02-27 13:28:40 +0000 |
commit | a783e2c18c6b566b2f4c2b06e6c388a9645c826c (patch) | |
tree | ae12abc157dee99bd4c67bab25316be06d3519a2 /src | |
parent | cb721df9888a296af824a4acab4916694d6dc35d (diff) | |
download | cpio-a783e2c18c6b566b2f4c2b06e6c388a9645c826c.tar.gz cpio-a783e2c18c6b566b2f4c2b06e6c388a9645c826c.tar.bz2 |
Added to the repository
Diffstat (limited to 'src')
-rw-r--r-- | src/.cvsignore | 11 | ||||
-rw-r--r-- | src/Makefile.am | 81 | ||||
-rw-r--r-- | src/alloca.c | 495 | ||||
-rw-r--r-- | src/argmatch.c | 87 | ||||
-rw-r--r-- | src/bcopy.c | 19 | ||||
-rw-r--r-- | src/copyin.c | 1605 | ||||
-rw-r--r-- | src/copyout.c | 827 | ||||
-rw-r--r-- | src/copypass.c | 482 | ||||
-rw-r--r-- | src/cpio.h | 69 | ||||
-rw-r--r-- | src/cpiohdr.h | 90 | ||||
-rw-r--r-- | src/defer.c | 46 | ||||
-rw-r--r-- | src/defer.h | 25 | ||||
-rw-r--r-- | src/dirname.c | 70 | ||||
-rw-r--r-- | src/dstring.c | 118 | ||||
-rw-r--r-- | src/dstring.h | 49 | ||||
-rw-r--r-- | src/error.c | 109 | ||||
-rw-r--r-- | src/extern.h | 198 | ||||
-rw-r--r-- | src/filemode.c | 255 | ||||
-rw-r--r-- | src/filetypes.h | 84 | ||||
-rw-r--r-- | src/fnmatch.c | 200 | ||||
-rw-r--r-- | src/fnmatch.h | 67 | ||||
-rw-r--r-- | src/getopt.c | 765 | ||||
-rw-r--r-- | src/getopt.h | 129 | ||||
-rw-r--r-- | src/getopt1.c | 180 | ||||
-rw-r--r-- | src/gettext.h | 68 | ||||
-rw-r--r-- | src/global.c | 204 | ||||
-rw-r--r-- | src/idcache.c | 210 | ||||
-rw-r--r-- | src/main.c | 550 | ||||
-rw-r--r-- | src/makepath.c | 311 | ||||
-rw-r--r-- | src/mkdir.c | 100 | ||||
-rw-r--r-- | src/mt.c | 366 | ||||
-rw-r--r-- | src/rmt.c | 473 | ||||
-rw-r--r-- | src/rmt.h | 98 | ||||
-rw-r--r-- | src/rtapelib.c | 601 | ||||
-rw-r--r-- | src/safe-stat.h | 1 | ||||
-rw-r--r-- | src/strdup.c | 43 | ||||
-rw-r--r-- | src/strerror.c | 63 | ||||
-rw-r--r-- | src/stripslash.c | 43 | ||||
-rw-r--r-- | src/system.h | 146 | ||||
-rw-r--r-- | src/tar.c | 528 | ||||
-rw-r--r-- | src/tar.h | 112 | ||||
-rw-r--r-- | src/tarhdr.h | 62 | ||||
-rw-r--r-- | src/userspec.c | 265 | ||||
-rw-r--r-- | src/util.c | 1376 | ||||
-rw-r--r-- | src/xmalloc.c | 103 | ||||
-rw-r--r-- | src/xstrdup.c | 36 |
46 files changed, 11820 insertions, 0 deletions
diff --git a/src/.cvsignore b/src/.cvsignore new file mode 100644 index 0000000..729dc3f --- /dev/null +++ b/src/.cvsignore | |||
@@ -0,0 +1,11 @@ | |||
1 | Makefile.in | ||
2 | Makefile | ||
3 | .deps | ||
4 | .libs | ||
5 | cpio | ||
6 | mt | ||
7 | rmt | ||
8 | .gdbinit | ||
9 | *.tar.gz | ||
10 | *.tar.bz2 | ||
11 | localedir.h | ||
diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..1e5da40 --- /dev/null +++ b/src/Makefile.am | |||
@@ -0,0 +1,81 @@ | |||
1 | # This file is part of GNU cpio | ||
2 | # Copyright (C) 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 | bin_PROGRAMS=cpio @CPIO_MT_PROG@ | ||
19 | libexec_PROGRAMS=@CPIO_RMT_PROG@ | ||
20 | EXTRA_PROGRAMS=mt rmt | ||
21 | |||
22 | cpio_SOURCES = \ | ||
23 | copyin.c\ | ||
24 | copyout.c\ | ||
25 | copypass.c\ | ||
26 | defer.c\ | ||
27 | dstring.c\ | ||
28 | global.c\ | ||
29 | main.c\ | ||
30 | tar.c\ | ||
31 | util.c\ | ||
32 | error.c\ | ||
33 | filemode.c\ | ||
34 | dirname.c\ | ||
35 | idcache.c\ | ||
36 | makepath.c\ | ||
37 | xmalloc.c\ | ||
38 | stripslash.c\ | ||
39 | userspec.c\ | ||
40 | xstrdup.c | ||
41 | |||
42 | noinst_HEADERS =\ | ||
43 | cpio.h\ | ||
44 | cpiohdr.h\ | ||
45 | tar.h\ | ||
46 | tarhdr.h\ | ||
47 | defer.h\ | ||
48 | dstring.h\ | ||
49 | extern.h\ | ||
50 | filetypes.h\ | ||
51 | gettext.h\ | ||
52 | system.h\ | ||
53 | rmt.h\ | ||
54 | safe-stat.h\ | ||
55 | fnmatch.h\ | ||
56 | getopt.h | ||
57 | |||
58 | cpio_LDADD = @LIBOBJS@ | ||
59 | |||
60 | mt_SOURCES = \ | ||
61 | mt.c argmatch.c | ||
62 | mt_LDADD = @LIBOBJS@ | ||
63 | |||
64 | rmt_SOURCES = rmt.c | ||
65 | rmt_LDADD = @LIBOBJS@ | ||
66 | |||
67 | EXTRA_DIST=\ | ||
68 | getopt.c\ | ||
69 | getopt1.c\ | ||
70 | bcopy.c\ | ||
71 | fnmatch.c\ | ||
72 | mkdir.c\ | ||
73 | strdup.c | ||
74 | |||
75 | localedir = $(datadir)/locale | ||
76 | |||
77 | DISTCLEANFILES = localedir.h | ||
78 | localedir.h : Makefile | ||
79 | echo '#define LOCALEDIR "$(localedir)"' >$@ | ||
80 | |||
81 | mt.o main.o: localedir.h | ||
diff --git a/src/alloca.c b/src/alloca.c new file mode 100644 index 0000000..7061cec --- /dev/null +++ b/src/alloca.c | |||
@@ -0,0 +1,495 @@ | |||
1 | /* alloca.c -- allocate automatically reclaimed memory | ||
2 | (Mostly) portable public-domain implementation -- D A Gwyn | ||
3 | |||
4 | This implementation of the PWB library alloca function, | ||
5 | which is used to allocate space off the run-time stack so | ||
6 | that it is automatically reclaimed upon procedure exit, | ||
7 | was inspired by discussions with J. Q. Johnson of Cornell. | ||
8 | J.Otto Tennant <jot@cray.com> contributed the Cray support. | ||
9 | |||
10 | There are some preprocessor constants that can | ||
11 | be defined when compiling for your specific system, for | ||
12 | improved efficiency; however, the defaults should be okay. | ||
13 | |||
14 | The general concept of this implementation is to keep | ||
15 | track of all alloca-allocated blocks, and reclaim any | ||
16 | that are found to be deeper in the stack than the current | ||
17 | invocation. This heuristic does not reclaim storage as | ||
18 | soon as it becomes invalid, but it will do so eventually. | ||
19 | |||
20 | As a special case, alloca(0) reclaims storage without | ||
21 | allocating any. It is a good idea to use alloca(0) in | ||
22 | your main control loop, etc. to force garbage collection. */ | ||
23 | |||
24 | #ifdef HAVE_CONFIG_H | ||
25 | #include <config.h> | ||
26 | #endif | ||
27 | |||
28 | #ifdef emacs | ||
29 | #include "blockinput.h" | ||
30 | #endif | ||
31 | |||
32 | /* If compiling with GCC 2, this file's not needed. */ | ||
33 | #if !defined (__GNUC__) || __GNUC__ < 2 | ||
34 | |||
35 | /* If someone has defined alloca as a macro, | ||
36 | there must be some other way alloca is supposed to work. */ | ||
37 | #ifndef alloca | ||
38 | |||
39 | #ifdef emacs | ||
40 | #ifdef static | ||
41 | /* actually, only want this if static is defined as "" | ||
42 | -- this is for usg, in which emacs must undefine static | ||
43 | in order to make unexec workable | ||
44 | */ | ||
45 | #ifndef STACK_DIRECTION | ||
46 | you | ||
47 | lose | ||
48 | -- must know STACK_DIRECTION at compile-time | ||
49 | #endif /* STACK_DIRECTION undefined */ | ||
50 | #endif /* static */ | ||
51 | #endif /* emacs */ | ||
52 | |||
53 | /* If your stack is a linked list of frames, you have to | ||
54 | provide an "address metric" ADDRESS_FUNCTION macro. */ | ||
55 | |||
56 | #if defined (CRAY) && defined (CRAY_STACKSEG_END) | ||
57 | long i00afunc (); | ||
58 | #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) | ||
59 | #else | ||
60 | #define ADDRESS_FUNCTION(arg) &(arg) | ||
61 | #endif | ||
62 | |||
63 | #if __STDC__ | ||
64 | typedef void *pointer; | ||
65 | #else | ||
66 | typedef char *pointer; | ||
67 | #endif | ||
68 | |||
69 | #define NULL 0 | ||
70 | |||
71 | /* Different portions of Emacs need to call different versions of | ||
72 | malloc. The Emacs executable needs alloca to call xmalloc, because | ||
73 | ordinary malloc isn't protected from input signals. On the other | ||
74 | hand, the utilities in lib-src need alloca to call malloc; some of | ||
75 | them are very simple, and don't have an xmalloc routine. | ||
76 | |||
77 | Non-Emacs programs |