77a1a4c6ee6c882e187f1fc80b531c0e61f957cd
chmalee
  Tue Nov 19 15:23:59 2024 -0800
Be more intelligent about producing default hub names, don't die when a hub exists already and we are adding another file to it

diff --git src/hg/inc/userdata.h src/hg/inc/userdata.h
index bd6d0bf..c6360d3 100644
--- src/hg/inc/userdata.h
+++ src/hg/inc/userdata.h
@@ -70,30 +70,33 @@
 void removeHubForUser(char *path, char *userName);
 /* Remove a hub directory for this user (and all files in the directory), if it exists */
 
 struct userHubs *listHubsForUser(char *userName);
 /* Lists the directories for a particular user */
 
 time_t getHubLatestTime(struct userHubs *hub);
 /* Return the latest access time of the files in a hub */
 
 struct userFiles *listFilesForUserHub(char *userName, char *hubName);
 /* Get all the files for a particular hub for a particular user */
 
 struct hubSpace *listFilesForUser(char *userName);
 /* Return the files the user has uploaded */
 
+char *defaultHubNameForUser(char *userName);
+/* Return a name to use as a default for a hub, starts with myFirstHub, then myFirstHub2, ... */
+
 long long getMaxUserQuota(char *userName);
 /* Return how much space is allocated for this user or the default */
 
 long long checkUserQuota(char *userName);
 /* Return the amount of space a user is currently using */
 
 char *storeUserFile(char *userName, char *fileName, void *data, size_t dataSize);
 /* Give a fileName and a data stream, write the data to:
  * userdata/userStore/hashedUserName/userName/fileName
  * where hashedUserName is based on the md5sum of the userName
  * to prevent proliferation of too many directories. 
  *
  * After sucessfully saving the file, return a web accessible url
  * to the file. */