#!/usr/local/bin/perl
#
# $Id: extract_versions.pl,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
#
# $Log: extract_versions.pl,v $
# Revision 1.1.1.1 2003/11/04 23:34:58 mjames
# Imported into local repositrory
#
# Revision 1.7 2002/09/30 13:28:37 MJAMES
# Tidy up
#
# Revision 1.1.1.1 2002/09/09 15:06:16 mjames
# no message
#
# Revision 1.6 2002/01/16 11:22:43 mjames
# database.h header file is read in first as it undefined DLL stuff irrelevant
# to HPUX
#
# Revision 1.5 2001/10/31 22:20:05 mjames
# Tidying up problematical comments caused by CVS
# 'intelligent' comment guessing
#
#
#This program uses an escaped form of the word 'Header' in the expression below
# because CVS mangles it otherwise
open OUT
,">versionlib/versions.c";
print OUT
"\#include \<stdio.h\>\n";
print OUT
"\#include \"expression.h\"\n";
print OUT
"\#include \"generic.h\"\n";
print OUT
"\#include \"database.h\"\n";
print OUT
"\#include \"version.h\"\n";
print OUT
"\#include \"cmdparse.h\"\n";
print OUT
"\#include \"cmdlog.h\"\n";
print OUT
"void list_versions(FILE * f) {\n";
print OUT
" Log(LOG_GENERAL,\"Modules in use in Vertical %s\\n\",Vertical_Version);";
while ( <> ) {
if ( s/\@\(\#\)\$[I]d:([^\$]*)/(\1)/ ) {
print OUT
" Log(LOG_GENERAL,\"$1\\n\");\n";
}
if ( s/\@\(\#\)\$[H]eader:([^\$]*)/(\1)/ ) {
print OUT
" Log(LOG_GENERAL,\"_$1\\n\");\n";
}
}