00001 /* 00002 * Copyright 2008, 2009 Alexandros Frantzis, Michael Iatrou 00003 * 00004 * This file is part of libbls. 00005 * 00006 * libbls is free software: you can redistribute it and/or modify it under the 00007 * terms of the GNU Lesser General Public License as published by the Free Software 00008 * Foundation, either version 3 of the License, or (at your option) any later 00009 * version. 00010 * 00011 * libbls is distributed in the hope that it will be useful, but WITHOUT ANY 00012 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00014 * details. 00015 * 00016 * You should have received a copy of the GNU General Public License along with 00017 * libbls. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 /** 00021 * @file data_object_memory.h 00022 * 00023 * Definitions of constructor functions for the memory data_object_t. 00024 */ 00025 #ifndef _DATA_OBJECT_MEMORY_H 00026 #define _DATA_OBJECT_MEMORY_H 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 #include "data_object.h" 00033 #include <sys/types.h> 00034 00035 /** 00036 * @addtogroup data_object 00037 * @{ 00038 */ 00039 00040 /** 00041 * A function used to free the data owned by a memory data_object_t. 00042 */ 00043 typedef void (data_object_memory_free_func)(void *); 00044 00045 /** 00046 * @name Constructors 00047 * @{ 00048 */ 00049 00050 int data_object_memory_new(data_object_t **obj, void *data, size_t size); 00051 00052 int data_object_memory_set_free_func(data_object_t *obj, 00053 data_object_memory_free_func *mem_free); 00054 00055 /** @} */ 00056 /** @} */ 00057 00058 #ifdef __cplusplus 00059 } 00060 #endif 00061 00062 #endif 00063