Annotation of embedaddon/libpdel/http/servlet/xmlrpc.h, revision 1.1

1.1     ! misho       1: 
        !             2: /*
        !             3:  * Copyright (c) 2001-2002 Packet Design, LLC.
        !             4:  * All rights reserved.
        !             5:  * 
        !             6:  * Subject to the following obligations and disclaimer of warranty,
        !             7:  * use and redistribution of this software, in source or object code
        !             8:  * forms, with or without modifications are expressly permitted by
        !             9:  * Packet Design; provided, however, that:
        !            10:  * 
        !            11:  *    (i)  Any and all reproductions of the source or object code
        !            12:  *         must include the copyright notice above and the following
        !            13:  *         disclaimer of warranties; and
        !            14:  *    (ii) No rights are granted, in any manner or form, to use
        !            15:  *         Packet Design trademarks, including the mark "PACKET DESIGN"
        !            16:  *         on advertising, endorsements, or otherwise except as such
        !            17:  *         appears in the above copyright notice or in the software.
        !            18:  * 
        !            19:  * THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND
        !            20:  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO
        !            21:  * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING
        !            22:  * THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED
        !            23:  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
        !            24:  * OR NON-INFRINGEMENT.  PACKET DESIGN DOES NOT WARRANT, GUARANTEE,
        !            25:  * OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS
        !            26:  * OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY,
        !            27:  * RELIABILITY OR OTHERWISE.  IN NO EVENT SHALL PACKET DESIGN BE
        !            28:  * LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE
        !            29:  * OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT,
        !            30:  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL
        !            31:  * DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF
        !            32:  * USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY THEORY OF
        !            33:  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
        !            34:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
        !            35:  * THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
        !            36:  * THE POSSIBILITY OF SUCH DAMAGE.
        !            37:  *
        !            38:  * Author: Archie Cobbs <archie@freebsd.org>
        !            39:  */
        !            40: 
        !            41: #ifndef _PDEL_HTTP_SERVLET_XMLRPC_H_
        !            42: #define _PDEL_HTTP_SERVLET_XMLRPC_H_
        !            43: 
        !            44: struct http_servlet_xmlrpc_method;
        !            45: struct http_servlet_xmlrpc_servlet_info;
        !            46: struct http_request;
        !            47: struct structs_type;
        !            48: 
        !            49: /*
        !            50:  * User-supplied handler for http_servlet_xmlrpc. Should return the
        !            51:  * reply structure (and set *rtypep to its type) if successful.
        !            52:  *
        !            53:  * If a fault is to be returned, return a "struct structs_xmlrpc_fault",
        !            54:  * set *typep to &structs_type_xmlrpc_fault, and set *fault to non-zero.
        !            55:  *
        !            56:  * If a system error is to be returned, return NULL and set errno.
        !            57:  *
        !            58:  * Parameters
        !            59:  *
        !            60:  *     arg             User-supplied cookie
        !            61:  *     method          Name of XML-RPC method
        !            62:  *     req             Incoming HTTP request structure (do not free)
        !            63:  *     nparams         Number of parameters
        !            64:  *     params          Parameters
        !            65:  *     mtype           Memory type for allocating response
        !            66:  *     rtypep          Upon return, response type or NULL for xmlrpc_value
        !            67:  *     fault           Set *fault to non-zero if returning a fault
        !            68:  */
        !            69: typedef void   *http_servlet_xmlrpc_handler_t(void *arg, const char *method,
        !            70:                        struct http_request *req, u_int nparams,
        !            71:                        const void **params, const char *mtype,
        !            72:                        const struct structs_type **rtypep, int *fault);
        !            73: 
        !            74: /*
        !            75:  * Information required by for one XML-RPC method.
        !            76:  *
        !            77:  *     name            Name of XML-RPC method, or empty string for wildcard
        !            78:  *     handler         Handler function for method
        !            79:  *     ptypes          Parameter types, or NULL for xmlrpc_value
        !            80:  *     min_params      Minimum number of parameters accepted
        !            81:  *     max_params      Maximum number of parameters accepted
        !            82:  */
        !            83: struct http_servlet_xmlrpc_method {
        !            84:        const char                      *name;          /* method name */
        !            85:        http_servlet_xmlrpc_handler_t   *handler;       /* method handler */
        !            86:        const struct structs_type       **ptypes;       /* parameter types */
        !            87:        u_int                           min_params;     /* min # params */
        !            88:        u_int                           max_params;     /* max # params */
        !            89: };
        !            90: 
        !            91: /*
        !            92:  * Information required by http_servlet_xmlrpc().
        !            93:  *
        !            94:  *     method          List of acceptable methods
        !            95:  *     logger          Logging function
        !            96:  */
        !            97: struct http_servlet_xmlrpc_info {
        !            98:        const struct http_servlet_xmlrpc_method
        !            99:                                        *methods;       /* methods (NULL trm)*/
        !           100:        http_logger_t                   *logger;        /* loggging function */
        !           101: };
        !           102: 
        !           103: __BEGIN_DECLS
        !           104: 
        !           105: /*
        !           106:  * Create a new http_servlet_xmlrpc servlet.
        !           107:  *
        !           108:  * NOTE: "info" is not copied and so must remain valid for the
        !           109:  * lifetime of the servlet.
        !           110:  */
        !           111: extern struct  http_servlet *http_servlet_xmlrpc_create(
        !           112:                        const struct http_servlet_xmlrpc_info *info,
        !           113:                        void *arg, void (*destroy)(void *));
        !           114: 
        !           115: __END_DECLS
        !           116: 
        !           117: #endif /* _PDEL_HTTP_SERVLET_XMLRPC_H_ */
        !           118: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>