diff --git a/cel-c/BUILD b/cel-c/BUILD index 2f4a0a2..3a3d7f5 100644 --- a/cel-c/BUILD +++ b/cel-c/BUILD @@ -55,8 +55,8 @@ cc_library( deps = [ ":assert", ":config", - "//cel-c/src:ckdint", - "//cel-c/src:malloc", + "//cel-c/internal:ckdint", + "//cel-c/internal:malloc", "@protobuf//upb/mem", ], ) @@ -67,7 +67,7 @@ cc_test( deps = [ ":alloc", ":config", - "//cel-c/src:align", + "//cel-c/internal:align", "@googletest//:gtest_main", ], ) @@ -85,8 +85,8 @@ cc_library( ":alloc", ":assert", ":config", - "//cel-c/src:align", - "//cel-c/src:ckdint", + "//cel-c/internal:align", + "//cel-c/internal:ckdint", "@protobuf//upb/base", "@protobuf//upb/mem", ], @@ -184,8 +184,8 @@ cc_library( ":string_view", ":type", ":type_proto", - "//cel-c/src:malloc", - "//cel-c/src:setjmp", + "//cel-c/internal:malloc", + "//cel-c/internal:setjmp", "@cel-spec//proto/cel/expr:checked_upb_proto", "@cel-spec//proto/cel/expr:syntax_upb_proto", "@protobuf//upb/mem", @@ -240,8 +240,8 @@ cc_library( ":string_view", ":type", ":type_proto_v1alpha1", - "//cel-c/src:malloc", - "//cel-c/src:setjmp", + "//cel-c/internal:malloc", + "//cel-c/internal:setjmp", "@googleapis//google/api/expr/v1alpha1:checked_upb_proto", "@protobuf//upb/mem", ], @@ -290,8 +290,8 @@ cc_library( ":config", ":status", ":string_view", - "//cel-c/src:deque", - "//cel-c/src:malloc", + "//cel-c/internal:deque", + "//cel-c/internal:malloc", ], ) @@ -617,7 +617,7 @@ cc_library( deps = [ ":assert", ":config", - "//cel-c/src:ckdint", + "//cel-c/internal:ckdint", ], ) @@ -956,10 +956,10 @@ cc_library( deps = [ ":assert", ":config", - "//cel-c/src:bit", - "//cel-c/src:config", - "//cel-c/src:uint128", - "//cel-c/src:unaligned", + "//cel-c/internal:bit", + "//cel-c/internal:config", + "//cel-c/internal:uint128", + "//cel-c/internal:unaligned", "@protobuf//upb/base", ], ) @@ -1049,7 +1049,7 @@ cc_library( ":type", ":value", ":well_known_types", - "//cel-c/src/runtime", # buildcleaner: keep + "//cel-c/internal/runtime", # buildcleaner: keep "@protobuf//upb/reflection", ], ) @@ -1184,8 +1184,8 @@ cc_library( ":error_space", ":status_code", ":string_view", - "//cel-c/src:array", - "//cel-c/src:string", + "//cel-c/internal:array", + "//cel-c/internal:string", ], ) @@ -1363,7 +1363,7 @@ cc_library( ":config", ":cstring_view", ":hash", - "//cel-c/src:memory", + "//cel-c/internal:memory", "@protobuf//upb/base", ], ) @@ -1414,7 +1414,7 @@ cc_library( ":assert", ":config", ":duration", - "//cel-c/src:ckdint", + "//cel-c/internal:ckdint", ], ) @@ -1663,7 +1663,7 @@ cc_library( ":timestamp", ":value_kind", ":well_known_types", - "//cel-c/src:value", # buildcleaner: keep + "//cel-c/internal:value", # buildcleaner: keep "@protobuf//upb/message", "@protobuf//upb/reflection", ], diff --git a/cel-c/alloc.cc b/cel-c/alloc.cc index eb75a96..66ce147 100644 --- a/cel-c/alloc.cc +++ b/cel-c/alloc.cc @@ -22,8 +22,8 @@ #include "cel-c/assert.h" #include "cel-c/config.h" -#include "cel-c/src/ckdint.h" -#include "cel-c/src/malloc.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/malloc.h" #include "upb/mem/alloc.h" extern "C" CEL_NULLABLE(void*) diff --git a/cel-c/alloc_test.cc b/cel-c/alloc_test.cc index 4038b2d..4ae8b86 100644 --- a/cel-c/alloc_test.cc +++ b/cel-c/alloc_test.cc @@ -20,7 +20,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "cel-c/config.h" -#include "cel-c/src/align.h" +#include "cel-c/internal/align.h" namespace { diff --git a/cel-c/arena.cc b/cel-c/arena.cc index eb03b48..eb6411c 100644 --- a/cel-c/arena.cc +++ b/cel-c/arena.cc @@ -22,8 +22,8 @@ #include "cel-c/assert.h" #include "cel-c/config.h" -#include "cel-c/src/align.h" -#include "cel-c/src/ckdint.h" +#include "cel-c/internal/align.h" +#include "cel-c/internal/ckdint.h" #include "upb/base/string_view.h" #include "upb/mem/arena.h" diff --git a/cel-c/ast_proto.cc b/cel-c/ast_proto.cc index 87eab4f..19d9ca8 100644 --- a/cel-c/ast_proto.cc +++ b/cel-c/ast_proto.cc @@ -26,11 +26,11 @@ #include "cel-c/ast.h" #include "cel-c/config.h" #include "cel-c/constant_proto.h" +#include "cel-c/internal/malloc.h" +#include "cel-c/internal/setjmp.h" #include "cel-c/operators.h" #include "cel-c/ref.h" #include "cel-c/ref_proto.h" -#include "cel-c/src/malloc.h" -#include "cel-c/src/setjmp.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/type.h" diff --git a/cel-c/ast_proto_v1alpha1.cc b/cel-c/ast_proto_v1alpha1.cc index 84aeeb5..a4ae972 100644 --- a/cel-c/ast_proto_v1alpha1.cc +++ b/cel-c/ast_proto_v1alpha1.cc @@ -26,11 +26,11 @@ #include "cel-c/ast.h" #include "cel-c/config.h" #include "cel-c/constant_proto_v1alpha1.h" +#include "cel-c/internal/malloc.h" +#include "cel-c/internal/setjmp.h" #include "cel-c/operators.h" #include "cel-c/ref.h" #include "cel-c/ref_proto_v1alpha1.h" -#include "cel-c/src/malloc.h" -#include "cel-c/src/setjmp.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/type.h" diff --git a/cel-c/ast_traverse.cc b/cel-c/ast_traverse.cc index d08fbae..f46b40f 100644 --- a/cel-c/ast_traverse.cc +++ b/cel-c/ast_traverse.cc @@ -23,8 +23,8 @@ #include "cel-c/ast.h" #include "cel-c/ast_visitor.h" #include "cel-c/config.h" -#include "cel-c/src/deque.h" -#include "cel-c/src/malloc.h" +#include "cel-c/internal/deque.h" +#include "cel-c/internal/malloc.h" #include "cel-c/status.h" #include "cel-c/string_view.h" diff --git a/cel-c/config.h b/cel-c/config.h index c091c1c..84f5a7f 100644 --- a/cel-c/config.h +++ b/cel-c/config.h @@ -26,8 +26,6 @@ #include // IWYU pragma: keep #include // IWYU pragma: keep #include // IWYU pragma: keep -#include // IWYU pragma: keep -#include // IWYU pragma: keep #ifdef __has_include #if __has_include() #include // IWYU pragma: keep @@ -84,119 +82,6 @@ CEL_STATIC_ASSERT(sizeof(unsigned char) == 1); #define CEL_END_DECLS #endif -// cel_typeof/cel_typeof_unqual -// -// Expands to `typeof` and `typeof_unqual` equivalents, respectively. In C++ -// mode we remove references which do not exist in C. We also map `char8_t`, -// `char16_t`, `char32_t`, and `wchar_t` to their respective C types which are -// aliases of other builtin types instead of distinct types. Additionally we map -// enums to their underlying type. -#ifdef __cplusplus -template -struct _cel_typeof { - using type = T; -}; -template -struct _cel_typeof::value && !std::is_const::value && - !std::is_volatile::value)>::type> { - using type = - typename _cel_typeof::type>::type; -}; -template -struct _cel_typeof { - using type = typename _cel_typeof::type; -}; -template -struct _cel_typeof { - using type = typename _cel_typeof::type; -}; -template -struct _cel_typeof { - using type = typename _cel_typeof::type*; -}; -template -struct _cel_typeof { - using type = typename _cel_typeof::type[]; -}; -template -struct _cel_typeof { - using type = const typename _cel_typeof::type[]; -}; -template -struct _cel_typeof { - using type = volatile typename _cel_typeof::type[]; -}; -template -struct _cel_typeof { - using type = const volatile typename _cel_typeof::type[]; -}; -template -struct _cel_typeof { - using type = typename _cel_typeof::type[N]; -}; -template -struct _cel_typeof { - using type = const typename _cel_typeof::type[N]; -}; -template -struct _cel_typeof { - using type = volatile typename _cel_typeof::type[N]; -}; -template -struct _cel_typeof { - using type = const volatile typename _cel_typeof::type[N]; -}; -template -struct _cel_typeof { - using type = const typename _cel_typeof::type; -}; -template -struct _cel_typeof { - using type = volatile typename _cel_typeof::type; -}; -template -struct _cel_typeof { - using type = const volatile typename _cel_typeof::type; -}; -template <> -struct _cel_typeof { -#if defined(__GNUC__) || defined(__clang__) - using type = __WCHAR_TYPE__; -#elif defined(_MSC_VER) - using type = unsigned short; // NOLINT(runtime/int) -#else -#error Unexpected compiler. -#endif -}; -template <> -struct _cel_typeof { - using type = uint_least16_t; -}; -template <> -struct _cel_typeof { - using type = uint_least32_t; -}; -#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L -template <> -struct _cel_typeof { - using type = unsigned char; -}; -#endif -template -struct _cel_typeof_unqual { - using type = typename std::remove_cv::type>::type; -}; -#define cel_typeof(x) typename ::_cel_typeof::type -#define cel_typeof_unqual(x) typename ::_cel_typeof_unqual::type -#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L -#define cel_typeof(x) typeof(x) -#define cel_typeof_unqual(x) typeof_unqual(x) -#else -#define cel_typeof(x) __typeof__(x) -#define cel_typeof_unqual(x) __typeof_unqual__(x) -#endif - #ifdef cel_nullptr #error cel_nullptr cannot be directly set #endif @@ -211,32 +96,6 @@ struct _cel_typeof_unqual { #define cel_nullptr NULL #endif -#ifdef cel_arraysize -#error cel_arraysize cannot be directly set -#endif - -// cel_arraysize -// -// Expands to the number of elements in the array literal. -#ifdef __cplusplus -template -auto _cel_arraysize(const T (&array)[N]) -> char (&)[N]; -#define cel_arraysize(x) (sizeof(::_cel_arraysize((x)))) -#else -#define cel_arraysize(x) (sizeof((x)) / sizeof((x)[0])) -#endif - -#ifdef cel_containerof -#error cel_containerof cannot be directly set -#endif - -// cel_containerof -// -// Behaves the same as `container_of` in the Linux kernel. -#define cel_containerof(ptr, type, member) \ - ((CEL_NULLABILITY_UNKNOWN(type*))(((CEL_NULLABILITY_UNKNOWN(char*))(ptr)) - \ - offsetof(type, member))) - #ifdef CEL_HAVE_BUILTIN #error CEL_HAVE_BUILTIN cannot be directly set #endif @@ -702,44 +561,19 @@ auto _cel_arraysize(const T (&array)[N]) -> char (&)[N]; #define cel_kMaxAlign ((size_t)8) -#ifdef _CEL_HAVE_TYPES_COMPATIBLE -#error _CEL_HAVE_TYPES_COMPATIBLE cannot be directly set -#endif - -#ifdef _CEL_TYPES_COMPATIBLE -#error _CEL_TYPES_COMPATIBLE cannot be directly set +#ifdef cel_arraysize +#error cel_arraysize cannot be directly set #endif +// cel_arraysize +// +// Expands to the number of elements in the array literal. #ifdef __cplusplus -#define _CEL_HAVE_TYPES_COMPATIBLE 1 -template -struct _cel_types_compatible : std::false_type {}; -template -struct _cel_types_compatible : std::true_type {}; -template -struct _cel_types_compatible : std::true_type {}; -template -struct _cel_types_compatible : _cel_types_compatible {}; -template -struct _cel_types_compatible : _cel_types_compatible {}; -#define _CEL_TYPES_COMPATIBLE(type1, type2) \ - ::_cel_types_compatible::type, \ - typename ::_cel_typeof_unqual::type>::value -#elif (defined(__GNUC__) && !defined(__clang__)) || \ - CEL_HAVE_BUILTIN(__builtin_types_compatible_p) -#define _CEL_HAVE_TYPES_COMPATIBLE 1 -#define _CEL_TYPES_COMPATIBLE(type1, type2) \ - __builtin_types_compatible_p(type1, type2) -#else -#define _CEL_TYPES_COMPATIBLE(type1, type2) true -#endif - -#ifdef _CEL_HAVE_STMT_EXPRS -#define _CEL_HAVE_STMT_EXPRS cannot be directly set -#endif - -#if defined(__GNUC__) || defined(__clang__) -#define _CEL_HAVE_STMT_EXPRS 1 +template +auto _cel_arraysize(const T (&array)[N]) -> char (&)[N]; +#define cel_arraysize(x) (sizeof(::_cel_arraysize((x)))) +#else +#define cel_arraysize(x) (sizeof((x)) / sizeof((x)[0])) #endif // We require the standards conforming Microsoft C++ preprocessor. diff --git a/cel-c/duration.cc b/cel-c/duration.cc index 99efeec..e2e257f 100644 --- a/cel-c/duration.cc +++ b/cel-c/duration.cc @@ -19,7 +19,7 @@ #include "cel-c/assert.h" #include "cel-c/config.h" -#include "cel-c/src/ckdint.h" +#include "cel-c/internal/ckdint.h" extern "C" bool cel_Duration_Normalize(int64_t* cel_nonnull sec, int32_t* cel_nonnull nsec) { diff --git a/cel-c/hash.cc b/cel-c/hash.cc index f82c26e..3731e5f 100644 --- a/cel-c/hash.cc +++ b/cel-c/hash.cc @@ -19,10 +19,10 @@ #include #include "cel-c/assert.h" -#include "cel-c/src/bit.h" -#include "cel-c/src/config.h" -#include "cel-c/src/uint128.h" -#include "cel-c/src/unaligned.h" +#include "cel-c/internal/bit.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/uint128.h" +#include "cel-c/internal/unaligned.h" static CEL_NONNULL(const void*) const _cel_kHashSeed = &_cel_kHashSeed; diff --git a/cel-c/src/BUILD b/cel-c/internal/BUILD similarity index 93% rename from cel-c/src/BUILD rename to cel-c/internal/BUILD index 2756240..c35cb69 100644 --- a/cel-c/src/BUILD +++ b/cel-c/internal/BUILD @@ -25,8 +25,8 @@ cc_library( hdrs = ["align.h"], deps = [ ":bit", + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -35,7 +35,7 @@ cc_test( srcs = ["align_test.cc"], deps = [ ":align", - "//cel-c:config", + ":config", "@googletest//:gtest_main", ], ) @@ -51,8 +51,8 @@ cc_library( srcs = ["any.cc"], hdrs = ["any.h"], deps = [ + ":config", "//cel-c:assert", - "//cel-c:config", "//cel-c:status", "//cel-c:status_code", "//cel-c:string_view", @@ -70,9 +70,9 @@ cc_test( srcs = ["any_test.cc"], deps = [ ":any", + ":config", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "//cel-c:status", "//cel-c:status_code", "//cel-c:string_view", @@ -98,8 +98,8 @@ cc_library( name = "arc", hdrs = ["arc.h"], deps = [ + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -108,7 +108,7 @@ cc_test( srcs = ["arc_test.cc"], deps = [ ":arc", - "//cel-c:config", + ":config", "@googletest//:gtest_main", ], ) @@ -117,9 +117,9 @@ cc_library( name = "arena_array", hdrs = ["arena_array.h"], deps = [ + ":config", ":generic_array", "//cel-c:arena", - "//cel-c:config", ], ) @@ -128,9 +128,9 @@ cc_test( srcs = ["arena_array_test.cc"], deps = [ ":arena_array", + ":config", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "@abseil-cpp//absl/log:die_if_null", "@googletest//:gtest_main", ], @@ -140,9 +140,9 @@ cc_library( name = "arena_deque", hdrs = ["arena_deque.h"], deps = [ + ":config", ":generic_deque", "//cel-c:arena", - "//cel-c:config", ], ) @@ -151,9 +151,9 @@ cc_test( srcs = ["arena_deque_test.cc"], deps = [ ":arena_deque", + ":config", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "@abseil-cpp//absl/log:die_if_null", "@googletest//:gtest_main", ], @@ -163,9 +163,9 @@ cc_library( name = "arena_flat_hash_map", hdrs = ["arena_flat_hash_map.h"], deps = [ + ":config", ":generic_flat_hash", "//cel-c:arena", - "//cel-c:config", ], ) @@ -174,9 +174,9 @@ cc_test( srcs = ["arena_flat_hash_map_test.cc"], deps = [ ":arena_flat_hash_map", + ":config", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "//cel-c:hash", "@abseil-cpp//absl/log:die_if_null", "@googletest//:gtest_main", @@ -187,9 +187,9 @@ cc_library( name = "arena_string", hdrs = ["arena_string.h"], deps = [ + ":config", ":generic_string", "//cel-c:arena", - "//cel-c:config", "//cel-c:cstring_view", "//cel-c:string_view", ], @@ -200,10 +200,10 @@ cc_test( srcs = ["arena_string_test.cc"], deps = [ ":arena_string", + ":config", ":generic_string", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "//cel-c:cstring_view", "//cel-c:string_view", "@abseil-cpp//absl/log:die_if_null", @@ -215,9 +215,9 @@ cc_library( name = "array", hdrs = ["array.h"], deps = [ + ":config", ":generic_array", "//cel-c:alloc", - "//cel-c:config", ], ) @@ -226,8 +226,8 @@ cc_test( srcs = ["array_test.cc"], deps = [ ":array", + ":config", "//cel-c:alloc", - "//cel-c:config", "@googletest//:gtest_main", ], ) @@ -244,8 +244,8 @@ cc_library( name = "binary_search", hdrs = ["binary_search.h"], deps = [ + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -263,7 +263,7 @@ cc_library( srcs = ["bit.cc"], hdrs = ["bit.h"], deps = [ - "//cel-c:config", + ":config", ], ) @@ -282,8 +282,8 @@ cc_library( hdrs = ["bitset.h"], deps = [ ":bit", + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -305,7 +305,6 @@ cc_library( ":config", ":ctype", "//cel-c:assert", - "//cel-c:config", ], ) @@ -322,7 +321,7 @@ cc_library( name = "ckdint", hdrs = ["ckdint.h"], deps = [ - "//cel-c:config", + ":config", ], ) @@ -339,7 +338,7 @@ cc_library( name = "compare", hdrs = ["compare.h"], deps = [ - "//cel-c:config", + ":config", ], ) @@ -355,7 +354,7 @@ cc_test( name = "config_test", srcs = ["config_test.cc"], deps = [ - "//cel-c:config", + ":config", "@googletest//:gtest_main", ], ) @@ -364,10 +363,10 @@ cc_library( name = "container", hdrs = ["container.h"], deps = [ + ":config", ":string", "//cel-c:alloc", "//cel-c:assert", - "//cel-c:config", "//cel-c:string_view", ], ) @@ -390,7 +389,7 @@ cc_library( srcs = ["ctype.cc"], hdrs = ["ctype.h"], deps = [ - "//cel-c:config", + ":config", ], ) @@ -407,9 +406,9 @@ cc_library( name = "deque", hdrs = ["deque.h"], deps = [ + ":config", ":generic_deque", "//cel-c:alloc", - "//cel-c:config", ], ) @@ -417,9 +416,9 @@ cc_test( name = "deque_test", srcs = ["deque_test.cc"], deps = [ + ":config", ":deque", "//cel-c:alloc", - "//cel-c:config", "@googletest//:gtest_main", ], ) @@ -447,9 +446,9 @@ cc_library( name = "flat_hash_map", hdrs = ["flat_hash_map.h"], deps = [ + ":config", ":generic_flat_hash", "//cel-c:alloc", - "//cel-c:config", ], ) @@ -457,9 +456,9 @@ cc_test( name = "flat_hash_map_test", srcs = ["flat_hash_map_test.cc"], deps = [ + ":config", ":flat_hash_map", "//cel-c:alloc", - "//cel-c:config", "//cel-c:hash", "@googletest//:gtest_main", ], @@ -469,9 +468,9 @@ cc_library( name = "flat_hash_set", hdrs = ["flat_hash_set.h"], deps = [ + ":config", ":generic_flat_hash", "//cel-c:alloc", - "//cel-c:config", ], ) @@ -479,9 +478,9 @@ cc_test( name = "flat_hash_set_test", srcs = ["flat_hash_set_test.cc"], deps = [ + ":config", ":flat_hash_set", "//cel-c:alloc", - "//cel-c:config", "//cel-c:hash", "@googletest//:gtest_main", ], @@ -508,10 +507,10 @@ cc_library( deps = [ ":align", ":asan", + ":config", "//cel-c:alloc", "//cel-c:arena", "//cel-c:assert", - "//cel-c:config", ], ) @@ -523,10 +522,10 @@ cc_library( ":align", ":bit", ":bitset", + ":config", "//cel-c:alloc", "//cel-c:arena", "//cel-c:assert", - "//cel-c:config", ], ) @@ -537,10 +536,10 @@ cc_library( deps = [ ":asan", ":ckdint", + ":config", "//cel-c:alloc", "//cel-c:arena", "//cel-c:assert", - "//cel-c:config", "//cel-c:cstring_view", "//cel-c:string_view", ], @@ -572,8 +571,8 @@ cc_test( srcs = ["malloc_test.cc"], deps = [ ":align", + ":config", ":malloc", - "//cel-c:config", "@googletest//:gtest_main", ], ) @@ -604,12 +603,12 @@ cc_library( hdrs = ["message_equality.h"], deps = [ ":any", + ":config", ":number", ":setjmp", "//cel-c:alloc", "//cel-c:arena", "//cel-c:assert", - "//cel-c:config", "//cel-c:string_view", "//cel-c:well_known_types", "@protobuf//upb/base", @@ -624,10 +623,10 @@ cc_test( name = "message_equality_test", srcs = ["message_equality_test.cc"], deps = [ + ":config", ":message_equality", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "//cel-c:status", "//cel-c:well_known_types", "@abseil-cpp//absl/base", @@ -665,8 +664,8 @@ cc_library( hdrs = ["number.h"], deps = [ ":compare", + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -684,8 +683,8 @@ cc_library( name = "rc", hdrs = ["rc.h"], deps = [ + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -693,8 +692,8 @@ cc_test( name = "rc_test", srcs = ["rc_test.cc"], deps = [ + ":config", ":rc", - "//cel-c:config", "@googletest//:gtest_main", ], ) @@ -705,9 +704,9 @@ cc_library( hdrs = ["regexp.h"], deps = [ ":alloca", + ":config", ":malloc", "//cel-c:assert", - "//cel-c:config", "//cel-c:status", "//cel-c:status_code", "//cel-c:string_view", @@ -721,8 +720,8 @@ cc_test( name = "regexp_test", srcs = ["regexp_test.cc"], deps = [ + ":config", ":regexp", - "//cel-c:config", "//cel-c:status", "//cel-c:status_code", "//cel-c:string_view", @@ -734,11 +733,11 @@ cc_test( name = "runtime_test", srcs = ["runtime_test.cc"], deps = [ + ":config", ":value", "//cel-c:alloc", "//cel-c:arena", "//cel-c:ast", - "//cel-c:config", "//cel-c:duration", "//cel-c:error", "//cel-c:error_code", @@ -750,10 +749,10 @@ cc_test( "//cel-c:timestamp", "//cel-c:trilean", "//cel-c:value", - "//cel-c/src/runtime", - "//cel-c/src/testing:compiler", - "//cel-c/src/testing:def_pool", - "//cel-c/src/testing:parser", + "//cel-c/internal/runtime", + "//cel-c/internal/testing:compiler", + "//cel-c/internal/testing:def_pool", + "//cel-c/internal/testing:parser", "@abseil-cpp//absl/cleanup", "@abseil-cpp//absl/container:flat_hash_map", "@abseil-cpp//absl/log:absl_check", @@ -773,7 +772,7 @@ cc_library( name = "setjmp", hdrs = ["setjmp.h"], deps = [ - "//cel-c:config", + ":config", ], ) @@ -791,8 +790,8 @@ cc_library( hdrs = ["sort.h"], deps = [ ":alloca", + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -814,8 +813,8 @@ cc_library( hdrs = ["stable_sort.h"], deps = [ ":alloca", + ":config", "//cel-c:assert", - "//cel-c:config", ], ) @@ -836,9 +835,9 @@ cc_library( name = "string", hdrs = ["string.h"], deps = [ + ":config", ":generic_string", "//cel-c:alloc", - "//cel-c:config", "//cel-c:cstring_view", "//cel-c:string_view", ], @@ -848,10 +847,10 @@ cc_test( name = "string_test", srcs = ["string_test.cc"], deps = [ + ":config", ":generic_string", ":string", "//cel-c:alloc", - "//cel-c:config", "//cel-c:cstring_view", "//cel-c:string_view", "@googletest//:gtest_main", @@ -862,7 +861,7 @@ cc_test( name = "trilean_test", srcs = ["trilean_test.cc"], deps = [ - "//cel-c:config", + ":config", "//cel-c:trilean", "@googletest//:gtest_main", ], @@ -872,7 +871,7 @@ cc_library( name = "uchar", hdrs = ["uchar.h"], deps = [ - "//cel-c:config", + ":config", ], ) @@ -883,7 +882,6 @@ cc_library( ":config", ":endian", "//cel-c:assert", - "//cel-c:config", ], ) @@ -918,8 +916,8 @@ cc_library( name = "unicode", hdrs = ["unicode.h"], deps = [ + ":config", ":uchar", - "//cel-c:config", ], ) @@ -937,10 +935,10 @@ cc_library( srcs = ["utf8.cc"], hdrs = ["utf8.h"], deps = [ + ":config", ":uchar", ":unicode", "//cel-c:assert", - "//cel-c:config", "@protobuf//upb/base", ], ) @@ -990,13 +988,13 @@ cc_library( ":bit", ":bitset", ":ckdint", + ":config", ":malloc", ":message_equality", ":sort", "//cel-c:alloc", "//cel-c:arena", "//cel-c:assert", - "//cel-c:config", "//cel-c:duration", "//cel-c:error", "//cel-c:error_code", @@ -1036,9 +1034,9 @@ cc_test( "value_test.cc", ], deps = [ + ":config", ":value", ":value_testing", - "//cel-c:config", "//cel-c:duration", "//cel-c:error", "//cel-c:error_code", @@ -1063,9 +1061,9 @@ cc_library( srcs = ["value_testing.cc"], hdrs = ["value_testing.h"], deps = [ + ":config", "//cel-c:alloc", "//cel-c:arena", - "//cel-c:config", "//cel-c:duration", "//cel-c:error", "//cel-c:status", @@ -1138,9 +1136,9 @@ cc_library( srcs = ["durationconv.cc"], hdrs = ["durationconv.h"], deps = [ + ":config", "//cel-c:arena", "//cel-c:assert", - "//cel-c:config", "//cel-c:duration", "//cel-c:string_view", "//cel-c:string_view_absl", diff --git a/cel-c/src/align.h b/cel-c/internal/align.h similarity index 98% rename from cel-c/src/align.h rename to cel-c/internal/align.h index 9e256ae..2462ead 100644 --- a/cel-c/src/align.h +++ b/cel-c/internal/align.h @@ -15,8 +15,8 @@ // Internal header providing address alignment functions. Uses compiler // intrinsics if available, otherwise falls back to a pure implementation. -#ifndef THIRD_PARTY_CEL_C_SRC_ALIGN_H_ -#define THIRD_PARTY_CEL_C_SRC_ALIGN_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ALIGN_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ALIGN_H_ #include #include // IWYU pragma: keep @@ -24,8 +24,8 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/bit.h" +#include "cel-c/internal/bit.h" +#include "cel-c/internal/config.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) @@ -531,4 +531,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_ALIGN_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ALIGN_H_ diff --git a/cel-c/src/align_test.cc b/cel-c/internal/align_test.cc similarity index 98% rename from cel-c/src/align_test.cc rename to cel-c/internal/align_test.cc index 0f6e7dd..54425d9 100644 --- a/cel-c/src/align_test.cc +++ b/cel-c/internal/align_test.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/align.h" +#include "cel-c/internal/align.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) diff --git a/cel-c/src/alloca.h b/cel-c/internal/alloca.h similarity index 81% rename from cel-c/src/alloca.h rename to cel-c/internal/alloca.h index 4fa37d1..764ef15 100644 --- a/cel-c/src/alloca.h +++ b/cel-c/internal/alloca.h @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_ALLOCA_H_ -#define THIRD_PARTY_CEL_C_SRC_ALLOCA_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ALLOCA_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ALLOCA_H_ -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" #ifdef _WIN32 #include @@ -28,4 +28,4 @@ #define _cel_alloca(size) alloca(size) -#endif // THIRD_PARTY_CEL_C_SRC_ALLOCA_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ALLOCA_H_ diff --git a/cel-c/src/any.cc b/cel-c/internal/any.cc similarity index 98% rename from cel-c/src/any.cc rename to cel-c/internal/any.cc index dde6e02..7c62915 100644 --- a/cel-c/src/any.cc +++ b/cel-c/internal/any.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/any.h" +#include "cel-c/internal/any.h" #include #include #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/any.h b/cel-c/internal/any.h similarity index 93% rename from cel-c/src/any.h rename to cel-c/internal/any.h index 44f4775..2fa08bf 100644 --- a/cel-c/src/any.h +++ b/cel-c/internal/any.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_ANY_H_ -#define THIRD_PARTY_CEL_C_SRC_ANY_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ANY_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ANY_H_ #include -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/well_known_types.h" @@ -68,4 +68,4 @@ _cel_AnyUnpackResult_ToMessage(_cel_AnyUnpackResult result); CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_ANY_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ANY_H_ diff --git a/cel-c/src/any_test.cc b/cel-c/internal/any_test.cc similarity index 99% rename from cel-c/src/any_test.cc rename to cel-c/internal/any_test.cc index 8d79602..b7e00b3 100644 --- a/cel-c/src/any_test.cc +++ b/cel-c/internal/any_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/any.h" +#include "cel-c/internal/any.h" #include @@ -27,7 +27,7 @@ #include "absl/log/die_if_null.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/arc.h b/cel-c/internal/arc.h similarity index 95% rename from cel-c/src/arc.h rename to cel-c/internal/arc.h index d11926e..8673d35 100644 --- a/cel-c/src/arc.h +++ b/cel-c/internal/arc.h @@ -18,8 +18,8 @@ // toolchains that occur when mixing `` and ``. Instead we // use compiler intrinsics across the board. -#ifndef THIRD_PARTY_CEL_C_SRC_ARC_H_ -#define THIRD_PARTY_CEL_C_SRC_ARC_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ARC_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ARC_H_ #include #include // IWYU pragma: keep @@ -32,7 +32,7 @@ #endif #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) @@ -135,4 +135,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_ARC_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ARC_H_ diff --git a/cel-c/src/arc_test.cc b/cel-c/internal/arc_test.cc similarity index 95% rename from cel-c/src/arc_test.cc rename to cel-c/internal/arc_test.cc index 9b1b1f4..ff19cad 100644 --- a/cel-c/src/arc_test.cc +++ b/cel-c/internal/arc_test.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/arc.h" +#include "cel-c/internal/arc.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/arena_array.h b/cel-c/internal/arena_array.h similarity index 98% rename from cel-c/src/arena_array.h rename to cel-c/internal/arena_array.h index 6482acc..e7e984e 100644 --- a/cel-c/src/arena_array.h +++ b/cel-c/internal/arena_array.h @@ -15,16 +15,16 @@ // Internal header providing a dynamic array implementation which uses // arena-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_ARENA_ARRAY_H_ -#define THIRD_PARTY_CEL_C_SRC_ARENA_ARRAY_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ARENA_ARRAY_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ARENA_ARRAY_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep #include #include "cel-c/arena.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_array.h" CEL_BEGIN_DECLS @@ -376,4 +376,4 @@ static CEL_INLINE CEL_NULLABLE(void*) CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_ARENA_ARRAY_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ARENA_ARRAY_H_ diff --git a/cel-c/src/arena_array_test.cc b/cel-c/internal/arena_array_test.cc similarity index 98% rename from cel-c/src/arena_array_test.cc rename to cel-c/internal/arena_array_test.cc index 4dc8d05..6028715 100644 --- a/cel-c/src/arena_array_test.cc +++ b/cel-c/internal/arena_array_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/arena_array.h" +#include "cel-c/internal/arena_array.h" #include @@ -21,7 +21,7 @@ #include "absl/log/die_if_null.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/arena_deque.h b/cel-c/internal/arena_deque.h similarity index 97% rename from cel-c/src/arena_deque.h rename to cel-c/internal/arena_deque.h index 2ac4cce..08ad977 100644 --- a/cel-c/src/arena_deque.h +++ b/cel-c/internal/arena_deque.h @@ -15,16 +15,16 @@ // Internal header providing a deque implementation which uses arena-based // memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_ARENA_DEQUE_H_ -#define THIRD_PARTY_CEL_C_SRC_ARENA_DEQUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ARENA_DEQUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ARENA_DEQUE_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep #include #include "cel-c/arena.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_deque.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_deque.h" CEL_BEGIN_DECLS @@ -249,4 +249,4 @@ static CEL_INLINE void _cel_ArenaDeque_Clear(CEL_NONNULL(_cel_ArenaDeque*) CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_ARENA_DEQUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ARENA_DEQUE_H_ diff --git a/cel-c/src/arena_deque_test.cc b/cel-c/internal/arena_deque_test.cc similarity index 99% rename from cel-c/src/arena_deque_test.cc rename to cel-c/internal/arena_deque_test.cc index d351482..d29507c 100644 --- a/cel-c/src/arena_deque_test.cc +++ b/cel-c/internal/arena_deque_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/arena_deque.h" +#include "cel-c/internal/arena_deque.h" #include #include @@ -22,7 +22,7 @@ #include "absl/log/die_if_null.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/arena_flat_hash_map.h b/cel-c/internal/arena_flat_hash_map.h similarity index 97% rename from cel-c/src/arena_flat_hash_map.h rename to cel-c/internal/arena_flat_hash_map.h index 3afbdd6..bee0394 100644 --- a/cel-c/src/arena_flat_hash_map.h +++ b/cel-c/internal/arena_flat_hash_map.h @@ -15,8 +15,8 @@ // Internal header providing a flat hash map implementation which uses // arena-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_ARENA_FLAT_HASH_MAP_H_ -#define THIRD_PARTY_CEL_C_SRC_ARENA_FLAT_HASH_MAP_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ARENA_FLAT_HASH_MAP_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ARENA_FLAT_HASH_MAP_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -24,8 +24,8 @@ #include #include "cel-c/arena.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_flat_hash.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_flat_hash.h" CEL_BEGIN_DECLS @@ -252,4 +252,4 @@ static CEL_INLINE bool _cel_ArenaFlatHashMap_MutableNext( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_ARENA_FLAT_HASH_MAP_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ARENA_FLAT_HASH_MAP_H_ diff --git a/cel-c/src/arena_flat_hash_map_test.cc b/cel-c/internal/arena_flat_hash_map_test.cc similarity index 98% rename from cel-c/src/arena_flat_hash_map_test.cc rename to cel-c/internal/arena_flat_hash_map_test.cc index c6e2d83..45c1616 100644 --- a/cel-c/src/arena_flat_hash_map_test.cc +++ b/cel-c/internal/arena_flat_hash_map_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/arena_flat_hash_map.h" +#include "cel-c/internal/arena_flat_hash_map.h" #include @@ -21,8 +21,8 @@ #include "absl/log/die_if_null.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" #include "cel-c/hash.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/arena_string.h b/cel-c/internal/arena_string.h similarity index 95% rename from cel-c/src/arena_string.h rename to cel-c/internal/arena_string.h index f4074b1..67cafc6 100644 --- a/cel-c/src/arena_string.h +++ b/cel-c/internal/arena_string.h @@ -15,17 +15,17 @@ // Internal header providing a generic string implementation which uses // arena-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_ARENA_STRING_H_ -#define THIRD_PARTY_CEL_C_SRC_ARENA_STRING_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ARENA_STRING_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ARENA_STRING_H_ #include #include // IWYU pragma: keep #include #include "cel-c/arena.h" -#include "cel-c/config.h" #include "cel-c/cstring_view.h" -#include "cel-c/src/generic_string.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_string.h" #include "cel-c/string_view.h" CEL_BEGIN_DECLS @@ -158,4 +158,4 @@ _cel_ArenaString_ToCStringView(CEL_NONNULL(const _cel_ArenaString*) str) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_ARENA_STRING_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ARENA_STRING_H_ diff --git a/cel-c/src/arena_string_test.cc b/cel-c/internal/arena_string_test.cc similarity index 99% rename from cel-c/src/arena_string_test.cc rename to cel-c/internal/arena_string_test.cc index b0a2e9f..7f4ee42 100644 --- a/cel-c/src/arena_string_test.cc +++ b/cel-c/internal/arena_string_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/arena_string.h" +#include "cel-c/internal/arena_string.h" #include @@ -21,9 +21,9 @@ #include "absl/log/die_if_null.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" #include "cel-c/cstring_view.h" -#include "cel-c/src/generic_string.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_string.h" #include "cel-c/string_view.h" namespace { diff --git a/cel-c/src/array.h b/cel-c/internal/array.h similarity index 98% rename from cel-c/src/array.h rename to cel-c/internal/array.h index d1fef70..a6d06aa 100644 --- a/cel-c/src/array.h +++ b/cel-c/internal/array.h @@ -15,16 +15,16 @@ // Internal header providing a dynamic array implementation which uses // allocator-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_ARRAY_H_ -#define THIRD_PARTY_CEL_C_SRC_ARRAY_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ARRAY_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ARRAY_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep #include #include "cel-c/alloc.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_array.h" CEL_BEGIN_DECLS @@ -402,4 +402,4 @@ static CEL_INLINE CEL_NULLABLE(void*) CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_ARRAY_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ARRAY_H_ diff --git a/cel-c/src/array_test.cc b/cel-c/internal/array_test.cc similarity index 98% rename from cel-c/src/array_test.cc rename to cel-c/internal/array_test.cc index fd087db..8954be6 100644 --- a/cel-c/src/array_test.cc +++ b/cel-c/internal/array_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/array.h" +#include "cel-c/internal/array.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include "cel-c/alloc.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/asan.h b/cel-c/internal/asan.h similarity index 96% rename from cel-c/src/asan.h rename to cel-c/internal/asan.h index 46922df..3c22d62 100644 --- a/cel-c/src/asan.h +++ b/cel-c/internal/asan.h @@ -14,10 +14,10 @@ // Internal header providing wrappers around the ASan interface. -#ifndef THIRD_PARTY_CEL_C_SRC_ASAN_H_ -#define THIRD_PARTY_CEL_C_SRC_ASAN_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ASAN_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ASAN_H_ -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" #ifdef _CEL_HAVE_ASAN #include @@ -112,4 +112,4 @@ CEL_END_DECLS #define _CEL_ATTRIBUTE_NO_SANITIZE_ADDRESS #endif -#endif // THIRD_PARTY_CEL_C_SRC_ASAN_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ASAN_H_ diff --git a/cel-c/src/binary_search.h b/cel-c/internal/binary_search.h similarity index 90% rename from cel-c/src/binary_search.h rename to cel-c/internal/binary_search.h index 8060bdd..4861872 100644 --- a/cel-c/src/binary_search.h +++ b/cel-c/internal/binary_search.h @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_BINARY_SEARCH_H_ -#define THIRD_PARTY_CEL_C_SRC_BINARY_SEARCH_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_BINARY_SEARCH_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_BINARY_SEARCH_H_ #include #include #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -62,4 +62,4 @@ static inline void* cel_nullable _cel_BinarySearch( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_BINARY_SEARCH_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_BINARY_SEARCH_H_ diff --git a/cel-c/src/binary_search_test.cc b/cel-c/internal/binary_search_test.cc similarity index 98% rename from cel-c/src/binary_search_test.cc rename to cel-c/internal/binary_search_test.cc index ddbef53..2abaff8 100644 --- a/cel-c/src/binary_search_test.cc +++ b/cel-c/internal/binary_search_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/binary_search.h" +#include "cel-c/internal/binary_search.h" #include #include diff --git a/cel-c/src/bit.cc b/cel-c/internal/bit.cc similarity index 98% rename from cel-c/src/bit.cc rename to cel-c/internal/bit.cc index 8cfd869..8e438be 100644 --- a/cel-c/src/bit.cc +++ b/cel-c/internal/bit.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/bit.h" +#include "cel-c/internal/bit.h" #include // IWYU pragma: keep #include // IWYU pragma: keep -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #if CEL_HAVE_INCLUDE() #include diff --git a/cel-c/src/bit.h b/cel-c/internal/bit.h similarity index 99% rename from cel-c/src/bit.h rename to cel-c/internal/bit.h index 75966ae..5faeaf3 100644 --- a/cel-c/src/bit.h +++ b/cel-c/internal/bit.h @@ -16,13 +16,13 @@ // available, otherwise falls back to compiler intrinsics or a pure // implementation. -#ifndef THIRD_PARTY_CEL_C_SRC_BIT_H_ -#define THIRD_PARTY_CEL_C_SRC_BIT_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_BIT_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_BIT_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #if CEL_HAVE_INCLUDE() #include @@ -782,4 +782,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_BIT_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_BIT_H_ diff --git a/cel-c/src/bit_test.cc b/cel-c/internal/bit_test.cc similarity index 99% rename from cel-c/src/bit_test.cc rename to cel-c/internal/bit_test.cc index ab43b58..0e77ca3 100644 --- a/cel-c/src/bit_test.cc +++ b/cel-c/internal/bit_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/bit.h" +#include "cel-c/internal/bit.h" #include diff --git a/cel-c/src/bitset.cc b/cel-c/internal/bitset.cc similarity index 94% rename from cel-c/src/bitset.cc rename to cel-c/internal/bitset.cc index aaca874..82c7a5f 100644 --- a/cel-c/src/bitset.cc +++ b/cel-c/internal/bitset.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/bitset.h" +#include "cel-c/internal/bitset.h" #include // IWYU pragma: keep #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/bit.h" +#include "cel-c/internal/bit.h" +#include "cel-c/internal/config.h" extern "C" bool _cel_BitSet_Next(CEL_NULLABLE(const _cel_BitSetWord*) words, size_t bits, CEL_NONNULL(size_t*) bit) { diff --git a/cel-c/src/bitset.h b/cel-c/internal/bitset.h similarity index 95% rename from cel-c/src/bitset.h rename to cel-c/internal/bitset.h index fe51b1f..cae3aa9 100644 --- a/cel-c/src/bitset.h +++ b/cel-c/internal/bitset.h @@ -14,15 +14,15 @@ // Internal header providing functions for working with bit sets. -#ifndef THIRD_PARTY_CEL_C_SRC_BITSET_H_ -#define THIRD_PARTY_CEL_C_SRC_BITSET_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_BITSET_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_BITSET_H_ #include #include #include #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -130,4 +130,4 @@ bool _cel_BitSet_Next(CEL_NULLABLE(const _cel_BitSetWord*) words, size_t bits, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_BITSET_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_BITSET_H_ diff --git a/cel-c/src/bitset_test.cc b/cel-c/internal/bitset_test.cc similarity index 98% rename from cel-c/src/bitset_test.cc rename to cel-c/internal/bitset_test.cc index cb76ebe..7ce976d 100644 --- a/cel-c/src/bitset_test.cc +++ b/cel-c/internal/bitset_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/bitset.h" +#include "cel-c/internal/bitset.h" #include diff --git a/cel-c/src/charconv.cc b/cel-c/internal/charconv.cc similarity index 98% rename from cel-c/src/charconv.cc rename to cel-c/internal/charconv.cc index 3cbf508..721bc5a 100644 --- a/cel-c/src/charconv.cc +++ b/cel-c/internal/charconv.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/charconv.h" +#include "cel-c/internal/charconv.h" #include #include @@ -24,10 +24,9 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/ckdint.h" -#include "cel-c/src/config.h" -#include "cel-c/src/ctype.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/ctype.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) diff --git a/cel-c/src/charconv.h b/cel-c/internal/charconv.h similarity index 98% rename from cel-c/src/charconv.h rename to cel-c/internal/charconv.h index b810a9c..f707f0a 100644 --- a/cel-c/src/charconv.h +++ b/cel-c/internal/charconv.h @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_CHARCONV_H_ -#define THIRD_PARTY_CEL_C_SRC_CHARCONV_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_CHARCONV_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_CHARCONV_H_ #include #include #include -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) @@ -322,4 +322,4 @@ CEL_INLINE size_t _cel_ToChars(char* cel_nonnull first, double val) { // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_CHARCONV_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_CHARCONV_H_ diff --git a/cel-c/src/charconv_test.cc b/cel-c/internal/charconv_test.cc similarity index 99% rename from cel-c/src/charconv_test.cc rename to cel-c/internal/charconv_test.cc index eb007cb..9364fdf 100644 --- a/cel-c/src/charconv_test.cc +++ b/cel-c/internal/charconv_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/charconv.h" +#include "cel-c/internal/charconv.h" #include #include diff --git a/cel-c/src/ckdint.h b/cel-c/internal/ckdint.h similarity index 99% rename from cel-c/src/ckdint.h rename to cel-c/internal/ckdint.h index 5c6cf54..f9d8062 100644 --- a/cel-c/src/ckdint.h +++ b/cel-c/internal/ckdint.h @@ -16,13 +16,13 @@ // available, otherwise falls back to compiler intrinsics or a pure // implementation. -#ifndef THIRD_PARTY_CEL_C_SRC_CKDINT_H_ -#define THIRD_PARTY_CEL_C_SRC_CKDINT_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_CKDINT_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_CKDINT_H_ #include #include // IWYU pragma: keep -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #if CEL_HAVE_INCLUDE() #include @@ -833,4 +833,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_CKDINT_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_CKDINT_H_ diff --git a/cel-c/src/ckdint_test.cc b/cel-c/internal/ckdint_test.cc similarity index 99% rename from cel-c/src/ckdint_test.cc rename to cel-c/internal/ckdint_test.cc index 7e5f0bb..69f4a18 100644 --- a/cel-c/src/ckdint_test.cc +++ b/cel-c/internal/ckdint_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/ckdint.h" +#include "cel-c/internal/ckdint.h" #include diff --git a/cel-c/src/compare.h b/cel-c/internal/compare.h similarity index 86% rename from cel-c/src/compare.h rename to cel-c/internal/compare.h index d249864..4b3ffac 100644 --- a/cel-c/src/compare.h +++ b/cel-c/internal/compare.h @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_COMPARE_H_ -#define THIRD_PARTY_CEL_C_SRC_COMPARE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_COMPARE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_COMPARE_H_ -#include "cel-c/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -35,4 +35,4 @@ static CEL_INLINE _cel_PartialOrdering _cel_PartialOrdering_FromInt(int value) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_COMPARE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_COMPARE_H_ diff --git a/cel-c/internal/config.h b/cel-c/internal/config.h new file mode 100644 index 0000000..02edebd --- /dev/null +++ b/cel-c/internal/config.h @@ -0,0 +1,298 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// IWYU pragma: always_keep + +#ifndef THIRD_PARTY_CEL_C_INTERNAL_CONFIG_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_CONFIG_H_ + +#include +#include +#include + +#include "cel-c/config.h" // IWYU pragma: export + +#if defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \ + defined(__AARCH64EB__) || defined(_MIPSEB) || defined(__MIPSEB) || \ + defined(__MIPSEB__) || \ + (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ + __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#define _CEL_IS_BIG_ENDIAN 1 +#elif defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \ + defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \ + defined(__MIPSEL) || defined(__MIPSEL__) || \ + (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ + __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \ + defined(_WIN32) +#define _CEL_IS_LITTLE_ENDIAN 1 +#else +#error Endian detection needs to be set up for your environment. +#endif + +#if (defined(__clang__) && !defined(_WIN32)) || \ + (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \ + (defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__)) || \ + (defined(__CUDACC__) && __CUDACC_VER__ >= 70000) +#define _CEL_HAVE_INTRINSIC_INT128 1 +#endif + +#if defined(__cplusplus) && \ + (CEL_HAVE_FEATURE(cxx_exceptions) || \ + (!(defined(__GNUC__) && !defined(__cpp_exceptions)) && \ + !(defined(_MSC_VER) && !defined(_CPPUNWIND)))) +#define _CEL_HAVE_EXCEPTIONS 1 +#define _CEL_TRY try +#define _CEL_CATCH_ANY catch (...) +#define _CEL_RETHROW \ + do { \ + throw; \ + } while (false) +#else +#define _CEL_TRY if (true) +#define _CEL_CATCH_ANY else if (false) +#define _CEL_RETHROW \ + do { \ + } while (false) +#endif + +#if defined(__cplusplus) && (CEL_HAVE_FEATURE(cxx_rtti) || \ + (defined(__GNUC__) && defined(__GXX_RTTI)) || \ + (defined(_MSC_VER) && defined(_CPPRTTI)) || \ + (!defined(__GNUC__) && !defined(_MSC_VER))) +#define _CEL_HAVE_RTTI 1 +#endif + +#if ((defined(__GNUC__) && !defined(__clang__)) || \ + CEL_HAVE_ATTRIBUTE(weak)) && \ + !defined(_WIN32) && !defined(__MINGW32__) +#define _CEL_ATTRIBUTE_WEAK __attribute__((weak)) +#define _CEL_HAVE_ATTRIBUTE_WEAK 1 +#else +#define _CEL_ATTRIBUTE_WEAK +#define _CEL_HAVE_ATTRIBUTE_WEAK 0 +#endif + +#if ((defined(__GNUC__) && !defined(__clang__)) || CEL_HAVE_ATTRIBUTE(unused)) +#define _CEL_ATTRIBUTE_UNUSED __attribute__((unused)) +#else +#define _CEL_ATTRIBUTE_UNUSED +#endif + +#ifdef _CEL_HAVE_ASAN +#error _CEL_HAVE_ASAN cannot be directly set +#endif + +#if defined(__SANITIZE_ADDRESS__) || CEL_HAVE_FEATURE(address_sanitizer) +#define _CEL_HAVE_ASAN 1 +#endif + +#ifdef _CEL_HAVE_HWASAN +#error _CEL_HAVE_HWASAN cannot be directly set +#endif + +#if defined(__SANITIZE_HWADDRESS__) || CEL_HAVE_FEATURE(hwaddress_sanitizer) +#define _CEL_HAVE_HWASAN 1 +#endif + +#ifdef _CEL_HAVE_TSAN +#error _CEL_HAVE_TSAN cannot be directly set +#endif + +#if defined(__SANITIZE_THREAD__) || CEL_HAVE_FEATURE(thread_sanitizer) +#define _CEL_HAVE_TSAN 1 +#endif + +#ifdef _CEL_HAVE_MSAN +#error _CEL_HAVE_MSAN cannot be directly set +#endif + +#if CEL_HAVE_FEATURE(memory_sanitizer) +#define _CEL_HAVE_MSAN 1 +#endif + +#ifdef _CEL_HAVE_LSAN +#error _CEL_HAVE_LSAN cannot be directly set +#endif + +#if CEL_HAVE_FEATURE(leak_sanitizer) +#define _CEL_HAVE_LSAN 1 +#endif + +#ifdef _CEL_HAVE_SANITIZER +#error _CEL_HAVE_SANITIZER cannot be directly set +#endif + +#if defined(_CEL_HAVE_ASAN) || defined(_CEL_HAVE_HWASAN) || \ + defined(_CEL_HAVE_TSAN) || defined(_CEL_HAVE_MSAN) || \ + defined(_CEL_HAVE_LSAN) +#define _CEL_HAVE_SANITIZER 1 +#endif + +// cel_typeof/cel_typeof_unqual +// +// Expands to `typeof` and `typeof_unqual` equivalents, respectively. In C++ +// mode we remove references which do not exist in C. We also map `char8_t`, +// `char16_t`, `char32_t`, and `wchar_t` to their respective C types which are +// aliases of other builtin types instead of distinct types. Additionally we map +// enums to their underlying type. +#ifdef __cplusplus +template +struct _cel_typeof { + using type = T; +}; +template +struct _cel_typeof::value && !std::is_const::value && + !std::is_volatile::value)>::type> { + using type = + typename _cel_typeof::type>::type; +}; +template +struct _cel_typeof { + using type = typename _cel_typeof::type; +}; +template +struct _cel_typeof { + using type = typename _cel_typeof::type; +}; +template +struct _cel_typeof { + using type = typename _cel_typeof::type*; +}; +template +struct _cel_typeof { + using type = typename _cel_typeof::type[]; +}; +template +struct _cel_typeof { + using type = const typename _cel_typeof::type[]; +}; +template +struct _cel_typeof { + using type = volatile typename _cel_typeof::type[]; +}; +template +struct _cel_typeof { + using type = const volatile typename _cel_typeof::type[]; +}; +template +struct _cel_typeof { + using type = typename _cel_typeof::type[N]; +}; +template +struct _cel_typeof { + using type = const typename _cel_typeof::type[N]; +}; +template +struct _cel_typeof { + using type = volatile typename _cel_typeof::type[N]; +}; +template +struct _cel_typeof { + using type = const volatile typename _cel_typeof::type[N]; +}; +template +struct _cel_typeof { + using type = const typename _cel_typeof::type; +}; +template +struct _cel_typeof { + using type = volatile typename _cel_typeof::type; +}; +template +struct _cel_typeof { + using type = const volatile typename _cel_typeof::type; +}; +template <> +struct _cel_typeof { +#if defined(__GNUC__) || defined(__clang__) + using type = __WCHAR_TYPE__; +#elif defined(_MSC_VER) + using type = unsigned short; // NOLINT(runtime/int) +#else +#error Unexpected compiler. +#endif +}; +template <> +struct _cel_typeof { + using type = uint_least16_t; +}; +template <> +struct _cel_typeof { + using type = uint_least32_t; +}; +#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L +template <> +struct _cel_typeof { + using type = unsigned char; +}; +#endif +template +struct _cel_typeof_unqual { + using type = typename std::remove_cv::type>::type; +}; +#define cel_typeof(x) typename ::_cel_typeof::type +#define cel_typeof_unqual(x) typename ::_cel_typeof_unqual::type +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +#define cel_typeof(x) typeof(x) +#define cel_typeof_unqual(x) typeof_unqual(x) +#else +#define cel_typeof(x) __typeof__(x) +#define cel_typeof_unqual(x) __typeof_unqual__(x) +#endif + +#ifdef cel_containerof +#error cel_containerof cannot be directly set +#endif + +// cel_containerof +// +// Behaves the same as `container_of` in the Linux kernel. +#define cel_containerof(ptr, type, member) \ + ((CEL_NULLABILITY_UNKNOWN(type*))(((CEL_NULLABILITY_UNKNOWN(char*))(ptr)) - \ + offsetof(type, member))) + +#ifdef _CEL_HAVE_TYPES_COMPATIBLE +#error _CEL_HAVE_TYPES_COMPATIBLE cannot be directly set +#endif + +#ifdef _CEL_TYPES_COMPATIBLE +#error _CEL_TYPES_COMPATIBLE cannot be directly set +#endif + +#ifdef __cplusplus +#define _CEL_HAVE_TYPES_COMPATIBLE 1 +template +struct _cel_types_compatible : std::false_type {}; +template +struct _cel_types_compatible : std::true_type {}; +template +struct _cel_types_compatible : std::true_type {}; +template +struct _cel_types_compatible : _cel_types_compatible {}; +template +struct _cel_types_compatible : _cel_types_compatible {}; +#define _CEL_TYPES_COMPATIBLE(type1, type2) \ + ::_cel_types_compatible::type, \ + typename ::_cel_typeof_unqual::type>::value +#elif (defined(__GNUC__) && !defined(__clang__)) || \ + CEL_HAVE_BUILTIN(__builtin_types_compatible_p) +#define _CEL_HAVE_TYPES_COMPATIBLE 1 +#define _CEL_TYPES_COMPATIBLE(type1, type2) \ + __builtin_types_compatible_p(type1, type2) +#else +#define _CEL_TYPES_COMPATIBLE(type1, type2) true +#endif + +#endif // THIRD_PARTY_CEL_C_INTERNAL_CONFIG_H_ diff --git a/cel-c/src/config_test.cc b/cel-c/internal/config_test.cc similarity index 99% rename from cel-c/src/config_test.cc rename to cel-c/internal/config_test.cc index f9bb466..e83dd71 100644 --- a/cel-c/src/config_test.cc +++ b/cel-c/internal/config_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include #include diff --git a/cel-c/src/container.h b/cel-c/internal/container.h similarity index 94% rename from cel-c/src/container.h rename to cel-c/internal/container.h index cc1e2ac..2028cda 100644 --- a/cel-c/src/container.h +++ b/cel-c/internal/container.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_CONTAINER_H_ -#define THIRD_PARTY_CEL_C_SRC_CONTAINER_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_CONTAINER_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_CONTAINER_H_ #include #include "cel-c/alloc.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/string.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/string.h" #include "cel-c/string_view.h" CEL_BEGIN_DECLS @@ -135,4 +135,4 @@ _cel_ContainerIterator_Next(_cel_ContainerIterator* cel_nonnull iter) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_CONTAINER_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_CONTAINER_H_ diff --git a/cel-c/src/container_test.cc b/cel-c/internal/container_test.cc similarity index 98% rename from cel-c/src/container_test.cc rename to cel-c/internal/container_test.cc index 9a15eac..843f956 100644 --- a/cel-c/src/container_test.cc +++ b/cel-c/internal/container_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/container.h" +#include "cel-c/internal/container.h" #include #include diff --git a/cel-c/src/ctype.cc b/cel-c/internal/ctype.cc similarity index 99% rename from cel-c/src/ctype.cc rename to cel-c/internal/ctype.cc index 6e1cca8..60d41d6 100644 --- a/cel-c/src/ctype.cc +++ b/cel-c/internal/ctype.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/ctype.h" +#include "cel-c/internal/ctype.h" extern "C" const unsigned char _cel_CType_kProperties[256] = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, // 0x00 diff --git a/cel-c/src/ctype.h b/cel-c/internal/ctype.h similarity index 93% rename from cel-c/src/ctype.h rename to cel-c/internal/ctype.h index 36de49a..ba9589d 100644 --- a/cel-c/src/ctype.h +++ b/cel-c/internal/ctype.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_CTYPE_H_ -#define THIRD_PARTY_CEL_C_SRC_CTYPE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_CTYPE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_CTYPE_H_ #include -#include "cel-c/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -100,4 +100,4 @@ static CEL_INLINE char _cel_toupper(unsigned char c) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_CTYPE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_CTYPE_H_ diff --git a/cel-c/src/ctype_test.cc b/cel-c/internal/ctype_test.cc similarity index 98% rename from cel-c/src/ctype_test.cc rename to cel-c/internal/ctype_test.cc index dee48e0..8cba672 100644 --- a/cel-c/src/ctype_test.cc +++ b/cel-c/internal/ctype_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/ctype.h" +#include "cel-c/internal/ctype.h" #include diff --git a/cel-c/src/deque.h b/cel-c/internal/deque.h similarity index 97% rename from cel-c/src/deque.h rename to cel-c/internal/deque.h index 1cb19f5..706d3bb 100644 --- a/cel-c/src/deque.h +++ b/cel-c/internal/deque.h @@ -15,16 +15,16 @@ // Internal header providing a deque implementation which uses allocator-based // memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_DEQUE_H_ -#define THIRD_PARTY_CEL_C_SRC_DEQUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_DEQUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_DEQUE_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep #include #include "cel-c/alloc.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_deque.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_deque.h" CEL_BEGIN_DECLS @@ -272,4 +272,4 @@ static CEL_INLINE void _cel_Deque_Clear(CEL_NONNULL(_cel_Deque*) deq, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_DEQUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_DEQUE_H_ diff --git a/cel-c/src/deque_test.cc b/cel-c/internal/deque_test.cc similarity index 99% rename from cel-c/src/deque_test.cc rename to cel-c/internal/deque_test.cc index c54de2c..40be60d 100644 --- a/cel-c/src/deque_test.cc +++ b/cel-c/internal/deque_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/deque.h" +#include "cel-c/internal/deque.h" #include #include @@ -20,7 +20,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "cel-c/alloc.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/durationconv.cc b/cel-c/internal/durationconv.cc similarity index 97% rename from cel-c/src/durationconv.cc rename to cel-c/internal/durationconv.cc index 8c48724..e72c03d 100644 --- a/cel-c/src/durationconv.cc +++ b/cel-c/internal/durationconv.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/durationconv.h" +#include "cel-c/internal/durationconv.h" #include #include @@ -23,8 +23,8 @@ #include "absl/time/time.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/duration.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" diff --git a/cel-c/src/durationconv.h b/cel-c/internal/durationconv.h similarity index 92% rename from cel-c/src/durationconv.h rename to cel-c/internal/durationconv.h index e434604..a1fa36d 100644 --- a/cel-c/src/durationconv.h +++ b/cel-c/internal/durationconv.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_DURATIONCONV_H_ -#define THIRD_PARTY_CEL_C_SRC_DURATIONCONV_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_DURATIONCONV_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_DURATIONCONV_H_ #include "cel-c/arena.h" -#include "cel-c/config.h" #include "cel-c/duration.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" // NOLINTBEGIN(runtime/int) @@ -69,4 +69,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_DURATIONCONV_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_DURATIONCONV_H_ diff --git a/cel-c/src/durationconv_test.cc b/cel-c/internal/durationconv_test.cc similarity index 99% rename from cel-c/src/durationconv_test.cc rename to cel-c/internal/durationconv_test.cc index b67e650..de3adc1 100644 --- a/cel-c/src/durationconv_test.cc +++ b/cel-c/internal/durationconv_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/durationconv.h" +#include "cel-c/internal/durationconv.h" #include #include diff --git a/cel-c/src/empty_list_value.cc b/cel-c/internal/empty_list_value.cc similarity index 98% rename from cel-c/src/empty_list_value.cc rename to cel-c/internal/empty_list_value.cc index 3ae54de..22df8fb 100644 --- a/cel-c/src/empty_list_value.cc +++ b/cel-c/internal/empty_list_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/empty_list_value.h" +#include "cel-c/internal/empty_list_value.h" #include #include @@ -20,9 +20,9 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/empty_list_value.h b/cel-c/internal/empty_list_value.h similarity index 82% rename from cel-c/src/empty_list_value.h rename to cel-c/internal/empty_list_value.h index 5d41ede..1646eb9 100644 --- a/cel-c/src/empty_list_value.h +++ b/cel-c/internal/empty_list_value.h @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_EMPTY_LIST_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_EMPTY_LIST_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_EMPTY_LIST_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_EMPTY_LIST_VALUE_H_ #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/value.h" CEL_BEGIN_DECLS @@ -34,4 +34,4 @@ static CEL_INLINE void _cel_EmptyListValue_Set( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_EMPTY_LIST_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_EMPTY_LIST_VALUE_H_ diff --git a/cel-c/src/empty_list_value_test.cc b/cel-c/internal/empty_list_value_test.cc similarity index 96% rename from cel-c/src/empty_list_value_test.cc rename to cel-c/internal/empty_list_value_test.cc index a1bd3c3..e74c995 100644 --- a/cel-c/src/empty_list_value_test.cc +++ b/cel-c/internal/empty_list_value_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/empty_list_value.h" +#include "cel-c/internal/empty_list_value.h" #include @@ -20,7 +20,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/value.h" namespace { diff --git a/cel-c/src/empty_map_value.cc b/cel-c/internal/empty_map_value.cc similarity index 98% rename from cel-c/src/empty_map_value.cc rename to cel-c/internal/empty_map_value.cc index 99ed0a1..8944b3b 100644 --- a/cel-c/src/empty_map_value.cc +++ b/cel-c/internal/empty_map_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/empty_map_value.h" +#include "cel-c/internal/empty_map_value.h" #include #include @@ -20,9 +20,9 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/empty_map_value.h b/cel-c/internal/empty_map_value.h similarity index 82% rename from cel-c/src/empty_map_value.h rename to cel-c/internal/empty_map_value.h index a1e643c..b2930cb 100644 --- a/cel-c/src/empty_map_value.h +++ b/cel-c/internal/empty_map_value.h @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_EMPTY_MAP_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_EMPTY_MAP_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_EMPTY_MAP_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_EMPTY_MAP_VALUE_H_ #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/value.h" CEL_BEGIN_DECLS @@ -34,4 +34,4 @@ static CEL_INLINE void _cel_EmptyMapValue_Set( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_EMPTY_MAP_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_EMPTY_MAP_VALUE_H_ diff --git a/cel-c/src/empty_map_value_test.cc b/cel-c/internal/empty_map_value_test.cc similarity index 97% rename from cel-c/src/empty_map_value_test.cc rename to cel-c/internal/empty_map_value_test.cc index d4d17f1..98e5b40 100644 --- a/cel-c/src/empty_map_value_test.cc +++ b/cel-c/internal/empty_map_value_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/empty_map_value.h" +#include "cel-c/internal/empty_map_value.h" #include @@ -20,7 +20,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/value.h" diff --git a/cel-c/src/endian.h b/cel-c/internal/endian.h similarity index 96% rename from cel-c/src/endian.h rename to cel-c/internal/endian.h index 274d290..e865237 100644 --- a/cel-c/src/endian.h +++ b/cel-c/internal/endian.h @@ -15,8 +15,8 @@ // Internal header providing byte swapping functions. Uses compiler intrinsics // when available. -#ifndef THIRD_PARTY_CEL_C_SRC_ENDIAN_H_ -#define THIRD_PARTY_CEL_C_SRC_ENDIAN_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_ENDIAN_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_ENDIAN_H_ #include #include @@ -26,8 +26,8 @@ #endif #include "cel-c/assert.h" -#include "cel-c/src/config.h" -#include "cel-c/src/unaligned.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/unaligned.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) @@ -175,4 +175,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_ENDIAN_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_ENDIAN_H_ diff --git a/cel-c/src/endian_test.cc b/cel-c/internal/endian_test.cc similarity index 98% rename from cel-c/src/endian_test.cc rename to cel-c/internal/endian_test.cc index ab72d66..ab71bbe 100644 --- a/cel-c/src/endian_test.cc +++ b/cel-c/internal/endian_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/endian.h" +#include "cel-c/internal/endian.h" #include #include diff --git a/cel-c/src/flat_hash_map.h b/cel-c/internal/flat_hash_map.h similarity index 97% rename from cel-c/src/flat_hash_map.h rename to cel-c/internal/flat_hash_map.h index 666c0cb..1576afa 100644 --- a/cel-c/src/flat_hash_map.h +++ b/cel-c/internal/flat_hash_map.h @@ -15,8 +15,8 @@ // Internal header providing a flat hash map implementation which uses // allocator-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_FLAT_HASH_MAP_H_ -#define THIRD_PARTY_CEL_C_SRC_FLAT_HASH_MAP_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_FLAT_HASH_MAP_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_FLAT_HASH_MAP_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -24,8 +24,8 @@ #include #include "cel-c/alloc.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_flat_hash.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_flat_hash.h" CEL_BEGIN_DECLS @@ -279,4 +279,4 @@ static CEL_INLINE bool _cel_FlatHashMap_MutableNext( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_FLAT_HASH_MAP_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_FLAT_HASH_MAP_H_ diff --git a/cel-c/src/flat_hash_map_test.cc b/cel-c/internal/flat_hash_map_test.cc similarity index 98% rename from cel-c/src/flat_hash_map_test.cc rename to cel-c/internal/flat_hash_map_test.cc index cb8f224..1d7df67 100644 --- a/cel-c/src/flat_hash_map_test.cc +++ b/cel-c/internal/flat_hash_map_test.cc @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/flat_hash_map.h" +#include "cel-c/internal/flat_hash_map.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include "cel-c/alloc.h" -#include "cel-c/config.h" #include "cel-c/hash.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/flat_hash_set.h b/cel-c/internal/flat_hash_set.h similarity index 97% rename from cel-c/src/flat_hash_set.h rename to cel-c/internal/flat_hash_set.h index 978e654..a580d6b 100644 --- a/cel-c/src/flat_hash_set.h +++ b/cel-c/internal/flat_hash_set.h @@ -15,8 +15,8 @@ // Internal header providing a flat hash map implementation which uses // allocator-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_FLAT_HASH_SET_H_ -#define THIRD_PARTY_CEL_C_SRC_FLAT_HASH_SET_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_FLAT_HASH_SET_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_FLAT_HASH_SET_H_ #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -24,8 +24,8 @@ #include #include "cel-c/alloc.h" -#include "cel-c/config.h" -#include "cel-c/src/generic_flat_hash.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_flat_hash.h" CEL_BEGIN_DECLS @@ -270,4 +270,4 @@ static CEL_INLINE bool _cel_FlatHashSet_MutableNext( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_FLAT_HASH_SET_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_FLAT_HASH_SET_H_ diff --git a/cel-c/src/flat_hash_set_test.cc b/cel-c/internal/flat_hash_set_test.cc similarity index 98% rename from cel-c/src/flat_hash_set_test.cc rename to cel-c/internal/flat_hash_set_test.cc index 1f733a6..aac4431 100644 --- a/cel-c/src/flat_hash_set_test.cc +++ b/cel-c/internal/flat_hash_set_test.cc @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/flat_hash_set.h" +#include "cel-c/internal/flat_hash_set.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include "cel-c/alloc.h" -#include "cel-c/config.h" #include "cel-c/hash.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/generic_array.cc b/cel-c/internal/generic_array.cc similarity index 98% rename from cel-c/src/generic_array.cc rename to cel-c/internal/generic_array.cc index 788ef04..6e1c22d 100644 --- a/cel-c/src/generic_array.cc +++ b/cel-c/internal/generic_array.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/generic_array.h" +#include "cel-c/internal/generic_array.h" #include #include // IWYU pragma: keep @@ -22,9 +22,9 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/src/asan.h" -#include "cel-c/src/ckdint.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/asan.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/config.h" static void _cel_GenericArray_Annotate(CEL_NULLABLE(const void*) ptr, size_t cap, size_t old_len, diff --git a/cel-c/src/generic_array.h b/cel-c/internal/generic_array.h similarity index 97% rename from cel-c/src/generic_array.h rename to cel-c/internal/generic_array.h index 83098cf..d6fcbeb 100644 --- a/cel-c/src/generic_array.h +++ b/cel-c/internal/generic_array.h @@ -15,10 +15,10 @@ // Internal header providing a generic dynamic array implementation. // IWYU pragma: private -// IWYU pragma: friend "cel-c/src/(?:(?:arena|generic)_)?array\.[hc]" +// IWYU pragma: friend "cel-c/internal/(?:(?:arena|generic)_)?array\.[hc]" -#ifndef THIRD_PARTY_CEL_C_SRC_GENERIC_ARRAY_H_ -#define THIRD_PARTY_CEL_C_SRC_GENERIC_ARRAY_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_GENERIC_ARRAY_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_GENERIC_ARRAY_H_ #include // IWYU pragma: keep #include @@ -26,7 +26,7 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -371,4 +371,4 @@ static CEL_INLINE CEL_NULLABLE(void*) CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_GENERIC_ARRAY_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_GENERIC_ARRAY_H_ diff --git a/cel-c/src/generic_deque.cc b/cel-c/internal/generic_deque.cc similarity index 99% rename from cel-c/src/generic_deque.cc rename to cel-c/internal/generic_deque.cc index 9ec1819..a8d27b6 100644 --- a/cel-c/src/generic_deque.cc +++ b/cel-c/internal/generic_deque.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/generic_deque.h" +#include "cel-c/internal/generic_deque.h" #include #include // IWYU pragma: keep @@ -22,9 +22,9 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/align.h" -#include "cel-c/src/asan.h" +#include "cel-c/internal/align.h" +#include "cel-c/internal/asan.h" +#include "cel-c/internal/config.h" typedef struct _cel_GenericDequeBlock _cel_GenericDequeBlock; diff --git a/cel-c/src/generic_deque.h b/cel-c/internal/generic_deque.h similarity index 96% rename from cel-c/src/generic_deque.h rename to cel-c/internal/generic_deque.h index d0aa947..f80d944 100644 --- a/cel-c/src/generic_deque.h +++ b/cel-c/internal/generic_deque.h @@ -15,10 +15,10 @@ // Internal header providing a generic deque implementation. // IWYU pragma: private -// IWYU pragma: friend "cel-c/src/(?:(?:arena|generic)_)?deque\.[hc]" +// IWYU pragma: friend "cel-c/internal/(?:(?:arena|generic)_)?deque\.[hc]" -#ifndef THIRD_PARTY_CEL_C_SRC_GENERIC_DEQUE_H_ -#define THIRD_PARTY_CEL_C_SRC_GENERIC_DEQUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_GENERIC_DEQUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_GENERIC_DEQUE_H_ #include // IWYU pragma: keep #include @@ -26,7 +26,7 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -232,4 +232,4 @@ void _cel_GenericDeque_ClearArena(CEL_NONNULL(_cel_GenericDeque*) deq); CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_GENERIC_DEQUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_GENERIC_DEQUE_H_ diff --git a/cel-c/src/generic_flat_hash.cc b/cel-c/internal/generic_flat_hash.cc similarity index 98% rename from cel-c/src/generic_flat_hash.cc rename to cel-c/internal/generic_flat_hash.cc index f45ad33..2580724 100644 --- a/cel-c/src/generic_flat_hash.cc +++ b/cel-c/internal/generic_flat_hash.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/generic_flat_hash.h" +#include "cel-c/internal/generic_flat_hash.h" #include #include // IWYU pragma: keep @@ -24,10 +24,10 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/align.h" -#include "cel-c/src/bit.h" -#include "cel-c/src/bitset.h" +#include "cel-c/internal/align.h" +#include "cel-c/internal/bit.h" +#include "cel-c/internal/bitset.h" +#include "cel-c/internal/config.h" CEL_ATTRIBUTE_NODISCARD static size_t _cel_GenericFlatHash_Rehash( diff --git a/cel-c/src/generic_flat_hash.h b/cel-c/internal/generic_flat_hash.h similarity index 94% rename from cel-c/src/generic_flat_hash.h rename to cel-c/internal/generic_flat_hash.h index 615246f..0142655 100644 --- a/cel-c/src/generic_flat_hash.h +++ b/cel-c/internal/generic_flat_hash.h @@ -15,10 +15,10 @@ // Internal header providing a generic flat hash implementation. // IWYU pragma: private -// IWYU pragma: friend "cel-c/src/(?:(?:arena|generic)_)?flat_hash(?:_(?:set|map))?\.[hc]" +// IWYU pragma: friend "cel-c/internal/(?:(?:arena|generic)_)?flat_hash(?:_(?:set|map))?\.[hc]" -#ifndef THIRD_PARTY_CEL_C_SRC_GENERIC_FLAT_HASH_H_ -#define THIRD_PARTY_CEL_C_SRC_GENERIC_FLAT_HASH_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_GENERIC_FLAT_HASH_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_GENERIC_FLAT_HASH_H_ #include // IWYU pragma: keep #include @@ -26,8 +26,8 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/bitset.h" +#include "cel-c/internal/bitset.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -157,4 +157,4 @@ static CEL_INLINE bool _cel_GenericFlatHash_MutableNext( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_GENERIC_FLAT_HASH_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_GENERIC_FLAT_HASH_H_ diff --git a/cel-c/src/generic_string.cc b/cel-c/internal/generic_string.cc similarity index 99% rename from cel-c/src/generic_string.cc rename to cel-c/internal/generic_string.cc index 792100c..020f432 100644 --- a/cel-c/src/generic_string.cc +++ b/cel-c/internal/generic_string.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/generic_string.h" +#include "cel-c/internal/generic_string.h" #include #include @@ -26,9 +26,9 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/asan.h" -#include "cel-c/src/ckdint.h" +#include "cel-c/internal/asan.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" static void _cel_GenericString_AnnotateNew(CEL_NONNULL(char*) str, size_t len, diff --git a/cel-c/src/generic_string.h b/cel-c/internal/generic_string.h similarity index 97% rename from cel-c/src/generic_string.h rename to cel-c/internal/generic_string.h index ffd6e4e..0ec3b82 100644 --- a/cel-c/src/generic_string.h +++ b/cel-c/internal/generic_string.h @@ -15,10 +15,10 @@ // Internal header providing a generic string implementation. // IWYU pragma: private -// IWYU pragma: friend "cel-c/src/(?:(?:arena|generic)_)?string\.[hc]" +// IWYU pragma: friend "cel-c/internal/(?:(?:arena|generic)_)?string\.[hc]" -#ifndef THIRD_PARTY_CEL_C_SRC_GENERIC_STRING_H_ -#define THIRD_PARTY_CEL_C_SRC_GENERIC_STRING_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_GENERIC_STRING_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_GENERIC_STRING_H_ #include #include @@ -29,8 +29,8 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/cstring_view.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" CEL_BEGIN_DECLS @@ -263,4 +263,4 @@ _cel_GenericString_ToCStringView(CEL_NONNULL(const _cel_GenericString*) str) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_GENERIC_STRING_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_GENERIC_STRING_H_ diff --git a/cel-c/src/generic_string_test.cc b/cel-c/internal/generic_string_test.cc similarity index 96% rename from cel-c/src/generic_string_test.cc rename to cel-c/internal/generic_string_test.cc index 3e52bcd..0515d60 100644 --- a/cel-c/src/generic_string_test.cc +++ b/cel-c/internal/generic_string_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/generic_string.h" +#include "cel-c/internal/generic_string.h" #include diff --git a/cel-c/src/list_value.cc b/cel-c/internal/list_value.cc similarity index 99% rename from cel-c/src/list_value.cc rename to cel-c/internal/list_value.cc index b188ba6..f616cdb 100644 --- a/cel-c/src/list_value.cc +++ b/cel-c/internal/list_value.cc @@ -18,7 +18,7 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/value.h" diff --git a/cel-c/src/list_value_test.cc b/cel-c/internal/list_value_test.cc similarity index 98% rename from cel-c/src/list_value_test.cc rename to cel-c/internal/list_value_test.cc index c2aff38..195aad2 100644 --- a/cel-c/src/list_value_test.cc +++ b/cel-c/internal/list_value_test.cc @@ -15,11 +15,11 @@ #include #include "gtest/gtest.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/empty_list_value.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_list_value.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/malloc.cc b/cel-c/internal/malloc.cc similarity index 96% rename from cel-c/src/malloc.cc rename to cel-c/internal/malloc.cc index 4896d9b..60f0c74 100644 --- a/cel-c/src/malloc.cc +++ b/cel-c/internal/malloc.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/malloc.h" +#include "cel-c/internal/malloc.h" #if defined(__APPLE__) #include @@ -31,9 +31,9 @@ #include #include "cel-c/assert.h" -#include "cel-c/src/bit.h" -#include "cel-c/src/ckdint.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/bit.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/config.h" #ifdef _CEL_HAVE_SANITIZER #include diff --git a/cel-c/src/malloc.h b/cel-c/internal/malloc.h similarity index 94% rename from cel-c/src/malloc.h rename to cel-c/internal/malloc.h index 937a8b4..b06c1fd 100644 --- a/cel-c/src/malloc.h +++ b/cel-c/internal/malloc.h @@ -14,12 +14,12 @@ // Internal header exposing an interface to malloc. -#ifndef THIRD_PARTY_CEL_C_SRC_MALLOC_H_ -#define THIRD_PARTY_CEL_C_SRC_MALLOC_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MALLOC_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MALLOC_H_ #include -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -80,4 +80,4 @@ void _cel_FreeSized(CEL_NULLABLE(void*) addr, size_t size); CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MALLOC_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MALLOC_H_ diff --git a/cel-c/src/malloc_test.cc b/cel-c/internal/malloc_test.cc similarity index 95% rename from cel-c/src/malloc_test.cc rename to cel-c/internal/malloc_test.cc index 516b0a2..1eab7f8 100644 --- a/cel-c/src/malloc_test.cc +++ b/cel-c/internal/malloc_test.cc @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/malloc.h" +#include "cel-c/internal/malloc.h" #include #include #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" -#include "cel-c/src/align.h" +#include "cel-c/internal/align.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/map_value.cc b/cel-c/internal/map_value.cc similarity index 98% rename from cel-c/src/map_value.cc rename to cel-c/internal/map_value.cc index c749fad..a2a2b49 100644 --- a/cel-c/src/map_value.cc +++ b/cel-c/internal/map_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/map_value.h" +#include "cel-c/internal/map_value.h" #include #include @@ -20,9 +20,9 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/array.h" -#include "cel-c/src/sort.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/sort.h" #include "cel-c/status.h" #include "cel-c/value.h" #include "cel-c/value_kind.h" diff --git a/cel-c/src/map_value.h b/cel-c/internal/map_value.h similarity index 98% rename from cel-c/src/map_value.h rename to cel-c/internal/map_value.h index c4ecfb6..74a4b69 100644 --- a/cel-c/src/map_value.h +++ b/cel-c/internal/map_value.h @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_MAP_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_MAP_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MAP_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MAP_VALUE_H_ #include -#include "cel-c/config.h" #include "cel-c/hash.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #include "cel-c/value.h" #include "upb/base/descriptor_constants.h" @@ -378,4 +378,4 @@ static inline void _cel_MapValueKey_FromMessageValue( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MAP_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MAP_VALUE_H_ diff --git a/cel-c/src/map_value_test.cc b/cel-c/internal/map_value_test.cc similarity index 99% rename from cel-c/src/map_value_test.cc rename to cel-c/internal/map_value_test.cc index 13fc79d..6e9a527 100644 --- a/cel-c/src/map_value_test.cc +++ b/cel-c/internal/map_value_test.cc @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/map_value.h" +#include "cel-c/internal/map_value.h" #include #include #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" #include "cel-c/hash.h" -#include "cel-c/src/empty_map_value.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_map_value.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/memory.cc b/cel-c/internal/memory.cc similarity index 98% rename from cel-c/src/memory.cc rename to cel-c/internal/memory.cc index e2b4d39..f2f94d0 100644 --- a/cel-c/src/memory.cc +++ b/cel-c/internal/memory.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/memory.h" +#include "cel-c/internal/memory.h" #include // IWYU pragma: keep #include #include #include "cel-c/assert.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" #ifndef __GLIBC__ static inline void* memrchr(const void* b, int c, size_t len) { diff --git a/cel-c/src/memory.h b/cel-c/internal/memory.h similarity index 94% rename from cel-c/src/memory.h rename to cel-c/internal/memory.h index 76f9a02..7bd95b0 100644 --- a/cel-c/src/memory.h +++ b/cel-c/internal/memory.h @@ -14,13 +14,13 @@ // Internal header providing miscellaneous memory functions. -#ifndef THIRD_PARTY_CEL_C_SRC_MEMORY_H_ -#define THIRD_PARTY_CEL_C_SRC_MEMORY_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MEMORY_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MEMORY_H_ #include #include -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -86,4 +86,4 @@ _cel_Memory_FindLast(CEL_NULLABLE(const void*) hay_data, size_t hay_size, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MEMORY_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MEMORY_H_ diff --git a/cel-c/src/memory_test.cc b/cel-c/internal/memory_test.cc similarity index 99% rename from cel-c/src/memory_test.cc rename to cel-c/internal/memory_test.cc index df19dcb..14248d2 100644 --- a/cel-c/src/memory_test.cc +++ b/cel-c/internal/memory_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/memory.h" +#include "cel-c/internal/memory.h" #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/cel-c/src/message_equality.cc b/cel-c/internal/message_equality.cc similarity index 99% rename from cel-c/src/message_equality.cc rename to cel-c/internal/message_equality.cc index 1836679..8d3f0a7 100644 --- a/cel-c/src/message_equality.cc +++ b/cel-c/internal/message_equality.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/message_equality.h" +#include "cel-c/internal/message_equality.h" #include #include @@ -21,10 +21,10 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/any.h" -#include "cel-c/src/number.h" -#include "cel-c/src/setjmp.h" +#include "cel-c/internal/any.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/number.h" +#include "cel-c/internal/setjmp.h" #include "cel-c/string_view.h" #include "cel-c/well_known_types.h" #include "upb/base/descriptor_constants.h" diff --git a/cel-c/src/message_equality.h b/cel-c/internal/message_equality.h similarity index 90% rename from cel-c/src/message_equality.h rename to cel-c/internal/message_equality.h index 9985fa1..d2174fd 100644 --- a/cel-c/src/message_equality.h +++ b/cel-c/internal/message_equality.h @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_MESSAGE_EQUALITY_H_ -#define THIRD_PARTY_CEL_C_SRC_MESSAGE_EQUALITY_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MESSAGE_EQUALITY_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MESSAGE_EQUALITY_H_ #include #include "cel-c/alloc.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/well_known_types.h" #include "upb/message/array.h" #include "upb/message/message.h" @@ -62,4 +62,4 @@ _cel_MessageEquality _cel_MessageField_Equals( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MESSAGE_EQUALITY_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MESSAGE_EQUALITY_H_ diff --git a/cel-c/src/message_equality_test.cc b/cel-c/internal/message_equality_test.cc similarity index 99% rename from cel-c/src/message_equality_test.cc rename to cel-c/internal/message_equality_test.cc index a4c7a0f..ace2d46 100644 --- a/cel-c/src/message_equality_test.cc +++ b/cel-c/internal/message_equality_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/message_equality.h" +#include "cel-c/internal/message_equality.h" #include #include @@ -41,7 +41,7 @@ #include "absl/types/variant.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/well_known_types.h" #include "cel/expr/conformance/proto3/test_all_types.pb.h" diff --git a/cel-c/src/mutable_list_value.cc b/cel-c/internal/mutable_list_value.cc similarity index 98% rename from cel-c/src/mutable_list_value.cc rename to cel-c/internal/mutable_list_value.cc index 2da0489..b07a776 100644 --- a/cel-c/src/mutable_list_value.cc +++ b/cel-c/internal/mutable_list_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/mutable_list_value.h" +#include "cel-c/internal/mutable_list_value.h" #include #include @@ -22,11 +22,11 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/ckdint.h" -#include "cel-c/src/empty_list_value.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_list_value.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/mutable_list_value.h b/cel-c/internal/mutable_list_value.h similarity index 90% rename from cel-c/src/mutable_list_value.h rename to cel-c/internal/mutable_list_value.h index e642e98..fc6adf1 100644 --- a/cel-c/src/mutable_list_value.h +++ b/cel-c/internal/mutable_list_value.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_MUTABLE_LIST_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_MUTABLE_LIST_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MUTABLE_LIST_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MUTABLE_LIST_VALUE_H_ #include #include #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/value.h" CEL_BEGIN_DECLS @@ -61,4 +61,4 @@ static CEL_INLINE cel_Value* cel_nullable _cel_MutableListValue_Add( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MUTABLE_LIST_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MUTABLE_LIST_VALUE_H_ diff --git a/cel-c/src/mutable_list_value_test.cc b/cel-c/internal/mutable_list_value_test.cc similarity index 98% rename from cel-c/src/mutable_list_value_test.cc rename to cel-c/internal/mutable_list_value_test.cc index d6591dd..990c89b 100644 --- a/cel-c/src/mutable_list_value_test.cc +++ b/cel-c/internal/mutable_list_value_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/mutable_list_value.h" +#include "cel-c/internal/mutable_list_value.h" #include #include @@ -23,7 +23,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" #include "cel-c/value.h" diff --git a/cel-c/src/mutable_map_value.cc b/cel-c/internal/mutable_map_value.cc similarity index 98% rename from cel-c/src/mutable_map_value.cc rename to cel-c/internal/mutable_map_value.cc index b86c8f4..9d97bfd 100644 --- a/cel-c/src/mutable_map_value.cc +++ b/cel-c/internal/mutable_map_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/mutable_map_value.h" +#include "cel-c/internal/mutable_map_value.h" #include #include @@ -23,13 +23,13 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" #include "cel-c/hash.h" -#include "cel-c/src/bit.h" -#include "cel-c/src/empty_map_value.h" -#include "cel-c/src/map_value.h" +#include "cel-c/internal/bit.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_map_value.h" +#include "cel-c/internal/map_value.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/mutable_map_value.h b/cel-c/internal/mutable_map_value.h similarity index 90% rename from cel-c/src/mutable_map_value.h rename to cel-c/internal/mutable_map_value.h index 41280ef..22a28bc 100644 --- a/cel-c/src/mutable_map_value.h +++ b/cel-c/internal/mutable_map_value.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_MUTABLE_MAP_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_MUTABLE_MAP_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MUTABLE_MAP_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MUTABLE_MAP_VALUE_H_ #include #include #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/value.h" CEL_BEGIN_DECLS @@ -63,4 +63,4 @@ _cel_MutableMapValueInsertResult _cel_MutableMapValue_Insert( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MUTABLE_MAP_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MUTABLE_MAP_VALUE_H_ diff --git a/cel-c/src/mutable_map_value_test.cc b/cel-c/internal/mutable_map_value_test.cc similarity index 99% rename from cel-c/src/mutable_map_value_test.cc rename to cel-c/internal/mutable_map_value_test.cc index ca44326..6bff0eb 100644 --- a/cel-c/src/mutable_map_value_test.cc +++ b/cel-c/internal/mutable_map_value_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/mutable_map_value.h" +#include "cel-c/internal/mutable_map_value.h" #include #include @@ -23,7 +23,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" #include "cel-c/value.h" diff --git a/cel-c/src/number.h b/cel-c/internal/number.h similarity index 98% rename from cel-c/src/number.h rename to cel-c/internal/number.h index 785c336..6a33b28 100644 --- a/cel-c/src/number.h +++ b/cel-c/internal/number.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_NUMERIC_H_ -#define THIRD_PARTY_CEL_C_SRC_NUMERIC_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_NUMERIC_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_NUMERIC_H_ #include #include @@ -22,8 +22,8 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/compare.h" +#include "cel-c/internal/compare.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -361,4 +361,4 @@ static CEL_INLINE double _cel_Number_ToDouble(_cel_Number in) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_NUMERIC_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_NUMERIC_H_ diff --git a/cel-c/src/number_test.cc b/cel-c/internal/number_test.cc similarity index 99% rename from cel-c/src/number_test.cc rename to cel-c/internal/number_test.cc index beb2782..aae47f9 100644 --- a/cel-c/src/number_test.cc +++ b/cel-c/internal/number_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/number.h" +#include "cel-c/internal/number.h" #include #include #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/compare.h" +#include "cel-c/internal/compare.h" namespace { diff --git a/cel-c/src/opaque_value.cc b/cel-c/internal/opaque_value.cc similarity index 98% rename from cel-c/src/opaque_value.cc rename to cel-c/internal/opaque_value.cc index 822fa3a..88bef18 100644 --- a/cel-c/src/opaque_value.cc +++ b/cel-c/internal/opaque_value.cc @@ -17,7 +17,7 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/opaque_value_test.cc b/cel-c/internal/opaque_value_test.cc similarity index 96% rename from cel-c/src/opaque_value_test.cc rename to cel-c/internal/opaque_value_test.cc index a13cd79..3b1fadc 100644 --- a/cel-c/src/opaque_value_test.cc +++ b/cel-c/internal/opaque_value_test.cc @@ -13,8 +13,8 @@ // limitations under the License. #include "gtest/gtest.h" -#include "cel-c/config.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/optional_value.cc b/cel-c/internal/optional_value.cc similarity index 99% rename from cel-c/src/optional_value.cc rename to cel-c/internal/optional_value.cc index 23ad29a..f456992 100644 --- a/cel-c/src/optional_value.cc +++ b/cel-c/internal/optional_value.cc @@ -18,10 +18,10 @@ #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/duration.h" #include "cel-c/error.h" #include "cel-c/error_code.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" diff --git a/cel-c/src/optional_value_test.cc b/cel-c/internal/optional_value_test.cc similarity index 99% rename from cel-c/src/optional_value_test.cc rename to cel-c/internal/optional_value_test.cc index 1b758c7..bc0a5d4 100644 --- a/cel-c/src/optional_value_test.cc +++ b/cel-c/internal/optional_value_test.cc @@ -14,8 +14,8 @@ #include "gtest/gtest.h" #include "cel-c/duration.h" -#include "cel-c/src/empty_list_value.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/empty_list_value.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" #include "cel-c/value.h" diff --git a/cel-c/src/parsed_map_field_value.cc b/cel-c/internal/parsed_map_field_value.cc similarity index 98% rename from cel-c/src/parsed_map_field_value.cc rename to cel-c/internal/parsed_map_field_value.cc index 038f8be..1050064 100644 --- a/cel-c/src/parsed_map_field_value.cc +++ b/cel-c/internal/parsed_map_field_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/parsed_map_field_value.h" +#include "cel-c/internal/parsed_map_field_value.h" #include #include @@ -21,11 +21,11 @@ #include "cel-c/alloc.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/map_value.h" -#include "cel-c/src/message_equality.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/map_value.h" +#include "cel-c/internal/message_equality.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/parsed_map_field_value.h b/cel-c/internal/parsed_map_field_value.h similarity index 83% rename from cel-c/src/parsed_map_field_value.h rename to cel-c/internal/parsed_map_field_value.h index 96c4f61..1e5db57 100644 --- a/cel-c/src/parsed_map_field_value.h +++ b/cel-c/internal/parsed_map_field_value.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_PARSED_MAP_FIELD_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_PARSED_MAP_FIELD_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_PARSED_MAP_FIELD_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_PARSED_MAP_FIELD_VALUE_H_ #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/empty_map_value.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_map_value.h" #include "cel-c/value.h" #include "upb/message/map.h" #include "upb/reflection/def.h" @@ -44,4 +44,4 @@ static CEL_INLINE void _cel_ParsedMapFieldValue_Set( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_PARSED_MAP_FIELD_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_PARSED_MAP_FIELD_VALUE_H_ diff --git a/cel-c/src/parsed_map_field_value_test.cc b/cel-c/internal/parsed_map_field_value_test.cc similarity index 99% rename from cel-c/src/parsed_map_field_value_test.cc rename to cel-c/internal/parsed_map_field_value_test.cc index f559334..d98aad3 100644 --- a/cel-c/src/parsed_map_field_value_test.cc +++ b/cel-c/internal/parsed_map_field_value_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/parsed_map_field_value.h" +#include "cel-c/internal/parsed_map_field_value.h" #include #include @@ -23,7 +23,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" diff --git a/cel-c/src/parsed_message_value.cc b/cel-c/internal/parsed_message_value.cc similarity index 98% rename from cel-c/src/parsed_message_value.cc rename to cel-c/internal/parsed_message_value.cc index dbb4e64..fd69717 100644 --- a/cel-c/src/parsed_message_value.cc +++ b/cel-c/internal/parsed_message_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/parsed_message_value.h" +#include "cel-c/internal/parsed_message_value.h" #include #include @@ -21,10 +21,10 @@ #include "cel-c/alloc.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/message_equality.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/message_equality.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/parsed_message_value.h b/cel-c/internal/parsed_message_value.h similarity index 86% rename from cel-c/src/parsed_message_value.h rename to cel-c/internal/parsed_message_value.h index eb0f4fa..e5a2783 100644 --- a/cel-c/src/parsed_message_value.h +++ b/cel-c/internal/parsed_message_value.h @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_PARSED_MESSAGE_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_PARSED_MESSAGE_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_PARSED_MESSAGE_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_PARSED_MESSAGE_VALUE_H_ #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/type.h" #include "cel-c/value.h" #include "upb/message/message.h" @@ -42,4 +42,4 @@ static CEL_INLINE void _cel_ParsedMessageValue_Set( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_PARSED_MESSAGE_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_PARSED_MESSAGE_VALUE_H_ diff --git a/cel-c/src/parsed_message_value_test.cc b/cel-c/internal/parsed_message_value_test.cc similarity index 99% rename from cel-c/src/parsed_message_value_test.cc rename to cel-c/internal/parsed_message_value_test.cc index 7d5e252..8996652 100644 --- a/cel-c/src/parsed_message_value_test.cc +++ b/cel-c/internal/parsed_message_value_test.cc @@ -1,4 +1,4 @@ -#include "cel-c/src/parsed_message_value.h" +#include "cel-c/internal/parsed_message_value.h" #include #include @@ -9,7 +9,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" #include "cel-c/value.h" diff --git a/cel-c/src/parsed_repeated_field_value.cc b/cel-c/internal/parsed_repeated_field_value.cc similarity index 98% rename from cel-c/src/parsed_repeated_field_value.cc rename to cel-c/internal/parsed_repeated_field_value.cc index f959b4f..d2bcee0 100644 --- a/cel-c/src/parsed_repeated_field_value.cc +++ b/cel-c/internal/parsed_repeated_field_value.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/parsed_repeated_field_value.h" +#include "cel-c/internal/parsed_repeated_field_value.h" #include #include @@ -21,10 +21,10 @@ #include "cel-c/alloc.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/message_equality.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/message_equality.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/parsed_repeated_field_value.h b/cel-c/internal/parsed_repeated_field_value.h similarity index 83% rename from cel-c/src/parsed_repeated_field_value.h rename to cel-c/internal/parsed_repeated_field_value.h index d3eb409..3d5075a 100644 --- a/cel-c/src/parsed_repeated_field_value.h +++ b/cel-c/internal/parsed_repeated_field_value.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_PARSED_REPEATED_FIELD_VALUE_H_ -#define THIRD_PARTY_CEL_C_SRC_PARSED_REPEATED_FIELD_VALUE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_PARSED_REPEATED_FIELD_VALUE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_PARSED_REPEATED_FIELD_VALUE_H_ #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/empty_list_value.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_list_value.h" #include "cel-c/value.h" #include "upb/message/array.h" #include "upb/reflection/def.h" @@ -46,4 +46,4 @@ static CEL_INLINE void _cel_ParsedRepeatedFieldValue_Set( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_PARSED_REPEATED_FIELD_VALUE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_PARSED_REPEATED_FIELD_VALUE_H_ diff --git a/cel-c/src/parsed_repeated_field_value_test.cc b/cel-c/internal/parsed_repeated_field_value_test.cc similarity index 98% rename from cel-c/src/parsed_repeated_field_value_test.cc rename to cel-c/internal/parsed_repeated_field_value_test.cc index 597f181..a185f4c 100644 --- a/cel-c/src/parsed_repeated_field_value_test.cc +++ b/cel-c/internal/parsed_repeated_field_value_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/parsed_repeated_field_value.h" +#include "cel-c/internal/parsed_repeated_field_value.h" #include #include @@ -23,7 +23,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" #include "cel-c/value.h" diff --git a/cel-c/src/rc.h b/cel-c/internal/rc.h similarity index 94% rename from cel-c/src/rc.h rename to cel-c/internal/rc.h index 1d68c31..e7a3ef7 100644 --- a/cel-c/src/rc.h +++ b/cel-c/internal/rc.h @@ -14,14 +14,14 @@ // Internal header providing thread-compatible reference counting. -#ifndef THIRD_PARTY_CEL_C_SRC_RC_H_ -#define THIRD_PARTY_CEL_C_SRC_RC_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RC_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RC_H_ #include #include // IWYU pragma: keep #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" // NOLINTBEGIN(runtime/int) // NOLINTBEGIN(google-runtime-int) @@ -97,4 +97,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_RC_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RC_H_ diff --git a/cel-c/src/rc_test.cc b/cel-c/internal/rc_test.cc similarity index 95% rename from cel-c/src/rc_test.cc rename to cel-c/internal/rc_test.cc index af0b160..5e365a1 100644 --- a/cel-c/src/rc_test.cc +++ b/cel-c/internal/rc_test.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/rc.h" +#include "cel-c/internal/rc.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/regexp.cc b/cel-c/internal/regexp.cc similarity index 98% rename from cel-c/src/regexp.cc rename to cel-c/internal/regexp.cc index 2aa2e6f..c36a429 100644 --- a/cel-c/src/regexp.cc +++ b/cel-c/internal/regexp.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/regexp.h" +#include "cel-c/internal/regexp.h" #include #include @@ -21,9 +21,9 @@ #include "absl/strings/string_view.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/alloca.h" -#include "cel-c/src/malloc.h" +#include "cel-c/internal/alloca.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/malloc.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/regexp.h b/cel-c/internal/regexp.h similarity index 93% rename from cel-c/src/regexp.h rename to cel-c/internal/regexp.h index 98e3726..7ed736a 100644 --- a/cel-c/src/regexp.h +++ b/cel-c/internal/regexp.h @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_REGEXP_H_ -#define THIRD_PARTY_CEL_C_SRC_REGEXP_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_REGEXP_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_REGEXP_H_ #include #include #include -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" @@ -83,4 +83,4 @@ bool _cel_RegExp_Matches(cel_StringView pattern, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_REGEXP_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_REGEXP_H_ diff --git a/cel-c/src/regexp_test.cc b/cel-c/internal/regexp_test.cc similarity index 98% rename from cel-c/src/regexp_test.cc rename to cel-c/internal/regexp_test.cc index bb23b56..ac69c23 100644 --- a/cel-c/src/regexp_test.cc +++ b/cel-c/internal/regexp_test.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/regexp.h" +#include "cel-c/internal/regexp.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/runtime/BUILD b/cel-c/internal/runtime/BUILD similarity index 74% rename from cel-c/src/runtime/BUILD rename to cel-c/internal/runtime/BUILD index 0cc6995..1f23a78 100644 --- a/cel-c/src/runtime/BUILD +++ b/cel-c/internal/runtime/BUILD @@ -43,7 +43,6 @@ cc_library( "//cel-c:ast", "//cel-c:ast_traverse", "//cel-c:ast_visitor", - "//cel-c:config", "//cel-c:constant", "//cel-c:duration", "//cel-c:error", @@ -60,23 +59,23 @@ cc_library( "//cel-c:value", "//cel-c:value_kind", "//cel-c:well_known_types", - "//cel-c/src:arc", - "//cel-c/src:array", - "//cel-c/src:charconv", - "//cel-c/src:ckdint", - "//cel-c/src:compare", - "//cel-c/src:config", - "//cel-c/src:container", - "//cel-c/src:deque", - "//cel-c/src:durationconv", - "//cel-c/src:flat_hash_map", - "//cel-c/src:number", - "//cel-c/src:regexp", - "//cel-c/src:setjmp", - "//cel-c/src:string", - "//cel-c/src:timestampconv", - "//cel-c/src:utf8", - "//cel-c/src:value", + "//cel-c/internal:arc", + "//cel-c/internal:array", + "//cel-c/internal:charconv", + "//cel-c/internal:ckdint", + "//cel-c/internal:compare", + "//cel-c/internal:config", + "//cel-c/internal:container", + "//cel-c/internal:deque", + "//cel-c/internal:durationconv", + "//cel-c/internal:flat_hash_map", + "//cel-c/internal:number", + "//cel-c/internal:regexp", + "//cel-c/internal:setjmp", + "//cel-c/internal:string", + "//cel-c/internal:timestampconv", + "//cel-c/internal:utf8", + "//cel-c/internal:value", "@protobuf//upb/reflection", ], ) diff --git a/cel-c/src/runtime/activation.cc b/cel-c/internal/runtime/activation.cc similarity index 93% rename from cel-c/src/runtime/activation.cc rename to cel-c/internal/runtime/activation.cc index 491e232..f446e10 100644 --- a/cel-c/src/runtime/activation.cc +++ b/cel-c/internal/runtime/activation.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/runtime/activation.h" +#include "cel-c/internal/runtime/activation.h" #include #include @@ -21,11 +21,11 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/runtime/instr.h" -#include "cel-c/src/runtime/interpretable.h" -#include "cel-c/src/runtime/program.h" -#include "cel-c/src/runtime/runtime.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/runtime/instr.h" +#include "cel-c/internal/runtime/interpretable.h" +#include "cel-c/internal/runtime/program.h" +#include "cel-c/internal/runtime/runtime.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/trilean.h" diff --git a/cel-c/src/runtime/activation.h b/cel-c/internal/runtime/activation.h similarity index 87% rename from cel-c/src/runtime/activation.h rename to cel-c/internal/runtime/activation.h index b6adfaf..8e52c05 100644 --- a/cel-c/src/runtime/activation.h +++ b/cel-c/internal/runtime/activation.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_RUNTIME_ACTIVATION_H_ -#define THIRD_PARTY_CEL_C_SRC_RUNTIME_ACTIVATION_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_ACTIVATION_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_ACTIVATION_H_ #include #include @@ -21,10 +21,10 @@ #include "cel-c/activation.h" // IWYU pragma: export #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/runtime/instr.h" +#include "cel-c/internal/runtime/interpretable.h" #include "cel-c/program.h" -#include "cel-c/src/runtime/instr.h" -#include "cel-c/src/runtime/interpretable.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/trilean.h" @@ -66,4 +66,4 @@ static CEL_INLINE cel_Trilean _cel_Activation_FindVariable( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_RUNTIME_ACTIVATION_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_ACTIVATION_H_ diff --git a/cel-c/src/runtime/instr.h b/cel-c/internal/runtime/instr.h similarity index 97% rename from cel-c/src/runtime/instr.h rename to cel-c/internal/runtime/instr.h index 4e11d98..22f0fd1 100644 --- a/cel-c/src/runtime/instr.h +++ b/cel-c/internal/runtime/instr.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_RUNTIME_INSTR_H_ -#define THIRD_PARTY_CEL_C_SRC_RUNTIME_INSTR_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INSTR_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INSTR_H_ #include #include #include -#include "cel-c/config.h" #include "cel-c/duration.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" #include "upb/reflection/def.h" @@ -313,4 +313,4 @@ CEL_STATIC_ASSERT(alignof(_cel_Instr) <= 8); CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_RUNTIME_INSTR_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INSTR_H_ diff --git a/cel-c/src/runtime/interpretable.cc b/cel-c/internal/runtime/interpretable.cc similarity index 99% rename from cel-c/src/runtime/interpretable.cc rename to cel-c/internal/runtime/interpretable.cc index acece06..3bc4748 100644 --- a/cel-c/src/runtime/interpretable.cc +++ b/cel-c/internal/runtime/interpretable.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/runtime/interpretable.h" +#include "cel-c/internal/runtime/interpretable.h" #include #include @@ -25,30 +25,29 @@ #include "cel-c/activation.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/duration.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/array.h" -#include "cel-c/src/charconv.h" -#include "cel-c/src/ckdint.h" -#include "cel-c/src/compare.h" -#include "cel-c/src/config.h" -#include "cel-c/src/durationconv.h" -#include "cel-c/src/empty_list_value.h" -#include "cel-c/src/empty_map_value.h" -#include "cel-c/src/mutable_list_value.h" -#include "cel-c/src/mutable_map_value.h" -#include "cel-c/src/number.h" -#include "cel-c/src/regexp.h" -#include "cel-c/src/runtime/activation.h" -#include "cel-c/src/runtime/instr.h" -#include "cel-c/src/runtime/program.h" -#include "cel-c/src/runtime/runtime.h" -#include "cel-c/src/setjmp.h" -#include "cel-c/src/string.h" -#include "cel-c/src/timestampconv.h" -#include "cel-c/src/utf8.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/charconv.h" +#include "cel-c/internal/ckdint.h" +#include "cel-c/internal/compare.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/durationconv.h" +#include "cel-c/internal/empty_list_value.h" +#include "cel-c/internal/empty_map_value.h" +#include "cel-c/internal/mutable_list_value.h" +#include "cel-c/internal/mutable_map_value.h" +#include "cel-c/internal/number.h" +#include "cel-c/internal/regexp.h" +#include "cel-c/internal/runtime/activation.h" +#include "cel-c/internal/runtime/instr.h" +#include "cel-c/internal/runtime/program.h" +#include "cel-c/internal/runtime/runtime.h" +#include "cel-c/internal/setjmp.h" +#include "cel-c/internal/string.h" +#include "cel-c/internal/timestampconv.h" +#include "cel-c/internal/utf8.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" diff --git a/cel-c/src/runtime/interpretable.h b/cel-c/internal/runtime/interpretable.h similarity index 88% rename from cel-c/src/runtime/interpretable.h rename to cel-c/internal/runtime/interpretable.h index 1f1efc1..0584bc6 100644 --- a/cel-c/src/runtime/interpretable.h +++ b/cel-c/internal/runtime/interpretable.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_RUNTIME_INTERPRETABLE_H_ -#define THIRD_PARTY_CEL_C_SRC_RUNTIME_INTERPRETABLE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INTERPRETABLE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INTERPRETABLE_H_ #include #include @@ -21,11 +21,11 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/runtime/instr.h" -#include "cel-c/src/runtime/program.h" -#include "cel-c/src/setjmp.h" -#include "cel-c/src/string.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/runtime/instr.h" +#include "cel-c/internal/runtime/program.h" +#include "cel-c/internal/setjmp.h" +#include "cel-c/internal/string.h" #include "cel-c/status.h" #include "cel-c/value.h" #include "cel-c/well_known_types.h" @@ -100,4 +100,4 @@ static CEL_INLINE bool _cel_Interpretable_Interpret( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_RUNTIME_INTERPRETABLE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INTERPRETABLE_H_ diff --git a/cel-c/src/runtime/interpreter.cc b/cel-c/internal/runtime/interpreter.cc similarity index 99% rename from cel-c/src/runtime/interpreter.cc rename to cel-c/internal/runtime/interpreter.cc index f3c72f7..b91655f 100644 --- a/cel-c/src/runtime/interpreter.cc +++ b/cel-c/internal/runtime/interpreter.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/runtime/interpreter.h" +#include "cel-c/internal/runtime/interpreter.h" #include #include @@ -23,20 +23,20 @@ #include "cel-c/ast.h" #include "cel-c/ast_traverse.h" #include "cel-c/ast_visitor.h" -#include "cel-c/config.h" #include "cel-c/constant.h" #include "cel-c/hash.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/container.h" +#include "cel-c/internal/deque.h" +#include "cel-c/internal/flat_hash_map.h" +#include "cel-c/internal/runtime/instr.h" +#include "cel-c/internal/runtime/program.h" +#include "cel-c/internal/runtime/runtime.h" +#include "cel-c/internal/setjmp.h" +#include "cel-c/internal/string.h" #include "cel-c/operators.h" #include "cel-c/ref.h" -#include "cel-c/src/array.h" -#include "cel-c/src/container.h" -#include "cel-c/src/deque.h" -#include "cel-c/src/flat_hash_map.h" -#include "cel-c/src/runtime/instr.h" -#include "cel-c/src/runtime/program.h" -#include "cel-c/src/runtime/runtime.h" -#include "cel-c/src/setjmp.h" -#include "cel-c/src/string.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/type.h" diff --git a/cel-c/src/runtime/interpreter.h b/cel-c/internal/runtime/interpreter.h similarity index 74% rename from cel-c/src/runtime/interpreter.h rename to cel-c/internal/runtime/interpreter.h index d011d3a..ed31295 100644 --- a/cel-c/src/runtime/interpreter.h +++ b/cel-c/internal/runtime/interpreter.h @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_RUNTIME_INTERPRETER_H_ -#define THIRD_PARTY_CEL_C_SRC_RUNTIME_INTERPRETER_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INTERPRETER_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INTERPRETER_H_ #include "cel-c/ast.h" -#include "cel-c/config.h" -#include "cel-c/src/runtime/program.h" -#include "cel-c/src/runtime/runtime.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/runtime/program.h" +#include "cel-c/internal/runtime/runtime.h" #include "cel-c/status.h" CEL_BEGIN_DECLS @@ -30,4 +30,4 @@ cel_Program* cel_nullable _cel_Interpreter_Compile( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_RUNTIME_INTERPRETER_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_INTERPRETER_H_ diff --git a/cel-c/src/runtime/program.cc b/cel-c/internal/runtime/program.cc similarity index 92% rename from cel-c/src/runtime/program.cc rename to cel-c/internal/runtime/program.cc index 6cca502..5889e73 100644 --- a/cel-c/src/runtime/program.cc +++ b/cel-c/internal/runtime/program.cc @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/runtime/program.h" +#include "cel-c/internal/runtime/program.h" #include #include #include "cel-c/alloc.h" #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/arc.h" -#include "cel-c/src/array.h" -#include "cel-c/src/runtime/activation.h" -#include "cel-c/src/runtime/runtime.h" -#include "cel-c/src/string.h" +#include "cel-c/internal/arc.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/runtime/activation.h" +#include "cel-c/internal/runtime/runtime.h" +#include "cel-c/internal/string.h" extern "C" cel_ProgramOptions* cel_nonnull cel_ProgramOptions_Default(cel_ProgramOptions* cel_nonnull opts) { diff --git a/cel-c/src/runtime/program.h b/cel-c/internal/runtime/program.h similarity index 89% rename from cel-c/src/runtime/program.h rename to cel-c/internal/runtime/program.h index 1616306..6ab1305 100644 --- a/cel-c/src/runtime/program.h +++ b/cel-c/internal/runtime/program.h @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_RUNTIME_PROGRAM_H_ -#define THIRD_PARTY_CEL_C_SRC_RUNTIME_PROGRAM_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_PROGRAM_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_PROGRAM_H_ #include #include #include #include "cel-c/alloc.h" -#include "cel-c/config.h" +#include "cel-c/internal/arc.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/runtime/instr.h" +#include "cel-c/internal/string.h" #include "cel-c/program.h" // IWYU pragma: export -#include "cel-c/src/arc.h" -#include "cel-c/src/array.h" -#include "cel-c/src/runtime/instr.h" -#include "cel-c/src/string.h" CEL_BEGIN_DECLS @@ -102,4 +102,4 @@ static CEL_INLINE void _cel_Program_Unref( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_RUNTIME_PROGRAM_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_PROGRAM_H_ diff --git a/cel-c/src/runtime/runtime.cc b/cel-c/internal/runtime/runtime.cc similarity index 94% rename from cel-c/src/runtime/runtime.cc rename to cel-c/internal/runtime/runtime.cc index d2f6222..908937a 100644 --- a/cel-c/src/runtime/runtime.cc +++ b/cel-c/internal/runtime/runtime.cc @@ -12,21 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/runtime/runtime.h" +#include "cel-c/internal/runtime/runtime.h" #include #include "cel-c/alloc.h" #include "cel-c/assert.h" #include "cel-c/ast.h" -#include "cel-c/config.h" +#include "cel-c/internal/arc.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/container.h" +#include "cel-c/internal/runtime/interpreter.h" +#include "cel-c/internal/string.h" #include "cel-c/program.h" #include "cel-c/status.h" #include "cel-c/well_known_types.h" -#include "cel-c/src/arc.h" -#include "cel-c/src/container.h" -#include "cel-c/src/runtime/interpreter.h" -#include "cel-c/src/string.h" #include "upb/reflection/def.h" cel_RuntimeOptions* cel_nonnull diff --git a/cel-c/src/runtime/runtime.h b/cel-c/internal/runtime/runtime.h similarity index 86% rename from cel-c/src/runtime/runtime.h rename to cel-c/internal/runtime/runtime.h index 09f532c..5d00b8d 100644 --- a/cel-c/src/runtime/runtime.h +++ b/cel-c/internal/runtime/runtime.h @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_RUNTIME_RUNTIME_H_ -#define THIRD_PARTY_CEL_C_SRC_RUNTIME_RUNTIME_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_RUNTIME_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_RUNTIME_H_ #include "cel-c/alloc.h" -#include "cel-c/config.h" +#include "cel-c/internal/arc.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/container.h" #include "cel-c/runtime.h" // IWYU pragma: export -#include "cel-c/src/arc.h" -#include "cel-c/src/container.h" #include "cel-c/well_known_types.h" #include "upb/reflection/def.h" @@ -60,4 +60,4 @@ static CEL_INLINE void _cel_Runtime_Unref(const cel_Runtime* cel_nullable rt) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_RUNTIME_RUNTIME_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_RUNTIME_RUNTIME_H_ diff --git a/cel-c/src/runtime_test.cc b/cel-c/internal/runtime_test.cc similarity index 99% rename from cel-c/src/runtime_test.cc rename to cel-c/internal/runtime_test.cc index fe34146..9611abf 100644 --- a/cel-c/src/runtime_test.cc +++ b/cel-c/internal/runtime_test.cc @@ -32,16 +32,16 @@ #include "cel-c/alloc.h" #include "cel-c/arena.h" #include "cel-c/ast.h" -#include "cel-c/config.h" #include "cel-c/duration.h" #include "cel-c/error.h" #include "cel-c/error_code.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/parsed_map_field_value.h" +#include "cel-c/internal/runtime/program.h" +#include "cel-c/internal/testing/compiler.h" +#include "cel-c/internal/testing/def_pool.h" +#include "cel-c/internal/testing/parser.h" #include "cel-c/program.h" -#include "cel-c/src/parsed_map_field_value.h" -#include "cel-c/src/runtime/program.h" -#include "cel-c/src/testing/compiler.h" -#include "cel-c/src/testing/def_pool.h" -#include "cel-c/src/testing/parser.h" #include "cel-c/status.h" #include "cel-c/status_absl.h" #include "cel-c/string_view.h" diff --git a/cel-c/src/setjmp.h b/cel-c/internal/setjmp.h similarity index 90% rename from cel-c/src/setjmp.h rename to cel-c/internal/setjmp.h index 6bb155c..eae6aaf 100644 --- a/cel-c/src/setjmp.h +++ b/cel-c/internal/setjmp.h @@ -16,12 +16,12 @@ // setjmp/longjmp, that is the implementation that avoids saving and restoring // signal masks which requires syscalls. -#ifndef THIRD_PARTY_CEL_C_SRC_SETJMP_H_ -#define THIRD_PARTY_CEL_C_SRC_SETJMP_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_SETJMP_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_SETJMP_H_ #include // IWYU pragma: keep -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #if CEL_HAVE_INCLUDE() // Include for _POSIX_VERSION. @@ -47,4 +47,4 @@ typedef jmp_buf _cel_jmp_buf; CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_SETJMP_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_SETJMP_H_ diff --git a/cel-c/src/setjmp_test.cc b/cel-c/internal/setjmp_test.cc similarity index 96% rename from cel-c/src/setjmp_test.cc rename to cel-c/internal/setjmp_test.cc index 35cf028..2f534b2 100644 --- a/cel-c/src/setjmp_test.cc +++ b/cel-c/internal/setjmp_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/setjmp.h" +#include "cel-c/internal/setjmp.h" #include "gtest/gtest.h" diff --git a/cel-c/src/sort.h b/cel-c/internal/sort.h similarity index 93% rename from cel-c/src/sort.h rename to cel-c/internal/sort.h index d008998..542b962 100644 --- a/cel-c/src/sort.h +++ b/cel-c/internal/sort.h @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_SORT_H_ -#define THIRD_PARTY_CEL_C_SRC_SORT_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_SORT_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_SORT_H_ #include #include #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/alloca.h" +#include "cel-c/internal/alloca.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -105,4 +105,4 @@ static inline void _cel_Sort(void* cel_nullability_unknown ptr, size_t count, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_SORT_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_SORT_H_ diff --git a/cel-c/src/sort_test.cc b/cel-c/internal/sort_test.cc similarity index 97% rename from cel-c/src/sort_test.cc rename to cel-c/internal/sort_test.cc index 25a9843..a714978 100644 --- a/cel-c/src/sort_test.cc +++ b/cel-c/internal/sort_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/sort.h" +#include "cel-c/internal/sort.h" #include #include diff --git a/cel-c/src/stable_sort.h b/cel-c/internal/stable_sort.h similarity index 96% rename from cel-c/src/stable_sort.h rename to cel-c/internal/stable_sort.h index 3f99420..9e75f79 100644 --- a/cel-c/src/stable_sort.h +++ b/cel-c/internal/stable_sort.h @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_MERGESORT_H_ -#define THIRD_PARTY_CEL_C_SRC_MERGESORT_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_MERGESORT_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_MERGESORT_H_ #include #include #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/alloca.h" +#include "cel-c/internal/alloca.h" +#include "cel-c/internal/config.h" CEL_BEGIN_DECLS @@ -204,4 +204,4 @@ static inline void _cel_StableSort( CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_MERGESORT_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_MERGESORT_H_ diff --git a/cel-c/src/stable_sort_test.cc b/cel-c/internal/stable_sort_test.cc similarity index 97% rename from cel-c/src/stable_sort_test.cc rename to cel-c/internal/stable_sort_test.cc index 7cd309a..6f691aa 100644 --- a/cel-c/src/stable_sort_test.cc +++ b/cel-c/internal/stable_sort_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/stable_sort.h" +#include "cel-c/internal/stable_sort.h" #include #include diff --git a/cel-c/src/string.h b/cel-c/internal/string.h similarity index 96% rename from cel-c/src/string.h rename to cel-c/internal/string.h index 61944fd..9e35360 100644 --- a/cel-c/src/string.h +++ b/cel-c/internal/string.h @@ -15,17 +15,17 @@ // Internal header providing a generic string implementation which uses // allocator-based memory management. -#ifndef THIRD_PARTY_CEL_C_SRC_STRING_H_ -#define THIRD_PARTY_CEL_C_SRC_STRING_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_STRING_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_STRING_H_ #include #include // IWYU pragma: keep #include #include "cel-c/alloc.h" -#include "cel-c/config.h" #include "cel-c/cstring_view.h" -#include "cel-c/src/generic_string.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_string.h" #include "cel-c/string_view.h" CEL_BEGIN_DECLS @@ -170,4 +170,4 @@ _cel_String_ToCStringView(CEL_NONNULL(const _cel_String*) str) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_STRING_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_STRING_H_ diff --git a/cel-c/src/string_test.cc b/cel-c/internal/string_test.cc similarity index 99% rename from cel-c/src/string_test.cc rename to cel-c/internal/string_test.cc index 6a66620..94449a0 100644 --- a/cel-c/src/string_test.cc +++ b/cel-c/internal/string_test.cc @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/string.h" +#include "cel-c/internal/string.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include "cel-c/alloc.h" -#include "cel-c/config.h" #include "cel-c/cstring_view.h" -#include "cel-c/src/generic_string.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/generic_string.h" #include "cel-c/string_view.h" namespace { diff --git a/cel-c/src/struct_value.cc b/cel-c/internal/struct_value.cc similarity index 98% rename from cel-c/src/struct_value.cc rename to cel-c/internal/struct_value.cc index 5a5cabe..019f6a6 100644 --- a/cel-c/src/struct_value.cc +++ b/cel-c/internal/struct_value.cc @@ -18,9 +18,9 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/array.h" -#include "cel-c/src/sort.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/sort.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/struct_value_test.cc b/cel-c/internal/struct_value_test.cc similarity index 99% rename from cel-c/src/struct_value_test.cc rename to cel-c/internal/struct_value_test.cc index 0395bfa..4a3816c 100644 --- a/cel-c/src/struct_value_test.cc +++ b/cel-c/internal/struct_value_test.cc @@ -16,10 +16,10 @@ #include #include "gtest/gtest.h" -#include "cel-c/config.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/value.h" diff --git a/cel-c/src/testing/BUILD b/cel-c/internal/testing/BUILD similarity index 95% rename from cel-c/src/testing/BUILD rename to cel-c/internal/testing/BUILD index ee4b012..fa9f4f3 100644 --- a/cel-c/src/testing/BUILD +++ b/cel-c/internal/testing/BUILD @@ -29,10 +29,10 @@ cc_library( "//cel-c:assert", "//cel-c:ast", "//cel-c:ast_proto", - "//cel-c:config", "//cel-c:status", "//cel-c:string_view", "//cel-c:string_view_absl", + "//cel-c/internal:config", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:die_if_null", "@cel-cpp//checker:checker_options", @@ -58,8 +58,8 @@ cc_library( "//cel-c:arena", "//cel-c:assert", "//cel-c:ast", - "//cel-c:config", "//cel-c:string_view", + "//cel-c/internal:config", ], ) @@ -69,7 +69,7 @@ cc_library( hdrs = ["def_pool.h"], deps = [ "//cel-c:assert", - "//cel-c:config", + "//cel-c/internal:config", "@abseil-cpp//absl/log:die_if_null", "@cel-spec//proto/cel/expr/conformance/proto3:test_all_types_upb_proto_reflection", "@protobuf//:any_upb_reflection_proto", @@ -92,10 +92,10 @@ cc_library( "//cel-c:assert", "//cel-c:ast", "//cel-c:ast_proto", - "//cel-c:config", "//cel-c:status", "//cel-c:string_view", "//cel-c:string_view_absl", + "//cel-c/internal:config", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/log:die_if_null", "@cel-cpp//common:ast_proto", @@ -121,7 +121,7 @@ cc_library( "//cel-c:arena", "//cel-c:assert", "//cel-c:ast", - "//cel-c:config", "//cel-c:string_view", + "//cel-c/internal:config", ], ) diff --git a/cel-c/src/testing/compile.cc b/cel-c/internal/testing/compile.cc similarity index 88% rename from cel-c/src/testing/compile.cc rename to cel-c/internal/testing/compile.cc index c27be17..df6efe9 100644 --- a/cel-c/src/testing/compile.cc +++ b/cel-c/internal/testing/compile.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/testing/compile.h" +#include "cel-c/internal/testing/compile.h" #include "cel-c/arena.h" #include "cel-c/assert.h" #include "cel-c/ast.h" -#include "cel-c/config.h" -#include "cel-c/src/testing/compiler.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/testing/compiler.h" #include "cel-c/string_view.h" extern "C" CEL_ATTRIBUTE_NOTHROW cel_Ast* cel_nonnull diff --git a/cel-c/src/testing/compile.h b/cel-c/internal/testing/compile.h similarity index 81% rename from cel-c/src/testing/compile.h rename to cel-c/internal/testing/compile.h index 6399a81..24e1e67 100644 --- a/cel-c/src/testing/compile.h +++ b/cel-c/internal/testing/compile.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_TESTING_COMPILE_H_ -#define THIRD_PARTY_CEL_C_SRC_TESTING_COMPILE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_TESTING_COMPILE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_TESTING_COMPILE_H_ #include "cel-c/arena.h" #include "cel-c/ast.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" CEL_BEGIN_DECLS @@ -29,4 +29,4 @@ cel_Ast* cel_nonnull _cel_TestingCompile(cel_StringView content, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_TESTING_COMPILE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_TESTING_COMPILE_H_ diff --git a/cel-c/src/testing/compiler.cc b/cel-c/internal/testing/compiler.cc similarity index 97% rename from cel-c/src/testing/compiler.cc rename to cel-c/internal/testing/compiler.cc index 6c27a0b..8d1867d 100644 --- a/cel-c/src/testing/compiler.cc +++ b/cel-c/internal/testing/compiler.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/testing/compiler.h" +#include "cel-c/internal/testing/compiler.h" #include #include @@ -26,7 +26,7 @@ #include "cel-c/assert.h" #include "cel-c/ast.h" #include "cel-c/ast_proto.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" diff --git a/cel-c/src/testing/compiler.h b/cel-c/internal/testing/compiler.h similarity index 88% rename from cel-c/src/testing/compiler.h rename to cel-c/internal/testing/compiler.h index 9f7b8ce..8adebd2 100644 --- a/cel-c/src/testing/compiler.h +++ b/cel-c/internal/testing/compiler.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_TESTING_COMPILER_H_ -#define THIRD_PARTY_CEL_C_SRC_TESTING_COMPILER_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_TESTING_COMPILER_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_TESTING_COMPILER_H_ #include "cel-c/arena.h" #include "cel-c/ast.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #ifdef __cplusplus @@ -57,4 +57,4 @@ using _cel_TestingCompilerPtr = std::unique_ptr<_cel_TestingCompiler, _cel_TestingCompilerDeleter>; #endif -#endif // THIRD_PARTY_CEL_C_SRC_TESTING_COMPILER_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_TESTING_COMPILER_H_ diff --git a/cel-c/src/testing/def_pool.cc b/cel-c/internal/testing/def_pool.cc similarity index 97% rename from cel-c/src/testing/def_pool.cc rename to cel-c/internal/testing/def_pool.cc index 924d023..fbd0333 100644 --- a/cel-c/src/testing/def_pool.cc +++ b/cel-c/internal/testing/def_pool.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/testing/def_pool.h" +#include "cel-c/internal/testing/def_pool.h" #include "google/protobuf/any.upbdefs.h" #include "google/protobuf/duration.upbdefs.h" @@ -22,7 +22,7 @@ #include "google/protobuf/wrappers.upbdefs.h" #include "absl/log/die_if_null.h" #include "cel-c/assert.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel/expr/conformance/proto3/test_all_types.upbdefs.h" #include "upb/reflection/def.h" diff --git a/cel-c/src/testing/def_pool.h b/cel-c/internal/testing/def_pool.h similarity index 81% rename from cel-c/src/testing/def_pool.h rename to cel-c/internal/testing/def_pool.h index 9218b95..8c05945 100644 --- a/cel-c/src/testing/def_pool.h +++ b/cel-c/internal/testing/def_pool.h @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_TESTING_DEF_POOL_H_ -#define THIRD_PARTY_CEL_C_SRC_TESTING_DEF_POOL_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_TESTING_DEF_POOL_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_TESTING_DEF_POOL_H_ -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "upb/reflection/def.h" CEL_BEGIN_DECLS @@ -31,4 +31,4 @@ void _cel_TestingDefs(upb_DefPool* cel_nonnull def_pool); CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_TESTING_DEF_POOL_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_TESTING_DEF_POOL_H_ diff --git a/cel-c/src/testing/parse.cc b/cel-c/internal/testing/parse.cc similarity index 89% rename from cel-c/src/testing/parse.cc rename to cel-c/internal/testing/parse.cc index 2cedd1e..8e7cfbc 100644 --- a/cel-c/src/testing/parse.cc +++ b/cel-c/internal/testing/parse.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/testing/parse.h" +#include "cel-c/internal/testing/parse.h" #include "cel-c/arena.h" #include "cel-c/assert.h" #include "cel-c/ast.h" -#include "cel-c/config.h" -#include "cel-c/src/testing/parser.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/testing/parser.h" #include "cel-c/string_view.h" extern "C" CEL_ATTRIBUTE_NOTHROW cel_Ast* cel_nonnull diff --git a/cel-c/src/testing/parse.h b/cel-c/internal/testing/parse.h similarity index 81% rename from cel-c/src/testing/parse.h rename to cel-c/internal/testing/parse.h index c252c1e..0ec2fac 100644 --- a/cel-c/src/testing/parse.h +++ b/cel-c/internal/testing/parse.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_TESTING_PARSE_H_ -#define THIRD_PARTY_CEL_C_SRC_TESTING_PARSE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_TESTING_PARSE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_TESTING_PARSE_H_ #include "cel-c/arena.h" #include "cel-c/ast.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" CEL_BEGIN_DECLS @@ -29,4 +29,4 @@ cel_Ast* cel_nonnull _cel_TestingParse(cel_StringView content, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_TESTING_PARSE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_TESTING_PARSE_H_ diff --git a/cel-c/src/testing/parser.cc b/cel-c/internal/testing/parser.cc similarity index 97% rename from cel-c/src/testing/parser.cc rename to cel-c/internal/testing/parser.cc index 732f3bd..5720f1e 100644 --- a/cel-c/src/testing/parser.cc +++ b/cel-c/internal/testing/parser.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/testing/parser.h" +#include "cel-c/internal/testing/parser.h" #include #include @@ -28,7 +28,7 @@ #include "cel-c/assert.h" #include "cel-c/ast.h" #include "cel-c/ast_proto.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" diff --git a/cel-c/src/testing/parser.h b/cel-c/internal/testing/parser.h similarity index 88% rename from cel-c/src/testing/parser.h rename to cel-c/internal/testing/parser.h index 1cbfeda..36453e6 100644 --- a/cel-c/src/testing/parser.h +++ b/cel-c/internal/testing/parser.h @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_TESTING_PARSER_H_ -#define THIRD_PARTY_CEL_C_SRC_TESTING_PARSER_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_TESTING_PARSER_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_TESTING_PARSER_H_ #include "cel-c/arena.h" #include "cel-c/ast.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #ifdef __cplusplus @@ -57,4 +57,4 @@ using _cel_TestingParserPtr = std::unique_ptr<_cel_TestingParser, _cel_TestingParserDeleter>; #endif -#endif // THIRD_PARTY_CEL_C_SRC_TESTING_PARSER_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_TESTING_PARSER_H_ diff --git a/cel-c/src/timestampconv.cc b/cel-c/internal/timestampconv.cc similarity index 96% rename from cel-c/src/timestampconv.cc rename to cel-c/internal/timestampconv.cc index a37d74e..9dba091 100644 --- a/cel-c/src/timestampconv.cc +++ b/cel-c/internal/timestampconv.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/timestampconv.h" +#include "cel-c/internal/timestampconv.h" #include #include @@ -21,7 +21,7 @@ #include "absl/time/time.h" #include "cel-c/arena.h" #include "cel-c/assert.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #include "cel-c/string_view_absl.h" #include "cel-c/timestamp.h" diff --git a/cel-c/src/timestampconv.h b/cel-c/internal/timestampconv.h similarity index 87% rename from cel-c/src/timestampconv.h rename to cel-c/internal/timestampconv.h index 338dc8d..924c923 100644 --- a/cel-c/src/timestampconv.h +++ b/cel-c/internal/timestampconv.h @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_TIMESTAMPCONV_H_ -#define THIRD_PARTY_CEL_C_SRC_TIMESTAMPCONV_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_TIMESTAMPCONV_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_TIMESTAMPCONV_H_ #include #include "cel-c/arena.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" @@ -44,4 +44,4 @@ bool _cel_Timestamp_FromRFC3339(cel_Timestamp* cel_nonnull out, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_TIMESTAMPCONV_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_TIMESTAMPCONV_H_ diff --git a/cel-c/src/timestampconv_test.cc b/cel-c/internal/timestampconv_test.cc similarity index 99% rename from cel-c/src/timestampconv_test.cc rename to cel-c/internal/timestampconv_test.cc index 4691f53..8a24d4f 100644 --- a/cel-c/src/timestampconv_test.cc +++ b/cel-c/internal/timestampconv_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/timestampconv.h" +#include "cel-c/internal/timestampconv.h" #include diff --git a/cel-c/src/trilean_test.cc b/cel-c/internal/trilean_test.cc similarity index 97% rename from cel-c/src/trilean_test.cc rename to cel-c/internal/trilean_test.cc index 315baeb..a5b2c6b 100644 --- a/cel-c/src/trilean_test.cc +++ b/cel-c/internal/trilean_test.cc @@ -16,7 +16,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" namespace { diff --git a/cel-c/src/uchar.h b/cel-c/internal/uchar.h similarity index 84% rename from cel-c/src/uchar.h rename to cel-c/internal/uchar.h index 95256e6..ab31ec5 100644 --- a/cel-c/src/uchar.h +++ b/cel-c/internal/uchar.h @@ -15,12 +15,12 @@ // Internal header providing compatible typedefs for `uchar.h`. Some platforms, // namely older versions of macOS, do not have them. -#ifndef THIRD_PARTY_CEL_C_SRC_UCHAR_H_ -#define THIRD_PARTY_CEL_C_SRC_UCHAR_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_UCHAR_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_UCHAR_H_ #include // IWYU pragma: keep -#include "cel-c/config.h" // IWYU pragma: keep +#include "cel-c/internal/config.h" // IWYU pragma: keep #if !defined(__cplusplus) || __cplusplus < 201103L CEL_BEGIN_DECLS @@ -37,4 +37,4 @@ typedef uint_least32_t char32_t; CEL_END_DECLS #endif -#endif // THIRD_PARTY_CEL_C_SRC_UCHAR_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_UCHAR_H_ diff --git a/cel-c/src/uint128.h b/cel-c/internal/uint128.h similarity index 98% rename from cel-c/src/uint128.h rename to cel-c/internal/uint128.h index 840389c..f443775 100644 --- a/cel-c/src/uint128.h +++ b/cel-c/internal/uint128.h @@ -14,8 +14,8 @@ // Internal header providing an unsigned 128 bit unsigned integral. -#ifndef THIRD_PARTY_CEL_C_SRC_UINT128_H_ -#define THIRD_PARTY_CEL_C_SRC_UINT128_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_UINT128_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_UINT128_H_ #include #include // IWYU pragma: keep @@ -27,8 +27,8 @@ #endif #include "cel-c/assert.h" -#include "cel-c/src/config.h" -#include "cel-c/src/endian.h" // IWYU pragma: keep +#include "cel-c/internal/config.h" +#include "cel-c/internal/endian.h" // IWYU pragma: keep #ifdef __cplusplus #include @@ -368,4 +368,4 @@ CEL_END_DECLS // NOLINTEND(google-runtime-int) // NOLINTEND(runtime/int) -#endif // THIRD_PARTY_CEL_C_SRC_UINT128_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_UINT128_H_ diff --git a/cel-c/src/uint128_test.cc b/cel-c/internal/uint128_test.cc similarity index 99% rename from cel-c/src/uint128_test.cc rename to cel-c/internal/uint128_test.cc index 4a81bef..af2f1d1 100644 --- a/cel-c/src/uint128_test.cc +++ b/cel-c/internal/uint128_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/uint128.h" +#include "cel-c/internal/uint128.h" #include #include diff --git a/cel-c/src/unaligned.h b/cel-c/internal/unaligned.h similarity index 96% rename from cel-c/src/unaligned.h rename to cel-c/internal/unaligned.h index 19829f5..c2a6bc0 100644 --- a/cel-c/src/unaligned.h +++ b/cel-c/internal/unaligned.h @@ -14,14 +14,14 @@ // Internal header providing unaligned load and store functions. -#ifndef THIRD_PARTY_CEL_C_SRC_UNALIGNED_H_ -#define THIRD_PARTY_CEL_C_SRC_UNALIGNED_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_UNALIGNED_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_UNALIGNED_H_ #include #include // IWYU pragma: keep #include "cel-c/assert.h" -#include "cel-c/src/config.h" +#include "cel-c/internal/config.h" #if defined(_CEL_HAVE_ASAN) || defined(_CEL_HAVE_HWASAN) || \ defined(_CEL_HAVE_TSAN) || defined(_CEL_HAVE_MSAN) @@ -150,4 +150,4 @@ static CEL_INLINE void _cel_UnalignedStore64(CEL_NONNULL(void*) data, CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_UNALIGNED_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_UNALIGNED_H_ diff --git a/cel-c/src/unaligned_test.cc b/cel-c/internal/unaligned_test.cc similarity index 98% rename from cel-c/src/unaligned_test.cc rename to cel-c/internal/unaligned_test.cc index d7e6811..e44f9bc 100644 --- a/cel-c/src/unaligned_test.cc +++ b/cel-c/internal/unaligned_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/unaligned.h" +#include "cel-c/internal/unaligned.h" #include #include diff --git a/cel-c/src/unicode.h b/cel-c/internal/unicode.h similarity index 84% rename from cel-c/src/unicode.h rename to cel-c/internal/unicode.h index 855b546..d7c961f 100644 --- a/cel-c/src/unicode.h +++ b/cel-c/internal/unicode.h @@ -14,14 +14,14 @@ // Internal header providing utilities for working with unicode. -#ifndef THIRD_PARTY_CEL_C_SRC_UNICODE_H_ -#define THIRD_PARTY_CEL_C_SRC_UNICODE_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_UNICODE_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_UNICODE_H_ #include // IWYU pragma: keep #include -#include "cel-c/config.h" -#include "cel-c/src/uchar.h" // IWYU pragma: keep +#include "cel-c/internal/config.h" +#include "cel-c/internal/uchar.h" // IWYU pragma: keep CEL_BEGIN_DECLS @@ -43,4 +43,4 @@ static CEL_INLINE bool _cel_Unicode_IsValid(char32_t pnt) { CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_UNICODE_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_UNICODE_H_ diff --git a/cel-c/src/unicode_test.cc b/cel-c/internal/unicode_test.cc similarity index 96% rename from cel-c/src/unicode_test.cc rename to cel-c/internal/unicode_test.cc index 8f55eb6..150dcc6 100644 --- a/cel-c/src/unicode_test.cc +++ b/cel-c/internal/unicode_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/unicode.h" +#include "cel-c/internal/unicode.h" #include "gtest/gtest.h" diff --git a/cel-c/src/utf8.cc b/cel-c/internal/utf8.cc similarity index 98% rename from cel-c/src/utf8.cc rename to cel-c/internal/utf8.cc index b5c9856..74b093e 100644 --- a/cel-c/src/utf8.cc +++ b/cel-c/internal/utf8.cc @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/utf8.h" +#include "cel-c/internal/utf8.h" #include // IWYU pragma: keep #include #include #include "cel-c/assert.h" -#include "cel-c/config.h" -#include "cel-c/src/uchar.h" // IWYU pragma: keep -#include "cel-c/src/unicode.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/uchar.h" // IWYU pragma: keep +#include "cel-c/internal/unicode.h" #include "upb/base/string_view.h" #define _cel_kUtf8RuneSelf 0x80 diff --git a/cel-c/src/utf8.h b/cel-c/internal/utf8.h similarity index 92% rename from cel-c/src/utf8.h rename to cel-c/internal/utf8.h index 1197aeb..6a99fa9 100644 --- a/cel-c/src/utf8.h +++ b/cel-c/internal/utf8.h @@ -14,15 +14,15 @@ // Internal header providing facilities for working with UTF-8. -#ifndef THIRD_PARTY_CEL_C_SRC_UTF8_H_ -#define THIRD_PARTY_CEL_C_SRC_UTF8_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_UTF8_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_UTF8_H_ #include // IWYU pragma: keep #include #include -#include "cel-c/config.h" -#include "cel-c/src/uchar.h" // IWYU pragma: keep +#include "cel-c/internal/config.h" +#include "cel-c/internal/uchar.h" // IWYU pragma: keep #include "upb/base/string_view.h" CEL_BEGIN_DECLS @@ -80,4 +80,4 @@ bool _cel_Utf8_IsValid(upb_StringView str); CEL_END_DECLS -#endif // THIRD_PARTY_CEL_C_SRC_UTF8_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_UTF8_H_ diff --git a/cel-c/src/utf8_test.cc b/cel-c/internal/utf8_test.cc similarity index 99% rename from cel-c/src/utf8_test.cc rename to cel-c/internal/utf8_test.cc index 62fffbd..aeb653b 100644 --- a/cel-c/src/utf8_test.cc +++ b/cel-c/internal/utf8_test.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/utf8.h" +#include "cel-c/internal/utf8.h" #include diff --git a/cel-c/src/value.cc b/cel-c/internal/value.cc similarity index 99% rename from cel-c/src/value.cc rename to cel-c/internal/value.cc index 5323eab..31efab0 100644 --- a/cel-c/src/value.cc +++ b/cel-c/internal/value.cc @@ -19,14 +19,14 @@ #include #include "cel-c/assert.h" -#include "cel-c/config.h" #include "cel-c/duration.h" #include "cel-c/error.h" #include "cel-c/error_code.h" -#include "cel-c/src/any.h" -#include "cel-c/src/parsed_map_field_value.h" -#include "cel-c/src/parsed_message_value.h" -#include "cel-c/src/parsed_repeated_field_value.h" +#include "cel-c/internal/any.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/parsed_map_field_value.h" +#include "cel-c/internal/parsed_message_value.h" +#include "cel-c/internal/parsed_repeated_field_value.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" diff --git a/cel-c/src/value_test.cc b/cel-c/internal/value_test.cc similarity index 99% rename from cel-c/src/value_test.cc rename to cel-c/internal/value_test.cc index e739749..c2e87f3 100644 --- a/cel-c/src/value_test.cc +++ b/cel-c/internal/value_test.cc @@ -17,15 +17,15 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/strings/string_view.h" -#include "cel-c/config.h" #include "cel-c/duration.h" #include "cel-c/error.h" -#include "cel-c/src/empty_list_value.h" -#include "cel-c/src/empty_map_value.h" -#include "cel-c/src/mutable_list_value.h" -#include "cel-c/src/mutable_map_value.h" -#include "cel-c/src/parsed_message_value.h" -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/config.h" +#include "cel-c/internal/empty_list_value.h" +#include "cel-c/internal/empty_map_value.h" +#include "cel-c/internal/mutable_list_value.h" +#include "cel-c/internal/mutable_map_value.h" +#include "cel-c/internal/parsed_message_value.h" +#include "cel-c/internal/value_testing.h" #include "cel-c/status.h" #include "cel-c/string_view.h" #include "cel-c/timestamp.h" diff --git a/cel-c/src/value_testing.cc b/cel-c/internal/value_testing.cc similarity index 99% rename from cel-c/src/value_testing.cc rename to cel-c/internal/value_testing.cc index cc4be73..ee721b5 100644 --- a/cel-c/src/value_testing.cc +++ b/cel-c/internal/value_testing.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cel-c/src/value_testing.h" +#include "cel-c/internal/value_testing.h" #include #include @@ -34,7 +34,7 @@ #include "absl/log/die_if_null.h" #include "absl/strings/string_view.h" #include "cel-c/arena.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/value.h" #include "cel-c/well_known_types.h" diff --git a/cel-c/src/value_testing.h b/cel-c/internal/value_testing.h similarity index 93% rename from cel-c/src/value_testing.h rename to cel-c/internal/value_testing.h index b228b79..4fd891b 100644 --- a/cel-c/src/value_testing.h +++ b/cel-c/internal/value_testing.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef THIRD_PARTY_CEL_C_SRC_VALUE_TESTING_H_ -#define THIRD_PARTY_CEL_C_SRC_VALUE_TESTING_H_ +#ifndef THIRD_PARTY_CEL_C_INTERNAL_VALUE_TESTING_H_ +#define THIRD_PARTY_CEL_C_INTERNAL_VALUE_TESTING_H_ #include "gtest/gtest.h" #include "absl/log/die_if_null.h" #include "absl/strings/string_view.h" #include "cel-c/alloc.h" #include "cel-c/arena.h" -#include "cel-c/config.h" +#include "cel-c/internal/config.h" #include "cel-c/status.h" #include "cel-c/value.h" #include "cel-c/well_known_types.h" @@ -80,4 +80,4 @@ class ValueTest : public ::testing::Test { cel_ValueContext ctx_ = {}; }; -#endif // THIRD_PARTY_CEL_C_SRC_VALUE_TESTING_H_ +#endif // THIRD_PARTY_CEL_C_INTERNAL_VALUE_TESTING_H_ diff --git a/cel-c/src/config.h b/cel-c/src/config.h deleted file mode 100644 index 4082431..0000000 --- a/cel-c/src/config.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// IWYU pragma: always_keep - -#ifndef THIRD_PARTY_CEL_C_SRC_CONFIG_H_ -#define THIRD_PARTY_CEL_C_SRC_CONFIG_H_ - -#include "cel-c/config.h" // IWYU pragma: export - -#if defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \ - defined(__AARCH64EB__) || defined(_MIPSEB) || defined(__MIPSEB) || \ - defined(__MIPSEB__) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) -#define _CEL_IS_BIG_ENDIAN 1 -#elif defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || \ - defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \ - defined(__MIPSEL) || defined(__MIPSEL__) || \ - (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \ - defined(_WIN32) -#define _CEL_IS_LITTLE_ENDIAN 1 -#else -#error Endian detection needs to be set up for your environment. -#endif - -#if (defined(__clang__) && !defined(_WIN32)) || \ - (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \ - (defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__)) || \ - (defined(__CUDACC__) && __CUDACC_VER__ >= 70000) -#define _CEL_HAVE_INTRINSIC_INT128 1 -#endif - -#if defined(__cplusplus) && \ - (CEL_HAVE_FEATURE(cxx_exceptions) || \ - (!(defined(__GNUC__) && !defined(__cpp_exceptions)) && \ - !(defined(_MSC_VER) && !defined(_CPPUNWIND)))) -#define _CEL_HAVE_EXCEPTIONS 1 -#define _CEL_TRY try -#define _CEL_CATCH_ANY catch (...) -#define _CEL_RETHROW \ - do { \ - throw; \ - } while (false) -#else -#define _CEL_TRY if (true) -#define _CEL_CATCH_ANY else if (false) -#define _CEL_RETHROW \ - do { \ - } while (false) -#endif - -#if defined(__cplusplus) && (CEL_HAVE_FEATURE(cxx_rtti) || \ - (defined(__GNUC__) && defined(__GXX_RTTI)) || \ - (defined(_MSC_VER) && defined(_CPPRTTI)) || \ - (!defined(__GNUC__) && !defined(_MSC_VER))) -#define _CEL_HAVE_RTTI 1 -#endif - -#if ((defined(__GNUC__) && !defined(__clang__)) || \ - CEL_HAVE_ATTRIBUTE(weak)) && \ - !defined(_WIN32) && !defined(__MINGW32__) -#define _CEL_ATTRIBUTE_WEAK __attribute__((weak)) -#define _CEL_HAVE_ATTRIBUTE_WEAK 1 -#else -#define _CEL_ATTRIBUTE_WEAK -#define _CEL_HAVE_ATTRIBUTE_WEAK 0 -#endif - -#if ((defined(__GNUC__) && !defined(__clang__)) || CEL_HAVE_ATTRIBUTE(unused)) -#define _CEL_ATTRIBUTE_UNUSED __attribute__((unused)) -#else -#define _CEL_ATTRIBUTE_UNUSED -#endif - -#ifdef _CEL_HAVE_ASAN -#error _CEL_HAVE_ASAN cannot be directly set -#endif - -#if defined(__SANITIZE_ADDRESS__) || CEL_HAVE_FEATURE(address_sanitizer) -#define _CEL_HAVE_ASAN 1 -#endif - -#ifdef _CEL_HAVE_HWASAN -#error _CEL_HAVE_HWASAN cannot be directly set -#endif - -#if defined(__SANITIZE_HWADDRESS__) || CEL_HAVE_FEATURE(hwaddress_sanitizer) -#define _CEL_HAVE_HWASAN 1 -#endif - -#ifdef _CEL_HAVE_TSAN -#error _CEL_HAVE_TSAN cannot be directly set -#endif - -#if defined(__SANITIZE_THREAD__) || CEL_HAVE_FEATURE(thread_sanitizer) -#define _CEL_HAVE_TSAN 1 -#endif - -#ifdef _CEL_HAVE_MSAN -#error _CEL_HAVE_MSAN cannot be directly set -#endif - -#if CEL_HAVE_FEATURE(memory_sanitizer) -#define _CEL_HAVE_MSAN 1 -#endif - -#ifdef _CEL_HAVE_LSAN -#error _CEL_HAVE_LSAN cannot be directly set -#endif - -#if CEL_HAVE_FEATURE(leak_sanitizer) -#define _CEL_HAVE_LSAN 1 -#endif - -#ifdef _CEL_HAVE_SANITIZER -#error _CEL_HAVE_SANITIZER cannot be directly set -#endif - -#if defined(_CEL_HAVE_ASAN) || defined(_CEL_HAVE_HWASAN) || \ - defined(_CEL_HAVE_TSAN) || defined(_CEL_HAVE_MSAN) || \ - defined(_CEL_HAVE_LSAN) -#define _CEL_HAVE_SANITIZER 1 -#endif - -#endif // THIRD_PARTY_CEL_C_SRC_CONFIG_H_ diff --git a/cel-c/status.cc b/cel-c/status.cc index 07a8826..e90fbd9 100644 --- a/cel-c/status.cc +++ b/cel-c/status.cc @@ -25,8 +25,8 @@ #include "cel-c/assert.h" #include "cel-c/config.h" #include "cel-c/error_space.h" -#include "cel-c/src/array.h" -#include "cel-c/src/string.h" +#include "cel-c/internal/array.h" +#include "cel-c/internal/string.h" #include "cel-c/status_code.h" #include "cel-c/string_view.h" diff --git a/cel-c/string_view.cc b/cel-c/string_view.cc index 5e1ec21..e72bf77 100644 --- a/cel-c/string_view.cc +++ b/cel-c/string_view.cc @@ -19,7 +19,7 @@ #include "cel-c/assert.h" #include "cel-c/config.h" -#include "cel-c/src/memory.h" +#include "cel-c/internal/memory.h" extern "C" const char* cel_nullable cel_StringView_FindFirst(cel_StringView haystack, cel_StringView needle) { diff --git a/cel-c/timestamp.cc b/cel-c/timestamp.cc index 10c8ef2..27c5c36 100644 --- a/cel-c/timestamp.cc +++ b/cel-c/timestamp.cc @@ -20,7 +20,7 @@ #include "cel-c/assert.h" #include "cel-c/config.h" #include "cel-c/duration.h" -#include "cel-c/src/ckdint.h" +#include "cel-c/internal/ckdint.h" extern "C" bool cel_Timestamp_Normalize(int64_t* cel_nonnull sec, int32_t* cel_nonnull nsec) {