#include <u.h>
#include <libc.h>
#include <bio.h>
#include "shp.h"
void
main(int argc, char **argv) {
Biobuf stdout;
shp_handle *shp;
shp_object *obj;
int i;
if(argc != 2) {
fprint(2, "Usage: shp name\n");
exits("args");
}
Binit(&stdout, 1, OWRITE);
shp = shp_open(argv[1], OREAD);
shp_dump(&stdout, shp);
obj = shp_alloc_object(shp);
for(i=0; i<shp->records; i++){
shp_read(shp, obj, i);
obj_dump(&stdout, shp, obj);
}
shp_close(shp);
exits("");
}
|