summaryrefslogtreecommitdiff
path: root/tools/ward.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-11-23 00:05:50 (GMT)
committerJohn Denker <jsd@av8n.com>2012-11-23 00:05:50 (GMT)
commit38d51b1b20776f7435737bf26d2f912daa312282 (patch)
treea41e9795665655d05009588743b86dc7bd07ce01 /tools/ward.c
parent3c9817f94592907c8c19a8b8f97af87dad3dceaf (diff)
start moving stuff to libskrewt
Diffstat (limited to 'tools/ward.c')
-rw-r--r--tools/ward.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/tools/ward.c b/tools/ward.c
index 540b1cf..8be9f70 100644
--- a/tools/ward.c
+++ b/tools/ward.c
@@ -72,50 +72,7 @@ int mypid;
/* Content-Type: multipart/mixed; boundary="1170861315-1262462055-1341954763=:92165" */
//
-void parse_content(const string type_spec_line,
- string &maintype, string &boundary) {
- //xxx cerr << "parser called with: " << type_spec_line << endl;
- string get_type(type_spec_line);
-
- size_t where = get_type.find_first_of(" \t;\n");
- string rest;
- if (where == string::npos) {
- // keep whole string
- }
- else {
- rest = get_type.substr(where+1);
- get_type = get_type.substr(0,where);
- }
- where = get_type.find("/");
- if (where == string::npos){
- maintype = "";
- cerr << "could not find / in " << get_type << endl;
- } else {
- maintype = get_type.substr(0, where);
- }
-
-// now need to find boundary
-
- string srch = "boundary=";
- where = rest.find(srch);
- if (where != string::npos) {
- where += srch.length();
- boundary = rest.substr(where);
- if (boundary[0] == '"') {
- boundary = boundary.substr(1);
- where = boundary.find_first_of("\"");
- } else {
- where = boundary.find_first_of(" \t;\n");
- }
- if (where == string::npos) {
- /* do nothing, boundary=boundary as a whole */
- } else {
- boundary = boundary.substr(0, where);
- }
- } else {
- //xxxxxxx cerr << "boundary= not found in " << type_spec_line << endl;
- }
-}
+#include "libskrewt.h"
string join(const string sep, const list<string> stuff){
string rslt;