maint: make update-copyright
[autoconf.git] / lib / Autom4te / Request.pm
blob98af4515a10278543785018b6bc2b5a75d664649
1 # autoconf -- create `configure' using m4 macros
2 # Copyright (C) 2001-2003, 2009-2016 Free Software Foundation, Inc.
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 3 of the License, or
7 # (at your option) any later version.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package Autom4te::Request;
19 =head1 NAME
21 Autom4te::Request - a single m4 run request
23 =head1 SYNOPSIS
25 use Autom4te::Request;
27 =head1 DESCRIPTION
29 This perl module provides various general purpose support functions
30 used in several executables of the Autoconf and Automake packages.
32 =cut
34 use strict;
35 use Class::Struct;
36 use Carp;
37 use Data::Dumper;
39 struct
41 # The key of the cache files.
42 'id' => "\$",
43 # True iff %MACRO contains all the macros we want to trace.
44 'valid' => "\$",
45 # The include path.
46 'path' => '@',
47 # The set of input files.
48 'input' => '@',
49 # The set of macros currently traced.
50 'macro' => '%',
54 # Serialize a request or all the current requests.
55 sub marshall($)
57 my ($caller) = @_;
58 my $res = '';
60 # CALLER is an object: instance method.
61 my $marshall = Data::Dumper->new ([$caller]);
62 $marshall->Indent(2)->Terse(0);
63 $res = $marshall->Dump . "\n";
65 return $res;
69 # includes_p ($SELF, @MACRO)
70 # --------------------------
71 # Does this request covers all the @MACRO.
72 sub includes_p
74 my ($self, @macro) = @_;
76 foreach (@macro)
78 return 0
79 if ! exists ${$self->macro}{$_};
81 return 1;
85 =head1 SEE ALSO
87 L<Autom4te::C4che>
89 =head1 HISTORY
91 Written by Akim Demaille E<lt>F<akim@freefriends.org>E<gt>.
93 =cut
97 1; # for require
99 ### Setup "GNU" style for perl-mode and cperl-mode.
100 ## Local Variables:
101 ## perl-indent-level: 2
102 ## perl-continued-statement-offset: 2
103 ## perl-continued-brace-offset: 0
104 ## perl-brace-offset: 0
105 ## perl-brace-imaginary-offset: 0
106 ## perl-label-offset: -2
107 ## cperl-indent-level: 2
108 ## cperl-brace-offset: 0
109 ## cperl-continued-brace-offset: 0
110 ## cperl-label-offset: -2
111 ## cperl-extra-newline-before-brace: t
112 ## cperl-merge-trailing-else: nil
113 ## cperl-continued-statement-offset: 2
114 ## End: