Plan 9 from Bell Labs’s /usr/web/sources/contrib/tristan/root/sys/src/cmd/geo/shp/main.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#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("");
}
	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].