blob: 327a101d8a3ff71e3f077681e3ce45b486066ead (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include <gc.h>
#include <gc/cord.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/param.h>
#include <err.h>
#include "../SipHash/halfsiphash.h"
#include "../util.h"
#include "bool.h"
#include "types.h"
public CORD Bool__as_text(const bool *b, bool colorize, const TypeInfo *type)
{
(void)type;
if (!b) return "Bool";
if (colorize)
return *b ? "\x1b[35myes\x1b[m" : "\x1b[35mno\x1b[m";
else
return *b ? "yes" : "no";
}
public const TypeInfo Bool = {
.size=sizeof(bool),
.align=__alignof__(bool),
.tag=CustomInfo,
.CustomInfo={.as_text=(void*)Bool__as_text},
};
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
|