int MakeStringFromSMTPMail(smtp_node *smtp) { #ifdef SMTP_TEST return 0; #else int len_buf,string_id; char *buf; string_list *sl; /* cheesy here--allocate buffer, make the string, then free buffer. would be nice to not have to allocate here */ len_buf = 0; sl = smtp->data; while (sl != NULL) { len_buf += strlen(sl->str); sl = sl->next; } buf = (char *) AllocateMemory(MALLOC_ID_SMTP,len_buf+1); len_buf = 0; sl = smtp->data; while (sl != NULL) { strcpy(buf+len_buf,sl->str); len_buf += strlen(sl->str); sl = sl->next; } string_id = CreateStringWithLen(buf,len_buf+1); FreeMemory(MALLOC_ID_SMTP,buf,len_buf); return string_id; #endif }
int CreateString(char *new_str) { return CreateStringWithLen(new_str,strlen(new_str)); }