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