From 216c0d124d1e3ba2585ca74f101a630f558b0948 Mon Sep 17 00:00:00 2001 From: interp Date: Tue, 12 Feb 2002 11:47:54 +0000 Subject: [PATCH] * minor changes in comments --- netrc.scm | 16 +++++++++++++++- url.scm | 24 ++++++++++++------------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/netrc.scm b/netrc.scm index 163dac5..e1adc43 100644 --- a/netrc.scm +++ b/netrc.scm @@ -1,6 +1,6 @@ ;;; netrc.scm -- parse authentication information contained in ~/.netrc ;; -;; $Id: netrc.scm,v 1.4 2001/12/27 16:45:32 interp Exp $ +;; $Id: netrc.scm,v 1.5 2002/02/12 11:47:53 interp Exp $ ;; ;; Please send suggestions and bug reports to @@ -33,6 +33,20 @@ ;;; Entry points ======================================================= ;; +;; What you probably want, is to read out the default netrc-file. Do the +;; following: +;; +;; (let ((netrc-record (netrc:parse))) +;; (netrc:lookup netrc-record "name of the machine")) +;; +;; and you will receive three values: login-name, password and account-name. +;; If you only want the login-name or the password, use netrc:lookup-login +;; or netrc:lookup-password resp. +;; +;; You will get either the login / password for the specified machine, +;; or a default login / password if the machine is unknown. +;; +;; ;; (user-mail-address) -> string ;; Calculate the user's email address, as per the Emacs function of ;; the same name. Will take into account the environment variable diff --git a/url.scm b/url.scm index 532238b..80a27d7 100644 --- a/url.scm +++ b/url.scm @@ -41,9 +41,8 @@ ;;; Parse a URI path (a list representing a path, not a string!) into ;;; a userhost record. Default values are taken from the userhost ;;; record DEFAULT except for the host. Returns a userhost record if -;;; it wins, and #f if it cannot parse the path. CADDR drops the -;;; userhost portion of the path. In fact, fatal-syntax-error is -;;; called, if the path doesn't start with '//'. +;;; it wins. CADDR drops the userhost portion of the path. In fact, +;;; fatal-syntax-error is called, if the path doesn't start with '//'. (define (parse-userhost path default) (if (and (pair? path) ; The thing better begin @@ -113,16 +112,17 @@ frag-id) ;;; The URI parser (parse-uri in uri.scm) maps a string to four parts: -;;; : ? # -;;; , , and are strings; is a non-empty -;;; string list -- the URI's path split at slashes. Optional parts of the -;;; URI, when missing, are specified as #f. If is "http", then the -;;; other three parts can be passed to PARSE-HTTP-URL, which parses them -;;; into a HTTP-URL record (or #f if the string cannot be parsed). All strings -;;; come back from the URI parser encoded. SEARCH and FRAG-ID are left -;;; that way; this parser decodes the path elements. +;;; : ? # , , and +;;; are strings; is a non-empty string list -- the +;;; URI's path split at slashes. Optional parts of the URI, when +;;; missing, are specified as #f. If is "http", then the +;;; other three parts can be passed to PARSE-HTTP-URL, which parses +;;; them into a HTTP-URL record. All strings come back from the URI +;;; parser encoded. SEARCH and FRAG-ID are left that way; this parser +;;; decodes the path elements. ;;; -;;; Return #f if the URL could not be parsed. +;;; Returns a HTTP-URL record, if possible. Otherwise +;;; FATAL-SYNTAX-ERROR is called. (define (parse-http-url path search frag-id) (let ((uh (parse-userhost path default-http-userhost)))