src/inc/common.h 1.173
1.173 2010/05/29 22:24:53 kent
Adding some const to string function parameters to better work with C standard library code as callbacks.
Index: src/inc/common.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/common.h,v
retrieving revision 1.172
retrieving revision 1.173
diff -b -B -U 4 -r1.172 -r1.173
--- src/inc/common.h 29 May 2010 20:23:41 -0000 1.172
+++ src/inc/common.h 29 May 2010 22:24:53 -0000 1.173
@@ -516,8 +516,12 @@
int slNameCmp(const void *va, const void *vb);
/* Compare two slNames. */
+int slNameCmpStringsWithEmbeddedNumbers(const void *va, const void *vb);
+/* Compare strings such as gene names that may have embedded numbers,
+ * so that bmp4a comes before bmp14a */
+
void slNameSortCase(struct slName **pList);
/* Sort slName list, ignore case. */
void slNameSort(struct slName **pList);
@@ -639,12 +643,12 @@
* (Actually plain old freeMem does that these days.) */
/******* Some stuff for processing strings. *******/
-char *cloneStringZ(char *s, int size);
+char *cloneStringZ(const char *s, int size);
/* Make a zero terminated copy of string in memory */
-char *cloneString(char *s);
+char *cloneString(const char *s);
/* Make copy of string in dynamic memory */
char *cloneLongString(char *s);
/* Make clone of long string. */
@@ -680,13 +684,13 @@
#define isEmpty(string) (string == NULL || string[0] == 0)
#define isNotEmpty(string) (! isEmpty(string))
-int cmpStringsWithEmbeddedNumbers(char *a, char *b);
+int cmpStringsWithEmbeddedNumbers(const char *a, const char *b);
/* Compare strings such as gene names that may have embedded numbers,
* so that bmp4a comes before bmp14a */
-int cmpWordsWithEmbeddedNumbers(char *a, char *b);
+int cmpWordsWithEmbeddedNumbers(const char *a, const char *b);
/* Case insensitive version of cmpStringsWithEmbeddedNumbers. */
boolean startsWith(const char *start, const char *string);
/* Returns TRUE if string begins with start. */
@@ -797,12 +801,12 @@
int countLeadingChars(char *s, char c);
/* Count number of characters c at start of string. */
-int countLeadingDigits(char *s);
+int countLeadingDigits(const char *s);
/* Return number of leading digits in s */
-int countLeadingNondigits(char *s);
+int countLeadingNondigits(const char *s);
/* Count number of leading non-digit characters in s. */
int countSame(char *a, char *b);
/* Count number of characters that from start in a,b that are same. */