[PATCH] Rename string tree API functions

Straight substitution for ST_ functions -> STree_

diff -urN a/NQ/cl_demo.c head/NQ/cl_demo.c
--- a/NQ/cl_demo.c	2006-02-19 12:19:11.000000000 +1030
+++ head/NQ/cl_demo.c	2006-02-19 12:25:14.000000000 +1030
@@ -322,7 +322,7 @@
     root = Z_Malloc(sizeof(struct stree_root));
     if (root) {
 	*root = STREE_ROOT;
-	ST_AllocInit();
+	STree_AllocInit();
 	COM_ScanDir(root, "", arg, ".dem", true);
     }
 
diff -urN a/NQ/cmd.c head/NQ/cmd.c
--- a/NQ/cmd.c	2006-02-19 12:19:11.000000000 +1030
+++ head/NQ/cmd.c	2006-02-19 12:27:36.000000000 +1030
@@ -676,7 +676,7 @@
 
     for (cmd = cmd_functions; cmd; cmd = cmd->next) {
 	if (!strcasecmp(name, cmd->name) && cmd->completion) {
-	    /* FIXME - ST_AllocInit? */
+	    /* FIXME - STree_AllocInit? */
 	    root = cmd->completion(buf);
 	    break;
 	}
@@ -697,7 +697,7 @@
 
     root = Cmd_ArgCompletions(name, buf);
     if (root) {
-	result = ST_MaxMatch(root, buf);
+	result = STree_MaxMatch(root, buf);
 	Z_Free(root);
     }
 
diff -urN a/NQ/cmd.h head/NQ/cmd.h
--- a/NQ/cmd.h	2006-02-19 12:19:11.000000000 +1030
+++ head/NQ/cmd.h	2006-02-19 12:24:48.000000000 +1030
@@ -84,7 +84,7 @@
  * Command argument completion function.
  * Pass in the argument string
  * Returns a string tree of possible completions
- * Requires ST_Alloc_Init() prior to calling
+ * Requires STree_AllocInit() prior to calling
  */
 typedef struct stree_root *(*cmd_arg_f)(const char *);
 
diff -urN a/NQ/common.c head/NQ/common.c
--- a/NQ/common.c	2006-02-19 12:19:11.000000000 +1030
+++ head/NQ/common.c	2006-02-19 12:26:47.000000000 +1030
@@ -1338,7 +1338,7 @@
 	    if (fname) {
 		strncpy(fname, d->d_name, len);
 		fname[len] = '\0';
-		ST_InsertAlloc(root, fname, NULL);
+		STree_InsertAlloc(root, fname, NULL);
 		Z_Free(fname);
 	    }
 	}
@@ -1371,7 +1371,7 @@
 	    if (fname) {
 		strncpy(fname, pak_f, len);
 		fname[len] = '\0';
-		ST_InsertAlloc(root, fname, NULL);
+		STree_InsertAlloc(root, fname, NULL);
 		Z_Free(fname);
 	    }
 	}
@@ -1384,7 +1384,7 @@
 
 Scan the contents of a the given directory. Any filenames that match
 both the given prefix and extension are added to the string tree.
-Caller MUST have already called ST_AllocInit()
+Caller MUST have already called STree_AllocInit()
 ============
 */
 void
diff -urN a/NQ/host_cmd.c head/NQ/host_cmd.c
--- a/NQ/host_cmd.c	2006-02-19 12:19:11.000000000 +1030
+++ head/NQ/host_cmd.c	2006-02-19 12:24:21.000000000 +1030
@@ -308,7 +308,7 @@
     if (root) {
 	*root = STREE_ROOT;
 
-	ST_AllocInit();
+	STree_AllocInit();
 	COM_ScanDir(root, "maps", arg, ".bsp", true);
     }
     return root;
diff -urN a/QW/client/cl_demo.c head/QW/client/cl_demo.c
--- a/QW/client/cl_demo.c	2006-02-19 12:19:11.000000000 +1030
+++ head/QW/client/cl_demo.c	2006-02-19 12:24:02.000000000 +1030
@@ -759,7 +759,7 @@
     root = Z_Malloc(sizeof(struct stree_root));
     if (root) {
 	*root = STREE_ROOT;
-	ST_AllocInit();
+	STree_AllocInit();
 	COM_ScanDir(root, "", arg, ".qwd", true);
     }
 
diff -urN a/QW/client/cmd.h head/QW/client/cmd.h
--- a/QW/client/cmd.h	2006-02-19 12:19:11.000000000 +1030
+++ head/QW/client/cmd.h	2006-02-19 12:23:47.000000000 +1030
@@ -78,7 +78,7 @@
  * Command argument completion function.
  * Pass in the argument string
  * Returns a string tree of possible completions
- * Requires ST_Alloc_Init() prior to calling
+ * Requires STree_AllocInit() prior to calling
  */
 typedef struct stree_root *(*cmd_arg_f)(const char *);
 
diff -urN a/QW/common/cmd.c head/QW/common/cmd.c
--- a/QW/common/cmd.c	2006-02-19 12:19:11.000000000 +1030
+++ head/QW/common/cmd.c	2006-02-19 12:27:49.000000000 +1030
@@ -716,7 +716,7 @@
 
     for (cmd = cmd_functions; cmd; cmd = cmd->next) {
 	if (!strcasecmp(name, cmd->name) && cmd->completion) {
-	    /* FIXME - ST_AllocInit? */
+	    /* FIXME - STree_AllocInit? */
 	    root = cmd->completion(buf);
 	    break;
 	}
@@ -737,7 +737,7 @@
 
     root = Cmd_ArgCompletions(name, buf);
     if (root) {
-	result = ST_MaxMatch(root, buf);
+	result = STree_MaxMatch(root, buf);
 	Z_Free(root);
     }
 
diff -urN a/QW/common/common.c head/QW/common/common.c
--- a/QW/common/common.c	2006-02-19 12:19:11.000000000 +1030
+++ head/QW/common/common.c	2006-02-19 12:26:30.000000000 +1030
@@ -1426,7 +1426,7 @@
 	    if (fname) {
 		strncpy(fname, d->d_name, len);
 		fname[len] = '\0';
-		ST_InsertAlloc(root, fname, NULL);
+		STree_InsertAlloc(root, fname, NULL);
 		Z_Free(fname);
 	    }
 	}
@@ -1459,7 +1459,7 @@
 	    if (fname) {
 		strncpy(fname, pak_f, len);
 		fname[len] = '\0';
-		ST_InsertAlloc(root, fname, NULL);
+		STree_InsertAlloc(root, fname, NULL);
 		Z_Free(fname);
 	    }
 	}
@@ -1472,7 +1472,7 @@
 
 Scan the contents of a the given directory. Any filenames that match
 both the given prefix and extension are added to the string tree.
-Caller MUST have already called ST_AllocInit()
+Caller MUST have already called STree_AllocInit()
 ============
 */
 void
diff -urN a/QW/server/sv_ccmds.c head/QW/server/sv_ccmds.c
--- a/QW/server/sv_ccmds.c	2006-02-19 12:19:11.000000000 +1030
+++ head/QW/server/sv_ccmds.c	2006-02-19 12:22:46.000000000 +1030
@@ -348,7 +348,7 @@
     if (root) {
 	*root = STREE_ROOT;
 
-	ST_AllocInit();
+	STree_AllocInit();
 	COM_ScanDir(root, "maps", arg, ".bsp", true);
     }
     return root;
diff -urN a/common/console.c head/common/console.c
--- a/common/console.c	2006-02-19 12:19:11.000000000 +1030
+++ head/common/console.c	2006-02-19 12:22:27.000000000 +1030
@@ -748,7 +748,7 @@
     if (Cmd_Argc() == 2)
 	pfx = Cmd_Argv(1);
 
-    ST_AllocInit();
+    STree_AllocInit();
     COM_ScanDir(&st_root, "maps", pfx, ".bsp", true);
     Con_ShowTree(&st_root);
 }
diff -urN a/common/shell.c head/common/shell.c
--- a/common/shell.c	2006-02-19 12:19:11.000000000 +1030
+++ head/common/shell.c	2006-02-19 12:27:22.000000000 +1030
@@ -47,7 +47,7 @@
 #define ST_STRING_CHUNK	4096 /* 4k of strings together */
 
 void
-ST_AllocInit(void)
+STree_AllocInit(void)
 {
     /* Init the temp hunk */
     st_node_next = Hunk_TempAlloc(ST_NODE_CHUNK);
@@ -57,8 +57,8 @@
     st_string_space = 0;
 }
 
-struct stree_node *
-ST_AllocNode(void)
+static struct stree_node *
+STree_AllocNode(void)
 {
     struct stree_node *ret = NULL;
 
@@ -74,8 +74,8 @@
     return ret;
 }
 
-void *
-ST_AllocString(unsigned int length)
+static void *
+STree_AllocString(unsigned int length)
 {
     char *ret = NULL;
 
@@ -103,7 +103,7 @@
  * Insert string node "node" into rb_tree rooted at "root"
  */
 qboolean
-ST_Insert(struct stree_root *root, struct stree_node *node)
+STree_Insert(struct stree_root *root, struct stree_node *node)
 {
     struct rb_node **p = &root->root.rb_node;
     struct rb_node *parent = NULL;
@@ -140,24 +140,24 @@
  * NOTE: These allocations are only on the Temp hunk.
  */
 qboolean
-ST_InsertAlloc(struct stree_root *root, const char *s,
-	       struct stree_node *n)
+STree_InsertAlloc(struct stree_root *root, const char *s,
+		  struct stree_node *n)
 {
     qboolean ret = false;
 
     if (!n)
-	n = ST_AllocNode();
+	n = STree_AllocNode();
     if (n)
-	n->string = ST_AllocString(strlen(s) + 1);
+	n->string = STree_AllocString(strlen(s) + 1);
     if (n && n->string) {
 	strcpy(n->string, s);
-	ret = ST_Insert(root, n);
+	ret = STree_Insert(root, n);
     }
 
     return ret;
 }
 
-/* ST_MaxMatch helper */
+/* STree_MaxMatch helper */
 static int
 ST_node_match(struct rb_node *n, const char *str, int min_match, int max_match)
 {
@@ -185,7 +185,7 @@
  * the tree which match the given prefix.
  */
 char *
-ST_MaxMatch(struct stree_root *root, const char *pfx)
+STree_MaxMatch(struct stree_root *root, const char *pfx)
 {
     int max_match, min_match, match;
     struct rb_node *n;
diff -urN a/include/shell.h head/include/shell.h
--- a/include/shell.h	2006-02-19 12:19:11.000000000 +1030
+++ head/include/shell.h	2006-02-19 12:27:13.000000000 +1030
@@ -46,11 +46,11 @@
     struct rb_node node;
 };
 
-void ST_AllocInit(void);
-qboolean ST_Insert(struct stree_root *root, struct stree_node *node);
-qboolean ST_InsertAlloc(struct stree_root *root, const char *s,
-			struct stree_node *n);
-char *ST_MaxMatch(struct stree_root *root, const char *pfx);
+void STree_AllocInit(void);
+qboolean STree_Insert(struct stree_root *root, struct stree_node *node);
+qboolean STree_InsertAlloc(struct stree_root *root, const char *s,
+			   struct stree_node *n);
+char *STree_MaxMatch(struct stree_root *root, const char *pfx);
 
 /*
  * Set up some basic completion helpers
