|
a/src/internfile/mimehandler.cpp |
|
b/src/internfile/mimehandler.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.18 2006-03-29 13:08:08 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.19 2006-12-13 09:13:18 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
66 |
mtype.c_str()));
|
66 |
mtype.c_str()));
|
67 |
return 0;
|
67 |
return 0;
|
68 |
}
|
68 |
}
|
69 |
|
69 |
|
70 |
// Retrieve handler function according to type
|
70 |
// Retrieve handler function according to type
|
|
|
71 |
list<string>::iterator it = toks.begin();
|
71 |
if (!stringlowercmp("internal", toks.front())) {
|
72 |
if (!stringlowercmp("internal", *it)) {
|
72 |
return mhFactory(mtype);
|
73 |
return mhFactory(mtype);
|
73 |
} else if (!stringlowercmp("dll", toks.front())) {
|
74 |
} else if (!stringlowercmp("dll", *it)) {
|
74 |
} else if (!stringlowercmp("exec", toks.front())) {
|
75 |
} else if (!stringlowercmp("exec", *it)) {
|
75 |
if (toks.size() < 2) {
|
76 |
if (toks.size() < 2) {
|
76 |
LOGERR(("getMimeHandler: bad line for %s: %s\n",
|
77 |
LOGERR(("getMimeHandler: bad line for %s: %s\n",
|
77 |
mtype.c_str(), hs.c_str()));
|
78 |
mtype.c_str(), hs.c_str()));
|
78 |
return 0;
|
79 |
return 0;
|
79 |
}
|
80 |
}
|
80 |
MimeHandlerExec *h = new MimeHandlerExec;
|
81 |
MimeHandlerExec *h = new MimeHandlerExec;
|
81 |
list<string>::const_iterator it1 = toks.begin();
|
|
|
82 |
it1++;
|
82 |
it++;
|
83 |
for (;it1 != toks.end();it1++)
|
83 |
h->params.push_back(cfg->findFilter(*it++));
|
84 |
h->params.push_back(*it1);
|
84 |
h->params.insert(h->params.end(), it, toks.end());
|
85 |
return h;
|
85 |
return h;
|
86 |
}
|
86 |
}
|
87 |
}
|
87 |
}
|
88 |
|
88 |
|
89 |
// We are supposed to get here if there was no specific error, but
|
89 |
// We are supposed to get here if there was no specific error, but
|