-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvlr.c
More file actions
executable file
·59 lines (49 loc) · 773 Bytes
/
vlr.c
File metadata and controls
executable file
·59 lines (49 loc) · 773 Bytes
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
/*
** vlr.c
** A record to keep track of alternations and variable length nodes.
*/
#include <stdio.h>
#include <stdlib.h>
#include "vlr.h"
#include "memory.h"
vlr vlr_constructor (void)
{
vlr newvlr = (vlr) check_malloc (sizeof(variablelengthrecord));
newvlr->id = 0;
newvlr->min = 0;
newvlr->max = 0;
newvlr->cur = 0;
return (newvlr);
}
void vlr_set_id (vlr v, int i)
{
v->id = i;
}
void vlr_set_min (vlr v, int i)
{
v->min = i;
}
void vlr_set_max (vlr v, int i)
{
v->max = i;
}
void vlr_set_cur (vlr v, int i)
{
v->cur = i;
}
int vlr_get_id (vlr v)
{
return (v->id);
}
int vlr_get_min (vlr v)
{
return (v->min);
}
int vlr_get_max (vlr v)
{
return (v->max);
}
int vlr_get_cur (vlr v)
{
return (v->cur);
}