]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make these vg_message.c functions local, they're no longer used outside the
authorNicholas Nethercote <njn@valgrind.org>
Sat, 12 Mar 2005 04:59:51 +0000 (04:59 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 12 Mar 2005 04:59:51 +0000 (04:59 +0000)
module, as VG_(vmessage)() superseded them.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3287

coregrind/vg_messages.c
include/tool.h.base

index 842c2bfc6057a5fc4b519906a93aad4d0a7c39a8..a971324cfeb358f695568188665a03d2b46b53cc 100644 (file)
@@ -64,11 +64,7 @@ static void add_timestamp ( Char *buf )
    return;
 }
 
-
-/* Publically visible from here onwards. */
-
-int
-VG_(add_to_msg) ( const Char *format, ... )
+int add_to_msg ( const Char *format, ... )
 {
    int count;
    va_list vargs;
@@ -78,33 +74,14 @@ VG_(add_to_msg) ( const Char *format, ... )
    return count;
 }
 
-int VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs )
-{
-   int count;
-   count = VG_(start_msg) ( kind );
-   count += VG_(vprintf) ( add_to_buf, format, vargs, 0 );
-   count += VG_(end_msg)();
-   return count;
-}
-
-/* Send a simple single-part message. */
-int VG_(message) ( VgMsgKind kind, const Char* format, ... )
-{
-   int count;
-   va_list vargs;
-   va_start(vargs,format);
-   count = VG_(vmessage) ( kind, format, vargs );
-   va_end(vargs);
-   return count;
-}
-
-int VG_(start_msg) ( VgMsgKind kind )
+int start_msg ( VgMsgKind kind )
 {
    Char ts[32];
    Char c;
    static const Char pfx[] = ">>>>>>>>>>>>>>>>";
    vg_n_mbuf = 0;
    vg_mbuf[vg_n_mbuf] = 0;
+
    if (VG_(clo_time_stamp))
      add_timestamp(ts);
    else
@@ -116,24 +93,44 @@ int VG_(start_msg) ( VgMsgKind kind )
       case Vg_ClientMsg:     c = '*'; break;
       default:               c = '?'; break;
    }
-   return VG_(add_to_msg)( "%s%c%c%s%d%c%c ", 
-                          &pfx[sizeof(pfx)-1-RUNNING_ON_VALGRIND],
-                          c,c, ts, VG_(getpid)(), c,c );
+   // The pfx trick prints one or more '>' characters in front of the
+   // messages when running Valgrind under Valgrind, one per level of
+   // self-hosting.
+   return add_to_msg( "%s%c%c%s%d%c%c ", 
+                      &pfx[sizeof(pfx)-1-RUNNING_ON_VALGRIND],
+                      c,c, ts, VG_(getpid)(), c,c );
 }
 
-
-int VG_(end_msg) ( void )
+int end_msg ( void )
 {
    int count = 0;
    if (VG_(clo_log_fd) >= 0) {
       add_to_buf('\n',0);
-      VG_(send_bytes_to_logging_sink) ( 
-         vg_mbuf, VG_(strlen)(vg_mbuf) );
+      VG_(send_bytes_to_logging_sink) ( vg_mbuf, VG_(strlen)(vg_mbuf) );
       count = 1;
    }
    return count;
 }
 
+int VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs )
+{
+   int count;
+   count = start_msg ( kind );
+   count += VG_(vprintf) ( add_to_buf, format, vargs, 0 );
+   count += end_msg();
+   return count;
+}
+
+/* Send a simple single-part message. */
+int VG_(message) ( VgMsgKind kind, const Char* format, ... )
+{
+   int count;
+   va_list vargs;
+   va_start(vargs,format);
+   count = VG_(vmessage) ( kind, format, vargs );
+   va_end(vargs);
+   return count;
+}
 
 /* Do the low-level send of a message to the logging sink. */
 void VG_(send_bytes_to_logging_sink) ( Char* msg, Int nbytes )
index 506afffe90a2b215e8ffc14fc1d3ced559fc4ebc..f8e5a45a836981b267a64c76d1a5ffdb2b4a5946 100644 (file)
@@ -193,12 +193,6 @@ typedef
    }
    VgMsgKind;
 
-/* Functions for building a message from multiple parts. */
-extern int VG_(start_msg)  ( VgMsgKind kind );
-extern int VG_(add_to_msg) ( const Char* format, ... );
-/* Ends and prints the message.  Appends a newline. */
-extern int VG_(end_msg)    ( void );
-
 /* Send a single-part message.  Appends a newline. */
 extern int VG_(message)    ( VgMsgKind kind, const Char* format, ... );
 extern int VG_(vmessage)   ( VgMsgKind kind, const Char* format, va_list vargs );