Beispiel #1
0
struct snpExceptions *snpExceptionsLoadAll(char *fileName) 
/* Load all snpExceptions from a whitespace-separated file.
 * Dispose of this with snpExceptionsFreeList(). */
{
struct snpExceptions *list = NULL, *el;
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *row[5];

while (lineFileRow(lf, row))
    {
    el = snpExceptionsLoad(row);
    slAddHead(&list, el);
    }
lineFileClose(&lf);
slReverse(&list);
return list;
}
Beispiel #2
0
struct snpExceptions *snpExceptionsLoadAllByChar(char *fileName, char chopper) 
/* Load all snpExceptions from a chopper separated file.
 * Dispose of this with snpExceptionsFreeList(). */
{
struct snpExceptions *list = NULL, *el;
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *row[5];

while (lineFileNextCharRow(lf, chopper, row, ArraySize(row)))
    {
    el = snpExceptionsLoad(row);
    slAddHead(&list, el);
    }
lineFileClose(&lf);
slReverse(&list);
return list;
}
Beispiel #3
0
struct snpExceptions *snpExceptionsLoadByQuery(struct sqlConnection *conn, char *query)
/* Load all snpExceptions from table that satisfy the query given.  
 * Where query is of the form 'select * from example where something=something'
 * or 'select example.* from example, anotherTable where example.something = 
 * anotherTable.something'.
 * Dispose of this with snpExceptionsFreeList(). */
{
struct snpExceptions *list = NULL, *el;
struct sqlResult *sr;
char **row;

sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
    {
    el = snpExceptionsLoad(row);
    slAddHead(&list, el);
    }
slReverse(&list);
sqlFreeResult(&sr);
return list;
}
Beispiel #4
0
struct snpExceptions *getExceptionList(char *db, int inputExceptionId)
/* Get list of all exceptions to be tested. */
{
struct sqlConnection *conn       = hAllocConn(db);
struct sqlResult     *sr         = NULL;
char                **row        = NULL;
struct snpExceptions *list       = NULL;
struct snpExceptions *el         = NULL;
char                  query[256] = NOSQLINJ "select * from snpExceptions";

if (inputExceptionId>0)
    sqlSafef(query, sizeof(query), 
	  "select * from snpExceptions where exceptionId=%d", inputExceptionId);
sr = sqlGetResult(conn, query);
while ((row=sqlNextRow(sr))!=NULL)
    {
    el = snpExceptionsLoad(row);
    slAddHead(&list, el);
    }
slReverse(&list);
sqlFreeResult(&sr);
hFreeConn(&conn);
return list;
}