From 399bf41c5cbd12d2866204ee3ff1cc357a3d3a99 Mon Sep 17 00:00:00 2001 From: Anatoliy Belyanskiy Date: Sat, 15 Jun 2024 04:49:41 +1000 Subject: [PATCH] ... --- LUA/Functions.lua | 431 +++++++++++++++++++++++++--------------------- 1 file changed, 236 insertions(+), 195 deletions(-) diff --git a/LUA/Functions.lua b/LUA/Functions.lua index d130ef3..5a56e8e 100644 --- a/LUA/Functions.lua +++ b/LUA/Functions.lua @@ -4,14 +4,17 @@ -- []===========================[] -- превращает "YYYY-MM-DD" в "DD", "MM", "YYYY" function Get_date_RU(str_date) - return string.char(string.byte(str_date,10), string.byte(str_date,11)), string.char(string.byte(str_date,7), string.byte(str_date,8)), string.char(string.byte(str_date,2), string.byte(str_date,3), string.byte(str_date,4), string.byte(str_date,5)) + return string.char(string.byte(str_date, 10), string.byte(str_date, 11)), + string.char(string.byte(str_date, 7), string.byte(str_date, 8)), + string.char(string.byte(str_date, 2), string.byte(str_date, 3), string.byte(str_date, 4), + string.byte(str_date, 5)) end + -- []===========================[] -- []===========================[] function Get_file_data(fname) - -- убираем из дефайна_пути_файла всякие табы и пробелы лишние. Путь должен быть обрамлён одинарными кавычками fname = string.gsub(string.match(fname, '\'.*\''), "'", "") local file = assert(io.open(fname, "rb")) @@ -19,14 +22,15 @@ function Get_file_data(fname) file:close() return data end + -- []===========================[] -- []===========================[] - -- возвращает число из строки или файла заданной размерности - -- get_number (file, offset, bytes) +-- возвращает число из строки или файла заданной размерности +-- get_number (file, offset, bytes) -function Get_number (str,offset, bytes) +function Get_number(str, offset, bytes) local factor = 1 local number = 0 if bytes > 8 then @@ -34,20 +38,21 @@ function Get_number (str,offset, bytes) sj.exit(1) end - for i = offset, offset+bytes-1, 1 do + for i = offset, offset + bytes - 1, 1 do number = number + str:byte(i) * factor factor = factor * 256 end return number end + -- []===========================[] -- []===========================[] - -- считает контрольную сумму для файла - -- get_checksum(FileName, FileLength) +-- считает контрольную сумму для файла +-- get_checksum(FileName, FileLength) function Get_checksum(fname, fStart, fLength) local reg_b = 0 @@ -61,7 +66,7 @@ function Get_checksum(fname, fStart, fLength) if (fLength == 0) or (fLength == nil) then fLength = data:len() end if (fStart == 0) or (fStart == nil) then fStart = 1 end - -- Расчёт контрольной суммы (регистры BC - младший и DE - старший): + -- Расчёт контрольной суммы (регистры BC - младший и DE - старший): --print(fname, "fStart", fStart, "fLength", fLength) for i = fStart, fLength, 1 do reg_c = reg_c + data:byte(i) @@ -80,12 +85,13 @@ function Get_checksum(fname, fStart, fLength) end end end - - --print (string.format("%x",i-1), string.format("%x", reg_d*16777216+reg_e*65536+reg_b*256+reg_c)) + + --print (string.format("%x",i-1), string.format("%x", reg_d*16777216+reg_e*65536+reg_b*256+reg_c)) end - return reg_d*16777216+reg_e*65536+reg_b*256+reg_c + return reg_d * 16777216 + reg_e * 65536 + reg_b * 256 + reg_c end + -- []===========================[] @@ -93,31 +99,30 @@ end -- []===========================[] -- достаёт из BMP-8bit разрешение, размер растра, смещение растра, кол-во цветов function Get_bmp8bit_values(fname) - local TBitMapFileHeader = { - bfType = 0+1, - bfSize = 2+1, - bfOffBits = 10+1 + bfType = 0 + 1, + bfSize = 2 + 1, + bfOffBits = 10 + 1 } local TBitmapInfoHeader = { - biSize = 0+14+1, - biWidth = 4+14+1, - biHeight = 8+14+1, - biplanes = 12+14+1, - biBitCount = 14+14+1, - biCompression = 16+14+1, - biSizeImage = 20+14+1, - biXPelsPerMeter = 24+14+1, - biYPelsPerMeter = 28+14+1, - biClrUsed = 32+14+1, - biClrImportant = 36+14+1 + biSize = 0 + 14 + 1, + biWidth = 4 + 14 + 1, + biHeight = 8 + 14 + 1, + biplanes = 12 + 14 + 1, + biBitCount = 14 + 14 + 1, + biCompression = 16 + 14 + 1, + biSizeImage = 20 + 14 + 1, + biXPelsPerMeter = 24 + 14 + 1, + biYPelsPerMeter = 28 + 14 + 1, + biClrUsed = 32 + 14 + 1, + biClrImportant = 36 + 14 + 1 } local bmp_height, bmp_width, bmp_image_size, bmp_colors, bmp_image_offset, temp_variable local data = Get_file_data(fname) - temp_variable = Get_number (data,TBitMapFileHeader.bfType, 2) + temp_variable = Get_number(data, TBitMapFileHeader.bfType, 2) if temp_variable ~= 19778 then sj.error("error, not BMP file") sj.exit(1) @@ -129,33 +134,35 @@ function Get_bmp8bit_values(fname) sj.exit(1) end - temp_variable = Get_number (data,TBitmapInfoHeader.biBitCount, 2) + temp_variable = Get_number(data, TBitmapInfoHeader.biBitCount, 2) if temp_variable > 8 then sj.error("error in BMP file, not 8-bit pallete, but", temp_variable) sj.exit(1) end - bmp_height = Get_number (data, TBitmapInfoHeader.biHeight, 4) + bmp_height = Get_number(data, TBitmapInfoHeader.biHeight, 4) --[[ if bmp_height > 256 then sj.error("error in BMP file, max height is 256, but", bmp_height) sj.exit(1) end - ]]-- + ]] -- bmp_width = Get_number(data, TBitmapInfoHeader.biWidth, 4) --[[ if bmp_width > 320 then sj.error("error in BMP file, max width is 320, but", bmp_width) sj.exit(1) end - ]]-- + ]] -- bmp_image_offset = Get_number(data, TBitMapFileHeader.bfOffBits, 4) bmp_image_size = bmp_height * bmp_width - bmp_colors = (Get_number (data, TBitMapFileHeader.bfOffBits, 4) - Get_number (data, TBitmapInfoHeader.biSize, 4) - (TBitmapInfoHeader.biSize - 1))/4 + bmp_colors = (Get_number(data, TBitMapFileHeader.bfOffBits, 4) - Get_number(data, TBitmapInfoHeader.biSize, 4) - (TBitmapInfoHeader.biSize - 1)) / + 4 return bmp_width, bmp_height, bmp_image_size, bmp_image_offset, bmp_colors end + -- []===========================[] @@ -164,37 +171,47 @@ end function Detect_os() local BinaryFormat = package.cpath:match("%p[\\|/][?]%p(%a+)") - if BinaryFormat == "dll" then return "Windows" elseif - BinaryFormat == "dylib" then return "MacOS" elseif - BinaryFormat == "so" then - if (os.execute("test -e /sbin/dynamic_pager")) then return "MacOS" - else return "Linux" - end + if BinaryFormat == "dll" then + return "Windows" + elseif + BinaryFormat == "dylib" then + return "MacOS" + elseif + BinaryFormat == "so" then + if (os.execute("test -e /sbin/dynamic_pager")) then + return "MacOS" + else + return "Linux" + end else print("--[ ERROR! OS is not detected!!! ]--") - os.exit(1) + os.exit(1) end end + -- []===========================[] -- []===========================[] function File_save(fname, new_fname, offset, size, fstep, fskip) - if (fstep and fskip) == nil then fstep = 0 fskip = 0 end + if (fstep and fskip) == nil then + fstep = 0 + fskip = 0 + end local data = Get_file_data(fname) local file = assert(io.open(new_fname, "w+b")) - if (io.type(file) == "file" ) then - if fstep + fskip ~= 0 then + if (io.type(file) == "file") then + if fstep + fskip ~= 0 then local i = offset + 1 repeat - file:write(string.sub(data, i, i+fstep-1)) - i = i+fstep+fskip + file:write(string.sub(data, i, i + fstep - 1)) + i = i + fstep + fskip until i >= (offset + 1 + size - 1) file:close() return true else - file:write(string.sub(data, offset+1, offset+1+size-1)) + file:write(string.sub(data, offset + 1, offset + 1 + size - 1)) file:close() return true end @@ -203,113 +220,122 @@ function File_save(fname, new_fname, offset, size, fstep, fskip) return false end end + -- []===========================[] -- []===========================[] function Get_Full_Filename(pname, fname, OStype) -- убираем из дефайна_пути_файла всякие табы и пробелы лишние. Путь должен быть обрамлён одинарными кавычками local psep = "/" - fname = string.gsub(string.match(fname, '\'.*\''), "'", "") - pname = string.gsub(string.match(pname, '\'.*\''), "'", "") - return (pname .. psep .. fname) - --print (fname, pname) + fname = string.gsub(string.match(fname, '\'.*\''), "'", "") + pname = string.gsub(string.match(pname, '\'.*\''), "'", "") + return (pname .. psep .. fname) + --print (fname, pname) end + -- []===========================[] -- []===========================[] function INCLUDING_INFO_START() - -- {ii_parent_num} = ii_count - -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} - -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} - -- {ii_parent_num} = ii_count - -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} - -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} + -- {ii_parent_num} = ii_count + -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} + -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} + -- {ii_parent_num} = ii_count + -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} + -- {ii_parent_num, ii_nested_level, ii_file_name, ii_start_addr, ii_end_addr, ii_its_size} - --ii_parent_num = 1 - ii_nested_level = 1 - ii_file_name = 2 - ii_start_addr = 3 - ii_end_addr = 4 - ii_its_size = 5 - - ii_array = {} -- nest level, data - ii_count = 0 - ii_nest = {} - ii_nest_count = 0 - ii_tmp_nested_level = -1 + --ii_parent_num = 1 + ii_nested_level = 1 + ii_file_name = 2 + ii_start_addr = 3 + ii_end_addr = 4 + ii_its_size = 5 + + ii_array = {} -- nest level, data + ii_count = 0 + ii_nest = {} + ii_nest_count = 0 + ii_tmp_nested_level = -1 end -- []---------------------------[] function INCLUDING_INFO_ADDstart() - local temp_cnt = tonumber(sj.get_define("__INCLUDE_LEVEL__")) - - if temp_cnt < ii_tmp_nested_level then - print("Error in script INCLUDING_INFO_ADDstart: new nesting < old nesting\r\n","File: " .. sj.get_define("__FILE__"), "Line: " .. sj.get_define("__LINE__")) - sj.exit(1) - elseif temp_cnt > 20 then - print("Error in script INCLUDING_INFO_ADDstart: current nesting > 20\r\n","File: " .. sj.get_define("__FILE__"), "Line: " .. sj.get_define("__LINE__")) - sj.exit(1) - end - - ii_array[ii_count] = {--ii_count, -- ii_parent_num - temp_cnt, -- ii_nested_level - sj.get_define("__FILE__"), - sj.current_address, - 0,0 - } - - ii_nest[ii_nest_count] = ii_count - ii_nest_count = ii_nest_count+1 - ii_count = ii_count + 1 - ii_tmp_nested_level = temp_cnt + local temp_cnt = tonumber(sj.get_define("__INCLUDE_LEVEL__")) + + if temp_cnt < ii_tmp_nested_level then + print("Error in script INCLUDING_INFO_ADDstart: new nesting < old nesting\r\n", + "File: " .. sj.get_define("__FILE__"), "Line: " .. sj.get_define("__LINE__")) + sj.exit(1) + elseif temp_cnt > 20 then + print("Error in script INCLUDING_INFO_ADDstart: current nesting > 20\r\n", + "File: " .. sj.get_define("__FILE__"), "Line: " .. sj.get_define("__LINE__")) + sj.exit(1) + end + + ii_array[ii_count] = { --ii_count, -- ii_parent_num + temp_cnt, -- ii_nested_level + sj.get_define("__FILE__"), + sj.current_address, + 0, 0 + } + + ii_nest[ii_nest_count] = ii_count + ii_nest_count = ii_nest_count + 1 + ii_count = ii_count + 1 + ii_tmp_nested_level = temp_cnt end + -- []---------------------------[] function INCLUDING_INFO_ADDend() - local temp_cnt = tonumber(sj.get_define("__INCLUDE_LEVEL__")) + local temp_cnt = tonumber(sj.get_define("__INCLUDE_LEVEL__")) - if temp_cnt > ii_tmp_nested_level then - print("Error in script INCLUDING_INFO_ADDend: current nesting > old nesting\r\n","File: " .. sj.get_define("__FILE__"), "Line: " .. sj.get_define("__LINE__")) - sj.exit(1) - end + if temp_cnt > ii_tmp_nested_level then + print("Error in script INCLUDING_INFO_ADDend: current nesting > old nesting\r\n", + "File: " .. sj.get_define("__FILE__"), "Line: " .. sj.get_define("__LINE__")) + sj.exit(1) + end - ii_nest_count = ii_nest_count-1 - temp_cnt = ii_nest[ii_nest_count] - ii_array[temp_cnt][ii_end_addr] = sj.current_address - ii_array[temp_cnt][ii_its_size] = sj.current_address - ii_array[temp_cnt][ii_start_addr] - - ii_tmp_nested_level = ii_array[temp_cnt][ii_nested_level] + ii_nest_count = ii_nest_count - 1 + temp_cnt = ii_nest[ii_nest_count] + ii_array[temp_cnt][ii_end_addr] = sj.current_address + ii_array[temp_cnt][ii_its_size] = sj.current_address - ii_array[temp_cnt][ii_start_addr] + + ii_tmp_nested_level = ii_array[temp_cnt][ii_nested_level] end -- []---------------------------[] -function INCLUDING_INFO_END() - local nest_sting_start = "└├│" - local nest_sting_line = "────────────────────" - local previous_nest = 0 - - print(" File\t\t\t\t\t","Start \tEnd \tSize ") - for i = 0, ii_count-1, 1 do - --print(tostring(ii_array[i][ii_nested_level]) .. " " .. ii_array[i][ii_file_name]:sub(ii_array[i][ii_file_name]:find("/")+1,-1),"\r\t\t\t\t\t", tostring(ii_array[i][ii_start_addr]), tostring(ii_array[i][ii_end_addr]), tostring(ii_array[i][ii_its_size])) - print(tostring(ii_array[i][ii_nested_level]) .. " " .. ii_array[i][ii_file_name]:sub(ii_array[i][ii_file_name]:find("/")+1,-1),"\r\t\t\t\t\t", string.format("%X",ii_array[i][ii_start_addr]), string.format("%X",ii_array[i][ii_end_addr]), tostring(ii_array[i][ii_its_size])) - end +function INCLUDING_INFO_END() + local nest_sting_start = "└├│" + local nest_sting_line = "────────────────────" + local previous_nest = 0 + print(" File\t\t\t\t\t", "Start \tEnd \tSize ") + for i = 0, ii_count - 1, 1 do + --print(tostring(ii_array[i][ii_nested_level]) .. " " .. ii_array[i][ii_file_name]:sub(ii_array[i][ii_file_name]:find("/")+1,-1),"\r\t\t\t\t\t", tostring(ii_array[i][ii_start_addr]), tostring(ii_array[i][ii_end_addr]), tostring(ii_array[i][ii_its_size])) + print( + tostring(ii_array[i][ii_nested_level]) .. + " " .. ii_array[i][ii_file_name]:sub(ii_array[i][ii_file_name]:find("/") + 1, -1), "\r\t\t\t\t\t", + string.format("%X", ii_array[i][ii_start_addr]), string.format("%X", ii_array[i][ii_end_addr]), + tostring(ii_array[i][ii_its_size])) + end end - -- []===========================[] -- []===========================[] function Hrust_File(cmdLine, firstPath, secondPath, firstName, secondName) - cmdLine = string.gsub(string.match(cmdLine, '\'.*\''), "'", "") - firstPath = string.gsub(string.match(firstPath, '\'.*\''), "'", "") - secondPath = string.gsub(string.match(secondPath, '\'.*\''), "'", "") - firstName = string.gsub(string.match(firstName, '\'.*\''), "'", "") - secondName = string.gsub(string.match(secondName, '\'.*\''), "'", "") + cmdLine = string.gsub(string.match(cmdLine, '\'.*\''), "'", "") + firstPath = string.gsub(string.match(firstPath, '\'.*\''), "'", "") + secondPath = string.gsub(string.match(secondPath, '\'.*\''), "'", "") + firstName = string.gsub(string.match(firstName, '\'.*\''), "'", "") + secondName = string.gsub(string.match(secondName, '\'.*\''), "'", "") local fullCmdLine = cmdLine .. firstPath .. firstName .. " " .. secondPath .. secondName print(fullCmdLine) end + -- []===========================[] @@ -317,101 +343,120 @@ end -- Конвертит число в строку его двоичного представления. bits - разрядность, если число больше, -- чем разрядность для представления этого числа, то будет баг function Number2Binary(n, bits) - bits = bits-1 - local t = {} - for i = bits, 0, -1 do - t[#t+1] = math.floor(n/2^i) - n = n%2^i - end - return table.concat(t) + bits = bits - 1 + local t = {} + for i = bits, 0, -1 do + t[#t + 1] = math.floor(n / 2 ^ i) + n = n % 2 ^ i + end + return table.concat(t) end + -- []===========================[] -- []===========================[] -function DCP_Page2Table (DCP_PAGE) - local portsTable = {} - local bitAddress = 0 - local bitTMPor = 0 - local bitMask = 0 - local CNFadr = 0 - local CNFadrEnd = 0 - for Altera_Port = 1, 0xFF, 1 do - for CNF = 0, 3, 1 do - CNFadr = 1 + CNF * 0x1000 - CNFadrEnd = CNFadr + 0x0FFF - bitAddress = 0 - bitTMPor = 0 - for address = CNFadr, CNFadrEnd, 1 do - if (DCP_PAGE:byte(address) == Altera_Port) then - if bitAddress == 0 then - bitAddress = (address-1) - bitTMPor = (address-1) - else - bitAddress = bitAddress & (address-1) - bitTMPor = bitTMPor | (address-1) - end - end - end - if (bitAddress ~= 0) then - bitMask = ~bitAddress ~ bitTMPor - bitMask = bitMask & 0x3FFF - portsTable[#portsTable+1] = bitAddress - portsTable[#portsTable+1] = bitMask - portsTable[#portsTable+1] = Altera_Port - end - end - end - return portsTable +function DCP_Page2Table(DCP_PAGE) + local portsTable = {} + local bitAddress = 0 + local bitTMPor = 0 + local bitMask = 0 + local CNFadr = 0 + local CNFadrEnd = 0 + for Altera_Port = 1, 0xFF, 1 do + for CNF = 0, 3, 1 do + CNFadr = 1 + CNF * 0x1000 + CNFadrEnd = CNFadr + 0x0FFF + bitAddress = 0 + bitTMPor = 0 + for address = CNFadr, CNFadrEnd, 1 do + if (DCP_PAGE:byte(address) == Altera_Port) then + if bitAddress == 0 then + bitAddress = (address - 1) + bitTMPor = (address - 1) + else + bitAddress = bitAddress & (address - 1) + bitTMPor = bitTMPor | (address - 1) + end + end + end + if (bitAddress ~= 0) then + bitMask = ~bitAddress ~ bitTMPor + bitMask = bitMask & 0x3FFF + portsTable[#portsTable + 1] = bitAddress + portsTable[#portsTable + 1] = bitMask + portsTable[#portsTable + 1] = Altera_Port + end + end + end + return portsTable end + -- []===========================[] -- []===========================[] -function Generate_DCPASM_fromPAGE (DCP_Page_file, DCP_new_ASM) - -- получаем порты из файла - print(DCP_Page_file) - print(DCP_new_ASM) - - local data = Get_file_data(DCP_Page_file) - DCP_TABLE = DCP_Page2Table(data) +function Generate_DCPASM_fromPAGE(DCP_Page_file, DCP_new_ASM) + -- получаем порты из файла + print(DCP_Page_file) + print(DCP_new_ASM) - -- открываем файл на запись - local DCP_TABLE_CODE + local data = Get_file_data(DCP_Page_file) + DCP_TABLE = DCP_Page2Table(data) - -- убираем из дефайна_пути_файла всякие табы и пробелы лишние. Путь должен быть обрамлён одинарными кавычками + -- открываем файл на запись + local DCP_TABLE_CODE + + -- убираем из дефайна_пути_файла всякие табы и пробелы лишние. Путь должен быть обрамлён одинарными кавычками DCP_new_ASM = string.gsub(string.match(DCP_new_ASM, '\'.*\''), "'", "") - DCP_TABLE_CODE = assert(io.open(DCP_new_ASM, "w+")) + DCP_TABLE_CODE = assert(io.open(DCP_new_ASM, "w+")) - -- шапка - assert(DCP_TABLE_CODE:write(';', '\r\n')) - assert(DCP_TABLE_CODE:write(';-----------------------------------------------------------------------;', '\r\n', '\r\n')) + -- шапка + assert(DCP_TABLE_CODE:write(';', '\r\n')) + assert(DCP_TABLE_CODE:write(';-----------------------------------------------------------------------;', '\r\n', + '\r\n')) - -- таблица - for i = 1, #DCP_TABLE, 3 do - assert(DCP_TABLE_CODE:write(';', '\r\n')) - assert(DCP_TABLE_CODE:write(' DW %', Number2Binary(DCP_TABLE[i], 14), '\r\n')) - assert(DCP_TABLE_CODE:write(' DW %', Number2Binary(DCP_TABLE[i+1], 14), '\r\n')) - assert(DCP_TABLE_CODE:write(' DB #', string.format("%X",DCP_TABLE[i+2]), '\r\n')) - end + -- таблица + for i = 1, #DCP_TABLE, 3 do + assert(DCP_TABLE_CODE:write(';', '\r\n')) + assert(DCP_TABLE_CODE:write(' DW %', Number2Binary(DCP_TABLE[i], 14), '\r\n')) + assert(DCP_TABLE_CODE:write(' DW %', Number2Binary(DCP_TABLE[i + 1], 14), '\r\n')) + assert(DCP_TABLE_CODE:write(' DB #', string.format("%X", DCP_TABLE[i + 2]), '\r\n')) + end - -- подвал - assert(DCP_TABLE_CODE:write('; DCP END MARKER', '\r\n')) - assert(DCP_TABLE_CODE:write(' DW 0,0,0', '\r\n')) - assert(DCP_TABLE_CODE:write(';-----------------------------------------------------------------------;', '\r\n')) - assert(DCP_TABLE_CODE:write(';')) + -- подвал + assert(DCP_TABLE_CODE:write('; DCP END MARKER', '\r\n')) + assert(DCP_TABLE_CODE:write(' DW 0,0,0', '\r\n')) + assert(DCP_TABLE_CODE:write(';-----------------------------------------------------------------------;', '\r\n')) + assert(DCP_TABLE_CODE:write(';')) - -- закрытие файла - assert(DCP_TABLE_CODE:flush()) - assert(DCP_TABLE_CODE:close()) + -- закрытие файла + assert(DCP_TABLE_CODE:flush()) + assert(DCP_TABLE_CODE:close()) end + -- []===========================[] -- []===========================[] - -- Function reads number from file , increases it, creates define "BUILD" with the number and saves the number to . - -- With this function you can control count of compilations. +-- Function reads number from file , increases it, creates define "BUILD" with the number and saves the number to . +-- With this function you can control count of compilations. function increase_build(fname) + local fp + local build + build = get_build(fname) + 1 + fp = assert(io.open(fname, "wb")) + assert(fp:write(build)) + assert(fp:flush()) + assert(fp:close()) + return build +end + +-- []===========================[] + + +-- []===========================[] +function get_build(fname) local fp local build fp = assert(io.open(fname, "rb")) @@ -420,14 +465,9 @@ function increase_build(fname) if type(build) == "nil" then build = 0 end - build = build + 1; - --sj.insert_define("BUILD", build) - fp = assert(io.open(fname, "wb")) - assert(fp:write(build)) - assert(fp:flush()) - assert(fp:close()) return build end + -- []===========================[] @@ -435,4 +475,5 @@ end function make_string_version(ver_, mod_, build_) return (tostring(ver_) .. "." .. tostring(mod_) .. "." .. tostring(build_)) end --- []===========================[] \ No newline at end of file + +-- []===========================[]