#!/usr/bin/perl
#
#   vSFR vaRiaBle SYMBOL Field Re_Cord
#
# "Symbol variable field" transformation.
#
# This is a program that transforms the "generic" chunks of text  that
# are  scattered  throughout  the  SNMP  agent code, replacing several
# embedded strings with our command-line  args.   The  transformations
# that we make are:
#
#   fuBar  -> vaRiaBle
#   FuBar  -> Field
#   FUBAR  -> SYMBOL
#   Fu_Bar -> Rec_name
#
# where vaRiaBle is the  SNMP  MIB  variable  name  (which  must  also
# conform  to  C variable-name rules), SYMBOL is the #defined constant
# in mibtbl.h, and Field is the field name in the cm4_record.h  header
# file  for the record Rec_name.  Note that the file "icd.t" (produced
# as a side-effect of using icd-c to make  cm4record.h)  contains  the
# three fields you need for calls on this program.

$var = shift(ARGV) || "fuBar";	# SNMP MIB variable name
$sym = shift(ARGV) || "FUBAR";	# Symbolic constant
$fld = shift(ARGV) || "FuBar";	# Field name in ICD and cm4_record.h
$rec = shift(ARGV) || "FuBar";	# Field name in ICD and cm4_record.h

for (<>) {
	s/FUBAR/$sym/g;
	s/fuBar/$var/g;
	s/FuBar/$fld/g;
	s/Fu_Bar/$rec/g;
	print;
}
