struct dbf_field { int offset; int size; int decimals; char name[11]; uchar type; }; typedef struct shp_handle { Biobuf *pfile; Biobuf *xfile; Biobuf *dfile; int type; uint size; int headerw; /* FIXME intergrate! */ int fieldc; int recordc, recordw; struct dbf_field *fieldv; int records; int *rec_offset; int *rec_size; double «x, «y, «z, «m, »x, »y, »z, »m; } shp_handle; typedef struct shp_object { int type; double «x, «y, «z, «m, »x, »y, »z, »m; int partc, pointc, pointw; ulong *partv; double *pointv; void **attrv; } shp_object; enum { Shp_null = 0, Shp_point = 1, Shp_polyline = 3, Shp_polygon = 5, Shp_multipoint = 8, Shp_pointm = 11, Shp_polylinem = 13, Shp_polygonm = 15, Shp_multipointm = 18, Shp_pointz = 21, Shp_polylinez = 23, Shp_polygonz = 25, Shp_multipointz = 28, Shp_multipatch = 31, }; shp_handle *shp_open(char *name, int mode); void shp_close(shp_handle *shp); int shp_read(shp_handle *shp, shp_object *obj, int i); shp_object *shp_alloc_object(shp_handle *shp); char *shp_attr_fmt(shp_handle *shp, int i); void shp_dump(Biobuf *out, shp_handle *shp); void obj_dump(Biobuf *out, shp_handle *shp, shp_object *obj);