1 #ifndef ARCH_H
2 #define ARCH_H
3 /*	$OpenPackages$ */
4 /*	$OpenBSD: arch.h,v 1.1 2001/05/23 12:34:40 espie Exp $ */
5 
6 /*
7  * Copyright (c) 2001 Marc Espie.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OPENBSD
22  * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /*-
32  * arch --
33  *	Functions to manipulate libraries, archives and their members.
34  */
35 
36 #ifndef TIMESTAMP_TYPE
37 #include "timestamp_t.h"
38 #endif
39 
40 /* Initialization and cleanup */
41 extern void Arch_Init(void);
42 #ifdef CLEANUP
43 extern void Arch_End(void);
44 #else
45 #define Arch_End()
46 #endif
47 
48 /* ok = Arch_ParseArchive(&begin, nodeLst, ctxt);
49  *	Given an archive specification, add list of corresponding GNodes to
50  *	nodeLst, one for each member in the spec.
51  *	false is returned if the specification is invalid for some reason.
52  *	Side-effect: begin is bumped to the end of the specification.  */
53 extern bool Arch_ParseArchive(char **, Lst, SymTable *);
54 /* Arch_Touch(node);
55  *	Alter the modification time of the archive member described by node
56  *	to the current time.  */
57 extern void Arch_Touch(GNode *);
58 /* Arch_TouchLib(node);
59  *	Update the modification time of the library described by node.
60  *	This is distinct from Arch_Touch, as it also updates the mtime
61  *	of the library's table of contents.  */
62 extern void Arch_TouchLib(GNode *);
63 /* stamp = Arch_MTime(node);
64  *	Find the modification time of a member of an archive *in the
65  *	archive*, and returns it.
66  *	The time is also stored in the member's GNode.  */
67 extern TIMESTAMP Arch_MTime(GNode *);
68 /* stamp = Arch_MemMTime(node);
69  *	Find the modification time of a member of an archive and returns it.
70  *	To use when the member only exists within the archive.  */
71 extern TIMESTAMP Arch_MemMTime(GNode *);
72 /* Arch_FindLib(node, path);
73  *	Search for a library node along a path, and fills the gnode's path
74  *	field to the actual complete path. If we don't find it, we set the
75  *	library name to libname.a, assuming some other mechanism will take
76  *	care of finding it.  The library name should be in -l<name> format.  */
77 extern void Arch_FindLib(GNode *, Lst);
78 /* bool = Arch_LibOODate(node);
79  *	Decide whether a library node is out-of-date. */
80 extern bool Arch_LibOODate(GNode *);
81 
82 /* bool = Arch_IsLib(node);
83  *	Decide whether a node is a library.  */
84 extern bool Arch_IsLib(GNode *);
85 
86 #endif
87