diff --git a/upb/pb/encoder.c b/upb/pb/encoder.c index b8e9191fc0..3734710059 100644 --- a/upb/pb/encoder.c +++ b/upb/pb/encoder.c @@ -374,8 +374,7 @@ static void *encode_startdelimfield(void *c, const void *hd) { return ok ? c : UPB_BREAK; } -static bool encode_unknown(void *c, const void *hd, const char *buf, - size_t len) { +bool encode_unknown(void *c, const void *hd, const char *buf, size_t len) { UPB_UNUSED(hd); return encode_bytes(c, buf, len) && commit(c); } @@ -571,9 +570,3 @@ upb_pb_encoder *upb_pb_encoder_create(upb_env *env, const upb_handlers *h, } upb_sink *upb_pb_encoder_input(upb_pb_encoder *e) { return &e->input_; } - -void upb_pb_encoder_encode_unknown(upb_pb_encoder *p, const char *buf, - size_t size) { - encode_bytes(p, buf, size); - commit(p); -} diff --git a/upb/pb/encoder.h b/upb/pb/encoder.h index 3d8dce1ceb..780dfcb11b 100644 --- a/upb/pb/encoder.h +++ b/upb/pb/encoder.h @@ -64,8 +64,8 @@ const upb_handlers *upb_pb_encoder_newhandlers(const upb_msgdef *m, upb_sink *upb_pb_encoder_input(upb_pb_encoder *p); upb_pb_encoder* upb_pb_encoder_create(upb_env* e, const upb_handlers* h, upb_bytessink* output); -void upb_pb_encoder_encode_unknown(upb_pb_encoder* p, const char* buf, - size_t size); +bool encode_unknown(upb_pb_encoder* p, const void* hd, const char* buf, + size_t size); UPB_END_EXTERN_C