172
|
1 /*
|
|
2 lwar.c
|
|
3 Copyright © 2009 William Astle
|
|
4
|
|
5 This file is part of LWAR.
|
|
6
|
|
7 LWAR is free software: you can redistribute it and/or modify it under the
|
|
8 terms of the GNU General Public License as published by the Free Software
|
|
9 Foundation, either version 3 of the License, or (at your option) any later
|
|
10 version.
|
|
11
|
|
12 This program is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
15 more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License along with
|
|
18 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
|
20
|
|
21 Implements the program startup code
|
|
22
|
|
23 */
|
|
24
|
|
25 #ifdef HAVE_CONFIG_H
|
|
26 #include "config.h"
|
|
27 #endif
|
|
28
|
174
|
29 #include <stdio.h>
|
172
|
30 #include <stdlib.h>
|
174
|
31 #include <sys/stat.h>
|
|
32 #include <sys/types.h>
|
|
33 #include <unistd.h>
|
172
|
34
|
|
35 #define __lwar_c_seen__
|
|
36 #include "lwar.h"
|
|
37 #include "util.h"
|
|
38
|
174
|
39 typedef struct
|
|
40 {
|
|
41 FILE *f;
|
|
42 } arhandle_real;
|
|
43
|
172
|
44 int debug_level = 0;
|
|
45 int operation = 0;
|
|
46 int nfiles = 0;
|
|
47 char *archive_file = NULL;
|
174
|
48 int mergeflag = 0;
|
172
|
49
|
|
50 char **files = NULL;
|
|
51
|
|
52 void add_file_name(char *fn)
|
|
53 {
|
|
54 files = lw_realloc(files, sizeof(char *) * (nfiles + 1));
|
|
55 files[nfiles] = fn;
|
|
56 nfiles++;
|
|
57 }
|