This is an automated email from the ASF dual-hosted git repository. astitcher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
commit 0545b51c234260fe6977e8545c785a442732950d Author: Andrew Stitcher <astitc...@apache.org> AuthorDate: Thu May 4 15:31:51 2023 -0400 PROTON-2753: Split util.h so that we can keep the C++ in the schannel impl happy --- c/src/core/engine-internal.h | 1 - c/src/core/error.c | 2 +- c/src/core/logger.c | 2 +- c/src/core/transport.c | 2 ++ c/src/core/util.h | 5 ----- c/src/core/util_str.h | 42 ++++++++++++++++++++++++++++++++++++++++++ c/src/extra/url.c | 2 +- c/src/messenger/messenger.c | 1 + c/src/sasl/sasl.c | 2 ++ c/src/ssl/openssl.c | 1 + c/src/ssl/schannel.cpp | 2 +- 11 files changed, 52 insertions(+), 10 deletions(-) diff --git a/c/src/core/engine-internal.h b/c/src/core/engine-internal.h index 5ff6ae4ce..29e84eb02 100644 --- a/c/src/core/engine-internal.h +++ b/c/src/core/engine-internal.h @@ -29,7 +29,6 @@ #include "buffer.h" #include "dispatcher.h" #include "logger_private.h" -#include "util.h" #if __cplusplus extern "C" { diff --git a/c/src/core/error.c b/c/src/core/error.c index fa7b137c0..c4b5c0497 100644 --- a/c/src/core/error.c +++ b/c/src/core/error.c @@ -23,7 +23,7 @@ #include "memory.h" #include "platform/platform.h" -#include "util.h" +#include "util_str.h" #include <proton/connection.h> #include <proton/link.h> diff --git a/c/src/core/logger.c b/c/src/core/logger.c index ea1659347..003a3ce5b 100644 --- a/c/src/core/logger.c +++ b/c/src/core/logger.c @@ -24,7 +24,7 @@ #include "fixed_string.h" #include "memory.h" -#include "util.h" +#include "util_str.h" #include "value_dump.h" #include <assert.h> diff --git a/c/src/core/transport.c b/c/src/core/transport.c index 1fad3773a..38d3a188d 100644 --- a/c/src/core/transport.c +++ b/c/src/core/transport.c @@ -28,6 +28,8 @@ #include "platform/platform_fmt.h" #include "sasl/sasl-internal.h" #include "ssl/ssl-internal.h" +#include "util.h" +#include "util_str.h" #include "autodetect.h" #include "protocol.h" diff --git a/c/src/core/util.h b/c/src/core/util.h index 692f8fdb6..7924bc9bd 100644 --- a/c/src/core/util.h +++ b/c/src/core/util.h @@ -46,11 +46,6 @@ bool pn_env_bool(const char *name); pn_timestamp_t pn_timestamp_min(pn_timestamp_t a, pn_timestamp_t b); extern const pn_class_t PN_CLASSCLASS(pn_strdup)[]; -char *pn_strdup(const char *src); -char *pn_strndup(const char *src, size_t n); - -int pn_strcasecmp(const char* a, const char* b); -int pn_strncasecmp(const char* a, const char* b, size_t len); static inline bool pn_bytes_equal(const pn_bytes_t a, const pn_bytes_t b) { return (a.size == b.size && !memcmp(a.start, b.start, a.size)); diff --git a/c/src/core/util_str.h b/c/src/core/util_str.h new file mode 100644 index 000000000..2f20e6709 --- /dev/null +++ b/c/src/core/util_str.h @@ -0,0 +1,42 @@ +#ifndef _PROTON_SRC_UTIL_STR_H +#define _PROTON_SRC_UTIL_STR_H 1 + +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 + * + * http://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. + * + */ + +#include <stddef.h> + +#if __cplusplus +extern "C" { +#endif + +char *pn_strdup(const char *src); +char *pn_strndup(const char *src, size_t n); + +int pn_strcasecmp(const char* a, const char* b); +int pn_strncasecmp(const char* a, const char* b, size_t len); + + +#if __cplusplus +} +#endif + +#endif /* util_str.h */ diff --git a/c/src/extra/url.c b/c/src/extra/url.c index 383d19719..d388b9a2a 100644 --- a/c/src/extra/url.c +++ b/c/src/extra/url.c @@ -22,7 +22,7 @@ #define PN_USE_DEPRECATED_API 1 #include "core/fixed_string.h" -#include "core/util.h" +#include "core/util_str.h" #include "proton/url.h" #include "proton/object.h" diff --git a/c/src/messenger/messenger.c b/c/src/messenger/messenger.c index add1491a7..ec3f0514a 100644 --- a/c/src/messenger/messenger.c +++ b/c/src/messenger/messenger.c @@ -39,6 +39,7 @@ #include "core/log_private.h" #include "core/util.h" +#include "core/util_str.h" #include "platform/platform.h" // pn_i_getpid, pn_i_now #include "platform/platform_fmt.h" #include "store.h" diff --git a/c/src/sasl/sasl.c b/c/src/sasl/sasl.c index 3de63aa45..1e1d877af 100644 --- a/c/src/sasl/sasl.c +++ b/c/src/sasl/sasl.c @@ -28,6 +28,7 @@ #include "core/frame_generators.h" #include "core/frame_consumers.h" #include "core/util.h" +#include "core/util_str.h" #include "platform/platform_fmt.h" #include "protocol.h" @@ -35,6 +36,7 @@ #include "proton/types.h" #include <assert.h> +#include <stdlib.h> // Machinery to allow plugin SASL implementations // Change this to &default_sasl_impl when we change cyrus to opt in diff --git a/c/src/ssl/openssl.c b/c/src/ssl/openssl.c index caa7ea011..41965dcd6 100644 --- a/c/src/ssl/openssl.c +++ b/c/src/ssl/openssl.c @@ -24,6 +24,7 @@ #include "core/engine-internal.h" #include "core/logger_private.h" #include "core/util.h" +#include "core/util_str.h" #include <proton/ssl.h> #include <proton/engine.h> diff --git a/c/src/ssl/schannel.cpp b/c/src/ssl/schannel.cpp index 5d2ff8b02..de1a182fb 100644 --- a/c/src/ssl/schannel.cpp +++ b/c/src/ssl/schannel.cpp @@ -35,7 +35,7 @@ #include "core/autodetect.h" #include "core/engine-internal.h" #include "core/logger_private.h" -#include "core/util.h" +#include "core/util_str.h" #include "platform/platform.h" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org