+
+ISAMC_M *key_isamc_m (Res res, ISAMC_M *me)
+{
+ isc_getmethod (me);
+
+ me->compare_item = key_compare;
+
+ me->code_start = iscz1_code_start;
+ me->code_item = iscz1_code_item;
+ me->code_stop = iscz1_code_stop;
+ me->code_reset = iscz1_code_reset;
+
+ me->debug = atoi(res_get_def (res, "isamcDebug", "0"));
+
+ return me;
+}
+
+ISAMD_M *key_isamd_m (Res res, ISAMD_M *me)
+{
+ me = isamd_getmethod (me);
+
+ me->compare_item = key_compare;
+
+ me->code_start = iscz1_code_start;
+ me->code_item = iscz1_code_item;
+ me->code_stop = iscz1_code_stop;
+ me->code_reset = iscz1_code_reset;
+
+ me->debug = atoi(res_get_def (res, "isamdDebug", "0"));
+
+ return me;
+}
+
+int key_SU_encode (int ch, char *out)
+{
+ int i;
+ for (i = 0; ch; i++)
+ {
+ if (ch >= 64)
+ out[i] = 65 + (ch & 63);
+ else
+ out[i] = 1 + ch;
+ ch = ch >> 6;
+ }
+ return i;
+ /* in out
+ 0 1
+ 1 2
+ 63 64
+ 64 65, 2
+ 65 66, 2
+ 127 128, 2
+ 128 65, 3
+ 191 128, 3
+ 192 65, 4
+ */
+}
+
+int key_SU_decode (int *ch, const unsigned char *out)
+{
+ int len = 1;
+ int fact = 1;
+ *ch = 0;
+ for (len = 1; *out >= 65; len++, out++)
+ {
+ *ch += (*out - 65) * fact;
+ fact <<= 6;
+ }
+ *ch += (*out - 1) * fact;
+ return len;
+}
+