292ed473726ab39e40b78978ed44c86add0d34fc kent Wed Oct 12 14:25:28 2011 -0700 Adding hashElCmpWithEmbeddedNumbers. diff --git src/inc/hash.h src/inc/hash.h index 93bb311..a7fc017 100644 --- src/inc/hash.h +++ src/inc/hash.h @@ -178,30 +178,34 @@ long long hashIntSum(struct hash *hash); /* Return sum of all the ints in a hash of ints. */ void hashTraverseEls(struct hash *hash, void (*func)(struct hashEl *hel)); /* Apply func to every element of hash with hashEl as parameter. */ void hashTraverseVals(struct hash *hash, void (*func)(void *val)); /* Apply func to every element of hash with hashEl->val as parameter. */ struct hashEl *hashElListHash(struct hash *hash); /* Return a list of all elements of hash. Free return with hashElFreeList. */ int hashElCmp(const void *va, const void *vb); /* Compare two hashEl by name. */ +int hashElCmpWithEmbeddedNumbers(const void *va, const void *vb); +/* Compare two hashEl by name sorting including numbers within name, + * suitable for chromosomes, genes, etc. */ + void *hashElFindVal(struct hashEl *list, char *name); /* Look up name in hashEl list and return val or NULL if not found. */ void hashElFree(struct hashEl **pEl); /* Free hash el list returned from hashListAll. */ void hashElFreeList(struct hashEl **pList); /* Free hash el list returned from hashListAll. (Don't use * this internally. */ struct hashCookie hashFirst(struct hash *hash); /* Return an object to use by hashNext() to traverse the hash table. * The first call to hashNext will return the first entry in the table. */ struct hashEl* hashNext(struct hashCookie *cookie);