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/lib/findKGProtAlias.c src/hg/lib/findKGProtAlias.c
index 3957bfc..bd9e637 100644
--- src/hg/lib/findKGProtAlias.c
+++ src/hg/lib/findKGProtAlias.c
@@ -1,64 +1,67 @@
 /* findKGProtAlias finds Known Gene entries using protein alias table */
+
+/* Copyright (C) 2014 The Regents of the University of California 
+ * See README in this or parent directory for licensing information. */
 #include "common.h"
 #include "hCommon.h"
 #include "hdb.h"
 #include "errabort.h"
 #include "kgProtAlias.h"
 
 static void addKGProtAlias(struct sqlConnection *conn, struct dyString *query,
        struct kgProtAlias **pList)
 /* Query database and add returned kgProtAlias to head of list. */
 {
 struct sqlResult *sr = sqlGetResult(conn, query->string);
 char **row;
 while ((row = sqlNextRow(sr)) != NULL)
     {
     struct kgProtAlias *kl = kgProtAliasLoad(row);
     slAddHead(pList, kl);
     }
 sqlFreeResult(&sr);
 }
 
 struct kgProtAlias *findKGProtAlias(char *dataBase, char *spec, char *mode)
 {
 /* findKGProtAlias looks up protein aliases for Known Genes, given a seach spec 
 
 	mode "E" is for Exact match
  	mode "F" is for Fuzzy match
  	mode "P" is for Prefix match
 
    it returns a link list of kgProtAlias nodes, which contain kgID, displayID, and alias 
 */
 struct sqlConnection *conn  = hAllocConn(dataBase);
 struct dyString      *ds    = newDyString(256);
 struct kgProtAlias *kapList = NULL;
 char   fullTableName[256];
 
 safef(fullTableName, 250, "%s.%s", dataBase, "kgProtAlias");
 if (!sqlTableExists(conn, fullTableName))
     {
     errAbort("Table %s.kgProtAlias does not exist.\n", dataBase);
     }
 
 if (sameString(mode, "E"))
     {
     sqlDyStringPrintf(ds, "select * from %s.kgProtAlias where alias = '%s'", dataBase, spec);
     }
 else if (sameString(mode, "F"))
     {
     sqlDyStringPrintf(ds, "select * from %s.kgProtAlias where alias like '%%%s%%'", dataBase, spec);
     }
 else if (sameString(mode, "P"))
     {
     sqlDyStringPrintf(ds, "select * from %s.kgProtAlias where alias like '%s%%'", dataBase, spec);
     }
 else
     {
     errAbort("%s is not a valid mode for findKGAlias()\n", mode);
     }
 
 addKGProtAlias(conn, ds, &kapList);
 hFreeConn(&conn);
 
 return(kapList);
 }