Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**** extract.c --- Front end to library extraction mode of TDF linker.
32
 *
33
 ** Author: Steve Folkes <smf@hermes.mod.uk>
34
 *
35
 **** Commentary:
36
 *
37
 * This file provides the front end to the library extraction mode of the TDF
38
 * linker.
39
 *
40
 **** Change Log:
41
 * $Log: extract.c,v $
42
 * Revision 1.1.1.1  1998/01/17  15:57:16  release
43
 * First version to be checked into rolling release.
44
 *
45
 * Revision 1.3  1995/09/22  08:37:08  smf
46
 * Fixed problems with incomplete structures (to shut "tcc" up).
47
 *
48
 * Revision 1.2  1994/12/12  11:44:02  smf
49
 * Performing changes for 'CR94_178.sid+tld-update' - bringing in line with
50
 * OSSG C Coding Standards.
51
 *
52
 * Revision 1.1.1.1  1994/07/25  16:03:24  smf
53
 * Initial import of TDF linker 3.5 non shared files.
54
 *
55
**/
56
 
57
/****************************************************************************/
58
 
59
#include "extract.h"
60
#include "error.h"
61
#include "gen-errors.h"
62
#include "library.h"
63
 
64
#include "solve-cycles.h"
65
 
66
/*--------------------------------------------------------------------------*/
67
 
68
void
69
extract_main PROTO_N ((arg_data))
70
	     PROTO_T (ArgDataP arg_data)
71
{
72
    BoolT     extract_all  = arg_data_get_extract_all (arg_data);
73
    BoolT     extract_base = arg_data_get_extract_basename (arg_data);
74
    BoolT     match_base   = arg_data_get_extract_match_base (arg_data);
75
    unsigned  num_files    = arg_data_get_num_files (arg_data);
76
    CStringP *files        = arg_data_get_files (arg_data);
77
    LibraryP  library;
78
 
79
    if (extract_all && (num_files > 1)) {
80
	E_all_specified_with_capsules ();
81
	UNREACHED;
82
    } else  if ((!extract_all) && (num_files == 1)) {
83
	E_no_capsules_specified ();
84
	UNREACHED;
85
    }
86
    if ((library = library_create_stream_input (files [0])) !=
87
	NIL (LibraryP)) {
88
	if (extract_all) {
89
	    library_extract_all (library, extract_base);
90
	} else {
91
	    num_files --;
92
	    files ++;
93
	    library_extract (library, extract_base, match_base, num_files,
94
			     files);
95
	}
96
	library_close (library);
97
    } else {
98
	E_cannot_open_input_file (files [0]);
99
    }
100
    if (error_max_reported_severity () >= ERROR_SEVERITY_ERROR) {
101
	exit (EXIT_FAILURE);
102
	UNREACHED;
103
    }
104
}
105
 
106
/*
107
 * Local variables(smf):
108
 * eval: (include::add-path-entry "../os-interface" "../library" "../tdf")
109
 * eval: (include::add-path-entry "../generated")
110
 * End:
111
**/