File: list.htm

package info (click to toggle)
styx 1.6.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,112 kB
  • ctags: 5,211
  • sloc: ansic: 95,977; sh: 7,991; cpp: 948; makefile: 259; xml: 107; pascal: 14
file content (69 lines) | stat: -rwxr-xr-x 2,673 bytes parent folder | download | duplicates (6)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"         "http://www.w3.org/TR/REC-html40/Transitional.dtd">
<html>
<head>
<title>[list.h] Type: List</title>
<meta name="robots" content="noindex">
</head>
<body bgcolor=white>
<h1><font color="#008B8B">[list.h] Type: List</font></h1>
<h2><font color="#008B8B"><a href="styx.html">contents</a></font></h2><br>
<br><a href="standard.htm">#include "standard.h"</a>
<br>
<br>
<br>
<br><hr width="100%" size=2><h2><b> The Type </b></h2>
<br><pre>
   This module implements a functional,i.e. LISP-like list data type.

</pre>
<br>
<table border=0 cellspacing=10>
<TR valign=top>
<td align=left><b>List(Abs_T)</b>
<td align=left> Abstract list type 

</table>
<br><hr width="100%" size=2><h2><b> Operations and predicates </b></h2>
<table border=0 cellspacing=20>
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>c_bool <b>empty</b>(List(Abs_T) x)</pre>
<td bgcolor="#FFF0F5" align=left>whether list 'x' is empty
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>Abs_T <b>list_fst</b>(List(Abs_T) x)
#define fst(TYPE, LIST) ((TYPE) list_fst(LIST))</pre>
<td bgcolor="#FFF0F5" align=left> first member of list 'x' <br>
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre> List(Abs_T) <b>rst</b>(List(Abs_T) x)</pre>
<td bgcolor="#FFF0F5" align=left>rest of list 'x'
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre> List(Abs_T) <b>cons</b>(Abs_T fst, List(Abs_T) rst)</pre>
<td bgcolor="#FFF0F5" align=left>list constructor
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre> List(Abs_T) *<b>rst_ref</b>(List(Abs_T) x)</pre>
<td bgcolor="#FFF0F5" align=left>pointer to rest(x); use with care!
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>Abs_T *<b>fst_ref</b>(List(Abs_T) x)</pre>
<td bgcolor="#FFF0F5" align=left>pointer to first(x); use with care!
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>int <b>length</b>(List(Abs_T) x)</pre>
<td bgcolor="#FFF0F5" align=left>length of list 'x'
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>void <b>pList</b>(List(Abs_T) x, int Indent, void (*pMember)(Abs_T x))</pre>
<td bgcolor="#FFF0F5" align=left> prints list 'x' to stdout <br>
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>void <b>pListEx</b>
     (
       List(Abs_T) x, int Indent,
       void (*pMember)(Abs_T x, StdCPtr any), StdCPtr any
     )</pre>
<td bgcolor="#FFF0F5" align=left> prints list 'x' to stdout;<br>
   uses 'any' as member context<br>
<br>
<tr valign=top>
<td bgcolor="#FFF8DC" align=left><pre>void <b>freeList</b>(List(Abs_T) x, void (*freeMember)(Abs_T x))</pre>
<td bgcolor="#FFF0F5" align=left> frees list 'x' <br>

</table>

</body>
</html>