Path: blob/master/thirdparty/linuxbsd_headers/dbus/dbus-memory.h
9898 views
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */1/* dbus-memory.h D-Bus memory handling2*3* Copyright (C) 2002 Red Hat Inc.4*5* Licensed under the Academic Free License version 2.16*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20*21*/22#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)23#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."24#endif2526#ifndef DBUS_MEMORY_H27#define DBUS_MEMORY_H2829#include <dbus/dbus-macros.h>30#include <stddef.h>3132DBUS_BEGIN_DECLS3334/**35* @addtogroup DBusMemory36* @{37*/3839DBUS_EXPORT40DBUS_MALLOC41DBUS_ALLOC_SIZE(1)42void* dbus_malloc (size_t bytes);4344DBUS_EXPORT45DBUS_MALLOC46DBUS_ALLOC_SIZE(1)47void* dbus_malloc0 (size_t bytes);4849DBUS_EXPORT50DBUS_MALLOC51DBUS_ALLOC_SIZE(2)52void* dbus_realloc (void *memory,53size_t bytes);54DBUS_EXPORT55void dbus_free (void *memory);5657#define dbus_new(type, count) ((type*)dbus_malloc (sizeof (type) * (count)))58#define dbus_new0(type, count) ((type*)dbus_malloc0 (sizeof (type) * (count)))5960DBUS_EXPORT61void dbus_free_string_array (char **str_array);6263typedef void (* DBusFreeFunction) (void *memory);6465DBUS_EXPORT66void dbus_shutdown (void);6768/** @} */6970DBUS_END_DECLS7172#endif /* DBUS_MEMORY_H */737475