#!/usr/bin/perl
# vi: set ts=4:

use strict;
use warnings;

@ARGV = ('-') unless @ARGV;

$ARGV=shift @ARGV;
if(!open(FILE,$ARGV)){
	warn "Can't open $ARGV: $!\n";
	exit 1;
}

my $nothing_found = 1;
my $go=0;
while(<FILE>) {
	if( m/^Driver: / ){
		$go=1;
	}
	if( m/\*\// ){
		if($go){
			print "\n\n\n";
		}
		$go=0;
	}
	if( $go ){
		#chomp;
		print $_;
		$nothing_found = 0;
	}
}
if($nothing_found)
{
	warn "No Comedi documentation comment block found in $ARGV\n";
}

