iproto: replace iproto_constant with string arrays
There are no substantial gaps in the remaining IPROTO constant enums so there's no need in iproto_constant struct. Instead we can generate string arrays, as we usually do. This is more flexible because it allows us to look up a name by code. It's also consistent with iproto_type and iproto_key names. The only tricky part here is the iproto_flag enum because it contains bit masks. To generate names for the flags, we add the auxiliary enum iproto_flag_bit that contains bit numbers. Follow-up #8443 Follow-up commit b3fb883b ("iproto: export IPROTO constants to Lua automatically") NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
Showing
- src/box/iproto_constants.c 19 additions, 18 deletionssrc/box/iproto_constants.c
- src/box/iproto_constants.h 21 additions, 33 deletionssrc/box/iproto_constants.h
- src/box/iproto_features.c 7 additions, 7 deletionssrc/box/iproto_features.c
- src/box/iproto_features.h 2 additions, 6 deletionssrc/box/iproto_features.h
- src/box/lua/iproto.c 36 additions, 38 deletionssrc/box/lua/iproto.c
Loading
Please register or sign in to comment