Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79489 - in trunk/tools/build/v2/engine: . modules
From: jurko.gospodnetic_at_[hidden]
Date: 2012-07-13 19:14:41


Author: jurko
Date: 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
New Revision: 79489
URL: http://svn.boost.org/trac/boost/changeset/79489

Log:
Boost Jam code cleanup - cleaned up the timestamp.c module identifiers and better commented its functions.
Text files modified:
   trunk/tools/build/v2/engine/builtins.c | 2 +-
   trunk/tools/build/v2/engine/jam.c | 2 +-
   trunk/tools/build/v2/engine/modules/path.c | 2 +-
   trunk/tools/build/v2/engine/search.c | 6 +++---
   trunk/tools/build/v2/engine/timestamp.c | 32 ++++++++++++++++++++++++--------
   trunk/tools/build/v2/engine/timestamp.h | 4 ++--
   6 files changed, 32 insertions(+), 16 deletions(-)

Modified: trunk/tools/build/v2/engine/builtins.c
==============================================================================
--- trunk/tools/build/v2/engine/builtins.c (original)
+++ trunk/tools/build/v2/engine/builtins.c 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
@@ -755,7 +755,7 @@
 static LIST * append_if_exists( LIST * list, OBJECT * file )
 {
     time_t time;
- timestamp( file, &time );
+ timestamp_from_target( file, &time );
     return time > 0
         ? list_push_back( list, object_copy( file ) )
         : list;

Modified: trunk/tools/build/v2/engine/jam.c
==============================================================================
--- trunk/tools/build/v2/engine/jam.c (original)
+++ trunk/tools/build/v2/engine/jam.c 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
@@ -562,7 +562,7 @@
     /* Widely scattered cleanup. */
     file_done();
     rules_done();
- stamps_done();
+ timestamp_done();
     search_done();
     class_done();
     modules_done();

Modified: trunk/tools/build/v2/engine/modules/path.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/path.c (original)
+++ trunk/tools/build/v2/engine/modules/path.c 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
@@ -10,7 +10,7 @@
 LIST * path_exists( FRAME * frame, int flags )
 {
     time_t time;
- timestamp( list_front( lol_get( frame->args, 0 ) ), &time );
+ timestamp_from_target( list_front( lol_get( frame->args, 0 ) ), &time );
     return time ? list_new( object_new( "true" ) ) : L0;
 }
 

Modified: trunk/tools/build/v2/engine/search.c
==============================================================================
--- trunk/tools/build/v2/engine/search.c (original)
+++ trunk/tools/build/v2/engine/search.c 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
@@ -127,7 +127,7 @@
         explicitly_located = 1;
 
         key = object_new( buf->value );
- timestamp( key, time );
+ timestamp_from_target( key, time );
         object_free( key );
         found = 1;
     }
@@ -156,7 +156,7 @@
             key = path_as_key( test_path );
             object_free( test_path );
             ff = file_query( key );
- timestamp( key, time );
+ timestamp_from_target( key, time );
 
             if ( ( ba = (BINDING *)hash_find( explicit_bindings, key ) ) )
             {
@@ -200,7 +200,7 @@
             printf( "search %s: %s\n", object_str( target ), buf->value );
 
         key = object_new( buf->value );
- timestamp( key, time );
+ timestamp_from_target( key, time );
         object_free( key );
     }
 

Modified: trunk/tools/build/v2/engine/timestamp.c
==============================================================================
--- trunk/tools/build/v2/engine/timestamp.c (original)
+++ trunk/tools/build/v2/engine/timestamp.c 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
@@ -12,6 +12,15 @@
 
 /*
  * timestamp.c - get the timestamp of a file or archive member
+ *
+ * External routines:
+ * timestamp_from_target() - return timestamp on a file, if present
+ * timestamp_done() - free timestamp tables
+ *
+ * Internal routines:
+ * time_enter() - internal worker callback for scanning archives &
+ * directories
+ * free_timestamps() - worker function for freeing timestamp table contents
  */
 
 #include "jam.h"
@@ -28,9 +37,7 @@
  * BINDING - all known files
  */
 
-typedef struct _binding BINDING;
-
-struct _binding {
+typedef struct _binding {
     OBJECT * name;
     short flags;
 
@@ -46,7 +53,7 @@
 
     /* update time - 0 if not exist */
     time_t time;
-};
+} BINDING;
 
 static struct hash * bindhash = 0;
 static void time_enter( void *, OBJECT *, int const found, time_t );
@@ -62,10 +69,10 @@
 
 
 /*
- * timestamp() - return timestamp on a file, if present.
+ * timestamp_from_target() - return timestamp on a file, if present
  */
 
-void timestamp( OBJECT * target, time_t * time )
+void timestamp_from_target( OBJECT * target, time_t * time )
 {
     PROFILE_ENTER( timestamp );
 
@@ -180,6 +187,10 @@
 }
 
 
+/*
+ * time_enter() - internal worker callback for scanning archives & directories
+ */
+
 static void time_enter( void * closure, OBJECT * target, int const found,
     time_t time )
 {
@@ -206,6 +217,11 @@
     object_free( target );
 }
 
+
+/*
+ * free_timestamps() - worker function for freeing timestamp table contents
+ */
+
 static void free_timestamps( void * xbinding, void * data )
 {
     object_free( ((BINDING *)xbinding)->name );
@@ -213,10 +229,10 @@
 
 
 /*
- * stamps_done() - free timestamp tables.
+ * timestamp_done() - free timestamp tables
  */
 
-void stamps_done()
+void timestamp_done()
 {
     if ( bindhash )
     {

Modified: trunk/tools/build/v2/engine/timestamp.h
==============================================================================
--- trunk/tools/build/v2/engine/timestamp.h (original)
+++ trunk/tools/build/v2/engine/timestamp.h 2012-07-13 19:14:40 EDT (Fri, 13 Jul 2012)
@@ -15,7 +15,7 @@
 
 #include <time.h>
 
-void timestamp( OBJECT * target, time_t * time );
-void stamps_done();
+void timestamp_from_target( OBJECT * target, time_t * time );
+void timestamp_done();
 
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk