chiark / gitweb /
Version bump.
[mLib] / man / darray.3
index 3b796b1f3ad0858c4ed1724d9b16c795c580b09d..db50fd12c1be29c3076bc7fe43bef88e860564a9 100644 (file)
@@ -19,7 +19,7 @@
 ..
 .ie t .ds o \(bu
 .el .ds o o
 ..
 .ie t .ds o \(bu
 .el .ds o o
-.TH darray 3 "21 October 1999" mLib
+.TH darray 3 "21 October 1999" "Straylight/Edgeware" "mLib utilities library"
 .SH "NAME"
 darray \- dense, dynamically resizing arrays
 .\" @DA_INIT
 .SH "NAME"
 darray \- dense, dynamically resizing arrays
 .\" @DA_INIT
@@ -43,6 +43,8 @@ darray \- dense, dynamically resizing arrays
 .\" @DA_UNSAFE_SHRINK
 .\" @DA_UNSLIDE
 .\" @DA_UNSAFE_UNSLIDE
 .\" @DA_UNSAFE_SHRINK
 .\" @DA_UNSLIDE
 .\" @DA_UNSAFE_UNSLIDE
+.\" @DA_FIRST
+.\" @DA_LAST
 .\" @DA_PUSH
 .\" @DA_POP
 .\" @DA_UNSHIFT
 .\" @DA_PUSH
 .\" @DA_POP
 .\" @DA_UNSHIFT
@@ -82,6 +84,8 @@ darray \- dense, dynamically resizing arrays
 .BI "void DA_UNSAFE_SLIDE(" type_v " *" a ", long " n );
 .BI "void DA_UNSAFE_UNSLIDE(" type_v " *" a ", long " n );
 
 .BI "void DA_UNSAFE_SLIDE(" type_v " *" a ", long " n );
 .BI "void DA_UNSAFE_UNSLIDE(" type_v " *" a ", long " n );
 
+.IB type " DA_FIRST(" type_v " *" a );
+.IB type " DA_LAST(" type_v " *" a );
 .BI "void DA_PUSH(" type_v " *" a ", " type " " x );
 .IB type " DA_POP(" type_v " *" a );
 .BI "void DA_UNSHIFT(" type_v " *" a ", " type " " x );
 .BI "void DA_PUSH(" type_v " *" a ", " type " " x );
 .IB type " DA_POP(" type_v " *" a );
 .BI "void DA_UNSHIFT(" type_v " *" a ", " type " " x );
@@ -94,8 +98,8 @@ darray \- dense, dynamically resizing arrays
 .SH "DESCRIPTION"
 The
 .B <mLib/darray.h>
 .SH "DESCRIPTION"
 The
 .B <mLib/darray.h>
-declares a collection of types, macros and functions which implement
-dynamically resizing arrays.
+header file declares a collection of types, macros and functions which
+implement dynamically resizing arrays.
 .PP
 The macros described here may evaluate their arguments multiple times
 unless otherwise specified.
 .PP
 The macros described here may evaluate their arguments multiple times
 unless otherwise specified.
@@ -129,7 +133,7 @@ The macro
 is a valid static initializer for all types of dynamic arrays.  For
 cases where this isn't appropriate, a dynamic array may be initialized
 using the macro
 is a valid static initializer for all types of dynamic arrays.  For
 cases where this isn't appropriate, a dynamic array may be initialized
 using the macro
-.BR DA_INIT ,
+.BR DA_CREATE ,
 passing it the address of the array.
 .PP
 Arrays may be disposed of using the
 passing it the address of the array.
 .PP
 Arrays may be disposed of using the
@@ -179,7 +183,7 @@ is the base address of the actual array.  The elements are stored
 contiguously starting at this address.  An element at index
 .I i
 may be referenced using the syntax
 contiguously starting at this address.  An element at index
 .I i
 may be referenced using the syntax
-.BI DA( a )[ i \fR.
+.BI DA( a )[ i ]\fR.
 .PP
 The number of elements in the array
 .I a
 .PP
 The number of elements in the array
 .I a
@@ -329,6 +333,13 @@ and
 can fail because the array is empty, in which case
 .B DAEXC_UFLOW
 is thrown.
 can fail because the array is empty, in which case
 .B DAEXC_UFLOW
 is thrown.
+.PP
+The operations
+.B DA_FIRST
+and
+.B DA_LAST
+are lvalues referring to the first and last elements in the array
+respectively.  They are unsafe if the array is empty.
 .SS "Low-level details"
 This section describes low-level details of the dynamic array
 implementation.  You should try to avoid making use of this information
 .SS "Low-level details"
 This section describes low-level details of the dynamic array
 implementation.  You should try to avoid making use of this information