summaryrefslogtreecommitdiffstats
path: root/tests/langbench/sort.l
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-19 20:35:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-19 20:35:49 (GMT)
commit66032e8a327e0498b0d8970307452f66c69be25c (patch)
tree345b92b9d0c1be0f8ff45032a38884929744545e /tests/langbench/sort.l
parent0a228666ae8b3189ae92ff7624263de1455c24ff (diff)
downloadtcl-66032e8a327e0498b0d8970307452f66c69be25c.zip
tcl-66032e8a327e0498b0d8970307452f66c69be25c.tar.gz
tcl-66032e8a327e0498b0d8970307452f66c69be25c.tar.bz2
Fork of Tcl used in the "Little" project.
http://www.mcvoy.com/lm/little/index.html
Diffstat (limited to 'tests/langbench/sort.l')
-rw-r--r--tests/langbench/sort.l19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/langbench/sort.l b/tests/langbench/sort.l
new file mode 100644
index 0000000..f36c0e7
--- /dev/null
+++ b/tests/langbench/sort.l
@@ -0,0 +1,19 @@
+void
+main(int ac, string av[])
+{
+ int i;
+ FILE f;
+ string buf;
+ string l[];
+
+ fconfigure("stdout", buffering: "full", translation: "binary");
+ for (i = 1; i < ac; ++i) {
+ f = open(av[i], "rb");
+ while (gets(f, &buf) >= 0) {
+ push(&l, buf);
+ }
+ }
+ foreach (buf in sort(l)) {
+ puts(buf);
+ }
+}