2
* Copyright (c) 2012 by Internet Systems Consortium, Inc. ("ISC")
4
* Permission to use, copy, modify, and/or distribute this software for any
5
* purpose with or without fee is hereby granted, provided that the above
6
* copyright notice and this permission notice appear in all copies.
8
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
9
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
11
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
14
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2
* Copyright (c) 2012, 2014 by Farsight Security, Inc.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
17
#include "mtbl-private.h"
19
#include "librsf/heap.h"
20
#include "librsf/ubuf.h"
21
#include "librsf/vector.h"
19
#include "libmy/heap.h"
20
#include "libmy/ubuf.h"
24
23
struct mtbl_iter *it;
198
196
if (ubuf_size(it->cur_key) == 0) {
199
197
ubuf_clip(it->cur_val, 0);
200
ubuf_append(it->cur_key, ubuf_data(e->key), ubuf_size(e->key));
201
ubuf_append(it->cur_val, ubuf_data(e->val), ubuf_size(e->val));
198
ubuf_extend(it->cur_key, e->key);
199
ubuf_extend(it->cur_val, e->val);
202
201
res = entry_fill(e);
203
202
if (res == mtbl_res_success)
204
203
heap_replace(it->h, e);
231
*out_key = ubuf_data(it->cur_key);
232
*out_val = ubuf_data(it->cur_val);
233
*out_len_key = ubuf_size(it->cur_key);
234
*out_len_val = ubuf_size(it->cur_val);
236
return (mtbl_res_success);
232
*out_key = ubuf_data(it->cur_key);
233
*out_val = ubuf_data(it->cur_val);
234
*out_len_key = ubuf_size(it->cur_key);
235
*out_len_val = ubuf_size(it->cur_val);
236
return (mtbl_res_success);
238
return (mtbl_res_failure);