MODULE EncCodecs;

	(* THIS IS TEXT COPY OF Codecs.odc *)
	(* DO NOT EDIT *)

	(*
			A. V. Shiryaev, 2012.10
	*)

	TYPE
		Encoding* = ARRAY 32 OF CHAR;
		Directory* = POINTER TO ABSTRACT RECORD END;
		Encoder* = POINTER TO ABSTRACT RECORD END;
		Decoder* = POINTER TO ABSTRACT RECORD END;

	VAR
		dir-: Directory;

	(* Directory *)

	PROCEDURE (dir: Directory) NewEncoder* (enc: Encoding): Encoder, NEW, ABSTRACT;
	PROCEDURE (dir: Directory) NewDecoder* (enc: Encoding): Decoder, NEW, ABSTRACT;

	(* Encoder *)

	(* pre: fR >= 0, fLen >= 0, tW >= 0 *)
	(* post:
		fLen = 0: ok
		fLen > 0: error at f[fR]
	*)
	PROCEDURE (e: Encoder) Encode* (IN f: ARRAY OF CHAR; VAR fR, fLen: INTEGER; VAR t: ARRAY OF SHORTCHAR; VAR tW: INTEGER), NEW, ABSTRACT;

	(* Decoder *)

	(* pre: d not in error state, fR >= 0, fLen >= 0, tW >= 0 *)
	(* post:
		fLen = 0: ok, state: d has state
		fLen > 0: error at f[fR]
	*)
	PROCEDURE (d: Decoder) Decode* (IN f: ARRAY OF SHORTCHAR; VAR fR, fLen: INTEGER; VAR t: ARRAY OF CHAR; VAR tW: INTEGER; OUT state: BOOLEAN), NEW, ABSTRACT;

	PROCEDURE (d: Decoder) Reset*, NEW, ABSTRACT;


	PROCEDURE SetDir* (d: Directory);
	BEGIN
		dir := d
	END SetDir;

END EncCodecs.
