pbc icon indicating copy to clipboard operation
pbc copied to clipboard

A protocol buffers library for C

Results 74 pbc issues
Sort by recently updated
recently updated
newest added

在openresty里使用pbc decode protobuf int64, 因为默认的是lua5.1,返回的值时number,看了看源代码没有很清楚头绪,请云哥指教如何使返回是2个int或8个byte?还有如果要生成protobuf int64类型如何解决?谢谢!

Add extern C for luaopen_protobuf_c() in pbc-lua53.c. Also add dllexport for Windows.

``` cs_obtain_bar_task tdata = new cs_obtain_bar_task(); tdata.position = 1001; tdata.task_id = 1002; pb_bar_warrior_info p = new pb_bar_warrior_info(); pb_merge_user pb = new pb_merge_user(); pb.svr_id = 1; pb.uid = 2; p.uid =...

local data = {account= "robot1"} local savebuffer, savelength local function _callback(buffer, length) ---在这里直接decode就没问题 savebuffer = buffer savelength = length end --parser.register("test.proto") --test.proto: -- message test -- { -- required string...

define PROTO_temp TAR := $(BUILD)/$(notdir $(basename $(1))) PROTO := $(PROTO) $$(TAR).pb $$(TAR).pb : | $(BUILD) $$(TAR).pb : test/$(1) protoc -o$$@ $$< ==>build/pbc -o $$@ $$< endef

你好!我想问下message嵌套问题,代码跟上一位的一致,encode时一直有错。你所说的打开lua 5.2的宏是可以解决这个问题吗?是的话这个宏在哪呢?

``` [david@host1 lua{master}]$ C_INCLUDE_PATH=/usr/include/lua5.1 make gcc -O2 -Wall --shared -o protobuf.dll -I../.. -I/usr/local/include -L/usr/local/bin -L../../build pbc-lua.c -lpbc -llua52 pbc-lua.c: In function ‘_env_enum_id’: pbc-lua.c:80:38: warning: implicit declaration of function ‘_pbcM_sp_query’ [-Wimplicit-function-declaration]...

the message like this: message Role{ optional int32 fieldA = 1; } i got message from server, but server didn't packed 'fieldA' everytime . so how did know if 'fieldA'...

``` #ifndef _LUA_PBC_EXTRA_H_ #define _LUA_PBC_EXTRA_H_ #if defined(_USRDLL) #define LUA_EXTENSIONS_DLL _decispec(dllexport) #else #define LUA_EXTENSIONS_DLL #endif #ifdef __cplusplus extern "C"{ #endif #include "lauxlib.h" int LUA_EXTENSIONS_DLL luaopen_protobuf_c(lua_State *L); #ifdef __cplusplus } #endif #endif...