summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/omegafonts/list_routines.c
blob: 3cac5e26588a71e925663693dd7617be8bfaf844 (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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* list_routines.c: Types used in this program.

This file is part of Omega,
which is based on the web2c distribution of TeX,

Copyright (c) 1994--2001 John Plaice and Yannis Haralambous

Omega is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Omega is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Omega; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

*/

#include "cpascal.h"
#include "list_routines.h"

static list
list1 (void *x)
{
list temp;
temp = (list) xmalloc(sizeof(cell));
temp->contents = x;
temp->ptr = NULL;
return temp;
}

/* Attribute-value list function */

av_list
av_list1 (int attr, int val)
{
av_list temp;
temp = (av_list) xmalloc(sizeof(av_cell));
temp->attribute = attr;
temp->value = val;
temp->ptr = NULL;
return temp;
}

/* Index-value list function */

in_list
in_list1 (int val, in_list N)
{
in_list temp;
temp = (in_list) xmalloc(sizeof(in_cell));
temp->index = 0;
temp->value = val;
temp->actual = N;
temp->ptr = NULL;
return temp;
}

/* Attribute-value list function */

hash_list
hash_list1 (int x, int y, int new_class, int lig_z, hash_list N)
{
hash_list temp;
temp = (hash_list) xmalloc(sizeof(hash_cell));
temp->x = x;
temp->y = y;
temp->new_class = new_class;
temp->lig_z = lig_z;
temp->ptr = N;
return temp;
}


void
append_to_queue(queue *q, void *content)
{
    if (q->front == NULL) {
        q->front = list1(content);
        q->tail = q->front;
    } else {
        q->tail->ptr = list1(content);
        q->tail = q->tail->ptr;
    }
}