(*
    Title: 	Network specific routines
    LastEdit:	"Mon Feb  1 12:09:04 1988"
    Author: 	Derek McAuley,Oms1,4652
		Cambridge University Computer Laboratory
*)

DEFINITION MODULE MCNetLib;


IMPORT
  SYSTEM;

EXPORT QUALIFIED 
  Short,
  
  ChangeWordSex, ChangeBufferSex,
  NToHL, NToHS, HToNL, HToNS;


TYPE
  Short = [0..010000H];


PROCEDURE ChangeWordSex(w:SYSTEM.WORD):SYSTEM.WORD;
(* changes the order of bytes in a word, from 0123 to 3210.
Just as if you were about to send the result over a network to
an opposite-sex machine. *)

PROCEDURE ChangeBufferSex(from, to:SYSTEM.ADDRESS; nOfBytes:CARDINAL);

PROCEDURE NToHL(long:CARDINAL):CARDINAL;

PROCEDURE NToHS(short:Short):Short;

PROCEDURE HToNL(long:CARDINAL):CARDINAL;

PROCEDURE HToNS(short:Short):Short;

END MCNetLib.
