[w3m-dev 02834] mailto: use external program
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# $Id: configure,v 1.48 2002/01/14 15:59:17 ukai Exp $
|
||||
# $Id: configure,v 1.49 2002/01/15 03:45:02 ukai Exp $
|
||||
# Configuration.
|
||||
#
|
||||
|
||||
@@ -699,6 +699,9 @@ fi
|
||||
|
||||
# protocols?
|
||||
ask_param "External URI loader support" use_external_uri_loader y
|
||||
if [ "$use_external_uri_loader" = y ]; then
|
||||
ask_param "Use w3mmail.cgi" use_w3mmailer y
|
||||
fi
|
||||
ask_param "NNTP support" use_nntp $include_opt
|
||||
ask_param "Gopher support" use_gopher $include_opt
|
||||
|
||||
@@ -2046,6 +2049,7 @@ $def_use_ssl
|
||||
$def_use_ssl_verify
|
||||
$def_ftppass_hostnamegen
|
||||
$def_use_external_uri_loader
|
||||
$def_use_w3mmailer
|
||||
$def_use_nntp
|
||||
$def_use_gopher
|
||||
$def_use_alarm
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: frame.c,v 1.7 2001/11/29 09:34:14 ukai Exp $ */
|
||||
/* $Id: frame.c,v 1.8 2002/01/15 03:45:02 ukai Exp $ */
|
||||
#include "fm.h"
|
||||
#include "parsetagx.h"
|
||||
#include "myctype.h"
|
||||
@@ -677,8 +677,10 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level,
|
||||
tag->value[j] =
|
||||
url_quote_conv(tag->value[j], code);
|
||||
parseURL2(tag->value[j], &url, &base);
|
||||
if (url.scheme == SCM_MAILTO ||
|
||||
url.scheme == SCM_UNKNOWN ||
|
||||
if (url.scheme == SCM_UNKNOWN ||
|
||||
#ifndef USE_W3MMAILER
|
||||
url.scheme == SCM_MAILTO ||
|
||||
#endif
|
||||
url.scheme == SCM_MISSING)
|
||||
break;
|
||||
a_target |= 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: main.c,v 1.56 2002/01/10 15:39:21 ukai Exp $ */
|
||||
/* $Id: main.c,v 1.57 2002/01/15 03:45:02 ukai Exp $ */
|
||||
#define MAINPROGRAM
|
||||
#include "fm.h"
|
||||
#include <signal.h>
|
||||
@@ -2602,6 +2602,7 @@ followA(void)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifndef USE_W3MMAILER
|
||||
if (!strncasecmp(a->url, "mailto:", 7)) {
|
||||
/* invoke external mailer */
|
||||
fmTerm();
|
||||
@@ -2611,6 +2612,7 @@ followA(void)
|
||||
displayBuffer(Currentbuf, B_FORCE_REDRAW);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_NNTP
|
||||
else if (!strncasecmp(a->url, "news:", 5) && strchr(a->url, '@') == NULL) {
|
||||
/* news:newsgroup is not supported */
|
||||
@@ -3539,6 +3541,7 @@ cmd_loadURL(char *url, ParsedURL *current)
|
||||
{
|
||||
Buffer *buf;
|
||||
|
||||
#ifndef USE_W3MMAILER
|
||||
if (!strncasecmp(url, "mailto:", 7)) {
|
||||
/* invoke external mailer */
|
||||
fmTerm();
|
||||
@@ -3548,8 +3551,9 @@ cmd_loadURL(char *url, ParsedURL *current)
|
||||
displayBuffer(Currentbuf, B_FORCE_REDRAW);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_NNTP
|
||||
else if (!strncasecmp(url, "news:", 5) && strchr(url, '@') == NULL) {
|
||||
if (!strncasecmp(url, "news:", 5) && strchr(url, '@') == NULL) {
|
||||
/* news:newsgroup is not supported */
|
||||
disp_err_message("news:newsgroup_name is not supported", TRUE);
|
||||
return;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ LIB_DIR = $(prefix)/lib/w3m
|
||||
HELP_DIR = $(prefix)/lib/w3m
|
||||
RC_DIR = ~/.w3m
|
||||
|
||||
LIB_TARGETS = dirlist.cgi w3mhelp.cgi
|
||||
LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi
|
||||
HELP_LIBS = w3mhelp-funcname.pl w3mhelp-funcdesc.pl
|
||||
|
||||
MKDIR = mkdir -p
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: url.c,v 1.33 2002/01/14 15:59:17 ukai Exp $ */
|
||||
/* $Id: url.c,v 1.34 2002/01/15 03:45:02 ukai Exp $ */
|
||||
#include "fm.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -69,7 +69,9 @@ struct cmdtable schemetable[] = {
|
||||
/* {"exec", SCM_EXEC}, */
|
||||
{"nntp", SCM_NNTP},
|
||||
{"news", SCM_NEWS},
|
||||
#ifndef USE_W3MMAILER
|
||||
{"mailto", SCM_MAILTO},
|
||||
#endif
|
||||
#ifdef USE_SSL
|
||||
{"https", SCM_HTTPS},
|
||||
#endif /* USE_SSL */
|
||||
@@ -945,9 +947,10 @@ parseURL2(char *url, ParsedURL *pu, ParsedURL *current)
|
||||
int relative_uri = FALSE;
|
||||
|
||||
parseURL(url, pu, current);
|
||||
#ifndef USE_W3MMAILER
|
||||
if (pu->scheme == SCM_MAILTO)
|
||||
return;
|
||||
|
||||
#endif
|
||||
if (pu->scheme == SCM_LOCAL)
|
||||
pu->file = expandName(pu->file);
|
||||
|
||||
@@ -1107,10 +1110,12 @@ _parsedURL2Str(ParsedURL *pu, int pass)
|
||||
}
|
||||
tmp = Strnew_charp(scheme_str[pu->scheme]);
|
||||
Strcat_char(tmp, ':');
|
||||
#ifndef USE_W3MMAILER
|
||||
if (pu->scheme == SCM_MAILTO) {
|
||||
Strcat_charp(tmp, pu->file);
|
||||
return tmp;
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_NNTP
|
||||
if (pu->scheme != SCM_NEWS)
|
||||
#endif /* USE_NNTP */
|
||||
@@ -1955,6 +1960,10 @@ filename_extension(char *path, int is_url)
|
||||
|
||||
#ifdef USE_EXTERNAL_URI_LOADER
|
||||
static struct table2 **urimethods;
|
||||
static struct table2 default_urimethods[] = {
|
||||
{"mailto", "file:///$LIB/w3mmail.cgi?%s"},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static struct table2 *
|
||||
loadURIMethods(char *filename)
|
||||
@@ -2046,11 +2055,15 @@ searchURIMethods(ParsedURL *pu)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; (ump = urimethods[i]) != NULL; i++) {
|
||||
while (ump->item1 != NULL) {
|
||||
for (; ump->item1 != NULL; ump++) {
|
||||
if (strcmp(ump->item1, scheme->ptr) == 0) {
|
||||
return Sprintf(ump->item2, url_quote(url->ptr));
|
||||
}
|
||||
ump++;
|
||||
}
|
||||
}
|
||||
for (ump = default_urimethods; ump->item1 != NULL; ump++) {
|
||||
if (strcmp(ump->item1, scheme->ptr) == 0) {
|
||||
return Sprintf(ump->item2, url_quote(url->ptr));
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user