require '_h2ph_pre.ph';

unless(defined(&_SYS_TIMEX_H)) {
    eval 'sub _SYS_TIMEX_H () {1;}' unless defined(&_SYS_TIMEX_H);
    require 'features.ph';
    require 'sys/time.ph';
    eval 'sub ADJ_OFFSET () {0x1;}' unless defined(&ADJ_OFFSET);
    eval 'sub ADJ_FREQUENCY () {0x2;}' unless defined(&ADJ_FREQUENCY);
    eval 'sub ADJ_MAXERROR () {0x4;}' unless defined(&ADJ_MAXERROR);
    eval 'sub ADJ_ESTERROR () {0x8;}' unless defined(&ADJ_ESTERROR);
    eval 'sub ADJ_STATUS () {0x10;}' unless defined(&ADJ_STATUS);
    eval 'sub ADJ_TIMECONST () {0x20;}' unless defined(&ADJ_TIMECONST);
    eval 'sub ADJ_TICK () {0x4000;}' unless defined(&ADJ_TICK);
    eval 'sub ADJ_OFFSET_SINGLESHOT () {0x8001;}' unless defined(&ADJ_OFFSET_SINGLESHOT);
    eval 'sub MOD_OFFSET () { &ADJ_OFFSET;}' unless defined(&MOD_OFFSET);
    eval 'sub MOD_FREQUENCY () { &ADJ_FREQUENCY;}' unless defined(&MOD_FREQUENCY);
    eval 'sub MOD_MAXERROR () { &ADJ_MAXERROR;}' unless defined(&MOD_MAXERROR);
    eval 'sub MOD_ESTERROR () { &ADJ_ESTERROR;}' unless defined(&MOD_ESTERROR);
    eval 'sub MOD_STATUS () { &ADJ_STATUS;}' unless defined(&MOD_STATUS);
    eval 'sub MOD_TIMECONST () { &ADJ_TIMECONST;}' unless defined(&MOD_TIMECONST);
    eval 'sub MOD_CLKB () { &ADJ_TICK;}' unless defined(&MOD_CLKB);
    eval 'sub MOD_CLKA () { &ADJ_OFFSET_SINGLESHOT;}' unless defined(&MOD_CLKA);
    eval 'sub STA_PLL () {0x1;}' unless defined(&STA_PLL);
    eval 'sub STA_PPSFREQ () {0x2;}' unless defined(&STA_PPSFREQ);
    eval 'sub STA_PPSTIME () {0x4;}' unless defined(&STA_PPSTIME);
    eval 'sub STA_FLL () {0x8;}' unless defined(&STA_FLL);
    eval 'sub STA_INS () {0x10;}' unless defined(&STA_INS);
    eval 'sub STA_DEL () {0x20;}' unless defined(&STA_DEL);
    eval 'sub STA_UNSYNC () {0x40;}' unless defined(&STA_UNSYNC);
    eval 'sub STA_FREQHOLD () {0x80;}' unless defined(&STA_FREQHOLD);
    eval 'sub STA_PPSSIGNAL () {0x100;}' unless defined(&STA_PPSSIGNAL);
    eval 'sub STA_PPSJITTER () {0x200;}' unless defined(&STA_PPSJITTER);
    eval 'sub STA_PPSWANDER () {0x400;}' unless defined(&STA_PPSWANDER);
    eval 'sub STA_PPSERROR () {0x800;}' unless defined(&STA_PPSERROR);
    eval 'sub STA_CLOCKERR () {0x1000;}' unless defined(&STA_CLOCKERR);
    eval 'sub STA_RONLY () {( &STA_PPSSIGNAL |  &STA_PPSJITTER |  &STA_PPSWANDER |  &STA_PPSERROR |  &STA_CLOCKERR);}' unless defined(&STA_RONLY);
    eval 'sub TIME_OK () {0;}' unless defined(&TIME_OK);
    eval 'sub TIME_INS () {1;}' unless defined(&TIME_INS);
    eval 'sub TIME_DEL () {2;}' unless defined(&TIME_DEL);
    eval 'sub TIME_OOP () {3;}' unless defined(&TIME_OOP);
    eval 'sub TIME_WAIT () {4;}' unless defined(&TIME_WAIT);
    eval 'sub TIME_ERROR () {5;}' unless defined(&TIME_ERROR);
    eval 'sub TIME_BAD () { &TIME_ERROR;}' unless defined(&TIME_BAD);
    eval 'sub MAXTC () {6;}' unless defined(&MAXTC);
}
1;
