From 316501c79abac54bc1cfe08c7dff3562368ca18b Mon Sep 17 00:00:00 2001
From: Ann Priestman <apriestman@basistech.com>
Date: Thu, 6 Feb 2020 11:12:53 -0500
Subject: [PATCH] Added comments

---
 tsk/auto/auto_db.cpp       | 12 +++++++++++-
 tsk/auto/db_postgresql.cpp | 10 ++++++++++
 tsk/auto/db_sqlite.cpp     | 14 ++++++++++++++
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/tsk/auto/auto_db.cpp b/tsk/auto/auto_db.cpp
index 29f1c342f..0fdfdf670 100755
--- a/tsk/auto/auto_db.cpp
+++ b/tsk/auto/auto_db.cpp
@@ -334,6 +334,13 @@ TskAutoDb::filterPool(const TSK_POOL_INFO * pool_info)
     return TSK_FILTER_CONT;
 }
 
+/**
+* Adds unallocated pool blocks to a new volume.
+*
+* @param numPool Will be updated with the number of pools processed
+*
+* @return Returns 0 for success, 1 for failure
+*/
 TSK_RETVAL_ENUM
 TskAutoDb::addUnallocatedPoolBlocksToDb(size_t & numPool) {
 
@@ -359,12 +366,15 @@ TskAutoDb::addUnallocatedPoolBlocksToDb(size_t & numPool) {
         if (pool_info->ctype != TSK_POOL_TYPE_APFS) {
             continue;
         }
+
+        /* Increment the count of pools found */
         numPool++;
 
-        // Create the volume
+        /* Create the volume */
         int64_t unallocVolObjId;
         m_db->addUnallocatedPoolVolume(pool_info->num_vols, curPoolVs, unallocVolObjId);
 
+        /* Create the unallocated space files */
         TSK_FS_ATTR_RUN * unalloc_runs = tsk_pool_unallocated_runs(pool_info);
         TSK_FS_ATTR_RUN * current_run = unalloc_runs;
         vector<TSK_DB_FILE_LAYOUT_RANGE> ranges;
diff --git a/tsk/auto/db_postgresql.cpp b/tsk/auto/db_postgresql.cpp
index 03189f8f8..7de8a0a98 100755
--- a/tsk/auto/db_postgresql.cpp
+++ b/tsk/auto/db_postgresql.cpp
@@ -1054,6 +1054,11 @@ TskDbPostgreSQL::addPoolInfoAndVS(const TSK_POOL_INFO *pool_info, int64_t parObj
 
 /**
 * Adds the sector addresses of the pool volumes into the db.
+*
+* @param pool_vol The pool volume to save to the DB
+* @param parObjId The ID of the parent of the pool volume (should be a volume system)
+* @param objId    Will be set to the object ID of the new volume
+*
 * @returns 1 on error, 0 on success
 */
 int
@@ -1085,6 +1090,11 @@ TskDbPostgreSQL::addPoolVolumeInfo(const TSK_POOL_VOLUME_INFO* pool_vol,
 
 /**
 * Adds a fake volume that will hold the unallocated blocks for the pool.
+*
+* @param vol_index The index for the new volume (should be one higher than the number of pool volumes)
+* @param parObjId  The object ID of the parent volume system
+* @param objId     Will be set to the object ID of the new volume
+*
 * @returns 1 on error, 0 on success
 */
 int
diff --git a/tsk/auto/db_sqlite.cpp b/tsk/auto/db_sqlite.cpp
index 7db4f9c88..79f9feca6 100644
--- a/tsk/auto/db_sqlite.cpp
+++ b/tsk/auto/db_sqlite.cpp
@@ -796,6 +796,11 @@ TskDbSqlite::addPoolInfoAndVS(const TSK_POOL_INFO *pool_info, int64_t parObjId,
 
 /**
 * Adds a fake volume that will hold the unallocated blocks for the pool.
+*
+* @param vol_index The index for the new volume (should be one higher than the number of pool volumes)
+* @param parObjId  The object ID of the parent volume system
+* @param objId     Will be set to the object ID of the new volume
+*
 * @returns 1 on error, 0 on success
 */
 int
@@ -820,6 +825,15 @@ TskDbSqlite::addUnallocatedPoolVolume(int vol_index, int64_t parObjId, int64_t&
     return ret;
 }
 
+/**
+* Adds the sector addresses of the pool volumes into the db.
+*
+* @param pool_vol The pool volume to save to the DB
+* @param parObjId The ID of the parent of the pool volume (should be a volume system)
+* @param objId    Will be set to the object ID of the new volume
+*
+* @returns 1 on error, 0 on success
+*/
 int
 TskDbSqlite::addPoolVolumeInfo(const TSK_POOL_VOLUME_INFO* pool_vol,
     int64_t parObjId, int64_t& objId)
-- 
GitLab