-#define curY Wcm.cm_curY
-#define curX Wcm.cm_curX
-#define Up Wcm.cm_up
-#define Down Wcm.cm_down
-#define Left Wcm.cm_left
-#define Right Wcm.cm_right
-#define Tab Wcm.cm_tab
-#define BackTab Wcm.cm_backtab
-#define TabWidth Wcm.cm_tabwidth
-#define CR Wcm.cm_cr
-#define Home Wcm.cm_home
-#define LastLine Wcm.cm_ll
-#define AbsPosition Wcm.cm_abs
-#define ColPosition Wcm.cm_habs
-#define RowPosition Wcm.cm_vabs
-#define MultiUp Wcm.cm_multiup
-#define MultiDown Wcm.cm_multidown
-#define MultiLeft Wcm.cm_multileft
-#define MultiRight Wcm.cm_multiright
-#define AutoWrap Wcm.cm_autowrap
-#define MagicWrap Wcm.cm_magicwrap
-#define UseTabs Wcm.cm_usetabs
-#define FrameRows Wcm.cm_rows
-#define FrameCols Wcm.cm_cols
-
-#define UpCost Wcm.cc_up
-#define DownCost Wcm.cc_down
-#define LeftCost Wcm.cc_left
-#define RightCost Wcm.cc_right
-#define HomeCost Wcm.cc_home
-#define CRCost Wcm.cc_cr
-#define LastLineCost Wcm.cc_ll
-#define TabCost Wcm.cc_tab
-#define BackTabCost Wcm.cc_backtab
-#define AbsPositionCost Wcm.cc_abs
-#define ColPositionCost Wcm.cc_habs
-#define RowPositionCost Wcm.cc_vabs
-#define MultiUpCost Wcm.cc_multiup
-#define MultiDownCost Wcm.cc_multidown
-#define MultiLeftCost Wcm.cc_multileft
-#define MultiRightCost Wcm.cc_multiright
+#define curY(tty) (tty)->Wcm->cm_curY
+#define curX(tty) (tty)->Wcm->cm_curX
+#define Up(tty) (tty)->Wcm->cm_up
+#define Down(tty) (tty)->Wcm->cm_down
+#define Left(tty) (tty)->Wcm->cm_left
+#define Right(tty) (tty)->Wcm->cm_right
+#define Tab(tty) (tty)->Wcm->cm_tab
+#define BackTab(tty) (tty)->Wcm->cm_backtab
+#define TabWidth(tty) (tty)->Wcm->cm_tabwidth
+#define CR(tty) (tty)->Wcm->cm_cr
+#define Home(tty) (tty)->Wcm->cm_home
+#define LastLine(tty) (tty)->Wcm->cm_ll
+#define AbsPosition(tty) (tty)->Wcm->cm_abs
+#define ColPosition(tty) (tty)->Wcm->cm_habs
+#define RowPosition(tty) (tty)->Wcm->cm_vabs
+#define MultiUp(tty) (tty)->Wcm->cm_multiup
+#define MultiDown(tty) (tty)->Wcm->cm_multidown
+#define MultiLeft(tty) (tty)->Wcm->cm_multileft
+#define MultiRight(tty) (tty)->Wcm->cm_multiright
+#define AutoWrap(tty) (tty)->Wcm->cm_autowrap
+#define MagicWrap(tty) (tty)->Wcm->cm_magicwrap
+#define UseTabs(tty) (tty)->Wcm->cm_usetabs
+#define FrameRows(tty) (tty)->Wcm->cm_rows
+#define FrameCols(tty) (tty)->Wcm->cm_cols
+
+#define UpCost(tty) (tty)->Wcm->cc_up
+#define DownCost(tty) (tty)->Wcm->cc_down
+#define LeftCost(tty) (tty)->Wcm->cc_left
+#define RightCost(tty) (tty)->Wcm->cc_right
+#define HomeCost(tty) (tty)->Wcm->cc_home
+#define CRCost(tty) (tty)->Wcm->cc_cr
+#define LastLineCost(tty) (tty)->Wcm->cc_ll
+#define TabCost(tty) (tty)->Wcm->cc_tab
+#define BackTabCost(tty) (tty)->Wcm->cc_backtab
+#define AbsPositionCost(tty) (tty)->Wcm->cc_abs
+#define ColPositionCost(tty) (tty)->Wcm->cc_habs
+#define RowPositionCost(tty) (tty)->Wcm->cc_vabs
+#define MultiUpCost(tty) (tty)->Wcm->cc_multiup
+#define MultiDownCost(tty) (tty)->Wcm->cc_multidown
+#define MultiLeftCost(tty) (tty)->Wcm->cc_multileft
+#define MultiRightCost(tty) (tty)->Wcm->cc_multiright