Revision: 76962
          http://sourceforge.net/p/brlcad/code/76962
Author:   d_rossberg
Date:     2020-08-26 13:11:27 +0000 (Wed, 26 Aug 2020)
Log Message:
-----------
don't want to duplicate db5_diradd() and db5_diradd_handler() because of 
setting a single flag -  used the free client_data parameter instead
maybe there is a better posibility to detect an inmem directory handle which I 
don't know

Modified Paths:
--------------
    brlcad/trunk/src/librt/db5_scan.c

Modified: brlcad/trunk/src/librt/db5_scan.c
===================================================================
--- brlcad/trunk/src/librt/db5_scan.c   2020-08-26 13:10:10 UTC (rev 76961)
+++ brlcad/trunk/src/librt/db5_scan.c   2020-08-26 13:11:27 UTC (rev 76962)
@@ -246,10 +246,6 @@
 
     RT_CK_DBI(dbip);
 
-    if (client_data && RT_G_DEBUG&RT_DEBUG_DB) {
-       bu_log("WARNING: db5_diradd() received non-NULL client_data\n");
-    }
-
     bu_vls_strcpy(&local, (const char *)rip->name.ext_buf);
     if (db_dircheck(dbip, &local, 0, &headp) < 0) {
        bu_vls_free(&local);
@@ -303,6 +299,8 @@
     }
     if (rip->h_name_hidden)
        dp->d_flags |= RT_DIR_HIDDEN;
+    if (client_data && (*((int*)client_data) == 1))
+       dp->d_flags |= RT_DIR_INMEM;
     dp->d_len = rip->object_length;            /* in bytes */
     BU_LIST_INIT(&dp->d_use_hd);
     dp->d_animate = NULL;
@@ -486,11 +484,12 @@
        struct db5_raw_internal raw;
        struct bu_attribute_value_set avs;
        const char *cp;
+       int inmem_flag = 1;
 
        bu_avs_init_empty(&avs);
 
        /* File is v5 format */
-       if (db5_scan_inmem(dbip, db5_diradd_handler, NULL, data, data_size) < 
0) {
+       if (db5_scan_inmem(dbip, db5_diradd_handler, &inmem_flag, data, 
data_size) < 0) {
            bu_log("db_dirbuild_inmem(): db5_scan_inmem() failed\n");
            return -1;
        }

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to