chromium/third_party/grpc/src/src/core/lib/channel/channel_args.cc

//
//
// Copyright 2015 gRPC authors.
//
// 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
//
//     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 <grpc/support/port_platform.h>

#include "src/core/lib/channel/channel_args.h"

#include <limits.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <initializer_list>
#include <map>
#include <vector>

#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"

#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>

#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/match.h"

namespace grpc_core {

ChannelArgs::Pointer::Pointer(void* p, const grpc_arg_pointer_vtable* vtable)
    :{}

ChannelArgs::Pointer::Pointer(const Pointer& other)
    :{}

ChannelArgs::Pointer::Pointer(Pointer&& other) noexcept
    :{}

const grpc_arg_pointer_vtable* ChannelArgs::Pointer::EmptyVTable() {}

ChannelArgs::ChannelArgs() = default;
ChannelArgs::~ChannelArgs() = default;
ChannelArgs::ChannelArgs(const ChannelArgs& other) = default;
ChannelArgs& ChannelArgs::operator=(const ChannelArgs& other) = default;
ChannelArgs::ChannelArgs(ChannelArgs&& other) noexcept = default;
ChannelArgs& ChannelArgs::operator=(ChannelArgs&& other) noexcept = default;

const ChannelArgs::Value* ChannelArgs::Get(absl::string_view name) const {}

bool ChannelArgs::Contains(absl::string_view name) const {}

bool ChannelArgs::operator<(const ChannelArgs& other) const {}

bool ChannelArgs::operator==(const ChannelArgs& other) const {}

bool ChannelArgs::operator!=(const ChannelArgs& other) const {}

bool ChannelArgs::WantMinimalStack() const {}

ChannelArgs::ChannelArgs(AVL<std::string, Value> args)
    :{}

ChannelArgs ChannelArgs::Set(grpc_arg arg) const {}

ChannelArgs ChannelArgs::FromC(const grpc_channel_args* args) {}

ChannelArgs::CPtr ChannelArgs::ToC() const {}

ChannelArgs ChannelArgs::Set(absl::string_view name, Pointer value) const {}

ChannelArgs ChannelArgs::Set(absl::string_view name, int value) const {}

ChannelArgs ChannelArgs::Set(absl::string_view key, Value value) const {}

ChannelArgs ChannelArgs::Set(absl::string_view key,
                             absl::string_view value) const {}

ChannelArgs ChannelArgs::Set(absl::string_view key, const char* value) const {}

ChannelArgs ChannelArgs::Set(absl::string_view key, std::string value) const {}

ChannelArgs ChannelArgs::Remove(absl::string_view key) const {}

absl::optional<int> ChannelArgs::GetInt(absl::string_view name) const {}

absl::optional<Duration> ChannelArgs::GetDurationFromIntMillis(
    absl::string_view name) const {}

absl::optional<absl::string_view> ChannelArgs::GetString(
    absl::string_view name) const {}

absl::optional<std::string> ChannelArgs::GetOwnedString(
    absl::string_view name) const {}

void* ChannelArgs::GetVoidPointer(absl::string_view name) const {}

absl::optional<bool> ChannelArgs::GetBool(absl::string_view name) const {}

std::string ChannelArgs::ToString() const {}

ChannelArgs ChannelArgs::UnionWith(ChannelArgs other) const {}

void ChannelArgs::ChannelArgsDeleter::operator()(
    const grpc_channel_args* p) const {}

std::ostream& operator<<(std::ostream& out, const ChannelArgs& args) {}

}  // namespace grpc_core

static grpc_arg copy_arg(const grpc_arg* src) {}

grpc_channel_args* grpc_channel_args_copy_and_add(const grpc_channel_args* src,
                                                  const grpc_arg* to_add,
                                                  size_t num_to_add) {}

grpc_channel_args* grpc_channel_args_copy_and_remove(
    const grpc_channel_args* src, const char** to_remove,
    size_t num_to_remove) {}

static bool should_remove_arg(const grpc_arg* arg, const char** to_remove,
                              size_t num_to_remove) {}

grpc_channel_args* grpc_channel_args_copy_and_add_and_remove(
    const grpc_channel_args* src, const char** to_remove, size_t num_to_remove,
    const grpc_arg* to_add, size_t num_to_add) {}

grpc_channel_args* grpc_channel_args_copy(const grpc_channel_args* src) {}

grpc_channel_args* grpc_channel_args_union(const grpc_channel_args* a,
                                           const grpc_channel_args* b) {}

static int cmp_arg(const grpc_arg* a, const grpc_arg* b) {}

// stabilizing comparison function: since channel_args ordering matters for
// keys with the same name, we need to preserve that ordering
static int cmp_key_stable(const void* ap, const void* bp) {}

grpc_channel_args* grpc_channel_args_normalize(const grpc_channel_args* src) {}

void grpc_channel_args_destroy(grpc_channel_args* a) {}

int grpc_channel_args_compare(const grpc_channel_args* a,
                              const grpc_channel_args* b) {}

const grpc_arg* grpc_channel_args_find(const grpc_channel_args* args,
                                       const char* name) {}

int grpc_channel_arg_get_integer(const grpc_arg* arg,
                                 const grpc_integer_options options) {}

int grpc_channel_args_find_integer(const grpc_channel_args* args,
                                   const char* name,
                                   const grpc_integer_options options) {}

char* grpc_channel_arg_get_string(const grpc_arg* arg) {}

char* grpc_channel_args_find_string(const grpc_channel_args* args,
                                    const char* name) {}

bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value) {}

bool grpc_channel_args_find_bool(const grpc_channel_args* args,
                                 const char* name, bool default_value) {}

bool grpc_channel_args_want_minimal_stack(const grpc_channel_args* args) {}

grpc_arg grpc_channel_arg_string_create(char* name, char* value) {}

grpc_arg grpc_channel_arg_integer_create(char* name, int value) {}

grpc_arg grpc_channel_arg_pointer_create(
    char* name, void* value, const grpc_arg_pointer_vtable* vtable) {}

std::string grpc_channel_args_string(const grpc_channel_args* args) {}

namespace grpc_core {
ChannelArgs ChannelArgsBuiltinPrecondition(const grpc_channel_args* src) {}

}  // namespace grpc_core

namespace {
grpc_channel_args_client_channel_creation_mutator g_mutator =;
}  // namespace

void grpc_channel_args_set_client_channel_creation_mutator(
    grpc_channel_args_client_channel_creation_mutator cb) {}
grpc_channel_args_client_channel_creation_mutator
grpc_channel_args_get_client_channel_creation_mutator() {}