1 /****************************************************************************
2 * Familia Lignum - Genealogical program *
3 * Copyright (C) 2011-2012 Rafał Długołęcki <rafal@dlugolecki.net.pl> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; version 2 of the License. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License along *
15 * with this program; if not, write to the Free Software Foundation, Inc., *
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18 ****************************************************************************/
20 #ifndef _FAMILIA_MEMORY_STACK_H
21 #define _FAMILIA_MEMORY_STACK_H
24 * @file memory_stack.h
25 * @brief API for communication of file parsers with Familia application.
29 * Initializes memory stack for communication with the storage.
31 void familia_memory_stack_init();
34 * Releases memory stack. Any additional resources will be freed. Data pointed
35 * to the storage objects, will stay as it is managed by storage itself.
37 void familia_memory_stack_free();
40 * Helper function for displaying current state of memory stack. Data is passed
43 void familia_memory_stack_dump();
46 * Searches memory for the object with the given key. If object does not exists,
47 * creates it and returns. If NULL will be returned this means that there was a
48 * problem with allocating memory.
49 * @param xref_key string under which the object will be found.
50 * @param type type of the object. It is used to properly allocate object.
51 * @return Pointer to found object, or newly created object of the given type.
52 * Object is allocated in the application storage and should not be
55 void * familia_memory_stack_find(char *xref_key, enum familia_storage_type type);
57 #endif /* _FAMILIA_MEMORY_STACK_H */