Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/sys/src/libmemdraw/subfont.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include <draw.h>
4
#include <memdraw.h>
5
 
6
Memsubfont*
7
allocmemsubfont(char *name, int n, int height, int ascent, Fontchar *info, Memimage *i)
8
{
9
	Memsubfont *f;
10
 
11
	f = malloc(sizeof(Memsubfont));
12
	if(f == 0)
13
		return 0;
14
	f->n = n;
15
	f->height = height;
16
	f->ascent = ascent;
17
	f->info = info;
18
	f->bits = i;
19
	if(name)
20
		f->name = strdup(name);
21
	else
22
		f->name = 0;
23
	return f;
24
}
25
 
26
void
27
freememsubfont(Memsubfont *f)
28
{
29
	if(f == 0)
30
		return;
31
	free(f->info);	/* note: f->info must have been malloc'ed! */
32
	freememimage(f->bits);
33
	free(f);
34
}