Mercurial > hg > xemacs-beta
comparison lisp/url/ssl.el @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
1 ;;; ssl.el,v --- ssl functions for emacsen without them builtin | |
2 ;; Author: wmperry | |
3 ;; Created: 1996/05/28 01:20:06 | |
4 ;; Version: 1.2 | |
5 ;; Keywords: comm | |
6 | |
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
8 ;;; Copyright (c) 1995 by William M. Perry (wmperry@spry.com) | |
9 ;;; | |
10 ;;; This file is not part of GNU Emacs, but the same permissions apply. | |
11 ;;; | |
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;;; it under the terms of the GNU General Public License as published by | |
14 ;;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;;; any later version. | |
16 ;;; | |
17 ;;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;;; GNU General Public License for more details. | |
21 ;;; | |
22 ;;; You should have received a copy of the GNU General Public License | |
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to | |
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
26 | |
27 (defvar ssl-program-name "ssl %s %s" | |
28 "*The program to run in a subprocess to open an SSL connection. | |
29 This is run through `format' with two strings, the hostname and port # | |
30 to connect to.") | |
31 | |
32 (defun open-ssl-stream (name buffer host service) | |
33 "Open a SSL connection for a service to a host. | |
34 Returns a subprocess-object to represent the connection. | |
35 Input and output work as for subprocesses; `delete-process' closes it. | |
36 Args are NAME BUFFER HOST SERVICE. | |
37 NAME is name for process. It is modified if necessary to make it unique. | |
38 BUFFER is the buffer (or buffer-name) to associate with the process. | |
39 Process output goes at end of that buffer, unless you specify | |
40 an output stream or filter function to handle the output. | |
41 BUFFER may be also nil, meaning that this process is not associated | |
42 with any buffer | |
43 Third arg is name of the host to connect to, or its IP address. | |
44 Fourth arg SERVICE is name of the service desired, or an integer | |
45 specifying a port number to connect to." | |
46 (let ((proc (start-process name buffer | |
47 "/bin/sh" | |
48 "-c" | |
49 (format ssl-program-name host | |
50 (if (stringp service) | |
51 service | |
52 (int-to-string service)))))) | |
53 (process-kill-without-query proc) | |
54 proc)) | |
55 | |
56 (provide 'ssl) |