direct.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * direct.h
  3. *
  4. * Functions for manipulating paths and directories (included from io.h)
  5. * plus functions for setting the current drive.
  6. *
  7. * This file is part of the Mingw32 package.
  8. *
  9. * Contributors:
  10. * Created by Colin Peters <[email protected]>
  11. *
  12. * THIS SOFTWARE IS NOT COPYRIGHTED
  13. *
  14. * This source code is offered for use in the public domain. You may
  15. * use, modify or distribute it freely.
  16. *
  17. * This code is distributed in the hope that it will be useful but
  18. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  19. * DISCLAIMED. This includes but is not limited to warranties of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21. *
  22. * $Revision: 1.2 $
  23. * $Author: bellard $
  24. * $Date: 2005/04/17 13:14:29 $
  25. *
  26. */
  27. #ifndef __STRICT_ANSI__
  28. #ifndef _DIRECT_H_
  29. #define _DIRECT_H_
  30. /* All the headers include this file. */
  31. #include <_mingw.h>
  32. #define __need_wchar_t
  33. #ifndef RC_INVOKED
  34. #include <stddef.h>
  35. #endif /* Not RC_INVOKED */
  36. #include <io.h>
  37. #ifndef RC_INVOKED
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. #ifndef _DISKFREE_T_DEFINED
  42. /* needed by _getdiskfree (also in dos.h) */
  43. struct _diskfree_t {
  44. unsigned total_clusters;
  45. unsigned avail_clusters;
  46. unsigned sectors_per_cluster;
  47. unsigned bytes_per_sector;
  48. };
  49. #define _DISKFREE_T_DEFINED
  50. #endif
  51. /*
  52. * You really shouldn't be using these. Use the Win32 API functions instead.
  53. * However, it does make it easier to port older code.
  54. */
  55. int _getdrive (void);
  56. unsigned long _getdrives(void);
  57. int _chdrive (int);
  58. char* _getdcwd (int, char*, int);
  59. unsigned _getdiskfree (unsigned, struct _diskfree_t *);
  60. #ifndef _NO_OLDNAMES
  61. # define diskfree_t _diskfree_t
  62. #endif
  63. #ifndef _WDIRECT_DEFINED
  64. /* wide character versions. Also in wchar.h */
  65. #ifdef __MSVCRT__
  66. int _wchdir(const wchar_t*);
  67. wchar_t* _wgetcwd(wchar_t*, int);
  68. wchar_t* _wgetdcwd(int, wchar_t*, int);
  69. int _wmkdir(const wchar_t*);
  70. int _wrmdir(const wchar_t*);
  71. #endif /* __MSVCRT__ */
  72. #define _WDIRECT_DEFINED
  73. #endif
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* Not RC_INVOKED */
  78. #endif /* Not _DIRECT_H_ */
  79. #endif /* Not __STRICT_ANSI__ */