[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xml-rpc 725bc20829 14/64: Bump the version. (xml-rpc-fault
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/xml-rpc 725bc20829 14/64: Bump the version. (xml-rpc-fault-string, xml-rpc-fault-code): Defvar some previously un-declared vars. (xml-rpc-value-intp, xml-rpc-value-doublep) (xml-rpc-value-stringp): Change from defun to defsubst for consistency. (xml-rpc-request, xml-rpc-list-to-value, xml-rpc-clean): Fix compilation warnings |
Date: |
Fri, 31 Dec 2021 20:10:59 -0500 (EST) |
branch: elpa/xml-rpc
commit 725bc208294dce6f43a2720198f8fc5371b978a4
Author: Mark A. Hershberger <mah@everybody.org>
Commit: Mark A. Hershberger <mah@everybody.org>
Bump the version. (xml-rpc-fault-string, xml-rpc-fault-code): Defvar some
previously un-declared vars. (xml-rpc-value-intp, xml-rpc-value-doublep)
(xml-rpc-value-stringp): Change from defun to defsubst for consistency.
(xml-rpc-request, xml-rpc-list-to-value, xml-rpc-clean): Fix compilation
warnings
---
xml-rpc.el | 184 ++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 98 insertions(+), 86 deletions(-)
diff --git a/xml-rpc.el b/xml-rpc.el
index f78ae1529c..96626b0af5 100644
--- a/xml-rpc.el
+++ b/xml-rpc.el
@@ -8,12 +8,12 @@
;; Author: Mark A. Hershberger <mah@everybody.org>
;; Original Author: Daniel Lundin <daniel@codefactory.se>
-;; Version: 1.6.5
+;; Version: 1.6.5.1
;; Created: May 13 2001
;; Keywords: xml rpc network
;; URL: http://emacswiki.org/emacs/xml-rpc.el
-;; Last Modified: <2009-08-12 19:20:27 mah>
-;; Package-Requires: url
+;; Maintained-at: http://savannah.nongnu.org/bzr/?group=emacsweblogs
+;; Last Modified: <2009-09-09 21:09:47 mah>
;; This file is NOT (yet) part of GNU Emacs.
@@ -114,7 +114,9 @@
;;; History:
-;; 1.6.5 - Made handling of dateTime elements more robust.
+;; 1.6.5.1 - Fix compile time warnings.
+
+;; 1.6.5 - Made handling of dateTime elements more robust.
;; 1.6.4.1 - Updated to work with both Emacs22 and Emacs23.
@@ -127,37 +129,37 @@
;; make 'value' object instead of 'base64' object.
;; This is good for WikiRPC.
-;; 1.6.2 - Fix whitespace issues to work better with new xml.el
-;; Fix bug in string handling.
-;; Add support for gzip-encoding when needed.
+;; 1.6.2 - Fix whitespace issues to work better with new xml.el
+;; Fix bug in string handling.
+;; Add support for gzip-encoding when needed.
-;; 1.6.1 - base64 support added.
-;; url-insert-entities-in-string done on string types now.
+;; 1.6.1 - base64 support added.
+;; url-insert-entities-in-string done on string types now.
-;; 1.6 - Fixed dependencies (remove w3, add cl).
-;; Move string-to-boolean and boolean-to-string into xml-rpc namespace.
-;; Fix bug in xml-rpc-xml-to-response where non-existent var was.
-;; More tweaking of "Connection: close" header.
-;; Fix bug in xml-rpc-request-process-buffer so that this works with
-;; different mixes of the url.el code.
+;; 1.6 - Fixed dependencies (remove w3, add cl).
+;; Move string-to-boolean and boolean-to-string into xml-rpc
namespace.
+;; Fix bug in xml-rpc-xml-to-response where non-existent var was.
+;; More tweaking of "Connection: close" header.
+;; Fix bug in xml-rpc-request-process-buffer so that this works with
+;; different mixes of the url.el code.
-;; 1.5.1 - Added Andrew J Cosgriff's patch to make the
-;; xml-rpc-clean-string function work in XEmacs.
+;; 1.5.1 - Added Andrew J Cosgriff's patch to make the
+;; xml-rpc-clean-string function work in XEmacs.
-;; 1.5 - Added headers to the outgoing url-retreive-synchronously
-;; so that it would close connections immediately on completion.
+;; 1.5 - Added headers to the outgoing url-retreive-synchronously
+;; so that it would close connections immediately on completion.
-;; 1.4 - Added conditional debugging code. Added version tag.
+;; 1.4 - Added conditional debugging code. Added version tag.
-;; 1.2 - Better error handling. The documentation didn't match
-;; the code. That was changed so that an error was
-;; signaled. Also, better handling of various and
-;; different combinations of xml.el and url.el.
+;; 1.2 - Better error handling. The documentation didn't match
+;; the code. That was changed so that an error was
+;; signaled. Also, better handling of various and
+;; different combinations of xml.el and url.el.
-;; 1.1 - Added support for boolean types. If the type of a
-;; returned value is not specified, string is assumed
+;; 1.1 - Added support for boolean types. If the type of a
+;; returned value is not specified, string is assumed
-;; 1.0 - First version
+;; 1.0 - First version
;;; Code:
@@ -168,8 +170,11 @@
(eval-when-compile
(require 'cl))
+(defconst xml-rpc-version "1.6.5.1"
+ "Current Version of xml-rpc.el")
+
(defcustom xml-rpc-load-hook nil
- "*Hook run after loading xml-rpc."
+ "*Hook run after loading xml-rpc."
:type 'hook :group 'xml-rpc)
(defcustom xml-rpc-allow-unicode-string (coding-system-p 'utf-8)
@@ -194,24 +199,28 @@ utf-8 coding system."
(defcustom xml-rpc-debug 0
"Set this to 1 or greater to avoid killing temporary buffers.
-Set it higher to get some info in the *Messages* buffer")
+Set it higher to get some info in the *Messages* buffer"
+ :type 'integerp :group 'xml-rpc)
-(defconst xml-rpc-version "1.6"
- "Current Version of xml-rpc.el")
+(defvar xml-rpc-fault-string nil
+ "Contains the fault string if a fault is returned")
+
+(defvar xml-rpc-fault-code nil
+ "Contains the fault code if a fault is returned")
;;
;; Value type handling functions
;;
-(defun xml-rpc-value-intp (value)
+(defsubst xml-rpc-value-intp (value)
"Return t if VALUE is an integer."
(integerp value))
-(defun xml-rpc-value-doublep (value)
+(defsubst xml-rpc-value-doublep (value)
"Return t if VALUE is a double precision number."
(floatp value))
-(defun xml-rpc-value-stringp (value)
+(defsubst xml-rpc-value-stringp (value)
"Return t if VALUE is a string."
(stringp value))
@@ -259,54 +268,55 @@ time, or it will be confused for a list."
(defun xml-rpc-xml-list-to-value (xml-list)
"Convert an XML-RPC structure in an xml.el style XML-LIST to an elisp list, \
interpreting and simplifying it while retaining its structure."
- (cond
- ((and (xml-rpc-caddar-safe xml-list)
- (listp (car-safe (cdr-safe (cdr-safe (car-safe xml-list))))))
-
- (setq valtype (car (caddar xml-list))
- valvalue (caddr (caddar xml-list)))
+ (let (valtype valvalue)
(cond
- ;; Base64
- ((eq valtype 'base64)
- (if xml-rpc-base64-decode-unicode
- (decode-coding-string (base64-decode-string valvalue) 'utf-8)
- (base64-decode-string valvalue)))
- ;; Boolean
- ((eq valtype 'boolean)
- (xml-rpc-string-to-boolean valvalue))
- ;; String
- ((eq valtype 'string)
- valvalue)
- ;; Integer
- ((or (eq valtype 'int) (eq valtype 'i4))
- (string-to-number valvalue))
- ;; Double/float
- ((eq valtype 'double)
- (string-to-number valvalue))
- ;; Struct
- ((eq valtype 'struct)
- (mapcar (lambda (member)
- (let ((membername (cadr (cdaddr member)))
- (membervalue (xml-rpc-xml-list-to-value (cdddr member))))
- (cons membername membervalue)))
- (cddr (caddar xml-list))))
- ;; Fault
- ((eq valtype 'fault)
- (let* ((struct (xml-rpc-xml-list-to-value (list valvalue)))
- (fault-string (cdr (assoc "faultString" struct)))
- (fault-code (cdr (assoc "faultCode" struct))))
- (list 'fault fault-code fault-string)))
- ;; DateTime
- ((eq valtype 'dateTime.iso8601)
- (list :datetime (date-to-time valvalue)))
- ((eq valtype 'dateTime)
- (list :datetime (date-to-time valvalue)))
- ;; Array
- ((eq valtype 'array)
- (mapcar (lambda (arrval)
- (xml-rpc-xml-list-to-value (list arrval)))
- (cddr valvalue)))))
- ((xml-rpc-caddar-safe xml-list))))
+ ((and (xml-rpc-caddar-safe xml-list)
+ (listp (car-safe (cdr-safe (cdr-safe (car-safe xml-list))))))
+
+ (setq valtype (car (caddar xml-list))
+ valvalue (caddr (caddar xml-list)))
+ (cond
+ ;; Base64
+ ((eq valtype 'base64)
+ (if xml-rpc-base64-decode-unicode
+ (decode-coding-string (base64-decode-string valvalue) 'utf-8)
+ (base64-decode-string valvalue)))
+ ;; Boolean
+ ((eq valtype 'boolean)
+ (xml-rpc-string-to-boolean valvalue))
+ ;; String
+ ((eq valtype 'string)
+ valvalue)
+ ;; Integer
+ ((or (eq valtype 'int) (eq valtype 'i4))
+ (string-to-number valvalue))
+ ;; Double/float
+ ((eq valtype 'double)
+ (string-to-number valvalue))
+ ;; Struct
+ ((eq valtype 'struct)
+ (mapcar (lambda (member)
+ (let ((membername (cadr (cdaddr member)))
+ (membervalue (xml-rpc-xml-list-to-value (cdddr
member))))
+ (cons membername membervalue)))
+ (cddr (caddar xml-list))))
+ ;; Fault
+ ((eq valtype 'fault)
+ (let* ((struct (xml-rpc-xml-list-to-value (list valvalue)))
+ (fault-string (cdr (assoc "faultString" struct)))
+ (fault-code (cdr (assoc "faultCode" struct))))
+ (list 'fault fault-code fault-string)))
+ ;; DateTime
+ ((eq valtype 'dateTime.iso8601)
+ (list :datetime (date-to-time valvalue)))
+ ((eq valtype 'dateTime)
+ (list :datetime (date-to-time valvalue)))
+ ;; Array
+ ((eq valtype 'array)
+ (mapcar (lambda (arrval)
+ (xml-rpc-xml-list-to-value (list arrval)))
+ (cddr valvalue)))))
+ ((xml-rpc-caddar-safe xml-list)))))
(defun xml-rpc-boolean-to-string (value)
"Convert a boolean value to a string"
@@ -420,7 +430,7 @@ the parsed XML response is returned."
(setq xml-rpc-fault-string (nth 2 resp))
(setq xml-rpc-fault-code (nth 1 resp))
(error "XML-RPC fault `%s'" xml-rpc-fault-string)))
-
+
;; Interpret the XML list and produce a more useful data structure
(t
(let ((valpart (cdr (cdaddr (caddar xml)))))
@@ -459,6 +469,9 @@ a single argument being an xml.el style XML list.
It returns an XML list containing the method response from the XML-RPC server,
or nil if called with ASYNC-CALLBACK-FUNCTION."
+ (declare (special url-current-callback-data
+ url-current-callback-func
+ url-http-response-status))
(unwind-protect
(save-excursion
(let ((url-request-method "POST")
@@ -476,7 +489,7 @@ or nil if called with ASYNC-CALLBACK-FUNCTION."
(url-mime-charset-string "utf-8;q=1, iso-8859-1;q=0.5")
(url-request-coding-system xml-rpc-use-coding-system)
(url-http-attempt-keepalives t)
- (url-request-extra-headers (list
+ (url-request-extra-headers (list
(cons "Connection" "keep-alive")
(cons "Content-Type"
"text/xml; charset=utf-8"))))
@@ -555,10 +568,9 @@ or nil if called with ASYNC-CALLBACK-FUNCTION."
result))
((stringp l) ; will returning nil be acceptable ?
- elem)
+ nil)
- (t
- l)))
+ (t l)))
(defun xml-rpc-request-process-buffer (xml-buffer)
"Process buffer XML-BUFFER."
- [nongnu] elpa/xml-rpc bc781d6edd 51/64: Merge pull request #15 from skangas/lexical-binding, (continued)
- [nongnu] elpa/xml-rpc bc781d6edd 51/64: Merge pull request #15 from skangas/lexical-binding, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 960b2510e3 61/64: Update README, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc bc331d010b 56/64: Test CI, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 9fa979302b 63/64: Merge pull request #17 from xml-rpc-el/ci, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 7b4d6c4820 04/64: Update copyright. (xml-rpc-response-errorp): make safe., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 4efc188b7f 53/64: Merge pull request #13 from skangas/version-number, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc a190759da8 41/64: Merge pull request #2 from mdorman/master, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 7bcf1427b7 07/64: (xml-rpc-value-datep): New function to determine if a string is an ISO date. (xml-rpc-value-to-xml-list): Add support for vector inputs. Add support for strings that are really dates., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc bfa3f97259 09/64: Clean up long lines, address bugs, use string-to-number instead of obsolete string-to-int., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 417f3d2a94 12/64: (xml-entity-alist): provide a definition for really old versions of xml.el. (xml-rpc-use-coding-system): Make unicode variables dependent on the existence of utf-8 coding-system. Generally allow use of Emacs that don't understand Unicode -- although the HTTP headers still claim to be UTF-8. Update backwards-compatibility code after testing against XEmacs21., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 725bc20829 14/64: Bump the version. (xml-rpc-fault-string, xml-rpc-fault-code): Defvar some previously un-declared vars. (xml-rpc-value-intp, xml-rpc-value-doublep) (xml-rpc-value-stringp): Change from defun to defsubst for consistency. (xml-rpc-request, xml-rpc-list-to-value, xml-rpc-clean): Fix compilation warnings,
Stefan Kangas <=
- [nongnu] elpa/xml-rpc 68d54c3c0f 11/64: (xml-rpc-xml-list-to-value): Make sure XML-RPC's dateTime.iso8601 is handled. (xml-rpc-datetime-to-string): Grab the right piece of data. (xml-rpc-request-process-buffer): Kill buffer if not debugging. (timezone-parse-date): Conditionally override if the version we have can't handle iso8601 basic format., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc cd88a4f5fa 16/64: (xml-rpc-xml-list-to-value): Handle nil for an int gracefully. Consolidate dateTime parsing. (xml-rpc-datetime-to-string): Wordpress expects dateTime elements to match the XML-RPC spec and not ISO8601 spec. (xml-rpc-value-to-xml-list): Switch to iso8601 for default., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc d3d4460ec9 15/64: typo, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 28dfbff291 18/64: Add submit-bug function and mode toggling functionality., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 481ed72dff 22/64: update bug reporting function., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc c20aa6359a 29/64: bump version for continued development, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 25c380cab0 28/64: Update release notes, tag 1.6.8, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 3b4ac0ebf2 24/64: update urls, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 4b21d27d35 25/64: Eliminate xemacs compile warning, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 643bbfb5da 30/64: * Apply link from http://rix3.8.je/2009/12/15/emacs%E7%9A%84weblogger1-4-4%E7%9A%84wordpress-patch/, Stefan Kangas, 2021/12/31