From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen) Subject: The patch [was Re: Missing `scandir' and `alphasort'] 18 Dec 1998 13:41:48 -0800 Message-ID: <367AC057.C9C9FBB3.cygnus.cygwin32.developers@cityweb.de> References: <36784F5A DOT E47FAC0F AT cityweb DOT de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------97D1173197E78BD702A575EC" To: Geoffrey Noer , cygwin32-developers AT cygnus DOT com This is a multi-part message in MIME format. --------------97D1173197E78BD702A575EC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Geoffrey Noer wrote: > > There are already quite a lot of functions in winsup that have protos > in newlib. You're right that we'll have to add protos there for these > functions but that's not a problem. > > Essentially, newlib is an embedded target libc/libm that Cygwin > happens to use. Extended functionality that is of little use to a > low-level embedded device really doesn't belong there so we put such > things in winsup. > > It's not the ideal setup but it works and is hard to change so I try > to live with it... Convincing... Attached are the patches to newlib/libc/sys/cygwin/dirent.h winsup/Makefile.in winsup/cygwin.def and the new file winsup/scandir.c Greetings, Corinna ChangeLog: ========== Fri Dec 18 21:30:00 1998 Corinna Vinschen * newlib/libc/sys/cygwin/sys/dirent.h: Added protos for `scandir()' and `alphasort()'. * cygwin.def: Added symbols for `scandir()' and `alphasort()'. * Makefile.in: Added file `scandir.o' to dependencies. * scandir.c: New file containing `scandir()' and `alphasort()'. --------------97D1173197E78BD702A575EC Content-Type: text/plain; charset=us-ascii; name="dirent.h-patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dirent.h-patch" --- dirent.h.orig Fri Dec 18 21:02:33 1998 +++ dirent.h Mon Dec 14 01:34:55 1998 @@ -43,4 +43,10 @@ struct dirent *readdir (DIR *); void rewinddir (DIR *); int closedir (DIR *); +int scandir (const char *dir, + struct dirent ***namelist, + int (*select) (const struct dirent *), + int (*compar) (const struct dirent **, const struct dirent **)); +int alphasort (const struct dirent **a, const struct dirent **b); + #endif --------------97D1173197E78BD702A575EC Content-Type: text/plain; charset=us-ascii; name="Makefile.in-patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Makefile.in-patch" Index: Makefile.in =================================================================== RCS file: /src/cvsroot/winsup-981214/Makefile.in,v retrieving revision 1.2 diff -u -p -r1.2 Makefile.in --- Makefile.in 1998/12/17 02:24:57 1.2 +++ Makefile.in 1998/12/18 20:01:21 @@ -295,6 +295,7 @@ DLL_OFILES:=$(EXTRA_DLL_OFILES) \ pipe.o \ registry.o \ resource.o \ + scandir.o \ security.o \ select.o \ shared.o \ --------------97D1173197E78BD702A575EC Content-Type: text/plain; charset=us-ascii; name="cygwin.def-patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cygwin.def-patch" Index: cygwin.def =================================================================== RCS file: /src/cvsroot/winsup-981214/cygwin.def,v retrieving revision 1.1 diff -u -p -r1.1 cygwin.def --- cygwin.def 1998/12/18 20:24:14 1.1 +++ cygwin.def 1998/12/18 20:22:18 @@ -542,6 +542,10 @@ scalbn _scalbn = scalbn scalbnf _scalbnf = scalbnf +scandir +_scandir = scandir +alphasort +_alphasort = alphasort scanf _scanf = scanf setbuf --------------97D1173197E78BD702A575EC Content-Type: application/x-unknown-content-type-cfile; name="scandir.c" Content-Transfer-Encoding: x-uuencode Content-Disposition: inline; filename="scandir.c" begin 644 scandir.c M"B-I;F-L=61E(#QD:7)E;G0N:#X*"FEN="!S8V%N9&ER*&-O;G-T(&-H87(@ M*F1IF5O9B J;FPI.PH@(" @(" @(" @(" @(" @(" @(" @("!I9B H(2!N M=&UP*2!["B @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @9G)E92AE M=&UP*3L*(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!G;W1O(&5R MF5O9B J;FPL"B @(" @(" @(" @(" @*&EN=" H*BDH8V]N M