File: fontspec.c

package info (click to toggle)
xtruss 0.0~git20241011.27fafffe-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,172 kB
  • sloc: ansic: 17,121; sh: 20; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (2)
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
34
35
/*
 * Implementation of FontSpec for Unix. This is more or less
 * degenerate - on this platform a font specification is just a
 * string.
 */

#include "putty.h"

FontSpec *fontspec_new(const char *name)
{
    FontSpec *f = snew(FontSpec);
    f->name = dupstr(name);
    return f;
}

FontSpec *fontspec_copy(const FontSpec *f)
{
    return fontspec_new(f->name);
}

void fontspec_free(FontSpec *f)
{
    sfree(f->name);
    sfree(f);
}

void fontspec_serialise(BinarySink *bs, FontSpec *f)
{
    put_asciz(bs, f->name);
}

FontSpec *fontspec_deserialise(BinarySource *src)
{
    return fontspec_new(get_asciz(src));
}