1
0
Fork 0
forked from len0rd/rockbox
foxbox/firmware/libc/include/time.h
James Buren c174d3a544 file/fat: add utime function
This emulates the traditional utime function from UNIX clones to allow
for manual updates of the modification timestamp on files and directories.

This should only prove useful for non-native targets as those usually
have a libc version of utime.

Change-Id: Iea8a1d328e78b92c400d3354ee80689c7cf53af8
2021-07-08 13:15:30 +00:00

57 lines
990 B
C

/*
* time.h
*
* Struct declaration for dealing with time.
*/
#ifndef _TIME_H_
#define _TIME_H_
#ifdef WPSEDITOR
#include "inttypes.h"
#include <time.h>
#endif
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
#if !defined(_TIME_T_DEFINED) && !defined(_TIME_T_DECLARED)
typedef long time_t;
struct utimbuf
{
time_t actime;
time_t modtime;
};
/* this define below is used by the mingw headers to prevent duplicate
typedefs */
#define _TIME_T_DEFINED
#define _TIME_T_DECLARED
time_t time(time_t *t);
struct tm *localtime(const time_t *timep);
struct tm *gmtime(const time_t *timep);
struct tm *gmtime_r(const time_t *timep, struct tm *result);
time_t mktime(struct tm *t);
#endif /* SIMULATOR */
#ifdef __PCTOOL__
/* this time.h does not define struct timespec,
so tell sys/stat.h not to use it */
#undef __USE_MISC
#endif
#endif /* _TIME_H_ */