Mercurial > projects > dbus-d
diff dbus-d/dsrc/org/freedesktop/dbus/c/Memory.d @ 0:a5576806d36d
recreate repository without any libs for lightweight repository
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 20 Oct 2007 18:07:18 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dbus-d/dsrc/org/freedesktop/dbus/c/Memory.d Sat Oct 20 18:07:18 2007 +0200 @@ -0,0 +1,52 @@ +/* -*- mode: C; c-file-style: "gnu" -*- */ +/* dbus-memory.h D-Bus memory handling + * + * Copyright (C) 2002 Red Hat Inc. + * + * Licensed under the Academic Free License version 2.1 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +module org.freedesktop.dbus.c.Memory; + +extern(C): +/** + * @addtogroup DBusMemory + * @{ + */ + +void* dbus_malloc (size_t bytes); +void* dbus_malloc0 (size_t bytes); +void* dbus_realloc (void *memory, + size_t bytes); +void dbus_free (void *memory); + +T* dbus_new(T)( count){ + return cast(T*)dbus_malloc (T.sizeof * count); +} + +T* dbus_new0(T)( count){ + return cast(T*)dbus_malloc0 (T.sizeof* count); +} + +void dbus_free_string_array (char **str_array); + +alias void (* DBusFreeFunction) (void *memory); + +void dbus_shutdown (); + +/** @} */ +