libcomps
..
Toggle main menu visibility
Loading...
Searching...
No Matches
libcomps
src
comps_mm.h
Go to the documentation of this file.
1
/* libcomps - C alternative to yum.comps library
2
* Copyright (C) 2013 Jindrich Luza
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but
10
* 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.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
* USA
18
*/
19
20
#ifndef COMPS_MM_H
21
#define COMPS_MM_H
22
23
#include <stdlib.h>
24
#include <string.h>
25
#include <signal.h>
26
32
36
typedef
struct
{
37
size_t
ref_count
;
38
void (*
destructor
)(
void
*);
40
void
*
obj
;
41
}
COMPS_RefC
;
42
44
COMPS_RefC
*
comps_refc_create
(
void
*obj,
void
(*destructor)(
void
*));
45
50
void
comps_refc_destroy
(
COMPS_RefC
*refc);
51
55
void
comps_refc_destroy_v
(
void
*refc);
56
60
void
comps_refc_decref
(
COMPS_RefC
*refc);
61
64
void
comps_refc_incref
(
COMPS_RefC
*refc);
65
66
#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
Generated by
1.17.0