lib/pslTbl.c File Reference

#include "common.h"
#include "pslTbl.h"
#include "psl.h"
#include "hash.h"
#include "linefile.h"
#include "localmem.h"

Include dependency graph for pslTbl.c:

Go to the source code of this file.

Functions

static struct pslQuerypslQueryGet (struct pslTbl *pslTbl, char *qName)
static void loadPsl (struct pslTbl *pslTbl, char **row)
static void loadPsls (struct pslTbl *pslTbl, char *pslFile)
pslTblpslTblNew (char *pslFile, char *setName)
void pslTblFree (struct pslTbl **pslTblPtr)
void pslTblFreeList (struct pslTbl **pslTblList)


Function Documentation

static void loadPsl ( struct pslTbl pslTbl,
char **  row 
) [static]

Definition at line 24 of file pslTbl.c.

References hash::lm, pslLoadLm(), pslQueryGet(), pslQuery::psls, psl::qName, pslTbl::queryHash, and slAddHead.

Referenced by loadPsls().

00026 {
00027 struct psl *psl = pslLoadLm(row, pslTbl->queryHash->lm);
00028 struct pslQuery *pslQuery = pslQueryGet(pslTbl, psl->qName);
00029 slAddHead(&pslQuery->psls, psl);
00030 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void loadPsls ( struct pslTbl pslTbl,
char *  pslFile 
) [static]

Definition at line 32 of file pslTbl.c.

References ArraySize, lineFileClose(), lineFileNextRowTab(), lineFileOpen(), loadPsl(), PSL_NUM_COLS, and TRUE.

Referenced by pslTblNew().

00034 {
00035 struct lineFile *lf = lineFileOpen(pslFile, TRUE);
00036 char *row[PSL_NUM_COLS];
00037 while (lineFileNextRowTab(lf, row, ArraySize(row)))
00038     loadPsl(pslTbl, row);
00039 lineFileClose(&lf);
00040 }

Here is the call graph for this function:

Here is the caller graph for this function:

static struct pslQuery* pslQueryGet ( struct pslTbl pslTbl,
char *  qName 
) [static, read]

Definition at line 9 of file pslTbl.c.

References hashStore(), hash::lm, lmAllocVar, hashEl::name, pslQuery::qName, pslTbl::queryHash, and hashEl::val.

Referenced by loadPsl().

00012 {
00013 struct hashEl *qHel = hashStore(pslTbl->queryHash, qName);
00014 if (qHel->val == NULL)
00015     {
00016     struct pslQuery *pslQuery;
00017     lmAllocVar(pslTbl->queryHash->lm, pslQuery);
00018     pslQuery->qName = qHel->name;
00019     qHel->val = pslQuery;
00020     }
00021 return qHel->val;
00022 }

Here is the call graph for this function:

Here is the caller graph for this function:

void pslTblFree ( struct pslTbl **  pslTblPtr  ) 

Definition at line 55 of file pslTbl.c.

References freeMem(), hashFree, pslTbl::queryHash, and pslTbl::setName.

Referenced by pslTblFreeList().

00057 {
00058 struct pslTbl *pslTbl = *pslTblPtr;
00059 if (pslTbl != NULL)
00060     {
00061     /* pslQuery and psl objects are in local mem */
00062     freeMem(pslTbl->setName);
00063     hashFree(&pslTbl->queryHash);
00064     freeMem(pslTbl);
00065     }
00066 }

Here is the call graph for this function:

Here is the caller graph for this function:

void pslTblFreeList ( struct pslTbl **  pslTblList  ) 

Definition at line 68 of file pslTbl.c.

References pslTbl::next, and pslTblFree().

00070 {
00071 struct pslTbl *pslTbl = *pslTblList;
00072 while (pslTbl != NULL)
00073     {
00074     struct pslTbl *pslTblDel = pslTbl;
00075     pslTbl = pslTbl->next;
00076     pslTblFree(&pslTblDel);
00077     }
00078 *pslTblList = NULL;
00079 }

Here is the call graph for this function:

struct pslTbl* pslTblNew ( char *  pslFile,
char *  setName 
) [read]

Definition at line 42 of file pslTbl.c.

References AllocVar, cloneString(), hashNew, loadPsls(), pslTbl::queryHash, and pslTbl::setName.

00045 {
00046 struct pslTbl *pslTbl;
00047 AllocVar(pslTbl);
00048 pslTbl->setName = (setName == NULL) ? cloneString(pslFile)
00049     : cloneString(setName);
00050 pslTbl->queryHash = hashNew(22);
00051 loadPsls(pslTbl, pslFile);
00052 return pslTbl;
00053 }

Here is the call graph for this function:


Generated on Tue Dec 25 20:13:16 2007 for blat by  doxygen 1.5.2