int wordTreeCmpWord(const void *va, const void *vb) /* Compare two wordTree for slSort. */ { const struct wordTree *a = *((struct wordTree **)va); const struct wordTree *b = *((struct wordTree **)vb); return cmpStringsWithEmbeddedNumbers(a->info->word, b->info->word); }
int hashElCmpWithEmbeddedNumbers(const void *va, const void *vb) /* Compare two hashEl by name sorting including numbers within name, * suitable for chromosomes, genes, etc. */ { const struct hashEl *a = *((struct hashEl **)va); const struct hashEl *b = *((struct hashEl **)vb); return cmpStringsWithEmbeddedNumbers(a->name, b->name); }
int bedCmpChrom(const void *va, const void *vb) /* Compare strings such as chromosome names that may have embedded numbers, * so that chr4 comes before chr14 */ { const struct bed *a = *((struct bed **)va); const struct bed *b = *((struct bed **)vb); return cmpStringsWithEmbeddedNumbers(a->chrom, b->chrom); }
static int bbiChromInfoCmpStringsWithEmbeddedNumbers(const void *va, const void *vb) /* Compare strings such as gene names that may have embedded numbers, * so that bmp4a comes before bmp14a */ { const struct bbiChromInfo *a = *((struct bbiChromInfo **)va); const struct bbiChromInfo *b = *((struct bbiChromInfo **)vb); return cmpStringsWithEmbeddedNumbers(a->name, b->name); }
int cmpChrom(char *a, char *b) /* Compare two chromosomes. */ { return cmpStringsWithEmbeddedNumbers(a, b); }