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

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

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

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

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

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

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

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

Loading…
Cancel
Save