+ /* A locale collation definition includes primary, secondary,
+ * tertiary, etc. weights for each character. To sort, the primary
+ * weights are used, and only if they compare equal, then the
+ * secondary weights are used, and only if they compare equal, then
+ * the tertiary, etc. strxfrm() works by taking the input string,
+ * say ABC, and creating an output string consisting of first the
+ * primary weights, A¹B¹C¹ followed by the secondary ones, A²B²C²;
+ * and then the tertiary, etc, yielding A¹B¹C¹A²B²C²A³B³C³....
+ * Some characters may not have weights at every level. In our
+ * example, let's say B doesn't have a tertiary weight, and A
+ * doesn't have a secondary weight. The constructed string is then
+ * going to be A¹B¹C¹B²C²A³C³.... This has the desired
+ * characteristics that strcmp() will look at the secondary or
+ * tertiary weights only if the strings compare equal at all higher
+ * priority weights. The length of the transformed string is
+ * roughly a linear function of the input string. It's not exactly
+ * linear because some characters don't have weights at all levels,
+ * and there are some complications, so there is often per-string
+ * overhead. When we call strxfrm() we have to allocate some
+ * memory to hold the transformed string. The calculations below
+ * try to find constants for this locale 'm' and 'b' so that m*x +
+ * b equals how much space we need given the size of the input
+ * string in 'x'. If we calculate too small, we increase the size
+ * as needed, and call strxfrm() again, but it is better to get it
+ * right the first time to avoid wasted expensive string
+ * transformations. */