include "inc/cmdsys.plh"
//
// External interface
//
struc t_fileio
    word getpfx
    word setpfx
    word getfileinfo
    word geteof
    word iobufalloc
    word open
    word close
    word read
    word write
    word create
    word destroy
    word newline
    word readblock
    word writeblock
end
predef a2getpfx(path), a23setpfx(path), a2getfileinfo(path, fileinfo), a23geteof(refnum), a2iobufs(iobufs), a2open(path), a2close(refnum)
predef a23read(refnum, buf, len), a2write(refnum, buf, len), a2create(path, type, aux), a23destroy(path)
predef a2newline(refnum, emask, nlchar), a2readblock(unit, buf, block), a2writeblock(unit, buf, block)
//
// Exported function table.
//
word fileio[]
word = @a2getpfx, @a23setpfx, @a2getfileinfo, @a23geteof, @a2iobufs, @a2open, @a2close
word = @a23read, @a2write, @a2create, @a23destroy
word = @a2newline, @a2readblock, @a2writeblock
//
// SOS/ProDOS error code
//
export byte perr
def a2getpfx(path)
    return path
end
def a23setpfx(path)
    return path
end
def a2getfileinfo(path, fileinfo)
    return perr
end
def a23geteof(refnum)
    return 0
end
def a2iobufs(iobufs)
    return 0
end
def a2open(path)
    return 0
end
def a2close(refnum)
    return perr
end
def a23read(refnum, buf, len)
    return len
end
def a2write(refnum, buf, len)
    return len
end
def a2create(path, type, aux)
    return perr
end
def a23destroy(path)
    return perr
end
def a2newline(refnum, emask, nlchar)
    return perr
end
def a2readblock(unit, buf, block)
    return 0
end
def, a2writeblock(unit, buf, block)
    return 0
end
done
