summaryrefslogtreecommitdiff
path: root/old-extension/testsparr.awk
blob: a9e3119dcc9b9b8913618cc97e1b6a1e49e3f383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# ../gawk -lsparr -f testsparr.awk
BEGIN {
	extension("./sparr.so")
	print SYS["time"]
	SYS["readline"] = "sparr.c";
	printf("File %s has %d lines\n", SYS["readline"], length(READLINE)) 
	SYS["readline"] = "testsparr.awk";
	printf("File %s has %d lines\n", SYS["readline"], length(READLINE)) 
	for (i = 1; i in READLINE; i++)
		print READLINE[i]

	system("sleep 1")

#	PROCINFO["/dev/stdin", "READ_TIMEOUT"] = 1000
#	getline < "/dev/stdin"

	print SYS["time"]
}