\def\ucwwarn#1{\immediate\write16{*** UCWmac warning: #1 ***}}
+% Replace all occurrences of #1 in \tmpb by #2.
+% Thanks to Petr Olsak's OPmac for an efficient implementation.
+\bgroup \catcode`!=3 \catcode`?=3
+\gdef\replacestrings#1#2{\long\def\replacestringsA##1#1{\def\tmpb{##1}\replacestringsB}%
+ \long\def\replacestringsB##1#1{\ifx!##1\relax \else\appendef\tmpb{#2##1}%
+ \expandafter\replacestringsB\fi}%
+ \expandafter\replacestringsA\tmpb?#1!#1%
+ \long\def\replacestringsA##1?{\def\tmpb{##1}}\expandafter\replacestringsA\tmpb
+}
+\egroup
+
%%% Page size and margins %%%
% If you modify these registers, call \setuppage afterwards