#include "ofc/core.h"
#include "ofc/types.h"
#include "ofc/file.h"
Go to the source code of this file.
| #define | OFC_DOS_DAY 0x001F |
| |
| #define | OFC_DOS_DAY_SHIFT 0 |
| |
| #define | OFC_DOS_MONTH 0x01E0 |
| |
| #define | OFC_DOS_MONTH_SHIFT 5 |
| |
| #define | OFC_DOS_YEAR 0xFE00 |
| |
| #define | OFC_DOS_YEAR_SHIFT 9 |
| |
| #define | OFC_DOS_YEAR_BASE 1980 |
| |
| #define | OFC_DOS_SECS 0x001F |
| |
| #define | OFC_DOS_SECS_SHIFT 0 |
| |
| #define | OFC_DOS_MINS 0x07E0 |
| |
| #define | OFC_DOS_MINS_SHIFT 5 |
| |
| #define | OFC_DOS_HRS 0xF800 |
| |
| #define | OFC_DOS_HRS_SHIFT 11 |
| |
| #define | OFC_TIME_S_EPOCH_OFFSET_1900 11644473600LL |
| |
| #define | OFC_TIME_S_EPOCH_OFFSET_1970 9435484800LL |
| |
| OFC_VOID | epoch_time_to_file_time (const OFC_ULONG tv_sec, const OFC_ULONG tv_nsec, OFC_FILETIME *filetime) |
| |
| OFC_VOID | file_time_to_epoch_time (const OFC_FILETIME *filetime, OFC_ULONG *tv_sec, OFC_ULONG *tv_nsec) |
| |
| OFC_CORE_LIB OFC_MSTIME | ofc_time_get_now (OFC_VOID) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_time_get_file_time (OFC_FILETIME *now) |
| |
| OFC_CORE_LIB OFC_UINT16 | ofc_time_get_time_zone (OFC_VOID) |
| |
| OFC_CORE_LIB OFC_BOOL | ofc_file_time_to_dos_date_time (const OFC_FILETIME *lpFileTime, OFC_WORD *lpFatDate, OFC_WORD *lpFatTime) |
| |
| OFC_CORE_LIB OFC_BOOL | ofc_dos_date_time_to_file_time (OFC_WORD FatDate, OFC_WORD FatTime, OFC_FILETIME *lpFileTime) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_time_elements_to_dos_date_time (OFC_UINT16 month, OFC_UINT16 day, OFC_UINT16 year, OFC_UINT16 hour, OFC_UINT16 min, OFC_UINT16 sec, OFC_WORD *lpFatDate, OFC_WORD *lpFatTime) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_dos_date_time_to_elements (OFC_WORD FatDate, OFC_WORD FatTime, OFC_UINT16 *month, OFC_UINT16 *day, OFC_UINT16 *year, OFC_UINT16 *hour, OFC_UINT16 *min, OFC_UINT16 *sec) |
| |
| OFC_CORE_LIB OFC_MSTIME | ofc_get_runtime (OFC_VOID) |
| |
◆ OFC_DOS_DAY
| #define OFC_DOS_DAY 0x001F |
Definition for DOS Day Field in DOS Day Word
◆ OFC_DOS_DAY_SHIFT
| #define OFC_DOS_DAY_SHIFT 0 |
Bit position for DOS Day Field
◆ OFC_DOS_HRS
| #define OFC_DOS_HRS 0xF800 |
Definition of DOS Hours Field in DOS Seconds Word
◆ OFC_DOS_HRS_SHIFT
| #define OFC_DOS_HRS_SHIFT 11 |
Bit position of DOS Hours Field
◆ OFC_DOS_MINS
| #define OFC_DOS_MINS 0x07E0 |
Definition of DOS Minute Field in DOS Seconds Word
◆ OFC_DOS_MINS_SHIFT
| #define OFC_DOS_MINS_SHIFT 5 |
Bit Position of DOS Minute Field
◆ OFC_DOS_MONTH
| #define OFC_DOS_MONTH 0x01E0 |
Definition for DOS Month Field in DOS Day Word
◆ OFC_DOS_MONTH_SHIFT
| #define OFC_DOS_MONTH_SHIFT 5 |
Bit position for DOS Month Field
◆ OFC_DOS_SECS
| #define OFC_DOS_SECS 0x001F |
Defition of DOS Seconds Field in DOS Seconds Word
◆ OFC_DOS_SECS_SHIFT
| #define OFC_DOS_SECS_SHIFT 0 |
Bit position of DOS Seconds Field
◆ OFC_DOS_YEAR
| #define OFC_DOS_YEAR 0xFE00 |
Definition for DOS Year Field in DOS Day Word
◆ OFC_DOS_YEAR_BASE
| #define OFC_DOS_YEAR_BASE 1980 |
Relative Offset of DOS Year
◆ OFC_DOS_YEAR_SHIFT
| #define OFC_DOS_YEAR_SHIFT 9 |
Bit Position for DOS Year Field
◆ OFC_TIME_S_EPOCH_OFFSET_1900
| #define OFC_TIME_S_EPOCH_OFFSET_1900 11644473600LL |
◆ OFC_TIME_S_EPOCH_OFFSET_1970
| #define OFC_TIME_S_EPOCH_OFFSET_1970 9435484800LL |
◆ epoch_time_to_file_time()
Convert Epoch Time to File Time. Epoch time is number of seconds since January 1, 1900. A file time is relative to January 1, 1980.
- Parameters
-
| tv_sec | Seconds within epoch time |
| tv_nsec | Nanoseconds within epoch time |
| filetime | Pointer to filetime to return |
◆ file_time_to_epoch_time()
Convert File Time to Epoch time. Epoch time is number of seconds since January 1, 1900. A file time is relative to January 1, 1980.
- Parameters
-
| filetime | Pointer to filetime |
| tv_sec | Pointer to Seconds within epoch time to return |
| tv_nsec | Pointer to Nanoseconds within epoch time to return |
◆ ofc_dos_date_time_to_elements()
ofc_dos_date_time_to_elements
Convert a DOS Date and Time to various elements
- Parameters
-
| FatDate | The DOS Date |
| FatTime | The DOS Time |
| month | Pointer to where to return the month (1-12) |
| day | Pointer to where to store the day of monthe (1-31) |
| year | Pointer to where to store the year (regular year i.e. 2008) |
| hour | Pointer to where to store the hour (0-23) |
| min | Pointer to where to store the minute (0-59) |
| sec | Pointer to where to store the sec (0-59) |
- Examples
- smbls.c, and test_file.c.
◆ ofc_dos_date_time_to_file_time()
Convert a DOS Date Time to a File Time
- Parameters
-
| FatDate | DOS Day Word |
| FatTime | DOS Seconds Word |
| lpFileTime | Pointer to where to store the file time |
- Returns
- OFC_TRUE if success, OFC_FALSE otherwise
◆ ofc_file_time_to_dos_date_time()
Convert a File Time to a DOS Date Time
- Parameters
-
| lpFileTime | File Time to convert |
| lpFatDate | Pointer to Fat Day Word |
| lpFatTime | Pointer to Fat Seconds Word |
- Returns
- OFC_TRUE if successful, OFC_FALSE otherwise
- Examples
- smbls.c, and test_file.c.
◆ ofc_get_runtime()
Get Process Runtime
- Returns
- Returns the number of us of runtime
◆ ofc_time_elements_to_dos_date_time()
Build A DOS Date Time from components
- Parameters
-
| month | The month where January is 1 |
| day | The day of month (first day is 1) |
| year | Year based at 1, in other words, the regular year. For instance, 2008. |
| hour | The hour in a 24 hour clock. Midnight is 0, Noon is 12. |
| min | The minute in the hour (0 - 59) |
| sec | The second in a minute (0 - 59) |
| lpFatDate | A pointer to where to store the date in DOS format |
| lpFatTime | A pointer to where to store the Time in DOS format |
◆ ofc_time_get_file_time()
Get Time of Day in OFC_FILETIME format
- Parameters
-
| now | Pointer to where to store the current file time |
◆ ofc_time_get_now()
Get a millisecond tick count
- Returns
- A Millisecond Tick Count
- Examples
- test_file.c.
◆ ofc_time_get_time_zone()
Get The local time zone offset from UTC
- Returns
- The number of minutes from UTC that this timezone is in