2 * Copyright © 2017 Keith Packard <keithp@keithp.com>
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 * (at your option) any later version.
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 GNU
12 * General Public License for more details.
15 #include "ao_scheme.h"
17 static void bool_mark(void *addr)
22 static int bool_size(void *addr)
25 return sizeof (struct ao_scheme_bool);
28 static void bool_move(void *addr)
33 const struct ao_scheme_type ao_scheme_bool_type = {
41 ao_scheme_bool_write(ao_poly v, bool write)
43 struct ao_scheme_bool *b = ao_scheme_poly_bool(v);
52 #ifdef AO_SCHEME_MAKE_CONST
54 struct ao_scheme_bool *ao_scheme_true, *ao_scheme_false;
56 struct ao_scheme_bool *
57 ao_scheme_bool_get(uint8_t value)
59 struct ao_scheme_bool **b;
67 *b = ao_scheme_alloc(sizeof (struct ao_scheme_bool));
68 (*b)->type = AO_SCHEME_BOOL;