+static char * get_keyname_to_command(char * command_name)
+{
+ uint8_t i = 0;
+ for (i = 0; i < world.kb_wingeom.n_of_kbs; i++)
+ {
+ if (!strcmp(world.kb_wingeom.kbs[i].command->dsc_short, command_name))
+ {
+ return get_keyname_to_keycode(world.kb_wingeom.kbs[i].keycode);
+ }
+ }
+ return "UNDEFINED";
+}
+
+
+
+static char * winconf_geom_helper(struct Win * win, char axis, char * sep,
+ char * newlines, char * value_prefix)
+{
+ char * p0 = 'v'==axis? "Height" : "Width";
+ char * p1 = " to save (grow/shrink/toggle positivity with ";
+ char * p2 = get_keyname_to_command('v'==axis? "grow_v" : "grow_h");
+ char * p4 = get_keyname_to_command('v'==axis? "shri_v" : "shri_v");
+ char * p6 = get_keyname_to_command('v'==axis? "to_height_t" : "to_width_t");
+ char p8[6 + 1]; /* 6: int16_t value max strlen */
+ int test = sprintf(p8,"%d", 'v'==axis?win->target_height:win->target_width);
+ exit_trouble(test < 0, __func__, "sprintf");
+ char * p9 = " (";
+ char * p10 = "in_cells";
+ if (1 == ('v'==axis? win->target_height_type : win->target_width_type))
+ {
+ p10 = "non-positive diff: cells to screen maximum";
+ }
+ char * p11 = ")";
+ uint8_t size = strlen(p0) + strlen(p1) + strlen(p2) + strlen(sep)
+ + strlen(p4) + strlen(sep) + strlen(p6) + strlen(value_prefix)
+ + strlen(p8) + strlen(p9) + strlen(p10) + strlen(p11)
+ + strlen(newlines);
+ char * msg = try_malloc(size, __func__);
+ sprintf(msg, "%s%s%s%s%s%s%s%s%s%s%s%s%s", p0, p1, p2, sep, p4, sep, p6,
+ value_prefix, p8, p9, p10, p11, newlines);
+ return msg;
+}
+
+
+