v2.6.0 - Added support for reading low endian numbers from files, and fixed some bugs with the Unicode library.
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
local agcfg = {
|
||||
["halyde"] = {
|
||||
["maindir"] = "",
|
||||
["version"] = "2.5.0",
|
||||
["version"] = "2.6.0",
|
||||
["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.",
|
||||
["directories"] = {
|
||||
"halyde/apps",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local loadfile = ...
|
||||
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
|
||||
|
||||
_G._OSVERSION = "Halyde 2.5.0"
|
||||
_G._OSVERSION = "Halyde 2.6.0"
|
||||
_G._OSLOGO = ""
|
||||
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
||||
repeat
|
||||
|
||||
@@ -88,9 +88,15 @@ local function readBytes(self,n)
|
||||
return string.byte(byte)
|
||||
end
|
||||
local bytes, res = {string.byte(self:read(n),1,n)}, 0
|
||||
if self.littleEndian then
|
||||
for i=#bytes,1,-1 do
|
||||
res = (res<<8)&0xFFFFFFFF | bytes[i]
|
||||
end
|
||||
else
|
||||
for i=1,#bytes do
|
||||
res = (res<<8)&0xFFFFFFFF | bytes[i]
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ else
|
||||
end
|
||||
|
||||
function unicodeLib.readCodePoint(readByte)
|
||||
checkArg(1,readByte,"function")
|
||||
|
||||
local function inRange(min,max,...)
|
||||
for _,v in ipairs({...}) do
|
||||
if not (v and v>=min and v<max) then return false end
|
||||
@@ -61,9 +63,9 @@ function unicodeLib.readChar(readByte)
|
||||
end
|
||||
|
||||
function unicodeLib.codepoint(chr)
|
||||
checkArg(1,readByte,"string")
|
||||
checkArg(1,chr,"string")
|
||||
local ptr = 1
|
||||
return readUniChar(function()
|
||||
return unicode.readCodePoint(function()
|
||||
local byte = chr:byte(ptr)
|
||||
ptr=ptr+1
|
||||
return byte
|
||||
|
||||
Reference in New Issue
Block a user