# Copyright 2002-2007 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.

UserTag file                Order        name type
UserTag file                PosNumber    2
UserTag file                Version      1.6
UserTag file                Routine      <<EOR
sub {
	my ($file, $type) = @_;
    return readfile($file)
		unless $type;
	return readfile($file, undef, 0)
		if $type eq 'raw';
	my $text = readfile($file);
	if($type =~ /mac/i) {
		$text =~ tr/\n/\r/;
	}
	elsif($type =~ /dos|window/i) {
		$text =~ s/\n/\r\n/g;
	}
	elsif($type =~ /unix/i) {
		if($text=~ /\n/) {
			$text =~ tr/\r/\n/;
		}
		else {
			$text =~ s/\r\n/\n/g;
		}
	}
	return $text;
}
EOR
