-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfont_lis.c
68 lines (52 loc) · 1.63 KB
/
font_lis.c
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* $Id: font_lis.c,v 1.2 1992/10/02 01:02:32 craigs Exp $
*
* This code was written by Craig Southeren whilst under contract
* to Computer Sciences of Australia, Systems Engineering Division.
* It has been kindly released by CSA into the public domain.
*
* Neither CSA or me guarantee that this source code is fit for anything,
* so use it at your peril. I don't even work for CSA any more, so
* don't bother them about it. If you have any suggestions or comments
* (or money, cheques, free trips =8^) !!!!! ) please contact me
* care of [email protected]
*/
#include "machdep.h"
#include "defs.h"
#include "font_lis.h"
#include "main.h"
/********************************
defines
********************************/
struct font_name_struct {
char * name;
struct font_name_struct * next;
};
struct font_name_struct * font_list = NULL;
/********************************
enumerate_fonts
********************************/
void enumerate_fonts (stream)
FILE *stream;
{
struct font_name_struct * p;
for (p = font_list;p != NULL; p = p->next)
fprintf (stream, "%s ", p->name);
}
/********************************
add_font_to_list
********************************/
void add_font_to_list (fontname)
char *fontname;
{
struct font_name_struct * p;
/* make sure there is no font with this name */
for (p = font_list;p != NULL; p = p->next)
if (strcmp (fontname, p->name) == 0)
return;
/* insert new font record at the start of the list */
p = (struct font_name_struct *)malloc (sizeof (struct font_name_struct));
p->name = STRDUP (fontname);
p->next = font_list;
font_list = p;
}