2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
21 map_init(Map *m, int n)
23 m->size = (n + 7) >> 3;
24 m->map = m->size ? solv_calloc(m->size, 1) : 0;
31 m->map = solv_free(m->map);
35 /* copy constructor t <- s */
37 map_init_clone(Map *t, Map *s)
42 t->map = solv_malloc(s->size);
43 memcpy(t->map, s->map, s->size);
51 map_grow(Map *m, int n)
56 m->map = solv_realloc(m->map, n);
57 memset(m->map + m->size, 0, n - m->size);
62 /* bitwise-ands same-sized maps t and s, stores the result in t. */
64 map_and(Map *t, Map *s)
66 unsigned char *ti, *si, *end;