-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3dLinkL.h
95 lines (83 loc) · 2.33 KB
/
3dLinkL.h
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
91
92
93
94
95
/*****************************************************************************
* file: "LinkedLists.h"
*
* purpose: inclusion lists, constants, data types & macros for use
* in three dimensional graphics applications which use the
* "3d.c" functions.
*
* ©1990 Mark M. Owen. All rights reserved.
*****************************************************************************
*/
#ifndef _LinkedLists_
#define _LinkedLists_
#include "xvt.h"
typedef char
*BytesPtr,
*ListDataType;
typedef struct ListType
{ struct ListType *Next;
struct ListType *Prior;
ListDataType ListData;
} ListType;
typedef struct ListControlType
{ struct ListType *First,
*Current,
*Last;
} ListCorontlType;
/* linked lists */
#if XVT_CC_PROTO
void InitList (ListControlType **p);
BOOLEAN EmptyList (ListControlType *p);
void AddToList (ListControlType *p, ListDataType Data);
void InsertInList (ListControlType *p, ListDataType Data);
BOOLEAN Equal (BytesPtr Source, BytesPtr Dest, int size);
ListDataType First (ListControlType *p);
ListDataType Next (ListControlType *p);
ListDataType Last (ListControlType *p);
ListDataType Prior (ListControlType *p);
BOOLEAN FoundInList (ListControlType *p,ListDataType Target,int size);
ListDataType DropFromList (ListControlType *p);
void DisposeList (ListControlType *p);
#else
void InitList ();
BOOLEAN EmptyList ();
void AddToList ();
void InsertInList ();
BOOLEAN Equal ();
ListDataType First ();
ListDataType Next ();
ListDataType Last ();
ListDataType Prior ();
BOOLEAN FoundInList ();
ListDataType DropFromList ();
void DisposeList ();
#endif
/* stacks */
#if XVT_CC_PROTO
void InitStack (ListControlType **stack);
void PushStack (ListControlType *stack, ListDataType Data);
ListDataType PopStack (ListControlType *stack);
BOOLEAN EmptyStack (ListControlType *stack);
void DisposeStack (ListControlType *stack);
#else
void InitStack ();
void PushStack ();
ListDataType PopStack ();
BOOLEAN EmptyStack ();
void DisposeStack ();
#endif
/* queues */
#if XVT_CC_PROTO
void InitQueue (ListControlType **queue);
void En_Queue (ListControlType *queue, ListDataType Data);
ListDataType De_Queue (ListControlType *queue);
BOOLEAN EmptyQueue (ListControlType *queue);
void DisposeQueue (ListControlType *queue);
#else
void InitQueue ();
void En_Queue ();
ListDataType De_Queue ();
BOOLEAN EmptyQueue ();
void DisposeQueue ();
#endif
#endif