require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_UVM_SWAP_ENCRYPT_H)) {
    eval 'sub _UVM_SWAP_ENCRYPT_H () {1;}' unless defined(&_UVM_SWAP_ENCRYPT_H);
    eval 'sub SWPENC_ENABLE () {0;}' unless defined(&SWPENC_ENABLE);
    eval 'sub SWPENC_CREATED () {1;}' unless defined(&SWPENC_CREATED);
    eval 'sub SWPENC_DELETED () {2;}' unless defined(&SWPENC_DELETED);
    eval 'sub SWPENC_MAXID () {3;}' unless defined(&SWPENC_MAXID);
    eval 'sub CTL_SWPENC_NAMES () {{ { "enable",  &CTLTYPE_INT }, { "keyscreated",  &CTLTYPE_INT }, { "keysdeleted",  &CTLTYPE_INT }, };}' unless defined(&CTL_SWPENC_NAMES);
    eval 'sub SWAP_KEY_EXPIRE () {(120);}' unless defined(&SWAP_KEY_EXPIRE);
    eval 'sub SWAP_KEY_SIZE () {4;}' unless defined(&SWAP_KEY_SIZE);
    eval 'sub SWAP_KEY_GET {
        my($s,$x) = @_;
	    eval q( &do {  &if (($x)-> &refcount == 0) {  &swap_key_create($x); } ($x)-> &refcount++; }  &while(0););
    }' unless defined(&SWAP_KEY_GET);
    eval 'sub SWAP_KEY_PUT {
        my($s,$x) = @_;
	    eval q( &do { ($x)-> &refcount--;  &if (($x)-> &refcount == 0) {  &swap_key_delete($x); } }  &while(0););
    }' unless defined(&SWAP_KEY_PUT);
}
1;
