00001 /* libcomps - C alternative to yum.comps library 00002 * Copyright (C) 2013 Jindrich Luza 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00017 * USA 00018 */ 00019 00020 #ifndef COMPS_MM_H 00021 #define COMPS_MM_H 00022 00023 #include <stdlib.h> 00024 #include <string.h> 00025 #include <signal.h> 00026 00036 typedef struct { 00037 size_t ref_count; 00038 void (*destructor)(void*); 00040 void *obj; 00041 } COMPS_RefC; 00042 00044 COMPS_RefC* comps_refc_create(void *obj, void (*destructor)(void*)); 00045 00050 void comps_refc_destroy(COMPS_RefC *refc); 00051 00055 void comps_refc_destroy_v(void *refc); 00056 00060 void comps_refc_decref(COMPS_RefC *refc); 00061 00064 void comps_refc_incref(COMPS_RefC *refc); 00065 00066 #endif //COMPS_MM_H