#!/usr/bin/env perl ################################################################################ # (C) COPYRIGHT 2000, Eric Busboom # # This library is free software; you can redistribute it and/or modify # it under the terms of either: # # The LGPL as published by the Free Software Foundation, version # 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.txt # # Or: # # The Mozilla Public License Version 2.0. You may obtain a copy of # the License at https://www.mozilla.org/MPL/ ################################################################################ use Getopt::Std; getopts('chspi:'); # ARG 0 is components.txt open(PV, "$ARGV[0]") || die "Can't open components file $ARGV[0]:$!"; my @components; while () { s/#.*//; chop; push(@components, $_); } close PV; # Write the file inline by copying everything before a demarcation # line, and putting the generated data after the demarcation if ($opt_i) { open(IN, $opt_i) || die "Can't open input file \"$opt_i\""; while () { if (/Do not edit/) { last; } print; } if ($opt_i) { print "# Everything below this line is machine generated. Do not edit. \n"; } else { print "/* Everything below this line is machine generated. Do not edit. */\n"; } } if ($opt_c or $opt_h and !$opt_i) { print < The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. ======================================================================*/ /* * THIS FILE IS MACHINE GENERATED DO NOT EDIT */ #include /* for va_arg functions */ EOM } if ($opt_p and !$opt_i) { print <