Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ;# $Id: comment.pl,v 3.0 1993/08/18 12:10:50 ram Exp $ |
2 | ;# | |
3 | ;# Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ;# | |
5 | ;# You may redistribute only under the terms of the Artistic Licence, | |
6 | ;# as specified in the README file that comes with the distribution. | |
7 | ;# You may reuse parts of this distribution only within the terms of | |
8 | ;# that same Artistic Licence; a copy of which may be found at the root | |
9 | ;# of the source tree for dist 3.0. | |
10 | ;# | |
11 | ;# $Log: comment.pl,v $ | |
12 | ;# Revision 3.0 1993/08/18 12:10:50 ram | |
13 | ;# Baseline for dist 3.0 netwide release. | |
14 | ;# | |
15 | ;# | |
16 | sub rcscomment { | |
17 | local($file) = @_; | |
18 | local($comment) = ''; | |
19 | open(FILE,$file); | |
20 | while (<FILE>) { | |
21 | if (/^(.*)\$Log[:\$]/) { # They know better than us (hopefully) | |
22 | $comment = $1; | |
23 | last; | |
24 | } | |
25 | } | |
26 | close FILE; | |
27 | unless ($comment) { | |
28 | if ($file =~ /\.SH$|[Mm]akefile/) { # Makefile template | |
29 | $comment = '# '; | |
30 | } elsif ($file =~ /\.U$/) { # Metaconfig unit | |
31 | $comment = '?RCS: '; | |
32 | } elsif ($file =~ /\.man$/) { # Manual page | |
33 | $comment = "''' "; | |
34 | } elsif ($file =~ /\.\d\w?$/) { # Manual page | |
35 | $comment = "''' "; | |
36 | } elsif ($file =~ /\.[chyl]$/) { # C source | |
37 | $comment = " * "; | |
38 | } elsif ($file =~ /\.e$/) { # Eiffel source | |
39 | $comment = "-- "; | |
40 | } elsif ($file =~ /\.pl$/) { # Perl library | |
41 | $comment = ";# "; | |
42 | } | |
43 | } | |
44 | $comment; | |
45 | } | |
46 |