summaryrefslogtreecommitdiff
path: root/third-party/s-xml-rpc/src/define-xmlrpc-method.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-30 20:52:07 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-30 20:52:07 +0100
commitddb83b1fb2d305e0c06fc067d82d6bab5458b0fd (patch)
tree8f9003926f0b5295c7a04b2ca257c0a2155ce841 /third-party/s-xml-rpc/src/define-xmlrpc-method.lisp
parent15937a1a4f1cf40bc55aa34eb71c67b88466ff57 (diff)
Add third-party XML processing libraries.
Ignore-this: 5ca28497555bf944858ca2f58bc8a62b darcs-hash:a0b0f9baa7c9b1259e755435db1fb17123630a6c
Diffstat (limited to 'third-party/s-xml-rpc/src/define-xmlrpc-method.lisp')
-rw-r--r--third-party/s-xml-rpc/src/define-xmlrpc-method.lisp30
1 files changed, 30 insertions, 0 deletions
diff --git a/third-party/s-xml-rpc/src/define-xmlrpc-method.lisp b/third-party/s-xml-rpc/src/define-xmlrpc-method.lisp
new file mode 100644
index 0000000..74a3bc3
--- /dev/null
+++ b/third-party/s-xml-rpc/src/define-xmlrpc-method.lisp
@@ -0,0 +1,30 @@
+;;;; -*- mode: lisp -*-
+;;;;
+;;;; $Id: define-xmlrpc-method.lisp,v 1.1 2004-07-08 19:45:25 scaekenberghe Exp $
+;;;;
+;;;; The code in this file adds a very handly define-xmlrpc-method macro.
+;;;;
+;;;; (define-xmlrpc-method get-state-name (state)
+;;;; :url #u"http://betty.userland.com/RPC2"
+;;;; :method "examples.getStateName")
+;;;;
+;;;; (define-xmlrpc-method get-time ()
+;;;; :url #u"http://time.xmlrpc.com/RPC2"
+;;;; :method "currentTime.getCurrentTime")
+;;;;
+;;;; It require the PURI package.
+;;;;
+;;;; Copyright (C) 2004 Frederic Brunel.
+;;;;
+;;;; You are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
+
+(defmacro define-xmlrpc-method (name args &key url method)
+ `(defun ,name ,args
+ (xml-rpc-call (encode-xml-rpc-call ,method ,@args)
+ :url ,(puri:uri-path url)
+ :host ,(puri:uri-host url)
+ :port ,(cond ((puri:uri-port url)) (t 80)))))
+
+;;;; eof