scandir.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 1983-2013 Martin Atkins, Richard Dobson and Composers Desktop Project Ltd
  3. * http://people.bath.ac.uk/masrwd
  4. * http://www.composersdesktop.com
  5. *
  6. This file is part of the CDP System.
  7. The CDP System is free software; you can redistribute it
  8. and/or modify it under the terms of the GNU Lesser General Public
  9. License as published by the Free Software Foundation; either
  10. version 2.1 of the License, or (at your option) any later version.
  11. The CDP System is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with the CDP System; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  18. 02111-1307 USA
  19. *
  20. */
  21. /*
  22. * Portable scandir for systems that don't have it!
  23. *
  24. * These definitions should be safe if the routines
  25. * are already declared
  26. */
  27. #define SCANDIR_H_RCSID "$Id: scandir.h%v 1.1 1994/10/31 15:30:08 martin Exp $"
  28. /*
  29. * $Log: scandir.h%v $
  30. * Revision 1.1 1994/10/31 15:30:08 martin
  31. * Initial revision
  32. *
  33. */
  34. #if defined(__MAC__)
  35. #include <machine/types.h>
  36. #endif
  37. #if defined(unix)
  38. #include <dirent.h>
  39. #elif defined(_WIN32) || defined(__SC__)
  40. struct dirent {
  41. char d_name[_MAX_PATH];
  42. };
  43. #else
  44. #error "Unknown system"
  45. #endif
  46. #ifndef __MAC__
  47. int scandir(const char *dir,
  48. struct dirent ***namelist,
  49. int (*selfn)(const struct dirent *d),
  50. int (*srtfn)(const struct dirent * const *d1,
  51. const struct dirent * const *d2));
  52. int alphasort(const struct dirent * const *d1,
  53. const struct dirent * const *d2);
  54. #endif