0b410a16e4139b5648ae6296a6f04c66f528beb6 kent Thu Oct 28 14:49:40 2010 -0700 Adding catTwoStrings to common library. diff --git src/inc/common.h src/inc/common.h index a87a51a..80efaab 100644 --- src/inc/common.h +++ src/inc/common.h @@ -631,56 +631,60 @@ void slPairFreeVals(struct slPair *list); /* Free up all values on list. */ void slPairFreeValsAndList(struct slPair **pList); /* Free up all values on list and list itself */ struct slPair *slPairFind(struct slPair *list, char *name); /* Return list element of given name, or NULL if not found. */ void *slPairFindVal(struct slPair *list, char *name); /* Return value associated with name in list, or NULL if not found. */ struct slPair *slPairFromString(char *s); /* Return slPair list parsed from list in string s * name1=val1 name2=val2 ... - * Returns NULL if parse error */ + * Returns NULL if parse error. Free this up with + * slPairFreeValsAndList. */ int slPairCmpCase(const void *va, const void *vb); /* Compare two slPairs, ignore case. */ void slPairSortCase(struct slPair **pList); /* Sort slPair list, ignore case. */ int slPairCmp(const void *va, const void *vb); /* Compare two slPairs. */ void gentleFree(void *pt); /* check pointer for NULL before freeing. * (Actually plain old freeMem does that these days.) */ /******* Some stuff for processing strings. *******/ char *cloneStringZ(const char *s, int size); /* Make a zero terminated copy of string in memory */ char *cloneString(const char *s); /* Make copy of string in dynamic memory */ char *cloneLongString(char *s); /* Make clone of long string. */ +char *catTwoStrings(char *a, char *b); +/* Allocate new string that is a concatenation of two strings. */ + int differentWord(char *s1, char *s2); /* strcmp ignoring case - returns zero if strings are * the same (ignoring case) otherwise returns difference * between first non-matching characters. */ #define sameWord(a,b) (!differentWord(a,b)) /* Return TRUE if two strings are same ignoring case */ #define differentString(a,b) (strcmp(a,b)) /* Returns FALSE if two strings same. */ int differentStringNullOk(char *a, char *b); /* Returns 0 if two strings (either of which may be NULL) * are the same. Otherwise it returns a positive or negative * number depending on the alphabetical order of the two