source: trunk/server/lib/talloc/compat/talloc_compat1.c

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 1.6 KB
Line 
1/*
2 Samba trivial allocation library - compat functions
3
4 Copyright (C) Stefan Metzmacher 2009
5
6 ** NOTE! The following LGPL license applies to the talloc
7 ** library. This does NOT imply that all of Samba is released
8 ** under the LGPL
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 3 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, see <http://www.gnu.org/licenses/>.
22*/
23
24/*
25 * This file contains only function to build a
26 * compat talloc.so.1 library on top of talloc.so.2
27 */
28
29#include "replace.h"
30#include "talloc.h"
31
32void *_talloc_reference(const void *context, const void *ptr);
33void *_talloc_reference(const void *context, const void *ptr) {
34 return _talloc_reference_loc(context, ptr,
35 "Called from talloc compat1 "
36 "_talloc_reference");
37}
38
39void *_talloc_steal(const void *new_ctx, const void *ptr);
40void *_talloc_steal(const void *new_ctx, const void *ptr)
41{
42 return talloc_reparent(talloc_parent(ptr), new_ctx, ptr);
43}
44
45#undef talloc_free
46int talloc_free(void *ptr);
47int talloc_free(void *ptr)
48{
49 return talloc_unlink(talloc_parent(ptr), ptr);
50}
51
Note: See TracBrowser for help on using the repository browser.