Files
fstester/setter/src/dos/dos.h

77 lines
2.3 KiB
C
Raw Normal View History

2018-01-15 21:27:12 +00:00
/****************************************************************************
2020-03-01 16:56:27 +00:00
Aaru Data Preservation Suite
2018-01-15 21:27:12 +00:00
-----------------------------------------------------------------------------
2021-03-14 19:14:41 +00:00
Author(s) : Natalia Portillo
2018-01-15 21:27:12 +00:00
--[ License ] ---------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
2021-03-09 04:42:30 +00:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2018-01-15 21:27:12 +00:00
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------
2020-12-31 23:13:50 +00:00
Copyright (C) 2011-2021 Natalia Portillo
2018-01-15 21:27:12 +00:00
*****************************************************************************/
2020-05-03 01:16:17 +01:00
#if defined(__DOS__) || defined(MSDOS)
2018-01-15 21:27:12 +00:00
2020-03-01 16:57:21 +00:00
#ifndef AARU_FSTESTER_SETTER_DOS_H
#define AARU_FSTESTER_SETTER_DOS_H
2018-01-15 21:27:12 +00:00
#if defined(__WATCOM__)
#include <direct.h>
#define __dos_mkdir(a) mkdir(a)
#elif defined(__DJGPP__)
#include <sys/stat.h>
#define __dos_mkdir(path) mkdir(path, 0)
#endif
2021-03-11 04:38:38 +00:00
#if defined(__WATCOM__)
2018-01-15 21:27:12 +00:00
#pragma pack(__push, 1)
2021-03-11 04:38:38 +00:00
#else
#pragma pack(push, 1)
#endif
2018-01-15 21:27:12 +00:00
typedef struct diskfree_ex_t
2018-01-15 21:27:12 +00:00
{
unsigned short size;
unsigned short version;
unsigned long sectorsPerCluster;
unsigned long bytesPerSector;
unsigned long freeClusters;
unsigned long totalClusters;
unsigned long freeSectors;
unsigned long totalSectors;
unsigned long freeUnits;
unsigned long totalUnits;
unsigned char reserved[8];
2021-03-11 04:38:38 +00:00
} diskfree_ex;
2021-03-11 04:56:07 +00:00
unsigned int _dos_getdiskfree_ex(unsigned int drive, struct diskfree_ex_t* diskspace);
2018-01-15 21:27:12 +00:00
2021-03-11 04:38:38 +00:00
#if defined(__WATCOM__)
2018-01-15 21:27:12 +00:00
#pragma pack(__pop)
2021-03-11 04:38:38 +00:00
#else
#pragma pack(pop)
#endif
2018-01-15 21:27:12 +00:00
#define YEAR(t) (((t & 0xFE00) >> 9) + 1980)
#define MONTH(t) ((t & 0x01E0) >> 5)
#define DAY(t) (t & 0x001F)
#define HOUR(t) ((t & 0xF800) >> 11)
#define MINUTE(t) ((t & 0x07E0) >> 5)
#define SECOND(t) ((t & 0x001F) << 1)
#endif
#endif