// FtpUtilInit.bcpl - utility initialization
// Copyright Xerox Corporation 1979, 1980, 1982
// Last modified May 13, 1982  1:19 PM by Boggs

get "FtpProt.decl"
get "Streams.d"

external
[
// outgoing procedrues
InitFtpUtil

// incoming procedures
Allocate; ExtractSubstring; Zero; MoveBlock
LsPuts; DlsPuts; DblsPuts

// outgoing static
mt

// incoming static
sysZone
]

static mt

//-----------------------------------------------------------------------------------------
let InitFtpUtil() be
//-----------------------------------------------------------------------------------------
[
mt = Allocate(sysZone, lenMT); Zero(mt, lenMT)
MakeMark(markRetrieve, "Retrieve", nf)
MakeMark(markStore, "Store", nf)
MakeMark(markYes, "Yes", sc)
MakeMark(markNo, "No", sc+ptx)
MakeMark(markHereIsFile, "HereIsFile", nf)
MakeMark(markEndOfCommand, "EndOfCommand", nf)
MakeMark(markComment, "Comment", ptx)
MakeMark(markVersion, "Version", sc+ptx)
MakeMark(markNewStore, "NewStore", nf)
MakeMark(markDirectory, "Directory", nf)
MakeMark(markNewDirectory, "NewDirectory", nf)
MakeMark(markHereIsPList, "HereIsPList", nf)
MakeMark(markDelete, "Delete", nf)
MakeMark(markRename, "Rename", nf)
compileif MTP then
   [
   MakeMark(markStoreMail, "Store-Mail", nf)
   MakeMark(markRetrieveMail, "Retrieve-Mail", nf)
   MakeMark(markFlushMailBox, "FlushMailBox", nf)
   MakeMark(markMailboxException, "Mailbox-Exception", sc)
   ]
]

//-----------------------------------------------------------------------------------------
and MakeMark(code, string, qBits) be
//-----------------------------------------------------------------------------------------
[
mt>>MT.code↑code = code
mt>>MT.string↑code = ExtractSubstring(string)
mt>>MT.qBits↑code = qBits
]