diff options
Diffstat (limited to 'upb/bindings/lua')
-rw-r--r-- | upb/bindings/lua/upb.c | 43 | ||||
-rw-r--r-- | upb/bindings/lua/upb.h | 9 | ||||
-rw-r--r-- | upb/bindings/lua/upb/pb.c | 15 | ||||
-rw-r--r-- | upb/bindings/lua/upb/table.c | 30 |
4 files changed, 40 insertions, 57 deletions
diff --git a/upb/bindings/lua/upb.c b/upb/bindings/lua/upb.c index 9629314..2d7b1b3 100644 --- a/upb/bindings/lua/upb.c +++ b/upb/bindings/lua/upb.c @@ -1,27 +1,24 @@ /* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2009 Google Inc. See LICENSE for details. - * Author: Josh Haberman <jhaberman@gmail.com> - * - * A Lua extension for upb. Exposes only the core library - * (sub-libraries are exposed in other extensions). - * - * 64-bit woes: Lua can only represent numbers of type lua_Number (which is - * double unless the user specifically overrides this). Doubles can represent - * the entire range of 64-bit integers, but lose precision once the integers are - * greater than 2^53. - * - * Lua 5.3 is adding support for integers, which will allow for 64-bit - * integers (which can be interpreted as signed or unsigned). - * - * LuaJIT supports 64-bit signed and unsigned boxed representations - * through its "cdata" mechanism, but this is not portable to regular Lua. - * - * Hopefully Lua 5.3 will come soon enough that we can either use Lua 5.3 - * integer support or LuaJIT 64-bit cdata for users that need the entire - * domain of [u]int64 values. - */ +** require("lua") -- A Lua extension for upb. +** +** Exposes only the core library +** (sub-libraries are exposed in other extensions). +** +** 64-bit woes: Lua can only represent numbers of type lua_Number (which is +** double unless the user specifically overrides this). Doubles can represent +** the entire range of 64-bit integers, but lose precision once the integers are +** greater than 2^53. +** +** Lua 5.3 is adding support for integers, which will allow for 64-bit +** integers (which can be interpreted as signed or unsigned). +** +** LuaJIT supports 64-bit signed and unsigned boxed representations +** through its "cdata" mechanism, but this is not portable to regular Lua. +** +** Hopefully Lua 5.3 will come soon enough that we can either use Lua 5.3 +** integer support or LuaJIT 64-bit cdata for users that need the entire +** domain of [u]int64 values. +*/ #include <float.h> #include <math.h> diff --git a/upb/bindings/lua/upb.h b/upb/bindings/lua/upb.h index 09ffaa9..6957ec2 100644 --- a/upb/bindings/lua/upb.h +++ b/upb/bindings/lua/upb.h @@ -1,11 +1,6 @@ /* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2012 Google Inc. See LICENSE for details. - * Author: Josh Haberman <jhaberman@gmail.com> - * - * Shared definitions for upb Lua modules. - */ +** Shared definitions for upb Lua modules. +*/ #ifndef UPB_LUA_UPB_H_ #define UPB_LUA_UPB_H_ diff --git a/upb/bindings/lua/upb/pb.c b/upb/bindings/lua/upb/pb.c index b85da18..f095a61 100644 --- a/upb/bindings/lua/upb/pb.c +++ b/upb/bindings/lua/upb/pb.c @@ -1,14 +1,9 @@ /* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2014 Google Inc. See LICENSE for details. - * Author: Josh Haberman <jhaberman@gmail.com> - * - * A Lua extension for upb.pb. - * - * Exposes all the types defined in upb/pb/{*}.h - * Also defines a few convenience functions on top. - */ +** require("upb.pb") -- A Lua extension for upb.pb. +** +** Exposes all the types defined in upb/pb/{*}.h +** Also defines a few convenience functions on top. +*/ #include "upb/bindings/lua/upb.h" #include "upb/pb/decoder.h" diff --git a/upb/bindings/lua/upb/table.c b/upb/bindings/lua/upb/table.c index b82b3f8..2379342 100644 --- a/upb/bindings/lua/upb/table.c +++ b/upb/bindings/lua/upb/table.c @@ -1,21 +1,17 @@ /* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2012 Google Inc. See LICENSE for details. - * Author: Josh Haberman <jhaberman@gmail.com> - * - * Lua extension that provides access to upb_table. This is an internal-only - * interface and exists for the sole purpose of writing a C code generator in - * Lua that can dump a upb_table as static C initializers. This lets us use - * Lua for convenient string manipulation while saving us from re-implementing - * the upb_table hash function and hash table layout / collision strategy in - * Lua. - * - * Since this is used only as part of the toolchain (and not part of the - * runtime) we do not hold this module to the same stringent requirements as - * the main Lua modules (for example that misbehaving Lua programs cannot - * crash the interpreter). - */ +** require("upb.table") -- a Lua extension for accessing upb_table +** +** This is an internal-only interface and exists for the sole purpose of +** writing a C code generator in Lua that can dump a upb_table as static C +** initializers. This lets us use Lua for convenient string manipulation while +** saving us from re-implementing the upb_table hash function and hash table +** layout / collision strategy in Lua. +** +** Since this is used only as part of the toolchain (and not part of the +** runtime) we do not hold this module to the same stringent requirements as +** the main Lua modules (for example that misbehaving Lua programs cannot +** crash the interpreter). +*/ #include <float.h> #include <math.h> |