bin2c.lua

colloquy-1.35.30/src/bin2c.lua · 396 B

From the archive colloquy-1.35.30.tar.bz2

Download the archive   « Back to the archive contents

local b
local n = 0
local t = 0
local write = write

print "{ static const unsigned char __LUA_DATA[] = {"

repeat
  b = read(1)
  if b then
    write( strbyte(b), "," )
    if n == 20 then
      n = 0
      write "\n"
    end
    n = n + 1
    t = t + 1
  else
    break
  end
until false

print "\n};\n\n"
write( "lua_dobuffer( L, (const char *)__LUA_DATA, ", t, ', "colloquy.luac" );\n}\n');

Site Stats

Snippets: 1791
Codebases: 571