
(********************************************************************)
(*                                                                  *)
(*  lower.s7i     Filter file which turns characters to lower case  *)
(*  Copyright (C) 1992, 1993, 1994, 2005  Thomas Mertes             *)
(*                                                                  *)
(*  This file is part of the Seed7 Runtime Library.                 *)
(*                                                                  *)
(*  The Seed7 Runtime Library is free software; you can             *)
(*  redistribute it and/or modify it under the terms of the GNU     *)
(*  Lesser General Public License as published by the Free Software *)
(*  Foundation; either version 2.1 of the License, or (at your      *)
(*  option) any later version.                                      *)
(*                                                                  *)
(*  The Seed7 Runtime Library is distributed in the hope that it    *)
(*  will be useful, but WITHOUT ANY WARRANTY; without even the      *)
(*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *)
(*  PURPOSE.  See the GNU Lesser General Public License for more    *)
(*  details.                                                        *)
(*                                                                  *)
(*  You should have received a copy of the GNU Lesser General       *)
(*  Public License along with this program; if not, write to the    *)
(*  Free Software Foundation, Inc., 51 Franklin Street,             *)
(*  Fifth Floor, Boston, MA  02110-1301, USA.                       *)
(*                                                                  *)
(********************************************************************)


const type: lower_file is sub null_file struct
    var file: destination_file is STD_NULL;
  end struct;


const func file: openLower (in file: aFile) is func
  result
    var file: newFile is STD_NULL;
  local
    var lower_file: new_lower_file is lower_file.value;
  begin
    new_lower_file.destination_file := aFile;
    newFile := toInterface(new_lower_file);
  end func;


(*
const proc: page (ref lower_file: lower_fil) is func
  begin
    page(lower_fil.destination_file);
  end func;
*)


const proc: write (inout lower_file: lower_fil, in string: stri) is func
  begin
    write(lower_fil.destination_file, lower(stri));
  end func;


const proc: writeln (inout lower_file: lower_fil) is func
  begin
    writeln(lower_fil.destination_file);
  end func;


const proc: writeln (inout lower_file: lower_fil, in string: stri) is func
  begin
    writeln(lower_fil.destination_file, lower(stri));
  end func;


const proc: moveLeft (inout lower_file: lower_fil, in string: stri) is func
  begin
    moveLeft(lower_fil.destination_file, stri);
  end func;


const proc: erase (inout lower_file: lower_fil, in string: stri) is func
  begin
    erase(lower_fil.destination_file, stri);
  end func;


const proc: cursorOn (inout lower_file: lower_fil, in char: cursorChar) is func
  begin
    cursorOn(lower_fil.destination_file, cursorChar);
  end func;


const proc: cursorOff (inout lower_file: lower_fil, in char: cursorChar) is func
  begin
    cursorOff(lower_fil.destination_file, cursorChar);
  end func;


const func string: gets (inout lower_file: lower_fil, in integer: maxLength) is func
  result
    var string: stri is "";
  begin
    stri := lower(gets(lower_fil.destination_file, maxLength));
  end func;
