Created
March 12, 2015 22:04
-
-
Save superbobry/13198f038a92f63e0eae to your computer and use it in GitHub Desktop.
UCSC style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct chromNameCallbackContext | |
/* Some stuff that the bPlusTree traverser needs for context. */ | |
{ | |
struct bbiChromInfo *list; /* The list we are building. */ | |
boolean isSwapped; /* Need to byte-swap things? */ | |
}; | |
static void chromNameCallback(void *context, void *key, int keySize, void *val, int valSize) | |
/* Callback that captures chromInfo from bPlusTree. */ | |
{ | |
struct chromNameCallbackContext *c = context; | |
struct bbiChromInfo *info; | |
struct bbiChromIdSize *idSize = val; | |
assert(valSize == sizeof(*idSize)); | |
chromIdSizeHandleSwapped(c->isSwapped, idSize); | |
AllocVar(info); | |
info->name = cloneStringZ(key, keySize); | |
info->id = idSize->chromId; | |
info->size = idSize->chromSize; | |
slAddHead(&c->list, info); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment