src/inc/common.h 1.152
1.152 2009/06/26 19:57:54 tdreszer
Added strSwapStrs like replaceChrs but swaps in place.
Index: src/inc/common.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/common.h,v
retrieving revision 1.151
retrieving revision 1.152
diff -b -B -U 4 -r1.151 -r1.152
--- src/inc/common.h 3 Jun 2009 00:34:10 -0000 1.151
+++ src/inc/common.h 26 Jun 2009 19:57:54 -0000 1.152
@@ -286,8 +286,9 @@
#if defined(__GNUC__)
__attribute__((format(printf, 2, 3)))
#endif
;
+#define debugMsg(verbosity, format, args...) { verbose(verbosity,"[%s(%d)::%s] ", __FILE__, __LINE__, __func__); verbose(verbosity, format, ##args); }
void verboseTime(int verbosity, char *label, ...)
/* Print label and how long it's been since last call. Call with
* a NULL label to initialize. Verbosity level 1 */
@@ -736,8 +737,12 @@
Can take any length string.
Return value needs to be freeMem'd.
*/
+int strSwapStrs(char *string, int sz,char *old, char *new);
+/* Swaps all occurnces of the old with the new in string. Need not be same size
+ Swaps in place but restricted by sz. Returns count of swaps or -1 for sz failure.*/
+
char * memSwapChar(char *s, int len, char oldChar, char newChar);
/* Substitute newChar for oldChar throughout memory of given length.
old or new may be null */
#define strSwapChar(s,old,new) memSwapChar((s),strlen(s),(old),(new))