reentrant library functions don't touch internal variables anymore