lib/scripts/feeder.pl
changeset 4504 2f39aa4bebf3
parent 4501 5f629ee2502b
child 6281 25d41c118304
equal deleted inserted replaced
4503:5ed72705c201 4504:2f39aa4bebf3
     4 # feeder.pl - feed isabelle session
     4 # feeder.pl - feed isabelle session
     5 #
     5 #
     6 
     6 
     7 # args
     7 # args
     8 
     8 
     9 ($head, $noint, $emitpid, $quit, $symbols, $tail) = @ARGV;
     9 ($head, $emitpid, $quit, $symbols, $tail) = @ARGV;
    10 
    10 
    11 
    11 
    12 # symbols translation table
    12 # symbols translation table
    13 
    13 
    14 %tab = (
    14 %tab = (
   111   "\xff", "\\<copyright>"
   111   "\xff", "\\<copyright>"
   112 #END OF GENERATED TEXT
   112 #END OF GENERATED TEXT
   113 );
   113 );
   114 
   114 
   115 
   115 
   116 # setup hangup handler
   116 # setup signal handlers
   117 
   117 
   118 sub hangup {
   118 sub hangup { exit(0); }
   119     exit(0);
       
   120 }
       
   121 
       
   122 $SIG{'HUP'} = "hangup";
   119 $SIG{'HUP'} = "hangup";
       
   120 $SIG{'INT'} = "IGNORE";
   123 
   121 
   124 
   122 
   125 # main
   123 # main
   126 
       
   127 #bulletproof session
       
   128 $noint && ($SIG{INT} = "IGNORE");
       
   129 
   124 
   130 #buffer lines
   125 #buffer lines
   131 $| = 1;
   126 $| = 1;
   132 
   127 
   133 
   128 
   143 }
   138 }
   144 
   139 
   145 $tail && (print "$tail", "\n");
   140 $tail && (print "$tail", "\n");
   146 
   141 
   147 
   142 
   148 # wait forever, expecting to be terminated by HUP
   143 # wait forever
   149 
   144 
   150 close STDOUT;
   145 close STDOUT;
   151 sleep;
   146 sleep;