Move string_move() into miscutil.c and make it extern
authorFabian Keil <fk@fabiankeil.de>
Sat, 24 Nov 2012 13:58:17 +0000 (13:58 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 24 Nov 2012 13:58:17 +0000 (13:58 +0000)
It's not really a parser.

miscutil.c
miscutil.h
parsers.c

index bbfba61..f04344c 100644 (file)
@@ -1,4 +1,4 @@
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.76 2012/03/09 17:55:50 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.77 2012/07/23 12:41:59 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.c,v $
@@ -524,6 +524,31 @@ char *string_toupper(const char *string)
 }
 
 
 }
 
 
+/*********************************************************************
+ *
+ * Function    :  string_move
+ *
+ * Description :  memmove wrapper to move the last part of a string
+ *                towards the beginning, overwriting the part in
+ *                the middle. strlcpy() can't be used here as the
+ *                strings overlap.
+ *
+ * Parameters  :
+ *          1  :  dst = Destination to overwrite
+ *          2  :  src = Source to move.
+ *
+ * Returns     :  N/A
+ *
+ *********************************************************************/
+void string_move(char *dst, char *src)
+{
+   assert(dst < src);
+
+   /* +1 to copy the terminating nul as well. */
+   memmove(dst, src, strlen(src)+1);
+}
+
+
 /*********************************************************************
  *
  * Function    :  bindup
 /*********************************************************************
  *
  * Function    :  bindup
index bf35238..6c51ee9 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef MISCUTIL_H_INCLUDED
 #define MISCUTIL_H_INCLUDED
 #ifndef MISCUTIL_H_INCLUDED
 #define MISCUTIL_H_INCLUDED
-#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.35 2012/03/04 11:52:45 fabiankeil Exp $"
+#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.36 2012/07/23 12:41:59 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.h,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.h,v $
@@ -60,8 +60,9 @@ extern int strncmpic(const char *s1, const char *s2, size_t n);
 
 extern jb_err string_append(char **target_string, const char *text_to_append);
 extern jb_err string_join  (char **target_string,       char *text_to_append);
 
 extern jb_err string_append(char **target_string, const char *text_to_append);
 extern jb_err string_join  (char **target_string,       char *text_to_append);
-
 extern char *string_toupper(const char *string);
 extern char *string_toupper(const char *string);
+extern void string_move(char *dst, char *src);
+
 extern char *chomp(char *string);
 extern char *bindup(const char *string, size_t len);
 
 extern char *chomp(char *string);
 extern char *bindup(const char *string, size_t len);
 
index 2f3b4f4..a785d82 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.264 2012/11/11 12:41:12 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.265 2012/11/24 13:57:30 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -738,31 +738,6 @@ jb_err decompress_iob(struct client_state *csp)
 #endif /* defined(FEATURE_ZLIB) */
 
 
 #endif /* defined(FEATURE_ZLIB) */
 
 
-/*********************************************************************
- *
- * Function    :  string_move
- *
- * Description :  memmove wrapper to move the last part of a string
- *                towards the beginning, overwriting the part in
- *                the middle. strlcpy() can't be used here as the
- *                strings overlap.
- *
- * Parameters  :
- *          1  :  dst = Destination to overwrite
- *          2  :  src = Source to move.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-static void string_move(char *dst, char *src)
-{
-   assert(dst < src);
-
-   /* +1 to copy the terminating nul as well. */
-   memmove(dst, src, strlen(src)+1);
-}
-
-
 /*********************************************************************
  *
  * Function    :  normalize_lws
 /*********************************************************************
  *
  * Function    :  normalize_lws