本文整理汇总了C++中slAddTail函数的典型用法代码示例。如果您正苦于以下问题:C++ slAddTail函数的具体用法?C++ slAddTail怎么用?C++ slAddTail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了slAddTail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hashNew
struct composite *makeCompositeList(struct encode2Manifest *manList, struct hash *metaHash)
/* Return a list of composites with everything on manList */
{
struct composite *comp, *compList = NULL;
struct hash *compHash = hashNew(0);
char compName[256];
struct encode2Manifest *man;
for (man = manList; man != NULL; man = man->next)
{
char *realComp = tagVal(man, metaHash, "composite");
if (realComp != NULL)
safef(compName, sizeof(compName), "%s", realComp);
else
{
char *lab = emptyForNull(tagVal(man, metaHash, "lab"));
char *dataType = emptyForNull(tagVal(man, metaHash, "dataType"));
safef(compName, sizeof(compName), "comp%s%s", lab, dataType);
}
comp = hashFindVal(compHash, compName);
if (comp == NULL)
{
AllocVar(comp);
comp->name = cloneString(compName);
hashAdd(compHash, compName, comp);
slAddTail(&compList, comp);
}
struct slRef *manRef = slRefNew(man);
slAddTail(&comp->manRefList, manRef);
}
hashFree(&compHash);
return compList;
}
示例2: AllocVar
struct polygon *makeTriangle(int x, int y, int z)
/* Make triangle about center x,y,z */
{
struct polygon *tri;
struct point *pt;
int i;
AllocVar(tri);
tri->id = nextId();
tri->pointCount = 3;
AllocVar(pt);
strcpy(pt->acc, "acc1");
pt->pt.x = pt->x = x;
pt->pt.y = pt->y = y-100;
pt->z = z;
slAddTail(&tri->points, pt);
AllocVar(pt);
strcpy(pt->acc, "acc2");
pt->pt.x = pt->x = x-100;
pt->pt.y = pt->y = y+100;
pt->z = z;
slAddTail(&tri->points, pt);
AllocVar(pt);
strcpy(pt->acc, "acc3");
pt->pt.x = pt->x = x+100;
pt->pt.y = pt->y = y+100;
pt->z = z;
slAddTail(&tri->points, pt);
AllocArray(tri->persp, 3);
for (i=0, pt = tri->points; i < 3; ++i, pt = pt->next)
{
tri->persp[i].x = pt->x/2;
tri->persp[i].y = pt->y/2;
}
return tri;
}
示例3: pipelineNew
static struct pipeline* pipelineNew(char ***cmds, unsigned options)
/* create a new pipeline object. Doesn't start processes */
{
static char *memPseudoCmd[] = {"[mem]", NULL};
struct pipeline *pl;
int iCmd;
AllocVar(pl);
pl->pipeFd = -1;
pl->options = options;
pl->procName = joinCmds(cmds);
if (cmds[0] == NULL)
errAbort("no commands in pipeline");
if (options & pipelineMemInput)
{
/* add proc for forked process to write memory to pipeline */
slAddTail(&pl->procs, plProcNew(memPseudoCmd, pl));
}
for(iCmd = 0; cmds[iCmd] != NULL; iCmd++)
slAddTail(&pl->procs, plProcNew(cmds[iCmd], pl));
return pl;
}
示例4: cJoinX
void cJoinX(char *j1, char *j2, char *j3)
/* cJoinX - Experiment in C joining.. */
{
struct joiner *joiner = joinerRead("../../makeDb/schema/all.joiner");
struct joinerDtf *a = joinerDtfFromDottedTriple(j1);
struct joinerDtf *b = joinerDtfFromDottedTriple(j2);
struct joinerDtf *c = joinerDtfFromDottedTriple(j3);
struct joinerPair *jpList = NULL, *jp;
struct joinerDtf *fieldList = NULL;
struct hash *visitedHash = hashNew(0);
slAddTail(&fieldList, a);
slAddTail(&fieldList, b);
slAddTail(&fieldList, c);
if (joinerDtfAllSameTable(fieldList))
printf("All in same table, easy enough!\n");
else
{
jpList = joinerFindRouteThroughAll(joiner, fieldList);
for (jp = jpList; jp != NULL; jp = jp->next)
{
printf("%s.%s.%s -> %s.%s.%s\n",
jp->a->database, jp->a->table, jp->a->field,
jp->b->database, jp->b->table, jp->b->field);
}
}
}
示例5: slCat
static struct gpFx *gpFxInExon(struct variant *variant, struct txCoords *txc, int exonIx,
struct genePred *pred, boolean predIsNmd,
struct dnaSeq *transcriptSeq, struct lm *lm)
/* Given a variant that overlaps an exon of pred, figure out what each allele does. */
{
struct gpFx *effectsList = NULL;
struct allele *allele = variant->alleles;
for ( ; allele ; allele = allele->next)
{
if (!allele->isReference)
{
if (pred->cdsStart != pred->cdsEnd)
{
// first find effects of allele in UTR, if any
effectsList = slCat(effectsList,
gpFxCheckUtr(allele, pred, txc, exonIx, predIsNmd, lm));
if (txc->startInCds >= 0)
effectsList = slCat(effectsList,
gpFxChangedCds(allele, pred, txc, exonIx, predIsNmd,
transcriptSeq, lm));
}
else
effectsList = slCat(effectsList,
gpFxChangedNoncodingExon(allele, pred, txc, exonIx, lm));
if (!predIsNmd)
{
// Was entire exon deleted?
int exonNumPos = exonIx;
if (pred->strand[0] == '-')
exonNumPos = pred->exonCount - 1 - exonIx;
uint exonStart = pred->exonStarts[exonNumPos], exonEnd = pred->exonEnds[exonNumPos];
if (variant->chromStart <= exonStart && variant->chromEnd >= exonEnd)
{
struct gpFx *effect = gpFxNew(allele->sequence, pred->name, exon_loss,
nonCodingExon, lm);
setNCExonVals(effect, exonIx, txc->startInCdna);
slAddTail(&effectsList, effect);
}
else
{
// If variant is in exon *but* within 3 bases of splice site,
// it also qualifies as splice_region_variant:
if ((variant->chromEnd > exonEnd-3 && variant->chromStart < exonEnd &&
exonIx < pred->exonCount - 1) ||
(variant->chromEnd > exonStart && variant->chromStart < exonStart+3 &&
exonIx > 0))
{
struct gpFx *effect = gpFxNew(allele->sequence, pred->name,
splice_region_variant, nonCodingExon, lm);
setNCExonVals(effect, exonIx, txc->startInCdna);
slAddTail(&effectsList, effect);
}
}
}
}
}
return effectsList;
}
示例6: testPolyhOut
void testPolyhOut()
{
struct polyhedron *ph;
AllocVar(ph);
ph->id = nextId();
ph->names[0] = cloneString("Jim");
ph->names[1] = cloneString("Kent");
ph->polygonCount = 2;
slAddTail(&ph->polygons, makeTriangle(0, 0, 0));
slAddTail(&ph->polygons, makeTriangle(0, 0, 100));
findBox(ph);
polyhedronCommaOut(ph, stdout);
printf("\n");
polyhedronFree(&ph);
}
示例7: hashNew
static struct hash *htmlHeaderRead(char **pHtml, struct htmlCookie **pCookies)
/* Read in from second line through first blank line and
* save in hash. These lines are in the form name: value. */
{
struct hash *hash = hashNew(6);
for (;;)
{
char *line = htmlNextCrLfLine(pHtml);
char *word;
if (line == NULL)
{
warn("End of file in header");
break;
}
word = nextWord(&line);
if (word == NULL)
break;
line = skipLeadingSpaces(line);
hashAdd(hash, word, cloneString(line));
if (sameString(word, "Set-Cookie:"))
{
struct htmlCookie *cookie = parseCookie(line);
if (cookie != NULL)
slAddTail(pCookies, cookie);
}
}
return hash;
}
示例8: dyStringNew
struct repBundle *bundleReplicates(struct replicate **pRepList)
/* Bundle together replicates, eating *pRepList in the process. */
{
struct replicate *rep, *nextRep;
struct repBundle *bundleList = NULL, *bundle;
struct dyString *hashName = dyStringNew(0);
struct hash *bundleHash = hashNew(0);
for (rep = *pRepList; rep != NULL; rep = nextRep)
{
nextRep = rep->next; // Going to clobber ->next field
dyStringClear(hashName);
struct slPair *tag;
for (tag = rep->tagList; tag != NULL; tag = tag->next)
{
if (!sameString(tag->name, "replicate") && !sameString(tag->name, "fileName"))
dyStringPrintf(hashName, "%s=%s;", tag->name, (char *)(tag->val));
}
bundle = hashFindVal(bundleHash, hashName->string);
if (bundle == NULL)
{
AllocVar(bundle);
slAddHead(&bundleList, bundle);
hashAddSaveName(bundleHash, hashName->string, bundle, &bundle->hashName);
}
slAddTail(&bundle->repList, rep);
}
slReverse(&bundleList);
*pRepList = NULL;
return bundleList;
}
示例9: trackDbSetting
struct consWiggle *wigMafWiggles(char *db, struct trackDb *tdb)
/* get conservation wiggle table names and labels from trackDb setting,
ignoring those where table doesn't exist */
{
char *fields[20];
int fieldCt;
int i;
char *wigTable, *wigLabel;
struct consWiggle *wig, *wigList = NULL;
char *setting = trackDbSetting(tdb, CONS_WIGGLE);
if (!setting)
return NULL;
fieldCt = chopLine(cloneString(setting), fields);
for (i = 0; i < fieldCt; i += 3)
{
wigTable = fields[i];
if (hTableExists(db, wigTable));
{
AllocVar(wig);
wig->table = cloneString(wigTable);
wigLabel = (i+1 == fieldCt ? DEFAULT_CONS_LABEL : fields[i+1]);
wig->leftLabel = cloneString(wigLabel);
wigLabel = (i+2 >= fieldCt ? wig->leftLabel : fields[i+2]);
wig->uiLabel = cloneString(wigLabel);
slAddTail(&wigList, wig);
}
}
return wigList;
}
示例10: getRefAli
/* make sure we have the whole range even if
* there isn't a maf loaded in this region
*/
static struct mafAli *padOutAli(struct mafAli *list, char *database,
char *chrom, int start, int end)
{
if (list == NULL)
{
struct mafAli *ali = getRefAli(database, chrom, start, end);
return ali;
}
int aliStart = list->components->start;
if (start != aliStart)
{
struct mafAli *ali = getRefAli(database, chrom, start, aliStart);
slAddHead(&list, ali);
}
struct mafAli *last = list;
for(; last->next; last = last->next)
;
int aliEnd = last->components->start + last->components->size;
if (end != aliEnd)
{
struct mafAli *ali = getRefAli(database, chrom, aliEnd, end);
slAddTail(&list, ali);
}
return list;
}
示例11: addOutKeys
void addOutKeys(struct hash *tableHash, struct joinerPair *routeList,
struct tableJoiner **pTfList)
/* Add output keys to tableJoiners. These are in table hash.
* We may also have to add some fieldLess tables to the mix,
* which will get appended to *pTfList, and added to the hash
* if need be. */
{
struct joinerPair *route;
struct tableJoiner *tj;
char fullName[256];
for (route = routeList; route != NULL; route = route->next)
{
struct joinerDtf *a = route->a;
safef(fullName, sizeof(fullName), "%s.%s", a->database, a->table);
tj = hashFindVal(tableHash, fullName);
if (tj == NULL)
{
AllocVar(tj);
tj->database = a->database;
tj->table = a->table;
slAddTail(pTfList, tj);
hashAdd(tableHash, fullName, tj);
}
if (!inKeysOut(tj, route))
refAdd(&tj->keysOut, route);
}
}
示例12: addDtfListToBundle
static void addDtfListToBundle(struct hash *hash, struct tableJoiner **pList,
struct joinerDtf *dtfList, boolean addField)
/* Add table to hash/list if haven't seen it already. Optionally add
* field to table. */
{
char fullName[256];
struct joinerDtf *dtf, *dupe;
struct tableJoiner *tj;
for (dtf = dtfList; dtf != NULL; dtf = dtf->next)
{
safef(fullName, sizeof(fullName), "%s.%s", dtf->database, dtf->table);
tj = hashFindVal(hash, fullName);
if (tj == NULL)
{
AllocVar(tj);
hashAdd(hash, fullName, tj);
tj->database = dtf->database;
tj->table = dtf->table;
slAddHead(pList, tj);
}
if (addField)
{
dupe = joinerDtfClone(dtf);
slAddTail(&tj->fieldList, dupe);
}
}
}
示例13: jrRowExpand
static void jrRowExpand(struct joinedTables *joined,
struct joinedRow *jr, char **row,
int fieldOffset, int fieldCount, int keyOffset, int keyCount)
/* Add some more to row. */
{
int i;
struct slName **keys = jr->keys + keyOffset;
struct slName **fields = jr->fields + fieldOffset;
struct lm *lm = joined->lm;
struct slName *name;
if (fieldCount + fieldOffset > joined->fieldCount)
internalErr();
if (keyCount + keyOffset > joined->keyCount)
internalErr();
for (i=0; i<fieldCount; ++i)
{
name = lmSlName(lm, row[i]);
slAddTail(&fields[i], name);
}
row += fieldCount;
for (i=0; i<keyCount; ++i)
{
name = lmSlName(lm, row[i]);
slAddHead(&keys[i], name);
}
}
示例14: wormCacheSomeGdf
struct gdfGene *wormGetSomeGdfGeneList(char *baseName, int baseNameSize, struct wormGdfCache *cache)
/* Get all gdfGenes that start with a given name. */
{
int snIx;
int maxIx;
struct snof *snof;
FILE *f;
struct gdfGene *list = NULL, *el;
wormCacheSomeGdf(cache);
snof = cache->snof;
f = cache->file;
if (!snofFindFirstStartingWith(snof, baseName, baseNameSize, &snIx))
return NULL;
maxIx = snofElementCount(snof);
for (;snIx < maxIx; ++snIx)
{
long offset;
char *geneName;
snofNameOffsetAtIx(snof, snIx, &geneName, &offset);
if (strncmp(geneName, baseName, baseNameSize) != 0)
break;
fseek(f, offset, SEEK_SET);
el = gdfReadOneGene(f);
slAddTail(&list, el);
}
slReverse(&list);
return list;
}
示例15: rqlParseAnd
static struct rqlParse *rqlParseOr(struct tokenizer *tkz)
/* Parse out and or or. */
{
struct rqlParse *p = rqlParseAnd(tkz);
struct rqlParse *parent = NULL;
for (;;)
{
char *tok = tokenizerNext(tkz);
if (tok == NULL || !sameString(tok, "or"))
{
tokenizerReuse(tkz);
return p;
}
else
{
if (parent == NULL)
{
p = rqlParseCoerce(p, rqlTypeBoolean);
AllocVar(parent);
parent->op = rqlOpOr;
parent->type = rqlTypeBoolean;
parent->children = p;
p = parent;
}
struct rqlParse *r = rqlParseCoerce(rqlParseAnd(tkz), rqlTypeBoolean);
slAddTail(&parent->children, r);
}
}
}