From a6138160501bf5c1bf42c5f16c6d0333d7b31e9d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Dec 2011 14:36:37 +0100 Subject: Removed the '.pl' suffix from all scripts --- libsi/Makefile | 4 +-- libsi/gendescr | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ libsi/gendescr.pl | 83 ------------------------------------------------------- 3 files changed, 85 insertions(+), 85 deletions(-) create mode 100755 libsi/gendescr delete mode 100755 libsi/gendescr.pl (limited to 'libsi') diff --git a/libsi/Makefile b/libsi/Makefile index 37be2f60..b24eb31d 100644 --- a/libsi/Makefile +++ b/libsi/Makefile @@ -1,7 +1,7 @@ # # Makefile for a libsi # -# $Id: Makefile 2.1 2010/11/07 13:31:05 kls Exp $ +# $Id: Makefile 2.2 2011/12/04 14:18:38 kls Exp $ ### The C++ compiler and options: @@ -52,4 +52,4 @@ clean: dist: tar cvzf libsi.tar.gz -C .. libsi/util.c libsi/si.c libsi/section.c libsi/descriptor.c \ - libsi/util.h libsi/si.h libsi/section.h libsi/descriptor.h libsi/headers.h libsi/Makefile libsi/gendescr.pl + libsi/util.h libsi/si.h libsi/section.h libsi/descriptor.h libsi/headers.h libsi/Makefile libsi/gendescr diff --git a/libsi/gendescr b/libsi/gendescr new file mode 100755 index 00000000..781340a7 --- /dev/null +++ b/libsi/gendescr @@ -0,0 +1,83 @@ +#!/usr/bin/perl + +# $Id: gendescr 1.2 2003/12/13 10:42:05 kls Exp $ + +print "Name (ohne ...Descriptor):"; +$name=; +$name =~ s/\n$//; +$inner = ($name =~ s/ä$//); +$name .= "Descriptor" unless ($inner); + +print "Struct:"; +$struct=; +$struct =~ s/\n$//; + +mm: +$index=0; +$which=1; +print "Variablen:"; +while ( ) { + if (/ä/) { + goto vv; + } elsif (/ü/) { + $which=1; + next; + } + $eingabe=$_; + $eingabe =~ s/(.{75,120} )/\1\n/g; + $eingabe =~ s/\n$//; + if ($which) { + $members[$index]=$eingabe; + } else { + $members_comments[$index]=$eingabe; + $index++; + print "Jep!\n"; + } + $which= (! $which); +} + +vv: +$filename_h="tempdescr.h"; +$filename_c="tempdescr.c"; +schreib(); + +sub schreib { + print "Danke.\n"; + open(OUTPUT_H, ">>".$filename_h) or die "Could not open file!!"; + open(OUTPUT_C, ">>".$filename_c) or die "Could not open file!!"; + + if ($inner) { + $offset=" "; + } else { + $offset=""; + } + print(OUTPUT_H $offset."class ".$name); + if ($inner) { + print(OUTPUT_H " : public LoopElement {\n".$offset."public:"); + } else { + print(OUTPUT_H " : public Descriptor {\n".$offset."public:"); + } + #for ($i=0; $i<=$#vars;$i++) { + # print (OUTPUT "/*\n".$vars_comments[$i]." */\n".$vars[$i].";\n\n\n"); + #} + for ($i=0; $i<=$#members;$i++) { + print (OUTPUT_H "\n".$offset." int get".$members[$i]."() const;"); + } + print(OUTPUT_H "\n".$offset."virtual int getLength() { return sizeof(".$struct."); }") if ($inner); + + print(OUTPUT_H "\n".$offset."protected:\n".$offset." virtual void Parse();"); + print(OUTPUT_H "\n".$offset."private:\n".$offset." const ".$struct." *s;") if ($struct ne ""); + print(OUTPUT_H "\n".$offset."};\n\n"); + for ($i=0; $i<=$#members_comments;$i++) { + print (OUTPUT_C "int ".$name."::get".$members[$i]."() const {\n"); + if ($members_comments[$i] =~ /^(.+)_hi$/) { + $varbase=$1; + print (OUTPUT_C " return HILO(s->".$varbase.");\n}\n\n"); + } else { + print (OUTPUT_C " return s->".$members_comments[$i].";\n}\n\n"); + } + } + print (OUTPUT_C "void ".$name."::Parse() {\n}\n\n"); + print (OUTPUT_C "\n\n\n"); + exit; +} diff --git a/libsi/gendescr.pl b/libsi/gendescr.pl deleted file mode 100755 index 8273f640..00000000 --- a/libsi/gendescr.pl +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/perl - -# $Id: gendescr.pl 1.2 2003/12/13 10:42:05 kls Exp $ - -print "Name (ohne ...Descriptor):"; -$name=; -$name =~ s/\n$//; -$inner = ($name =~ s/ä$//); -$name .= "Descriptor" unless ($inner); - -print "Struct:"; -$struct=; -$struct =~ s/\n$//; - -mm: -$index=0; -$which=1; -print "Variablen:"; -while ( ) { - if (/ä/) { - goto vv; - } elsif (/ü/) { - $which=1; - next; - } - $eingabe=$_; - $eingabe =~ s/(.{75,120} )/\1\n/g; - $eingabe =~ s/\n$//; - if ($which) { - $members[$index]=$eingabe; - } else { - $members_comments[$index]=$eingabe; - $index++; - print "Jep!\n"; - } - $which= (! $which); -} - -vv: -$filename_h="tempdescr.h"; -$filename_c="tempdescr.c"; -schreib(); - -sub schreib { - print "Danke.\n"; - open(OUTPUT_H, ">>".$filename_h) or die "Could not open file!!"; - open(OUTPUT_C, ">>".$filename_c) or die "Could not open file!!"; - - if ($inner) { - $offset=" "; - } else { - $offset=""; - } - print(OUTPUT_H $offset."class ".$name); - if ($inner) { - print(OUTPUT_H " : public LoopElement {\n".$offset."public:"); - } else { - print(OUTPUT_H " : public Descriptor {\n".$offset."public:"); - } - #for ($i=0; $i<=$#vars;$i++) { - # print (OUTPUT "/*\n".$vars_comments[$i]." */\n".$vars[$i].";\n\n\n"); - #} - for ($i=0; $i<=$#members;$i++) { - print (OUTPUT_H "\n".$offset." int get".$members[$i]."() const;"); - } - print(OUTPUT_H "\n".$offset."virtual int getLength() { return sizeof(".$struct."); }") if ($inner); - - print(OUTPUT_H "\n".$offset."protected:\n".$offset." virtual void Parse();"); - print(OUTPUT_H "\n".$offset."private:\n".$offset." const ".$struct." *s;") if ($struct ne ""); - print(OUTPUT_H "\n".$offset."};\n\n"); - for ($i=0; $i<=$#members_comments;$i++) { - print (OUTPUT_C "int ".$name."::get".$members[$i]."() const {\n"); - if ($members_comments[$i] =~ /^(.+)_hi$/) { - $varbase=$1; - print (OUTPUT_C " return HILO(s->".$varbase.");\n}\n\n"); - } else { - print (OUTPUT_C " return s->".$members_comments[$i].";\n}\n\n"); - } - } - print (OUTPUT_C "void ".$name."::Parse() {\n}\n\n"); - print (OUTPUT_C "\n\n\n"); - exit; -} -- cgit v1.2.3