00001 /* 00002 * Copyright 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 buffer_action_internal.h 00022 * 00023 * Buffer actions internal API 00024 */ 00025 #ifndef _BUFFER_ACTION_INTERNAL_H 00026 #define _BUFFER_ACTION_INTERNAL_H 00027 00028 #include "data_object.h" 00029 #include "buffer_action.h" 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 /** 00036 * @addtogroup buffer_action 00037 * 00038 * @{ 00039 */ 00040 00041 /** 00042 * Struct that holds the function pointers for an implementation of a 00043 * buffer_action_t. 00044 */ 00045 struct buffer_action_funcs { 00046 int (*do_func)(buffer_action_t *action); 00047 int (*undo_func)(buffer_action_t *action); 00048 int (*private_copy_func)(buffer_action_t *action, data_object_t *obj); 00049 int (*to_event_func)(buffer_action_t *action, 00050 struct bless_buffer_event_info *event_info); 00051 int (*free_func)(buffer_action_t *action); 00052 }; 00053 00054 /** 00055 * @name Internal functions 00056 * 00057 * @{ 00058 */ 00059 int buffer_action_create_impl(buffer_action_t **action, void *impl, 00060 struct buffer_action_funcs *funcs); 00061 00062 void *buffer_action_get_impl(buffer_action_t *action); 00063 00064 /** @} */ 00065 00066 /** @} */ 00067 00068 #ifdef __cplusplus 00069 } 00070 #endif 00071 00072 #endif /* _BUFFER_ACTION_INTERNAL_H */