#------------------------------------------------------------------
# predef.k3 - module with definitions for standard library routines
# Copyright  (C) 2000 C.H.A. Koster
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or  (at your option) any later version.
# 
# This 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
# Library General Public License for more details.
# 
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
#------------------------------------------------------------------

SCCSID = "$Id$"

MODULE predef.

DEFINES FORMAT,
        FILE,
        TEXT,
        INT,
        TEST open input file (>TEXT,FILE>),
        TEST open output file (>TEXT,FILE>),
        PRED open standard output (FILE>),
        PRED open standard error (FILE>),
        PRED open standard input (FILE>),
        TEST pipe to command (>TEXT,FILE>),
        TEST pipe from command (>TEXT,FILE>),
        ACTION close pipe (>FILE),
        ACTION close (>FILE),
        PRED seek (>FILE,>INT),
        ACTION write (>TEXT),
        ACTION write (>INT),
        ACTION write (>FILE,>TEXT),
        ACTION write (>FILE,>INT),
        ACTION formatted write (>FILE,>FORMAT),
        ACTION write char (>FILE,>INT),
        ACTION write char (>INT),
        FUNCTION trace (>TEXT),
        FUNCTION trace (>INT),
        FUNCTION formatted trace (>FILE,>FORMAT),
        PRED read line (TEXT>),
        PRED read line (>FILE,TEXT>),
        PRED read char (>FILE,TEXT>),
        PRED read char (TEXT>),
	PRED read char (>FILE,INT>),
	PRED read char (INT>),
	ACTION flush,
	ACTION flush (>FILE),
        TEST less (>INT,>INT1),
        TEST lesseq (>INT,>INT1),
        TEST greater (>INT,>INT1),
        TEST greatereq (>INT,>INT1),
        FUNCTION length (>TEXT,INT>),
        FUNCTION extract (>TEXT,>INT1,>INT2,TEXT1>),
        TEST is subtext (>TEXT,>INT>,>TEXT1),
        TEST between (>TEXT,>INT,>TEXT1,>TEXT2),
        TEST not between (>TEXT,>INT,>TEXT1,>TEXT2),
        TEST before (>TEXT,>TEXT1),
        TEST is prefix (>TEXT,>TEXT1,TEXT2>),
        TEST prefix (>TEXT,>INT,TEXT1>,TEXT2>),
        TEST asciicode (>TEXT,>INT1,INT2>),
        FUNCTION bindec (>INT,TEXT>),
        TEST decbin (>TEXT,INT>),
        FUNCTION hash (>TEXT,>INT1,INT2>),
        TEST command arg (>INT,TEXT>),
        FUNCTION exit (>INT),
        TEST get from environment (>TEXT1,TEXT2>),
        FUNCTION time (INT>),
        TEST file date (>TEXT,INT>),
        PRED execute (>TEXT),
        FUNCTION get key (TEXT>).

FORMAT           :: FORMAT TEXT;
                    FORMAT INT;
                    TEXT;
                    INT.

EXTERNAL TEXT
EXTERNAL INT
EXTERNAL FILE

EXTERNAL TEST open input file (>TEXT,FILE>):1

EXTERNAL TEST open output file (>TEXT,FILE>):2

EXTERNAL PRED open standard output (FILE>):3

EXTERNAL PRED open standard error (FILE>):4

EXTERNAL PRED open standard input (FILE>):5

EXTERNAL ACTION close (>FILE):6

EXTERNAL PRED seek (>FILE,>INT):7

EXTERNAL TEST pipe to command (>TEXT,FILE>):8

EXTERNAL TEST pipe from command (>TEXT,FILE>):28

EXTERNAL ACTION close pipe (>FILE):9

EXTERNAL ACTION write (>TEXT):10

EXTERNAL ACTION write (>INT):11

EXTERNAL ACTION write (>FILE,>TEXT):12

EXTERNAL ACTION write (>FILE,>INT):13

EXTERNAL ACTION formatted write (>FILE,>FORMAT):14

EXTERNAL ACTION write char (>FILE,>INT):15

EXTERNAL ACTION write char (>INT):16

EXTERNAL FUNCTION trace (>TEXT):20

EXTERNAL FUNCTION trace (>INT):21

EXTERNAL FUNCTION formatted trace (>FILE,>FORMAT):22

EXTERNAL PRED read line (TEXT>):30

EXTERNAL PRED read line (>FILE,TEXT>):31

EXTERNAL PRED read char (>FILE,TEXT>):32

EXTERNAL PRED read char (TEXT>):33

EXTERNAL PRED read char (>FILE,INT>):34

EXTERNAL PRED read char (INT>):35

EXTERNAL ACTION flush: 36

EXTERNAL ACTION flush (>FILE): 37

EXTERNAL TEST less (>INT,>INT1):40

EXTERNAL TEST lesseq (>INT,>INT1):41

EXTERNAL TEST greater (>INT,>INT1):42

EXTERNAL TEST greatereq (>INT,>INT1):43

EXTERNAL FUNCTION extract (>TEXT,>INT1,>INT2,TEXT1>):51

EXTERNAL TEST is subtext (>TEXT,>INT>,>TEXT1):52

EXTERNAL TEST between (>TEXT,>INT,>TEXT1,>TEXT2):53

EXTERNAL TEST not between (>TEXT,>INT,>TEXT1,>TEXT2):54

EXTERNAL TEST before (>TEXT,>TEXT1):55

EXTERNAL TEST is prefix (>TEXT,>TEXT1,TEXT2>):56

EXTERNAL TEST prefix (>TEXT,>INT,TEXT1>,TEXT2>):57

EXTERNAL FUNCTION length (>TEXT,INT>):58

EXTERNAL TEST asciicode (>TEXT,>INT1,INT2>):59

EXTERNAL FUNCTION bindec (>INT,TEXT>):60

EXTERNAL TEST decbin (>TEXT,INT>):61

EXTERNAL FUNCTION hash (>TEXT,>INT1,INT2>):70

EXTERNAL TEST command arg (>INT,TEXT>):80

EXTERNAL FUNCTION exit (>INT):81

EXTERNAL TEST get from environment (>TEXT1,TEXT2>):82

EXTERNAL FUNCTION time (INT>):83

EXTERNAL TEST file date (>TEXT,INT>):85

EXTERNAL PRED execute (>TEXT):84

EXTERNAL FUNCTION get key (TEXT>):200

