+static int labelcnt = 0; /* ラベル数 */
+static LABELTAB *labels[LABELTABSIZE]; /* ラベル表 */
+
+#ifndef UNITTEST
+static unsigned labelhash(const char *prog, const char *label);
+
+static int compare_adr(const void *a, const void *b);
+#endif
+
+/**
+ * プログラム名とラベルに対応するハッシュ値を返す
+ */
+unsigned labelhash(const char *prog, const char *label)
+{
+ HKEY *keys[2];
+ int i = 0;
+
+ if(prog != NULL) {
+ keys[i] = malloc_chk(sizeof(HKEY), "labelhash.key[]");
+ keys[i]->type = CHARS;
+ keys[i]->val.s = strdup_chk(prog, "labelhash.key[].val");
+ }
+ keys[i] = malloc_chk(sizeof(HKEY), "labelhash.key[]");
+ keys[i]->type = CHARS;
+ keys[i]->val.s = strdup_chk(label, "labelhash.key[].val");
+ /* ハッシュ値を返す */
+ return hash(i+1, keys, LABELTABSIZE);
+}