projects
/
platform
/
upstream
/
libsolv.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
0ebd2d961827593875208239ea25edc958b24f1a
[platform/upstream/libsolv.git]
/
src
/
bitmap.c
1
/*
2
* bitmap.c
3
*
4
*/
5
6
#include <stdlib.h>
7
#include <string.h>
8
9
#include "bitmap.h"
10
#include "util.h"
11
12
void
13
mapinit(Map *m, int n)
14
{
15
m->size = (n + 7) >> 3;
16
m->map = xcalloc(m->size, 1);
17
}
18
19
// free space allocated
20
void
21
mapfree(Map *m)
22
{
23
m->map = xfree(m->map);
24
m->size = 0;
25
}
26
27
// copy t <- s
28
void
29
clonemap(Map *t, Map *s)
30
{
31
t->size = s->size;
32
t->map = xmalloc(s->size);
33
memcpy(t->map, s->map, t->size);
34
}
35
36
// EOF