Copyright (c) 2004 Gordon D. Carrie. All rights reserved.

Licensed under the Open Software License version 2.1

Please address questions and feedback to user0@tkgeomap.org

@(#) $Id: mapLn.3,v 1.7 2004/09/22 21:57:50 tkgeomap Exp $
.so man.macros
mapLn 3 2 Geography "Geography C functions"
NAME
MapLn, MapLnCreate, MapLnClear, MapLnSetAlloc, MapLnAddPt, MapLnGetPt, MapLnDestroy - container for map points.
SYNOPSIS
#include <mapLines.h>
MapLn MapLnCreate(unsigned nptsMax);
void MapLnSetAlloc(MapLn mapLn, unsigned nptsMax);
void MapLnClear(MapLn mapLn);
void MapLnDestroy(MapLn mapLn);
void MapLnAddPt(MapPt mapPt, MapLn mapLn);
MapPt MapLnGetPt(MapLn mapLn, unsigned n);
DESCRIPTION
These functions create, manipulate and access maplines, which are arrays of map points. See geography (3) for information on map points. Maplines are represented by objects of type MapLn.

MapLnCreate creates and initializes a mapline with enough memory allocated to store nptsMax map points. It returns the new mapline, or NULL if it fails. When no longer needed, the mapline should be destroyed with a call to MapLnDestroy.

MapLnSetAlloc sets the allocation of mapLn to nptsMax.

MapLnClear removes all points from mapLn, but does not free it's storage. This reduces memory management overhead for maplines that are reused.

MapLnDestroy frees all storage associated with mapLn.

MapLnAddPt adds mapPt to the end of mapLn. It increases mapLn's allocation automatically, if necessary.

MapLnGetPt returns the map point at offset n from mapLn. The first point in the line has offset 0. MapLnGetPt returns MapPtNowhere() if n is out of bounds.

"SEE ALSO"
mapLnArr, mapLn, mapLnArr, geography
KEYWORDS
MapLn, mapline, geography, container
AUTHOR
Gordon Carrie (user0@tkgeomap.org)