9bc8d3c62d5b420e0ecbd9afe87c9a52c4103739
angie
  Fri Oct 25 10:56:05 2024 -0700
Move sessionData.c up from hgSession/ to lib/ so that hgPhyloPlace can use sessionDataSaveTrashFile.

diff --git src/hg/inc/sessionData.h src/hg/inc/sessionData.h
new file mode 100644
index 0000000..2c2a1a2
--- /dev/null
+++ src/hg/inc/sessionData.h
@@ -0,0 +1,21 @@
+/* sessionData - functions for moving user data out of trash into permanent storage
+ *
+ * Copyright (C) 2019-2024 The Regents of the University of California
+ * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
+
+#ifndef SESSIONDATA_H
+#define SESSIONDATA_H
+
+char *sessionDataSaveTrashFile(char *trashPath, char *sessionDir);
+/* If trashPath exists and is not already a soft-link to sessionDir, alloc and return a new path in
+ * sessionDir; move trashPath to new path and soft-link from trashPath to new path.
+ * If trashPath is already a soft-link, return the path that it links to.
+ * Return NULL if trashPath does not exist (can happen with expired custom track files). */
+
+void sessionDataSaveSession(struct cart *cart, char *encUserName, char *encSessionName,
+                            char *dbSuffix);
+/* If hg.conf specifies safe places to store files and/or tables that belong to user sessions,
+ * then scan cart for trashDir files and/or customTrash tables, store them in safe locations,
+ * and update cart to point to the new locations. */
+
+#endif // SESSIONDATA_H