Go to the documentation of this file.
39 #define LUPB_ENUMDEF "lupb.enumdef"
40 #define LUPB_ENUMVALDEF "lupb.enumvaldef"
41 #define LUPB_FIELDDEF "lupb.fielddef"
42 #define LUPB_FILEDEF "lupb.filedef"
43 #define LUPB_MSGDEF "lupb.msgdef"
44 #define LUPB_ONEOFDEF "lupb.oneof"
45 #define LUPB_SYMTAB "lupb.symtab"
46 #define LUPB_OBJCACHE "lupb.objcache"
56 #define LUPB_SYMTAB_INDEX 1
120 return luaL_error(
L,
"Message fields do not have explicit defaults.");
166 lua_pushinteger(
L,
num);
234 if (idx < 0 || idx >=
count) {
236 lua_pushfstring(
L,
"index %d exceeds field count %d",
idx,
count);
237 return luaL_argerror(
L, 2,
msg);
246 int*
index = lua_touserdata(
L, lua_upvalueindex(2));
255 int*
index = lua_newuserdata(
L,
sizeof(
int));
280 switch (lua_type(
L, 2)) {
288 const char*
msg = lua_pushfstring(
L,
"number or string expected, got %s",
289 luaL_typename(
L, 2));
290 return luaL_argerror(
L, 2,
msg);
346 lua_pushstring(
L,
".");
347 lua_pushvalue(
L,
name);
349 const char* nested_name = lua_tostring(
L, -1);
354 if (!
nested)
return false;
369 switch (lua_type(
L, 2)) {
377 const char*
msg = lua_pushfstring(
L,
"number or string expected, got %s",
378 luaL_typename(
L, 2));
379 return luaL_argerror(
L, 2,
msg);
421 int*
index = lua_touserdata(
L, lua_upvalueindex(2));
430 int*
index = lua_newuserdata(
L,
sizeof(
int));
454 luaL_error(
L,
"No such nested message");
461 int*
index = lua_touserdata(
L, lua_upvalueindex(2));
470 int*
index = lua_newuserdata(
L,
sizeof(
int));
493 lua_pushfstring(
L,
"<upb.MessageDef name=%s, field_count=%d>",
549 switch (lua_type(
L, 2)) {
557 const char*
msg = lua_pushfstring(
L,
"number or string expected, got %s",
558 luaL_typename(
L, 2));
559 return luaL_argerror(
L, 2,
msg);
620 int index = luaL_checkint(
L, 2);
634 int index = luaL_checkint(
L, 2);
648 int index = luaL_checkint(
L, 2);
706 #define LUPB_CACHE_INDEX 1
715 luaL_error(
L,
"called into dead object");
722 narg = lua_absindex(
L, narg);
733 lua_rawgetp(
L, -1,
def);
736 if (lua_isnil(
L, -1)) {
743 lua_pushvalue(
L, narg);
747 lua_pushvalue(
L, -1);
748 lua_rawsetp(
L, -3,
def);
767 lua_createtable(
L, 0, 1);
768 lua_pushstring(
L,
"v");
769 lua_setfield(
L, -2,
"__mode");
770 lua_setmetatable(
L, -2);
773 lua_pushvalue(
L, -2);
774 lua_rawsetp(
L, -2, lsymtab->
symtab);
792 const char*
str = luaL_checklstring(
L, 2, &
len);
802 luaL_argerror(
L, 2,
"failed to parse descriptor");
818 const char*
str = luaL_checklstring(
L, 2, &
len);
826 luaL_argerror(
L, 2,
"failed to parse descriptor");
830 for (
i = 0;
i <
n;
i++) {
862 lua_pushfstring(
L,
"<upb.SymbolTable>");
882 lua_pushinteger(
L,
i);
883 lua_setfield(
L, -2,
field);
const char * upb_OneofDef_Name(const upb_OneofDef *o)
void * lupb_newuserdata(lua_State *L, size_t size, int n, const char *type)
upb_FieldType upb_FieldDef_Type(const upb_FieldDef *f)
uint32_t upb_FieldDef_Number(const upb_FieldDef *f)
void lupb_def_registertypes(lua_State *L)
bool upb_FieldDef_IsPacked(const upb_FieldDef *f)
@ kUpb_FieldType_SFixed64
const upb_EnumDef * upb_DefPool_FindEnumByName(const upb_DefPool *s, const char *sym)
static int lupb_FileDef_Pool(lua_State *L)
bool upb_FieldDef_HasSubDef(const upb_FieldDef *f)
static int lupb_MessageDef_Fields(lua_State *L)
static int lupb_FileDef_Syntax(lua_State *L)
const char * upb_FileDef_Package(const upb_FileDef *f)
const grpc_generator::File * file
static const struct luaL_Reg lupb_FileDef_m[]
const upb_MessageDef * lupb_MessageDef_check(lua_State *L, int narg)
static int lupb_FieldDef_CType(lua_State *L)
upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef *m)
static int lupb_FieldDef_EnumSubDef(lua_State *L)
const upb_FileDef * lupb_FileDef_check(lua_State *L, int narg)
static int lupb_EnumValueDef_Number(lua_State *L)
const upb_FieldDef * upb_OneofDef_LookupNumber(const upb_OneofDef *o, uint32_t num)
static void lupb_wrapper_pushwrapper(lua_State *L, int narg, const void *def, const char *type)
const char * upb_EnumValueDef_Name(const upb_EnumValueDef *ev)
static int lupb_FileDef_enum(lua_State *L)
UPB_INLINE google_protobuf_FileDescriptorSet * google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size, upb_Arena *arena)
int32_t lupb_checkint32(lua_State *L, int narg)
static int lupb_MessageDef_OneofCount(lua_State *L)
UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef *m, const char *name, const upb_FieldDef **f, const upb_OneofDef **o)
static int lupb_msgfielditer_next(lua_State *L)
static int lupb_DefPool_AddFile(lua_State *L)
const upb_FileDef * upb_FileDef_Dependency(const upb_FileDef *f, int i)
const upb_EnumValueDef * upb_DefPool_FindEnumByNameval(const upb_DefPool *s, const char *sym)
static const struct luaL_Reg lupb_enumvaldef_m[]
static int lupb_OneofDef_Field(lua_State *L)
static const struct luaL_Reg lupb_OneofDef_mm[]
static int lupb_FieldDef_Type(lua_State *L)
static const void * lupb_wrapper_check(lua_State *L, int narg, const char *type)
const upb_MessageDef * upb_OneofDef_ContainingType(const upb_OneofDef *o)
static int lupb_OneofDef_Fields(lua_State *L)
@ kUpb_FieldType_SFixed32
static int lupb_FieldDef_Index(lua_State *L)
static bool lupb_MessageDef_pushnested(lua_State *L, int msgdef, int name)
const upb_FileDef * upb_EnumDef_File(const upb_EnumDef *e)
upb_DefPool * lupb_DefPool_check(lua_State *L, int narg)
static int lupb_EnumDef_len(lua_State *L)
void upb_Status_Clear(upb_Status *status)
struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet
static int lupb_DefPool_FindEnumByNameval(lua_State *L)
static void lupb_wrapper_pushsymtab(lua_State *L, int narg)
upb_Syntax upb_FileDef_Syntax(const upb_FileDef *f)
grpc_core::ScopedArenaPtr arena
const upb_EnumDef * upb_FileDef_TopLevelEnum(const upb_FileDef *f, int i)
static int lupb_MessageDef_Oneofs(lua_State *L)
static int lupb_OneofDef_ContainingType(lua_State *L)
static int lupb_MessageDef_Field(lua_State *L)
const upb_EnumValueDef * upb_EnumDef_FindValueByNumber(const upb_EnumDef *def, int32_t num)
static int lupb_DefPool_addset(lua_State *L)
uint32_t upb_FieldDef_Index(const upb_FieldDef *f)
void lupb_pushmsgval(lua_State *L, int container, upb_CType type, upb_MessageValue val)
static int lupb_MessageDef_Syntax(lua_State *L)
upb_Label upb_FieldDef_Label(const upb_FieldDef *f)
int lua_setiuservalue(lua_State *L, int index, int n)
UPB_INLINE bool upb_MessageDef_IsMapEntry(const upb_MessageDef *m)
const char * upb_MessageDef_Name(const upb_MessageDef *m)
static int lupb_DefPool_tostring(lua_State *L)
const UPB_INLINE upb_FieldDef * upb_OneofDef_LookupName(const upb_OneofDef *o, const char *name)
static int lupb_FileDef_msg(lua_State *L)
static int lupb_FileDef_enumcount(lua_State *L)
void lupb_pushint32(lua_State *L, int32_t val)
static int lupb_OneofDef_Name(lua_State *L)
int lua_getiuservalue(lua_State *L, int index, int n)
static int lupb_MessageDef_File(lua_State *L)
static int lupb_MessageDef_index(lua_State *L)
static int lupb_EnumValueDef_Name(lua_State *L)
void lupb_checkstatus(lua_State *L, upb_Status *s)
static int lupb_FieldDef_HasSubDef(lua_State *L)
const upb_OneofDef * lupb_OneofDef_check(lua_State *L, int narg)
void lupb_register_type(lua_State *L, const char *name, const luaL_Reg *m, const luaL_Reg *mm)
static int lupb_MessageDef_Name(lua_State *L)
static int lupb_MessageDef_FieldCount(lua_State *L)
static int lupb_FieldDef_Label(lua_State *L)
const upb_MessageDef * upb_FileDef_TopLevelMessage(const upb_FileDef *f, int i)
const upb_DefPool * upb_FileDef_Pool(const upb_FileDef *f)
int upb_OneofDef_FieldCount(const upb_OneofDef *o)
upb_DefPool * upb_DefPool_New(void)
static int lupb_DefPool_FindMessageByName(lua_State *L)
static int lupb_FieldDef_ContainingOneof(lua_State *L)
int def(FILE *source, FILE *dest, int level)
static const struct luaL_Reg lupb_OneofDef_m[]
upb_MessageValue upb_FieldDef_Default(const upb_FieldDef *f)
static int lupb_FieldDef_MessageSubDef(lua_State *L)
static int lupb_oneofiter_next(lua_State *L)
bool upb_FieldDef_IsExtension(const upb_FieldDef *f)
const char * upb_FileDef_Name(const upb_FileDef *f)
const UPB_INLINE upb_FieldDef * upb_MessageDef_FindFieldByName(const upb_MessageDef *m, const char *name)
static int lupb_EnumDef_File(lua_State *L)
const UPB_INLINE google_protobuf_FileDescriptorProto *const * google_protobuf_FileDescriptorSet_file(const google_protobuf_FileDescriptorSet *msg, size_t *len)
static void lupb_setfieldi(lua_State *L, const char *field, int i)
upb_CType upb_FieldDef_CType(const upb_FieldDef *f)
#define LUPB_SYMTAB_INDEX
int upb_EnumDef_ValueCount(const upb_EnumDef *e)
static int lupb_FieldDef_IsPacked(lua_State *L)
int upb_FileDef_TopLevelEnumCount(const upb_FileDef *f)
const upb_OneofDef * upb_MessageDef_Oneof(const upb_MessageDef *m, int i)
const upb_MessageDef * upb_FieldDef_MessageSubDef(const upb_FieldDef *f)
const upb_EnumDef * upb_FieldDef_EnumSubDef(const upb_FieldDef *f)
static int lupb_DefPool_New(lua_State *L)
static int lupb_FileDef_Name(lua_State *L)
static const struct luaL_Reg lupb_EnumDef_m[]
static int lupb_FieldDef_Number(lua_State *L)
const char * upb_EnumValueDef_FullName(const upb_EnumValueDef *ev)
static int lupb_EnumDef_Value(lua_State *L)
static int lupb_FieldDef_IsExtension(lua_State *L)
static const struct luaL_Reg lupb_DefPool_mm[]
static int lupb_DefPool_FindEnumByName(lua_State *L)
static int lupb_FileDef_Package(lua_State *L)
static int lupb_OneofDef_lookupfield(lua_State *L)
const upb_MessageDef * upb_FieldDef_ContainingType(const upb_FieldDef *f)
static int lupb_MessageDef_FullName(lua_State *L)
const FieldDescriptor * field
static int lupb_MessageDef_IsMapEntry(lua_State *L)
void upb_DefPool_Free(upb_DefPool *s)
static const struct luaL_Reg lupb_FieldDef_m[]
const upb_FieldDef * lupb_FieldDef_check(lua_State *L, int narg)
const upb_FieldDef * upb_OneofDef_Field(const upb_OneofDef *o, int i)
static int lupb_MessageDef_FindByNameWithSize(lua_State *L)
static int lupb_FieldDef_ContainingType(lua_State *L)
static int lupb_EnumValueDef_Enum(lua_State *L)
static int lupb_OneofDef_len(lua_State *L)
static int lupb_FileDef_Dependency(lua_State *L)
const upb_MessageDef * md
UPB_INLINE google_protobuf_FileDescriptorProto * google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size, upb_Arena *arena)
upb_Arena * lupb_Arena_pushnew(lua_State *L)
static int lupb_EnumValueDef_FullName(lua_State *L)
int upb_MessageDef_OneofCount(const upb_MessageDef *m)
static int lupb_msgoneofiter_next(lua_State *L)
const upb_msgdef * msgdef
static const struct luaL_Reg lupb_MessageDef_m[]
static int lupb_MessageDef_tostring(lua_State *L)
static int lupb_FieldDef_Default(lua_State *L)
const char * upb_MessageDef_FullName(const upb_MessageDef *m)
static const struct luaL_Reg lupbdef_toplevel_m[]
const upb_FileDef * upb_MessageDef_File(const upb_MessageDef *m)
const upb_FileDef * upb_DefPool_AddFile(upb_DefPool *s, const google_protobuf_FileDescriptorProto *file_proto, upb_Status *status)
static const struct luaL_Reg lupb_MessageDef_mm[]
static const struct luaL_Reg lupb_EnumDef_mm[]
static int lupb_FileDef_DependencyCount(lua_State *L)
void lupb_MessageDef_pushsubmsgdef(lua_State *L, const upb_FieldDef *f)
const upb_OneofDef * upb_FieldDef_ContainingOneof(const upb_FieldDef *f)
static int lupb_FieldDef_Name(lua_State *L)
static const struct luaL_Reg lupb_DefPool_m[]
static void lupb_DefPool_pushwrapper(lua_State *L, int narg, const void *def, const char *type)
const char * upb_FieldDef_Name(const upb_FieldDef *f)
const upb_EnumDef * upb_EnumValueDef_Enum(const upb_EnumValueDef *ev)
int upb_MessageDef_FieldCount(const upb_MessageDef *m)
const upb_FieldDef * upb_MessageDef_Field(const upb_MessageDef *m, int i)
static int lupb_DefPool_gc(lua_State *L)
int lupb_MessageDef_call(lua_State *L)
struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto
static int lupb_FileDef_msgcount(lua_State *L)
const upb_FieldDef * upb_MessageDef_FindFieldByNumber(const upb_MessageDef *m, uint32_t i)
int32_t upb_EnumValueDef_Number(const upb_EnumValueDef *ev)
const upb_MessageDef * upb_DefPool_FindMessageByName(const upb_DefPool *s, const char *sym)
const upb_EnumValueDef * lupb_enumvaldef_check(lua_State *L, int narg)
const UPB_INLINE upb_EnumValueDef * upb_EnumDef_FindValueByName(const upb_EnumDef *e, const char *name)
int upb_FileDef_TopLevelMessageCount(const upb_FileDef *f)
int upb_FileDef_DependencyCount(const upb_FileDef *f)
const upb_EnumDef * lupb_EnumDef_check(lua_State *L, int narg)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:09