udf: replace udf_*_offset macros with functions