Revision: 57226
          http://sourceforge.net/p/brlcad/code/57226
Author:   tbrowder2
Date:     2013-08-28 17:41:51 +0000 (Wed, 28 Aug 2013)
Log Message:
-----------
add func to update attr creation or modification times

Modified Paths:
--------------
    brlcad/trunk/src/libbu/avs.c

Modified: brlcad/trunk/src/libbu/avs.c
===================================================================
--- brlcad/trunk/src/libbu/avs.c        2013-08-28 17:22:51 UTC (rev 57225)
+++ brlcad/trunk/src/libbu/avs.c        2013-08-28 17:41:51 UTC (rev 57226)
@@ -27,7 +27,19 @@
 
 #define AVS_ALLOCATION_INCREMENT 32
 
+void
+bu_avs_set_date(struct bu_attribute_value_pair *app, const char* typ)
+{
+    /* save the current time */
+    time_t curr_time = time(0);
+    const int typ_is_created = BU_STR_EQUAL(typ, "created") ? 1 : 0;
 
+    if (typ_is_created)
+        app->created = (int64_t)curr_time;
+    else
+        app->modified = (int64_t)curr_time;
+}
+
 void
 bu_avs_init_empty(struct bu_attribute_value_set *avsp)
 {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to