Annotation of embedaddon/libpdel/http/xml.h, revision 1.1.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_XML_H_
                     42: #define _PDEL_HTTP_XML_H_
                     43: 
                     44: struct http_client;
                     45: struct structs_type;
                     46: struct xmlrpc_compact_fault;
                     47: 
                     48: __BEGIN_DECLS
                     49: 
                     50: /*
                     51:  * Send structured message, wait for a reply, and return the reply.
                     52:  * If there was an error, NULL is returned and errno is set.
                     53:  *
                     54:  * Parameters:
                     55:  *
                     56:  *     client          HTTP client
                     57:  *     ip, port        Remote HTTP server
                     58:  *     https           Non-zero for SSL
                     59:  *     urlpath         Remote URL path (must begin with '/')
                     60:  *     username        HTTP auth username (or NULL)
                     61:  *     password        HTTP auth password (or NULL)
                     62:  *     ptag            XML document element tag for payload
                     63:  *     pattrs          Attributes for ptag tag, or NULL for none
                     64:  *     ptype           Payload type
                     65:  *     payload         Payload (or NULL to do a GET instead of a POST)
                     66:  *     pflags          Flags to structs_xml_output()
                     67:  *     rtag            XML document element tag for reply
                     68:  *     rattrsp         Pointer to string to hold reply attributes (if != NULL)
                     69:  *     rattrs_mtype    Allocation type for *rattrsp.
                     70:  *     rtype           Reply type
                     71:  *     reply           Reply data
                     72:  *     rflags          Flags to structs_xml_input()
                     73:  *     rlogger         XML logger
                     74:  *
                     75:  * This function returns zero on success, -1 on error.
                     76:  */
                     77: extern int     http_xml_send(struct http_client *client, struct in_addr ip,
                     78:                        u_int16_t port, int https, const char *urlpath,
                     79:                        const char *username, const char *password,
                     80:                        const char *ptag, const char *pattrs,
                     81:                        const struct structs_type *ptype, const void *payload,
                     82:                        int pflags, const char *rtag, char **rattrsp,
                     83:                        const char *rattrs_mtype,
                     84:                        const struct structs_type *rtype, void *reply,
                     85:                        int rflags, structs_xmllog_t *rlogger);
                     86: 
                     87: /*
                     88:  * Send XML-RPC message, wait for a reply, and return the reply.
                     89:  * If there was an error, NULL is returned and errno is set.
                     90:  *
                     91:  * Parameters:
                     92:  *
                     93:  *     client          HTTP client
                     94:  *     ip, port        Remote HTTP server
                     95:  *     https           Non-zero for SSL
                     96:  *     username        HTTP auth username (or NULL)
                     97:  *     password        HTTP auth password (or NULL)
                     98:  *     methodName      Name of XML-RPC method
                     99:  *     nparams         Number of parameters
                    100:  *     ptypes          Array of pointers to parameter types
                    101:  *     pdatas          Array of pointers to parameter structures
                    102:  *     rtype           Reply type (or NULL)
                    103:  *     reply           Uninitialized reply (or NULL)
                    104:  *     faultp          Set to non-NULL to indicate a fault
                    105:  *     rlogger         XML logger
                    106:  *
                    107:  * This function returns zero on success, -1 on a system error, or -2
                    108:  * if an XML-RPC fault was returned (in which case *fault, if not NULL, will
                    109:  * be initialized and filled in (so *fault should never be pre-initialized
                    110:  * but it should be freed via structs_free() if -2 is returned)).
                    111:  */
                    112: extern int     http_xml_send_xmlrpc(struct http_client *client,
                    113:                        struct in_addr ip, u_int16_t port, int https,
                    114:                        const char *username, const char *password,
                    115:                        const char *methodName, u_int nparams,
                    116:                        const struct structs_type **ptypes, const void **pdatas,
                    117:                        const struct structs_type *rtype, void *reply,
                    118:                        struct xmlrpc_compact_fault *faultp,
                    119:                        structs_xmllog_t *rlogger);
                    120: 
                    121: __END_DECLS
                    122: 
                    123: #endif /* _PDEL_HTTP_XML_H_ */

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