epg/util.h

23 lines
605 B
C

/*
* Humax EPG Tool
* by af123, 2011
*/
/* Works for modern dates, 1970 - 2038 */
#define MJD_TO_UNIX(xx) (((xx) - 40587) * 86400)
#ifdef FOXSATPLATFORM
#define _swap16(v) (v)
#else
#define _swap16(v) ((((v) >> 8) & 0xff) | (((v) & 0xff) << 8))
#endif
#define bcd(v) (((((v) >> 4) & 0xf) * 10) + ((v) & 0xf))
#define DUMPINT(ss,xx) printf(" %30s: %d\n", #xx, ss->xx)
#define DUMPSTR(ss,xx) printf(" %30s: %s\n", #xx, ss->xx)
#define DUMPNSTR(ss,xx,nn) printf(" %30s: %.*s\n", #xx, nn, ss->xx)
#define DUMPHEX(ss,xx,nn) printf(" %30s: %s\n", #xx, \
hexstr((uint8_t *)ss->xx, nn))