cadb863ddfbcc1f97b04f0d0b8ef73db862dd060
tdreszer
  Thu Jul 28 16:32:04 2011 -0700
Fixed some hash sizes, moved some validation code from mdb.c to cv.c, added numeric sort of hgFileUi filerBy and track/file search of terms defined in cv validation as integer.
diff --git src/hg/inc/cv.h src/hg/inc/cv.h
index 16b9059..8415505 100644
--- src/hg/inc/cv.h
+++ src/hg/inc/cv.h
@@ -93,30 +93,49 @@
 
 enum cvSearchable
 // metadata Variavble are only certain declared types
     {
     cvNotSearchable        =0,  // Txt is default
     cvSearchByMultiSelect  =1,  // Search by drop down multi-select of supplied list (NOT YET IMPLEMENTED)
     cvSearchBySingleSelect =2,  // Search by drop down single-select of supplied list
     cvSearchByFreeText     =3,  // Search by free text field (NOT YET IMPLEMENTED)
     cvSearchByDateRange    =4,  // Search by discovered date range (NOT YET IMPLEMENTED)
     cvSearchByIntegerRange =5   // Search by discovered integer range (NOT YET IMPLEMENTED)
     };
 
 enum cvSearchable cvSearchMethod(const char *term);
 // returns whether the term is searchable
 
+const char *cvValidationRule(const char *term);
+// returns validation rule, trimmed of comment
+
+enum cvDataType
+// CV term may be recognizable as int or float
+    {
+    cvIndeterminant        =0,  // Indeterminant, likely string
+    cvString               =1,  // Just about all terms are strings
+    cvInteger              =2,  // Some are known integers
+    cvFloat                =3,  // Floats are possible
+    cvDate                 =4,  // Dates are expected as YYYY-MM-DD
+    };
+
+enum cvDataType cvDataType(const char *term);
+// returns the dataType if it can be determined
+
+boolean cvValidateTerm(const char *term,const char *val,char *reason,int len);
+// returns TRUE if term is valid.  Can pass in a reason buffer of len to get reason.
+
 const char *cvLabel(const char *term);
 // returns cv label if term found or else just term
 
 const char *cvTag(const char *type,const char *term);
 // returns cv Tag if term found or else NULL
 
 boolean cvTermIsHidden(const char *term);
 // returns TRUE if term is defined as hidden in cv.ra
 
 boolean cvTermIsEmpty(const char *term,const char *val);
 // returns TRUE if term has validation of "cv or None" and the val is None
 
 char *cvLabNormalize(const char *sloppyTerm);
 /* CV inconsistency work-arounds.  Return lab name trimmed of parenthesized trailing
  * info (a few ENCODE labs have this in metaDb and/or in CV term --