e70152e44cc66cc599ff6b699eb8adc07f3e656a kent Sat May 24 21:09:34 2014 -0700 Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment. diff --git src/hg/qa/getChroms.c src/hg/qa/getChroms.c index 01c6f33..6048126 100644 --- src/hg/qa/getChroms.c +++ src/hg/qa/getChroms.c @@ -1,50 +1,53 @@ /* getChroms -- sample code */ +/* Copyright (C) 2013 The Regents of the University of California + * See README in this or parent directory for licensing information. */ + #include "common.h" #include "chromInfo.h" #include "hdb.h" static char *db = NULL; void usage() /* Explain usage and exit. */ { errAbort( "getChroms - print chrom names\n" "usage:\n" " getChroms database\n"); } void getChroms() { char query[512]; struct sqlConnection *conn = hAllocConn(db); struct sqlResult *sr; char **row; struct chromInfo *el; sqlSafef(query, sizeof(query), "select chrom, size from chromInfo"); sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { el = chromInfoLoad(row); printf("chrom = %s, size = %d\n", el->chrom, el->size); } sqlFreeResult(&sr); hFreeConn(&conn); } int main(int argc, char *argv[]) { if (argc != 2) usage(); db = argv[1]; if (!hTableExists(db, "chromInfo")) errAbort("no chromInfo table in %s\n", db); getChroms(); return 0; }