Index: /trunk/gsdl/src/w32server/cgiwrapper.cpp
===================================================================
--- /trunk/gsdl/src/w32server/cgiwrapper.cpp	(revision 3809)
+++ /trunk/gsdl/src/w32server/cgiwrapper.cpp	(revision 3810)
@@ -689,5 +689,5 @@
   char *mimec = mime.getcstr();
   if (send_header(mimec, RInfo) >= 0) {
-    if (strcmpi(RFields->MethodStr, "HEAD") != 0) {
+    if (RFields->MethodStr != "HEAD") {
       for (;;) {
         nr = fread(buffer, 1, 2048, thefile);
Index: /trunk/gsdl/src/w32server/httpreq.cpp
===================================================================
--- /trunk/gsdl/src/w32server/httpreq.cpp	(revision 3809)
+++ /trunk/gsdl/src/w32server/httpreq.cpp	(revision 3810)
@@ -26,5 +26,4 @@
  *********************************************************************/
 
-#include "text_t.h"
 #include <windows.h>
 #include <stdlib.h>
@@ -32,9 +31,8 @@
 #include <string.h>
 #include <memory.h>
-#pragma hdrstop
+#include "httpreq.h"
 #include "parse.h"
 #include "netio.h"
 #include "settings.h"
-#include "httpreq.h" //Had to put myself here because of the global types...
 #include "httpsrv.h"
 #include "httpsend.h"
@@ -54,6 +52,4 @@
 #define IO_BUFFER_SIZE 16384        //16K IO Buffer
 #define MAX_HTTP_LINE_LEN 1024      //Max length of line in a header of 1024
-#define MAX_HTTP_FIELD_NAME_LEN 128 //Max length of name field in line
-#define MAX_HTTP_FIELD_LEN 1024     //Max length of data in line
 
 //Private Function Declarations with Return Contstants
@@ -219,15 +215,14 @@
 int GetHTTPHeaders(RequestInfoT &RequestInfo, RequestFieldsT &RequestFields) {
   //Parsing and IO buffers
-  char CurLine[NETIO_MAX_LINE];
-  char NextLine[NETIO_MAX_LINE];
-  char FieldNameStr[MAX_HTTP_FIELD_NAME_LEN];
-  char FieldValStr[MAX_HTTP_FIELD_LEN];
+  text_t CurLine;
+  text_t NextLine;
+  text_t FieldNameStr;
+  text_t FieldValStr;
   
   //Parsing and IO working vars
   int ReadBufferIndex;
   int DataInBuffer;
-  int Start;
-  int End;
-  int Len;
+  text_t::const_iterator next;
+  text_t::const_iterator end;
 
   //Clear all the fields
@@ -245,27 +240,26 @@
 	       RequestInfo.IOBufferSize, ReadBufferIndex, DataInBuffer,
 	       RequestInfo.ThreadNum) != 0) return GH_ERROR;
-    if ((NextLine[0] == ' ') || (NextLine[0] == '\t'))
-      strcat(CurLine, NextLine);
-  } while ((NextLine[0] == ' ') || (NextLine[0] == '\t'));
+    if ((*(NextLine.begin()) == ' ') || (*(NextLine.begin()) == '\t')) {
+      CurLine += NextLine;
+    }
+  } while ((*(NextLine.begin()) == ' ') || (*(NextLine.begin()) == '\t'));
   //Method String (first word)
-  Start = 0;
-  GetWord(RequestFields.MethodStr, CurLine, Start, End);
-  CharUpper(RequestFields.MethodStr);
+  GetWord(RequestFields.MethodStr, CurLine.begin(), CurLine.end(), next);
+  uc(RequestFields.MethodStr);
 
   /* Added Feb 2002 - IE since about version 5 send stupid frontpage requests
      for MS Document formats eg "GET /_vti_inf.html" */ 
-  if (strcmp(RequestFields.MethodStr,"OPTIONS")==0) {
-	return GH_BAD_METHOD;
+  if (RequestFields.MethodStr == "OPTIONS") {
+    return GH_BAD_METHOD;
   } 
   //Version String (last word)
-  GetLastWord(RequestFields.VersionStr, CurLine, Start);
-  CharUpper(RequestFields.VersionStr);
-
-  if (strncmp(RequestFields.VersionStr, "HTTP/", 5) != 0) {
+  GetLastWord(RequestFields.VersionStr, CurLine.begin(), CurLine.end(), end);
+  uc(RequestFields.VersionStr);
+  text_t::const_iterator versionbegin = RequestFields.VersionStr.begin();
+
+  if ((RequestFields.VersionStr.size() > 5) && (substr(versionbegin, versionbegin+5) != "HTTP/")) {
     //No version, assume simple request
     //part after method is URI
-    for (int i = 0; i < strlen(CurLine); i++) {
-      RequestFields.URIStr.push_back(CurLine[i]);
-    }
+    RequestFields.URIStr = CurLine;
     return GH_SIMPLE_REQUEST;
   }
@@ -273,10 +267,11 @@
   //URI String (in between End of first and Start of last)
   //<Method> <WhiteSpace> <URI> <WhiteSpace> <Version> <CRLF>
-  //                  End^             Start^
+  //                  next^             end^
   text_t spacebuffer;
-  for (int i = End; i < Start; i++) {
+  text_t::const_iterator here = next;
+  while (here != end) {
     // do this to remove trailing space
-    if (CurLine[i] == ' ') {
-      spacebuffer.push_back(' ');
+    if (*here == ' ' || *here == '\t') {
+      spacebuffer.push_back(*here);
     } else {
       if (!spacebuffer.empty()) {
@@ -284,18 +279,19 @@
 	spacebuffer.clear();
       }
-      RequestFields.URIStr.push_back(CurLine[i]);
-    }
+      RequestFields.URIStr.push_back(*here);
+    }
+    here++;
   }
 
   //Only accept requests from HTTP/0.9 or HTTP/1.X clients, we'll
   //assume that anything else will require an upgrade or patch
-  if (strncmp(RequestFields.VersionStr, "HTTP/1.", 7) != 0)
+  if ((RequestFields.VersionStr.size() > 7) && (substr(versionbegin, versionbegin+7) != "HTTP/1.")) {
     return GH_UNKNOWN_VERSION;
+  }
   
   //Get the rest of the lines
-  
-  strcpy(CurLine, NextLine);
-  
-  while (CurLine[0] != 0) {//Blank Line, we're done
+  CurLine = NextLine;
+  
+  while (!CurLine.empty()) {//Blank Line, we're done
     do {//Get Next Line, append it if the first charactor is space
       if (GetLine(NextLine, RequestInfo.ClientSocket, RequestInfo.IOBuffer,
@@ -303,15 +299,13 @@
 		  RequestInfo.ThreadNum) != 0)
 	return GH_ERROR;
-      if ((NextLine[0] == ' ') || (NextLine[0] == '\t'))
-	strcat(CurLine, NextLine);
-    } while ((NextLine[0] == ' ') || (NextLine[0] == '\t'));
+      if ((*(NextLine.begin()) == ' ') || (*(NextLine.begin()) == '\t')) {
+	CurLine += NextLine;
+      }
+    } while ((*(NextLine.begin()) == ' ') || (*(NextLine.begin()) == '\t'));
     
-    Start = 0;
-    GetWord(FieldNameStr, CurLine, Start, End);
-    CharUpper(FieldNameStr);
+    GetWord(FieldNameStr, CurLine.begin(), CurLine.end(), next);
+    uc(FieldNameStr);
     
-    Len = strlen(CurLine) - End;
-    memcpy(FieldValStr, CurLine + End, Len);
-    FieldValStr[Len] = 0;
+    FieldValStr = substr(next, CurLine.end());
     
     //Process it
@@ -319,81 +313,72 @@
     //All constants are in canonized, thus in upper case and case sensitive
     //comparisons are used
+
     //--Just About Always--
-    if (strcmp("ACCEPT:", FieldNameStr) == 0) {
-      if (RequestFields.AcceptStr[0] == '\0') {
-        strncpy(RequestFields.AcceptStr, FieldValStr, ReqAcceptStrLen - 1);
-      }
-      else {
-       	//Append it with a comma
-        int AcceptStrLen = strlen(RequestFields.AcceptStr);
-        if ((ReqAcceptStrLen - AcceptStrLen) >= 10) {
-          strncat(RequestFields.AcceptStr, ", ", ReqAcceptStrLen - AcceptStrLen - 1);
-          strncat(RequestFields.AcceptStr, FieldValStr, ReqAcceptStrLen - AcceptStrLen - 3);
-	}
-      }
-    }
-    else if (strcmp("DATE:", FieldNameStr) == 0) {
-      strncpy(RequestFields.DateStr, FieldValStr, ReqDateStrLen - 1);
-    }
-    else if (strcmp("USER-AGENT:", FieldNameStr) == 0) {
-      strncpy(RequestFields.UserAgentStr, FieldValStr, ReqUserAgentStrLen - 1);
-    }
-    else if (strcmp("CONNECTION:", FieldNameStr) == 0) {
-      strncpy(RequestFields.ConnectionStr, FieldValStr, ReqConnectionStrLen - 1);
+    if (FieldNameStr == "ACCEPT:") {
+      if (!RequestFields.AcceptStr.empty()) {
+	RequestFields.AcceptStr += ", ";
+      }
+      RequestFields.AcceptStr += FieldValStr;
+    }
+    else if (FieldNameStr == "DATE:") {
+      RequestFields.DateStr = FieldValStr;
+    }
+    else if (FieldNameStr == "USER-AGENT:") {
+      RequestFields.UserAgentStr = FieldValStr;
+    }
+    else if (FieldNameStr == "CONNECTION:") {
+      RequestFields.ConnectionStr = FieldValStr;
     }
     //--Sometimes--
-    else if (strcmp("ACCEPT-LANGUAGE:", FieldNameStr) == 0) {
-      strncpy(RequestFields.AcceptLangStr, FieldValStr, ReqAcceptLangStrLen - 1);
-    }
-    else if (strcmp("REFERER:", FieldNameStr) == 0) {
-      strncpy(RequestFields.RefererStr, FieldValStr, ReqRefererStrLen - 1);
-    }
-    else if (strcmp("IF-MODIFIED-SINCE:", FieldNameStr) == 0) {
-      strncpy(RequestFields.IfModSinceStr, FieldValStr, ReqIfModSinceStrLen - 1);
+    else if (FieldNameStr == "ACCEPT-LANGUAGE:") {
+      RequestFields.AcceptLangStr = FieldValStr;
+    }
+    else if (FieldNameStr == "REFERER:") {
+      RequestFields.RefererStr = FieldValStr;
+    }
+    else if (FieldNameStr == "IF-MODIFIED-SINCE:") {
+      RequestFields.IfModSinceStr = FieldValStr;
     }
     //--Uncommon--
-    else if (strcmp("FROM:", FieldNameStr) == 0) {
-      strncpy(RequestFields.FromStr, FieldValStr, ReqFromStrLen - 1);
-    }
-    else if (strcmp("MIME-VERSION:", FieldNameStr) == 0) {
-      strncpy(RequestFields.MIMEVerStr, FieldValStr, ReqMIMEVerStrLen - 1);
-    }
-    else if (strcmp("PRAGMA:", FieldNameStr) == 0) {
-      strncpy(RequestFields.PragmaStr, FieldValStr, ReqPragmaStrLen - 1);
+    else if (FieldNameStr == "FROM:") {
+      RequestFields.FromStr = FieldValStr;
+    }
+    else if (FieldNameStr == "MIME-VERSION:") {
+      RequestFields.MIMEVerStr = FieldValStr;
+    }
+    else if (FieldNameStr == "PRAGMA:") {
+      RequestFields.PragmaStr = FieldValStr;
     }
     //--Special case--
-    else if (strcmp("AUTHORIZATION:", FieldNameStr) == 0) {
-      strncpy(RequestFields.AuthorizationStr, FieldValStr, ReqAuthorizationStrLen - 1);
-    }
-    else if (strcmp("CONTENT-LENGTH:", FieldNameStr) == 0) {
-      strncpy(RequestFields.ContentLengthStr, FieldValStr, ReqContentLengthStrLen - 1);
-    }
-    else if (strcmp("CONTENT-TYPE:", FieldNameStr) == 0) {
-      strncpy(RequestFields.ContentTypeStr, FieldValStr, ReqContentTypeStrLen - 1);
-    }
-    else if (strcmp("CONTENT-ENCODING:", FieldNameStr) == 0) {
-      strncpy(RequestFields.ContentEncodingStr, FieldValStr, ReqContentEncodingStrLen - 1);
-    }
-    else {
+    else if (FieldNameStr == "AUTHORIZATION:") {
+      RequestFields.AuthorizationStr = FieldValStr;
+    }
+    else if (FieldNameStr == "CONTENT-LENGTH:") {
+      RequestFields.ContentLengthStr = FieldValStr;
+    }
+    else if (FieldNameStr == "CONTENT-TYPE:") {
+      RequestFields.ContentTypeStr = FieldValStr;
+    }
+    else if (FieldNameStr == "CONTENT-ENCODING:") {
+      RequestFields.ContentEncodingStr = FieldValStr;
+    }
+    else if (!FieldNameStr.empty()) {
       //Add it to the other headers
-      int VarLen = strlen(FieldNameStr);
-      if (FieldNameStr[VarLen - 1] == ':') {
-	//Remove the colon
-	FieldNameStr[VarLen - 1] = '\0';
-	VarLen--;
-      }
-      RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Var = new char[VarLen + 1];
-      RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Val = new char[Len + 1];
-      strcpy(RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Var, FieldNameStr);
-      strcpy(RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Val, FieldValStr);
+
+      //Remove the colon
+      if (*(FieldNameStr.end()-1) == ':') {
+	FieldNameStr.pop_back();
+      }
+      RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Var = FieldNameStr;
+      RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Val = FieldValStr;
       RequestFields.NumOtherHeaders++;
     }
-    strcpy(CurLine, NextLine);
-  }
-  
-  if (RequestFields.ContentLengthStr[0] != 0) { //Do we have attached data?
+    CurLine = NextLine;
+  }
+  
+  if (!RequestFields.ContentLengthStr.empty()) { //Do we have attached data?
     unsigned int NumRecv;
     
-    RequestFields.ContentLength = atol(RequestFields.ContentLengthStr);
+    RequestFields.ContentLength = RequestFields.ContentLengthStr.getint();
     if (RequestFields.ContentLength > 0) {
 
@@ -447,10 +432,6 @@
 void CleanUpHTTPHeaders(RequestInfoT &RequestInfo, RequestFieldsT &RequestFields) {
   //Clean up memory allocated for the Content
-  if (RequestFields.Content != NULL)
+  if (RequestFields.Content != NULL) {
     delete[] RequestFields.Content;
-  while (RequestFields.NumOtherHeaders > 0) {
-    RequestFields.NumOtherHeaders--;
-    delete[] RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Var;
-    delete[] RequestFields.OtherHeaders[RequestFields.NumOtherHeaders].Val;
   }
   
Index: /trunk/gsdl/src/w32server/httpreq.h
===================================================================
--- /trunk/gsdl/src/w32server/httpreq.h	(revision 3809)
+++ /trunk/gsdl/src/w32server/httpreq.h	(revision 3810)
@@ -29,4 +29,11 @@
 #define HTTPREQ_H
 
+// need this to avoid bizarre compiler problems under VC++ 6.0
+#if !defined (GSDL_NAMESPACE_BROKEN) && !defined (GSDL_USE_IOS_H)
+# include <iostream>
+# include <fstream>
+using namespace std;
+#endif
+
 #include "locate.h"
 #include "text_t.h"
@@ -50,20 +57,4 @@
 
 //Length constants for RequestFieldsT
-#define ReqMethodStrLen           24
-#define ReqVersionStrLen          24
-#define ReqDateStrLen             48
-#define ReqMIMEVerStrLen          24
-#define ReqPragmaStrLen          128
-#define ReqAuthorizationStrLen   512
-#define ReqFromStrLen            128
-#define ReqIfModSinceStrLen       48
-#define ReqRefererStrLen         512
-#define ReqUserAgentStrLen       256
-#define ReqContentEncodingStrLen 128
-#define ReqContentTypeStrLen     128
-#define ReqContentLengthStrLen    48
-#define ReqAcceptStrLen          256
-#define ReqAcceptLangStrLen       48
-#define ReqConnectionStrLen       24
 #define ReqAuthorizedUserStrLen   48
 #define ReqPathInfoStrLen        512
@@ -74,33 +65,33 @@
 
 struct RequestHeaderT {
-  char *Var;
-  char *Val;
+  text_t Var;
+  text_t Val;
 };
 
 struct RequestFieldsT {
   //Simple request line info v0.9
-  char MethodStr[ReqMethodStrLen];
+  text_t MethodStr;
   text_t URIStr;
   //added v1.0
-  char VersionStr[ReqVersionStrLen];
+  text_t VersionStr;
   //General Header
-  char DateStr[ReqDateStrLen];
-  char MIMEVerStr[ReqMIMEVerStrLen];
-  char PragmaStr[ReqPragmaStrLen];
+  text_t DateStr;
+  text_t MIMEVerStr;
+  text_t PragmaStr;
   //Request Header
-  char AuthorizationStr[ReqAuthorizationStrLen];
-  char FromStr[ReqFromStrLen];
-  char IfModSinceStr[ReqIfModSinceStrLen];
-  char RefererStr[ReqRefererStrLen];
-  char UserAgentStr[ReqUserAgentStrLen];
+  text_t AuthorizationStr;
+  text_t FromStr;
+  text_t IfModSinceStr;
+  text_t RefererStr;
+  text_t UserAgentStr;
   //Entity Header (Only CGI stuff)
-  char ContentEncodingStr[ReqContentEncodingStrLen];
-  char ContentTypeStr[ReqContentTypeStrLen];
-  char ContentLengthStr[ReqContentLengthStrLen];
+  text_t ContentEncodingStr;
+  text_t ContentTypeStr;
+  text_t ContentLengthStr;
   //v1.0 Optional (the more common ones)
-  char AcceptStr[ReqAcceptStrLen];
-  char AcceptLangStr[ReqAcceptLangStrLen];
+  text_t AcceptStr;
+  text_t AcceptLangStr;
   //v1.1 Exentions
-  char ConnectionStr[ReqConnectionStrLen];
+  text_t ConnectionStr;
   //Pointer to buffer containing the content
   DWORD ContentLength;
Index: /trunk/gsdl/src/w32server/netio.cpp
===================================================================
--- /trunk/gsdl/src/w32server/netio.cpp	(revision 3809)
+++ /trunk/gsdl/src/w32server/netio.cpp	(revision 3810)
@@ -333,11 +333,10 @@
 }
 
-int GetLine(char *OutStr, SOCKET ClientSocket, BYTE *IOBuffer, int IOBufferSize,
+int GetLine(text_t &OutStr, SOCKET ClientSocket, BYTE *IOBuffer, int IOBufferSize,
 	    int &BufferIndex, int &DataInBuffer, int ThreadNum) {
-  
-  int i;
+
+  OutStr.clear();
   char CurChar;
   
-  i = 0;
   do {
     if (BufferIndex == DataInBuffer) { //Need more data
@@ -352,13 +351,8 @@
     BufferIndex++;
     if ((CurChar != 10) && (CurChar != 13))  {
-      OutStr[i] = CurChar;
-      i++;
-    }
-  } while ((CurChar != 10) && (i < NETIO_MAX_LINE));
-  if (i == NETIO_MAX_LINE) {
-    return -1;
-  }
-  
-  OutStr[i] = 0;
+      OutStr.push_back(CurChar);
+    }
+  } while (CurChar != 10);
+  
   return 0;
 }
Index: /trunk/gsdl/src/w32server/netio.h
===================================================================
--- /trunk/gsdl/src/w32server/netio.h	(revision 3809)
+++ /trunk/gsdl/src/w32server/netio.h	(revision 3810)
@@ -26,4 +26,6 @@
  *********************************************************************/
 
+#include "text_t.h"
+
 /*
 Module Name: Net IO
@@ -48,8 +50,4 @@
 	SendFile
 */
-
-//Public definitions
-//Max line size for GetLine
-#define NETIO_MAX_LINE 300
 
 //Public Functions
@@ -131,5 +129,5 @@
 			just changes an index. Also has the ability to do multi-threaded debuging
 Parameters:
-	OutStr - Varible were output is put (a length of NETIO_MAX_LINE is assumed)
+	OutStr - Varible were output is put
 	ClientSocket - The socket to get data from
 	IOBuffer - A pointer to a chunk of memory to put data in
@@ -141,5 +139,5 @@
 Returns: -1 on disconnect or error (abort connection), 0 on success
 */
-int GetLine(char *OutStr, SOCKET ClientSocket, BYTE *IOBuffer, int IOBufferSize, 
+int GetLine(text_t &OutStr, SOCKET ClientSocket, BYTE *IOBuffer, int IOBufferSize, 
 	    int &BufferIndex, int &DataInBuffer, int ThreadNum);
 
Index: /trunk/gsdl/src/w32server/parse.cpp
===================================================================
--- /trunk/gsdl/src/w32server/parse.cpp	(revision 3809)
+++ /trunk/gsdl/src/w32server/parse.cpp	(revision 3810)
@@ -84,38 +84,41 @@
 }
 /******************************************************************************/
-void GetWord(char *DestStr, const char *SourceStr, const int Start, int &End) {
-  int i, Len;
-  
-  Len = 0;
-  i = Start;
-  while ((SourceStr[i] != ' ') && (SourceStr[i] != '\t') && (SourceStr[i] != 0)) {
-    Len++;
-    i++;
-  }
-  //Create the substring
-  memcpy(DestStr, SourceStr + Start, Len);
-  DestStr[Len] = 0;
-  //Set End
-  while ((SourceStr[i] != 0) &&
-	 ((SourceStr[i] == ' ') || (SourceStr[i] == '\t'))) {
-    i ++;
-  }
-  End = i;
-}
-/******************************************************************************/
-void GetLastWord(char *DestString, const char *SourceStr, int &Start) {
-  int SourceLen, i, Len;
-  
-  Len = 0;
-  SourceLen = strlen(SourceStr);
-  i = SourceLen - 1;
-  while ((i >= 0) && (SourceStr[i] != ' ') && (SourceStr[i] != '\t')) {
-    Len++;
-    i--;
-  }
-  //Create the substring
-  memcpy(DestString, SourceStr + SourceLen - Len, Len);
-  DestString[Len] = 0;
-  Start = i + 1;
+void GetWord(text_t &DestStr, text_t::const_iterator first,
+	     text_t::const_iterator last, text_t::const_iterator &next) {
+
+  DestStr.clear();
+  next = last;
+
+  while (first != last) {
+    if (*first == ' ' || *first == '\t') {
+      first++;
+      while ((first != last) && ((*first == ' ') || (*first == '\t'))) {
+	first++;
+      }
+      next = first;
+      break;
+    } else {
+      DestStr.push_back(*first);
+    }
+    first++;
+  }
+}
+/******************************************************************************/
+
+void GetLastWord(text_t &DestStr, text_t::const_iterator first, text_t::const_iterator last, 
+		 text_t::const_iterator &Start) {
+
+  DestStr.clear();
+  Start = first;
+
+  while (first != last) {
+    if ((*first == ' ') || (*first == '\t')) {
+      DestStr.clear();
+      Start = first+1;
+    } else {
+      DestStr.push_back(*first);
+    }
+    first ++;
+  }
 }
 /******************************************************************************/
Index: /trunk/gsdl/src/w32server/parse.h
===================================================================
--- /trunk/gsdl/src/w32server/parse.h	(revision 3809)
+++ /trunk/gsdl/src/w32server/parse.h	(revision 3810)
@@ -25,4 +25,6 @@
  *
  *********************************************************************/
+
+#include "text_t.h"
 
 /*
@@ -96,30 +98,29 @@
 /*
 Function Name: GetWord
-Purpose: Gets leftmost substring without a space, starts at any position at
-	 the start string and sets End to be the next non-space charactor in the
-	 string.  ' ' and '\t' and considered spaces
+Purpose: Gets leftmost substring without a space in the string between the iterators
+         'here' and 'end'. Sets 'DestStr' to the substring. Sets the 'next' iterator 
+	 to the next non-space charactor in the string.  ' ' and '\t' and considered
+         spaces
 Parameters:
 	 DestString - Destination buffer for substring
-	 SourceString - Source string to make substing from
-	 Start - 0 based string index to start at
-	 End - At end of function call is set to the location of next non-space
-               charactor
-
-Notes: If Start is greater than strlen(SourceStr) then a memory error may
-		 occur.
+	 first - First character in source string
+	 last - end iterator (one past last character) of source string
+	 next - At end of function call is set to the location of next non-space
+               charactor in source string
 */
-void GetWord(char *DestStr, const char *SourceStr, 
-	     const int Start, int &End);
+void GetWord(text_t &DestStr, text_t::const_iterator first,
+	     text_t::const_iterator last, text_t::const_iterator &next);
 
 /*
 Function Name: GetLastWord
-Purpose: Gets rightmost substring without a space sets Start to be the 0 based
-	index of where the substring starts in the original string.
+Purpose: Gets rightmost substring without a space sets Start to be the first
+         character of the substring in the original string.
 Parameters:
 	DestString - Destination buffer for substring
-	SourceString - Source string to make substing from
-	Start - 0 based string index where the DestString starts at
+	first and last - Source string to make substing from
+	Start - where the DestString starts at in the source string
 */
-void GetLastWord(char *DestString, const char *SourceStr, int &Start);
+void GetLastWord(text_t &DestStr, text_t::const_iterator first, text_t::const_iterator last, 
+		 text_t::const_iterator &Start);
 
 
