Path: utzoo!attcan!uunet!mcvax!enea!kth!sics!sics.se!jw From: jw@obelisk.sics.se (Johan Widen) Newsgroups: comp.sys.amiga Subject: re: mg2a patch for sorted buffer menus: source for tqsort Message-ID: Date: 23 Jun 88 17:40:28 GMT Sender: news@sics.se Organization: Swedish Institute of Computer Science, Kista Lines: 31 A previously posted patch for mg release 2a refers to thfunction tqsort() This function is provided by the Lattice library but not by the Manx library. Enclosed is a version that should work with Manx. The original source comes from the Amiga Hack program (Software Distillery). tqsort(v, n) register char **v; int n; { register char *temp; register int gap, j, i; for (gap=n/2; gap > 0 ; gap /= 2) for (i=gap; i= 0; j -= gap) if (strcmp(v[j], v[j + gap]) > 0) { /* exchange them */ temp = v[j]; v[j] = v[j + gap]; v[j + gap] = temp; } } -- Johan Widen SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Tel: +46 8 752 15 32 Ttx: 812 61 54 SICS S Fax: +46 8 751 72 30 Internet: jw@sics.se or {mcvax,munnari,ukc,unido}!enea!sics.se!jw