acphssrw@csuna.UUCP (Stephen R. Walton) (06/24/88)
A few comments on Johan Widen's recent mg2a patch postings: Sorted buffers and browser looks great. Those using Manx will need a version of tqsort(); here it is, written in terms of qsort(); I hung it on the end of ttymenu.c: #ifdef AZTEC_C /* * An implementation of tqsort for Aztec C using the qsort routine. */ static int cmp(a, b) char **a, **b; { return strcmp(*a, *b); } tqsort(table, n) int n; char **table; { qsort(table, n, sizeof(char *), cmp); } #endif AZTEC_C You could replace strcmp() with Strcmp() above if you prefer case-insensitive sorting. His fix to ttyio.c to eliminate the Open/CloseLibrary of diskfont.library if CHANGE_FONT isn't defined looks fine too. I've not tried his regex fixes, but do have a couple of comments on the basis of the source code: (1) Doug Gwyn's (mostly) system-independent implementation of alloca() is in sys/default/alloca.c in the mg2a distribution, so the code to eliminate alloca() isn't necessary. (One I wrote in assembly is in sys/amiga/alloca.asm, but I don't know if it is really right.) (2) Manx doesn't have the memcmp() routine. I've used the Henry Spencer strings library in the past for it as well as for bcopy and bzero. (3) Johan must have used Lattice with 32-bit ints, since regex.c doesn't declare either realloc() or alloca() as pointers. (4) I've never gotten the regex code to work properly with Manx, even fixing the above and compiling with 32-bit ints. Has anyone? Stephen Walton, representing myself swalton@solar.stanford.edu Cal State, Northridge rckg01m@calstate.BITNET