-
Notifications
You must be signed in to change notification settings - Fork 0
/
alt.c
executable file
·70 lines (58 loc) · 878 Bytes
/
alt.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
69
70
/*
** alt.c
** A record to keep track of alternation nodes.
*/
#include <stdio.h>
#include <stdlib.h>
#include "alt.h"
#include "memory.h"
alt alt_constructor (void)
{
alt newalt = (alt) check_malloc (sizeof(alternationrecord));
newalt->id1 = 0;
newalt->id2 = 0;
newalt->min = 0;
newalt->max = 0;
newalt->cur = 0;
return (newalt);
}
void alt_set_id1 (alt v, int i)
{
v->id1 = i;
}
void alt_set_id2 (alt v, int i)
{
v->id2 = i;
}
void alt_set_min (alt v, int i)
{
v->min = i;
}
void alt_set_max (alt v, int i)
{
v->max = i;
}
void alt_set_cur (alt v, int i)
{
v->cur = i;
}
int alt_get_id1 (alt v)
{
return (v->id1);
}
int alt_get_id2 (alt v)
{
return (v->id2);
}
int alt_get_min (alt v)
{
return (v->min);
}
int alt_get_max (alt v)
{
return (v->max);
}
int alt_get_cur (alt v)
{
return (v->cur);
}