Loading...
Searching...
No Matches
comps_mm.h
Go to the documentation of this file.
/* libcomps - C alternative to yum.comps library
* Copyright (C) 2013 Jindrich Luza
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA
*/
#ifndef COMPS_MM_H
#define COMPS_MM_H
#include <stdlib.h>
#include <string.h>
#include <signal.h>
typedef struct {
size_t ref_count;
void (*destructor)(void*);
void *obj;
} COMPS_RefC;
COMPS_RefC* comps_refc_create(void *obj, void (*destructor)(void*));
void comps_refc_destroy(COMPS_RefC *refc);
void comps_refc_destroy_v(void *refc);
void comps_refc_decref(COMPS_RefC *refc);
void comps_refc_incref(COMPS_RefC *refc);
#endif //COMPS_MM_H
comps_refc_destroy
void comps_refc_destroy(COMPS_RefC *refc)
Definition comps_mm.c:34
comps_refc_create
COMPS_RefC * comps_refc_create(void *obj, void(*destructor)(void *))
Definition comps_mm.c:21
comps_refc_destroy_v
void comps_refc_destroy_v(void *refc)
Definition comps_mm.c:43
comps_refc_incref
void comps_refc_incref(COMPS_RefC *refc)
Definition comps_mm.c:51
comps_refc_decref
void comps_refc_decref(COMPS_RefC *refc)
Definition comps_mm.c:47
COMPS_RefC
Definition comps_mm.h:36
COMPS_RefC::destructor
void(* destructor)(void *)
Definition comps_mm.h:38
COMPS_RefC::obj
void * obj
Definition comps_mm.h:40
COMPS_RefC::ref_count
size_t ref_count
Definition comps_mm.h:37