- setcchar(&temp, wch, my_attrs, (short) my_pair, NULL);
+ setcchar(&temp, wch, my_attrs,
+ (short) my_pair,
+ (use_init ? NULL : (void *) &my_pair));
+
+ if (check_set) {
+ int problem = 0;
+ wchar_t chk_wch[2];
+ attr_t chk_attrs = 0;
+ short chk_pair = 0;
+ int chk_pair2 = 0;
+
+#define AllButColor(a) ((a) & (A_ATTRIBUTES & ~A_COLOR))
+
+ if (getcchar(&temp, NULL, &chk_attrs, &chk_pair,
+ (use_init ? NULL : (void *) &chk_pair2)) != 2) {
+ problem = 1;
+ } else if (getcchar(&temp, chk_wch, &chk_attrs, &chk_pair,
+ (use_init ? NULL : (void *) &chk_pair2)) != OK) {
+ problem = 2;
+ } else if (chk_wch[0] != wch[0]) {
+ problem = 3;
+ } else if (AllButColor(my_attrs) != AllButColor(chk_attrs)) {
+ problem = 4;
+ } else if (my_pair != chk_pair) {
+ problem = 4;
+ } else if (!use_init && (my_pair != chk_pair2)) {
+ problem = 5;
+ }
+ if (problem) {
+ wch[0] = (wchar_t) (problem + '0');
+ setcchar(&temp, wch, my_attrs,
+ (short) my_pair,
+ (use_init ? NULL : (void *) &my_pair));
+ }
+ }
+