rename internal/upb.h as internal/encode.h

add build target for upb/internal/encode.h and lock down its visibility

PiperOrigin-RevId: 457087638
pull/13171/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 15596be402
commit 033859ff5d
  1. 17
      BUILD
  2. 4
      upb/decode.c
  3. 8
      upb/internal/encode.h
  4. 5
      upb/json_encode.c
  5. 4
      upb/status.c
  6. 2
      upb/text_encode.c
  7. 10
      upb/upb.c
  8. 2
      upb/upb_internal.h

17
BUILD

@ -108,7 +108,6 @@ cc_library(
"upb/encode.c",
"upb/internal/decode.h",
"upb/internal/table.h",
"upb/internal/upb.h",
"upb/msg.c",
"upb/msg_internal.h",
"upb/status.c",
@ -130,6 +129,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":arena_internal",
":encode_internal",
":extension_registry",
":fastdecode",
":port",
@ -390,7 +390,6 @@ cc_library(
cc_library(
name = "textformat",
srcs = [
"upb/internal/upb.h",
"upb/text_encode.c",
],
hdrs = [
@ -399,6 +398,7 @@ cc_library(
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
":encode_internal",
":port",
":reflection",
":table_internal",
@ -408,7 +408,6 @@ cc_library(
cc_library(
name = "json",
srcs = [
"upb/internal/upb.h",
"upb/json_decode.c",
"upb/json_encode.c",
],
@ -419,6 +418,7 @@ cc_library(
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
":encode_internal",
":port",
":reflection",
":upb",
@ -720,6 +720,14 @@ cc_library(
deps = [":port"],
)
cc_library(
name = "encode_internal",
hdrs = ["upb/internal/encode.h"],
copts = UPB_DEFAULT_COPTS,
visibility = ["//:__subpackages__"],
deps = [":port"],
)
cc_library(
name = "table_internal",
srcs = [
@ -752,6 +760,7 @@ upb_amalgamation(
":arena_internal",
":collections",
":descriptor_upb_proto",
":encode_internal",
":extension_registry",
":fastdecode",
":mini_table",
@ -780,6 +789,7 @@ upb_amalgamation(
":collections",
":descriptor_upb_proto",
":descriptor_upb_proto_reflection",
":encode_internal",
":extension_registry",
":fastdecode",
":json",
@ -809,6 +819,7 @@ upb_amalgamation(
":arena_internal",
":collections",
":descriptor_upb_proto",
":encode_internal",
":extension_registry",
":fastdecode",
":json",

@ -27,14 +27,12 @@
#include "upb/decode.h"
#include <setjmp.h>
#include <string.h>
#include "upb/internal/decode.h"
#include "upb/internal/upb.h"
#include "upb/upb.h"
/* Must be last. */
// Must be last.
#include "upb/port_def.inc"
/* Maps descriptor type -> elem_size_lg2. */

@ -25,10 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef UPB_INTERNAL_UPB_H_
#define UPB_INTERNAL_UPB_H_
#include "upb/upb.h"
#ifndef UPB_INTERNAL_ENCODE_H_
#define UPB_INTERNAL_ENCODE_H_
// Must be last.
#include "upb/port_def.inc"
@ -53,4 +51,4 @@ void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
#include "upb/port_undef.inc"
#endif /* UPB_INTERNAL_UPB_H_ */
#endif /* UPB_INTERNAL_ENCODE_H_ */

@ -31,17 +31,16 @@
#include <float.h>
#include <inttypes.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "upb/decode.h"
#include "upb/internal/upb.h"
#include "upb/internal/encode.h"
#include "upb/internal/vsnprintf_compat.h"
#include "upb/reflection.h"
/* Must be last. */
// Must be last.
#include "upb/port_def.inc"
typedef struct {

@ -30,14 +30,10 @@
#include <errno.h>
#include <float.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "upb/internal/upb.h"
// Must be last.
#include "upb/port_def.inc"

@ -34,7 +34,7 @@
#include <stdio.h>
#include <string.h>
#include "upb/internal/upb.h"
#include "upb/internal/encode.h"
#include "upb/internal/vsnprintf_compat.h"
#include "upb/reflection.h"

@ -25,19 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "upb/internal/upb.h"
#include <errno.h>
#include <float.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "upb/arena.h"
#include "upb/status.h"
#include "upb/internal/encode.h"
// Must be last.
#include "upb/port_def.inc"

@ -31,6 +31,6 @@
// TODO(b/232091617): Delete this entire header which currently exists only for
// temporary backwards compatibility.
#include "upb/internal/upb.h"
#include "upb/internal/encode.h"
#endif /* UPB_INT_H_ */

Loading…
Cancel
Save