+/* Like COMPOSITION_DECODE_REFS (RULE_CODE, GREF, NREF), but also
+ decode RULE_CODE into XOFF and YOFF (vertical offset). */
+
+#define COMPOSITION_DECODE_RULE(rule_code, gref, nref, xoff, yoff) \
+ do { \
+ xoff = (rule_code) >> 16; \
+ yoff = ((rule_code) >> 8) & 0xFF; \
+ COMPOSITION_DECODE_REFS (rule_code, gref, nref); \
+ } while (0)
+
+/* Nonzero if the global reference point GREF and new reference point NREF are
+ valid. */
+#define COMPOSITION_ENCODE_RULE_VALID(gref, nref) \
+ (UNSIGNED_CMP (gref, <, 12) && UNSIGNED_CMP (nref, <, 12))
+