blob: 0afb8b4b87964edc3c1b721b8fd5b0e2eeac4e65 [file] [log] [blame]
Craig Tiller1a61b172015-02-16 11:53:47 -08001/*
2 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003 * Copyright 2015 gRPC authors.
Craig Tiller1a61b172015-02-16 11:53:47 -08004 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
Craig Tiller1a61b172015-02-16 11:53:47 -08008 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Craig Tiller1a61b172015-02-16 11:53:47 -080010 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
Craig Tiller1a61b172015-02-16 11:53:47 -080016 *
17 */
18
Craig Tillerea61b072015-02-03 19:19:27 -080019#include <grpc/grpc.h>
20#include <grpc/support/alloc.h>
21
22#include <string.h>
23
Craig Tiller9533d042016-03-25 17:11:06 -070024#include "src/core/lib/surface/api_trace.h"
Masood Malekghassemi76c3d742015-08-19 18:22:53 -070025
Craig Tillera82950e2015-09-22 12:33:20 -070026void grpc_metadata_array_init(grpc_metadata_array* array) {
Masood Malekghassemi76c3d742015-08-19 18:22:53 -070027 GRPC_API_TRACE("grpc_metadata_array_init(array=%p)", 1, (array));
Craig Tillera82950e2015-09-22 12:33:20 -070028 memset(array, 0, sizeof(*array));
Craig Tillerea61b072015-02-03 19:19:27 -080029}
30
Craig Tillera82950e2015-09-22 12:33:20 -070031void grpc_metadata_array_destroy(grpc_metadata_array* array) {
Masood Malekghassemi76c3d742015-08-19 18:22:53 -070032 GRPC_API_TRACE("grpc_metadata_array_destroy(array=%p)", 1, (array));
Craig Tillera82950e2015-09-22 12:33:20 -070033 gpr_free(array->metadata);
Craig Tillerea61b072015-02-03 19:19:27 -080034}