ne_acl.h   ne_acl.h 
/* /*
Access control Access control
Copyright (C) 2001, Joe Orton <joe@manyfish.co.uk> Copyright (C) 2001-2006, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
skipping to change at line 52 skipping to change at line 52
char *principal; char *principal;
int read; int read;
int read_acl; int read_acl;
int write; int write;
int write_acl; int write_acl;
int read_cuprivset; int read_cuprivset;
} ne_acl_entry; } ne_acl_entry;
/* Set the ACL for the given resource to the list of ACL entries. */ /* Set the ACL for the given resource to the list of ACL entries. */
int ne_acl_set(ne_session *sess, const char *uri, int ne_acl_set(ne_session *sess, const char *uri,
ne_acl_entry entries[], int numentries); const ne_acl_entry entries[], int numentries);
NE_END_DECLS NE_END_DECLS
#endif /* NE_ACL_H */ #endif /* NE_ACL_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 ne_alloc.h   ne_alloc.h 
skipping to change at line 48 skipping to change at line 48
void ne_oom_callback(ne_oom_callback_fn callback); void ne_oom_callback(ne_oom_callback_fn callback);
#ifndef NEON_MEMLEAK #ifndef NEON_MEMLEAK
/* Replacements for standard C library memory allocation functions, /* Replacements for standard C library memory allocation functions,
* which never return NULL. If the C library malloc() returns NULL, * which never return NULL. If the C library malloc() returns NULL,
* neon will abort(); calling an OOM callback beforehand if one is * neon will abort(); calling an OOM callback beforehand if one is
* registered. The C library will only ever return NULL if the * registered. The C library will only ever return NULL if the
* operating system does not use optimistic memory allocation. */ * operating system does not use optimistic memory allocation. */
void *ne_malloc(size_t size) ne_attribute_malloc; void *ne_malloc(size_t size) ne_attribute_malloc;
void *ne_calloc(size_t size) ne_attribute_malloc; void *ne_calloc(size_t size) ne_attribute_malloc;
void *ne_realloc(void *ptr, size_t s) ne_attribute_malloc; void *ne_realloc(void *ptr, size_t s);
char *ne_strdup(const char *s) ne_attribute_malloc; char *ne_strdup(const char *s) ne_attribute_malloc;
char *ne_strndup(const char *s, size_t n) ne_attribute_malloc; char *ne_strndup(const char *s, size_t n) ne_attribute_malloc;
#define ne_free free #define ne_free free
#endif #endif
NE_END_DECLS NE_END_DECLS
#endif /* NE_ALLOC_H */ #endif /* NE_ALLOC_H */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 ne_compress.h   ne_compress.h 
skipping to change at line 27 skipping to change at line 27
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA MA 02111-1307, USA
*/ */
#ifndef NE_COMPRESS_H #ifndef NE_COMPRESS_H
#define NE_COMPRESS_H #define NE_COMPRESS_H
#include "ne_request.h" #include "ne_request.h"
NE_BEGIN_DECLS
typedef struct ne_decompress_s ne_decompress; typedef struct ne_decompress_s ne_decompress;
/* Call this to register a 'reader' callback which will be passed /* Call this to register a 'reader' callback which will be passed
* blocks of response body (if the 'acceptance' callback is * blocks of response body (if the 'acceptance' callback is
* successful). If the response body is returned compressed by the * successful). If the response body is returned compressed by the
* server, this reader will receive UNCOMPRESSED blocks. * server, this reader will receive UNCOMPRESSED blocks.
* *
* Returns pointer to context object which must be passed to * Returns pointer to context object which must be passed to
* ne_decompress_destroy after the request has been dispatched, to * ne_decompress_destroy after the request has been dispatched, to
* free any internal state. If an error occurs during decompression, * free any internal state. If an error occurs during decompression,
* the request will be aborted and session error string set. */ * the request will be aborted and session error string set. */
ne_decompress *ne_decompress_reader(ne_request *req, ne_accept_response acc pt, ne_decompress *ne_decompress_reader(ne_request *req, ne_accept_response acc pt,
ne_block_reader rdr, void *userdata); ne_block_reader rdr, void *userdata);
/* Destroys decompression state. */ /* Destroys decompression state. */
void ne_decompress_destroy(ne_decompress *ctx); void ne_decompress_destroy(ne_decompress *ctx);
NE_END_DECLS
#endif /* NE_COMPRESS_H */ #endif /* NE_COMPRESS_H */
 End of changes. 2 change blocks. 
0 lines changed or deleted 4 lines changed or added


 ne_defs.h   ne_defs.h 
/* /*
Standard definitions for neon headers Standard definitions for neon headers
Copyright (C) 2003-2005, Joe Orton <joe@manyfish.co.uk> Copyright (C) 2003-2006, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
skipping to change at line 32 skipping to change at line 32
#undef NE_BEGIN_DECLS #undef NE_BEGIN_DECLS
#undef NE_END_DECLS #undef NE_END_DECLS
#ifdef __cplusplus #ifdef __cplusplus
# define NE_BEGIN_DECLS extern "C" { # define NE_BEGIN_DECLS extern "C" {
# define NE_END_DECLS } # define NE_END_DECLS }
#else #else
# define NE_BEGIN_DECLS /* empty */ # define NE_BEGIN_DECLS /* empty */
# define NE_END_DECLS /* empty */ # define NE_END_DECLS /* empty */
#endif #endif
#ifndef NE_DEFS_H
#define NE_DEFS_H
#include <sys/types.h>
#ifdef NE_LFS
typedef off64_t ne_off_t;
#else
typedef off_t ne_off_t;
#endif
/* define ssize_t for Win32 */ /* define ssize_t for Win32 */
#if defined(WIN32) && !defined(ssize_t) #if defined(WIN32) && !defined(ssize_t)
#define ssize_t int #define ssize_t int
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#if __GNUC__ >= 3 #if __GNUC__ >= 3
#define ne_attribute_malloc __attribute__((malloc)) #define ne_attribute_malloc __attribute__((malloc))
#else #else
#define ne_attribute_malloc #define ne_attribute_malloc
#endif #endif
#define ne_attribute(x) __attribute__(x) #define ne_attribute(x) __attribute__(x)
#else #else
#define ne_attribute(x) #define ne_attribute(x)
#define ne_attribute_malloc #define ne_attribute_malloc
#endif #endif
#ifndef NE_BUFSIZ #ifndef NE_BUFSIZ
#define NE_BUFSIZ 8192 #define NE_BUFSIZ 8192
#endif #endif
#endif /* NE_DEFS_H */
 End of changes. 3 change blocks. 
1 lines changed or deleted 12 lines changed or added


 ne_md5.h   ne_md5.h 
skipping to change at line 22 skipping to change at line 22
The GNU C Library is distributed in the hope that it will be useful, The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not, License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330 , write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330 ,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#ifndef NEON_MD5_H #ifndef NE_MD5_H
#define NEON_MD5_H 1 #define NE_MD5_H 1
#include <stdio.h> #include <stdio.h>
#include "ne_defs.h"
NE_BEGIN_DECLS
/* /*
* The following three functions are build up the low level used in * The following three functions are build up the low level used in
* the functions `md5_stream' and `md5_buffer'. * the functions `md5_stream' and `md5_buffer'.
*/ */
struct ne_md5_ctx; struct ne_md5_ctx;
/* Create structure containing state of computation. */ /* Create structure containing state of computation. */
extern struct ne_md5_ctx *ne_md5_create_ctx(void); extern struct ne_md5_ctx *ne_md5_create_ctx(void);
/* Starting with the result of former calls of this function (or the /* Starting with the result of former calls of this function (or the
skipping to change at line 91 skipping to change at line 95
/* Process the remaining bytes in the buffer and put ASCII /* Process the remaining bytes in the buffer and put ASCII
representation of the resulting message digest from CTX in the representation of the resulting message digest from CTX in the
first 33 bytes of BUFFER, including a trailing NUL terminator first 33 bytes of BUFFER, including a trailing NUL terminator
byte. Returns pointer to buffer. */ byte. Returns pointer to buffer. */
char *ne_md5_finish_ascii(struct ne_md5_ctx *ctx, char buffer[33]); char *ne_md5_finish_ascii(struct ne_md5_ctx *ctx, char buffer[33]);
/* MD5 ascii->binary conversion */ /* MD5 ascii->binary conversion */
void ne_md5_to_ascii(const unsigned char md5_buf[16], char *buffer); void ne_md5_to_ascii(const unsigned char md5_buf[16], char *buffer);
void ne_ascii_to_md5(const char *buffer, unsigned char md5_buf[16]); void ne_ascii_to_md5(const char *buffer, unsigned char md5_buf[16]);
#endif /* NEON_MD5_H */ NE_END_DECLS
#endif /* NE_MD5_H */
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added


 ne_redirect.h   ne_redirect.h 
skipping to change at line 29 skipping to change at line 29
*/ */
#ifndef NE_REDIRECT_H #ifndef NE_REDIRECT_H
#define NE_REDIRECT_H #define NE_REDIRECT_H
#include "ne_request.h" #include "ne_request.h"
NE_BEGIN_DECLS NE_BEGIN_DECLS
/* Register redirect handling: if a redirection response is given, the /* Register redirect handling for the session: if a valid redirect
* request will fail with the NE_REDIRECT code, and the destinsation * (30x) response is given for any request in this session, the
* of the redirect can be retrieved using ne_redirect_location(). */ * request will fail with the NE_REDIRECT code, and the destination of
* the redirect can be retrieved using ne_redirect_location(). */
void ne_redirect_register(ne_session *sess); void ne_redirect_register(ne_session *sess);
/* Returns location of last redirect. Will return NULL if no redirect /* Returns location of last redirect for the session. Returns NULL if
* has been encountered for given session, or the last redirect * no redirect has been encountered for given session, or the last
* encountered could not be parsed. */ * redirect encountered could not be parsed. */
const ne_uri *ne_redirect_location(ne_session *sess); const ne_uri *ne_redirect_location(ne_session *sess);
NE_END_DECLS NE_END_DECLS
#endif /* NE_REDIRECT_H */ #endif /* NE_REDIRECT_H */
 End of changes. 2 change blocks. 
6 lines changed or deleted 7 lines changed or added


 ne_request.h   ne_request.h 
skipping to change at line 60 skipping to change at line 60
ne_request *ne_request_create(ne_session *sess, ne_request *ne_request_create(ne_session *sess,
const char *method, const char *path); const char *method, const char *path);
/* The request body will be taken from 'size' bytes of 'buffer'. */ /* The request body will be taken from 'size' bytes of 'buffer'. */
void ne_set_request_body_buffer(ne_request *req, const char *buffer, void ne_set_request_body_buffer(ne_request *req, const char *buffer,
size_t size); size_t size);
/* The request body will be taken from 'length' bytes read from the /* The request body will be taken from 'length' bytes read from the
* file descriptor 'fd', starting from file offset 'offset'. */ * file descriptor 'fd', starting from file offset 'offset'. */
void ne_set_request_body_fd(ne_request *req, int fd, void ne_set_request_body_fd(ne_request *req, int fd,
off_t offset, off_t length); ne_off_t offset, ne_off_t length);
#ifdef NE_LFS
/* Alternate version of ne_set_request_body_fd taking off64_t
* offset type for systems supporting _LARGEFILE64_SOURCE. */
void ne_set_request_body_fd64(ne_request *req, int fd,
off64_t offset, off64_t length);
#endif
/* "Pull"-based request body provider: a callback which is invoked to /* "Pull"-based request body provider: a callback which is invoked to
* provide blocks of request body on demand. * provide blocks of request body on demand.
* *
* Before each time the body is provided, the callback will be called * Before each time the body is provided, the callback will be called
* once with buflen == 0. The body may have to be provided >1 time * once with buflen == 0. The body may have to be provided >1 time
* per request (for authentication retries etc.). * per request (for authentication retries etc.).
* *
* For a call with buflen == 0, the callback must return zero on success * For a call with buflen == 0, the callback must return zero on success
* or non-zero on error; the session error string must be set on error. * or non-zero on error; the session error string must be set on error.
skipping to change at line 89 skipping to change at line 82
* <0 : error, abort request; session error string must be set. * <0 : error, abort request; session error string must be set.
* 0 : ignore 'buffer' contents, end of body. * 0 : ignore 'buffer' contents, end of body.
* 0 < x <= buflen : buffer contains x bytes of body data. */ * 0 < x <= buflen : buffer contains x bytes of body data. */
typedef ssize_t (*ne_provide_body)(void *userdata, typedef ssize_t (*ne_provide_body)(void *userdata,
char *buffer, size_t buflen); char *buffer, size_t buflen);
/* Install a callback which is invoked as needed to provide the /* Install a callback which is invoked as needed to provide the
* request body, a block at a time. The total size of the request * request body, a block at a time. The total size of the request
* body is 'length'; the callback must ensure that it returns no more * body is 'length'; the callback must ensure that it returns no more
* than 'length' bytes in total. */ * than 'length' bytes in total. */
void ne_set_request_body_provider(ne_request *req, off_t length, void ne_set_request_body_provider(ne_request *req, ne_off_t length,
ne_provide_body provider, void *userdata); ne_provide_body provider, void *userdata);
#ifdef NE_LFS
/* Duplicate version of ne_set_request_body_provider, taking an off64_t
* offset. */
void ne_set_request_body_provider64(ne_request *req, off64_t length,
ne_provide_body provider, void *userdat
a);
#endif
/* Handling response bodies; two callbacks must be provided: /* Handling response bodies; two callbacks must be provided:
* *
* 1) 'acceptance' callback: determines whether you want to handle the * 1) 'acceptance' callback: determines whether you want to handle the
* response body given the response-status information, e.g., if you * response body given the response-status information, e.g., if you
* only want 2xx responses, say so here. * only want 2xx responses, say so here.
* *
* 2) 'reader' callback: passed blocks of the response-body as they * 2) 'reader' callback: passed blocks of the response-body as they
* arrive, if the acceptance callback returned non-zero. */ * arrive, if the acceptance callback returned non-zero. */
/* 'acceptance' callback type. Return non-zero to accept the response, /* 'acceptance' callback type. Return non-zero to accept the response,
skipping to change at line 251 skipping to change at line 237
/* Return 0 if the given flag is not set, >0 it is set, or -1 if the /* Return 0 if the given flag is not set, >0 it is set, or -1 if the
* flag is not supported. */ * flag is not supported. */
int ne_get_request_flag(ne_request *req, ne_request_flag flag); int ne_get_request_flag(ne_request *req, ne_request_flag flag);
/**** Request hooks handling *****/ /**** Request hooks handling *****/
typedef void (*ne_free_hooks)(void *cookie); typedef void (*ne_free_hooks)(void *cookie);
/* Hook called when a request is created; passed the request method, /* Hook called when a request is created; passed the request method,
* and the string used as the Request-URI (note that this may be a * and the string used as the Request-URI (note that this may be a
* absolute URI if a proxy is in use, an absolute path, a "*", * absolute URI if a proxy is in use, an absolute path, a "*", etc).
* etc). */ * A create_request hook is called exactly once per request. */
typedef void (*ne_create_request_fn)(ne_request *req, void *userdata, typedef void (*ne_create_request_fn)(ne_request *req, void *userdata,
const char *method, const char *requri) ; const char *method, const char *requri) ;
void ne_hook_create_request(ne_session *sess, void ne_hook_create_request(ne_session *sess,
ne_create_request_fn fn, void *userdata); ne_create_request_fn fn, void *userdata);
/* Hook called before the request is sent. 'header' is the raw HTTP /* Hook called before the request is sent. 'header' is the raw HTTP
* header before the trailing CRLF is added: add in more here. */ * header before the trailing CRLF is added; more headers can be added
* here. A pre_send hook may be called >1 time per request if the
* request is retried due to a post_send hook returning NE_RETRY. */
typedef void (*ne_pre_send_fn)(ne_request *req, void *userdata, typedef void (*ne_pre_send_fn)(ne_request *req, void *userdata,
ne_buffer *header); ne_buffer *header);
void ne_hook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata); void ne_hook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata);
/* Hook called directly after the response headers have been read, but
* before the resposnse body has been read. 'status' is the response
* status-code. A post_header hook may be called >1 time per request
* if the request is retried due to a post_send hook returning
* NE_RETRY. */
typedef void (*ne_post_headers_fn)(ne_request *req, void *userdata,
const ne_status *status);
void ne_hook_post_headers(ne_session *sess,
ne_post_headers_fn fn, void *userdata);
/* Hook called after the request is dispatched (request sent, and /* Hook called after the request is dispatched (request sent, and
* the entire response read). If an error occurred reading the response, * the entire response read). If an error occurred reading the response,
* this hook will not run. May return: * this hook will not run. May return:
* NE_OK everything is okay * NE_OK everything is okay
* NE_RETRY try sending the request again. * NE_RETRY try sending the request again.
* anything else signifies an error, and the request is failed. The return * anything else signifies an error, and the request is failed. The return
* code is passed back the _dispatch caller, so the session error must * code is passed back the _dispatch caller, so the session error must
* also be set appropriately (ne_set_error). * also be set appropriately (ne_set_error).
*/ */
typedef int (*ne_post_send_fn)(ne_request *req, void *userdata, typedef int (*ne_post_send_fn)(ne_request *req, void *userdata,
skipping to change at line 297 skipping to change at line 295
/* The ne_unhook_* functions remove a hook registered with the given /* The ne_unhook_* functions remove a hook registered with the given
* session. If a hook is found which was registered with a given * session. If a hook is found which was registered with a given
* function 'fn', and userdata pointer 'userdata', then it will be * function 'fn', and userdata pointer 'userdata', then it will be
* removed from the hooks list. * removed from the hooks list.
* *
* It is unsafe to use any of these functions from a hook function to * It is unsafe to use any of these functions from a hook function to
* unregister itself, except for ne_unhook_destroy_request. */ * unregister itself, except for ne_unhook_destroy_request. */
void ne_unhook_create_request(ne_session *sess, void ne_unhook_create_request(ne_session *sess,
ne_create_request_fn fn, void *userdata); ne_create_request_fn fn, void *userdata);
void ne_unhook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata ); void ne_unhook_pre_send(ne_session *sess, ne_pre_send_fn fn, void *userdata );
void ne_unhook_post_headers(ne_session *sess, ne_post_headers_fn fn, void * userdata);
void ne_unhook_post_send(ne_session *sess, ne_post_send_fn fn, void *userda ta); void ne_unhook_post_send(ne_session *sess, ne_post_send_fn fn, void *userda ta);
void ne_unhook_destroy_request(ne_session *sess, void ne_unhook_destroy_request(ne_session *sess,
ne_destroy_req_fn fn, void *userdata); ne_destroy_req_fn fn, void *userdata);
void ne_unhook_destroy_session(ne_session *sess, void ne_unhook_destroy_session(ne_session *sess,
ne_destroy_sess_fn fn, void *userdata); ne_destroy_sess_fn fn, void *userdata);
/* Store an opaque context for the request, 'priv' is returned by a /* Store an opaque context for the request, 'priv' is returned by a
* call to ne_request_get_private with the same ID. */ * call to ne_request_get_private with the same ID. */
void ne_set_request_private(ne_request *req, const char *id, void *priv); void ne_set_request_private(ne_request *req, const char *id, void *priv);
void *ne_get_request_private(ne_request *req, const char *id); void *ne_get_request_private(ne_request *req, const char *id);
 End of changes. 7 change blocks. 
20 lines changed or deleted 18 lines changed or added


 ne_session.h   ne_session.h 
/* /*
HTTP session handling HTTP session handling
Copyright (C) 1999-2006, Joe Orton <joe@manyfish.co.uk> Copyright (C) 1999-2007, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
skipping to change at line 64 skipping to change at line 64
typedef enum ne_session_flag_e { typedef enum ne_session_flag_e {
NE_SESSFLAG_PERSIST = 0, /* disable this flag to prevent use of NE_SESSFLAG_PERSIST = 0, /* disable this flag to prevent use of
* persistent connections. */ * persistent connections. */
NE_SESSFLAG_ICYPROTO, /* enable this flag to enable support for NE_SESSFLAG_ICYPROTO, /* enable this flag to enable support for
* non-HTTP ShoutCast-style "ICY" responses. */ * non-HTTP ShoutCast-style "ICY" responses. */
NE_SESSFLAG_SSLv2, /* disable this flag to disable support for NE_SESSFLAG_SSLv2, /* disable this flag to disable support for
* SSLv2, if supported by the SSL library. */ * SSLv2, if supported by the SSL library. */
NE_SESSFLAG_RFC4918, /* enable this flag to enable support for
* RFC4918-only WebDAV features; losing
* backwards-compatibility with RFC2518
* servers. */
NE_SESSFLAG_CONNAUTH, /* enable this flag if an awful, broken,
* RFC-violating, connection-based HTTP
* authentication scheme is in use. */
NE_SESSFLAG_LAST /* enum sentinel value */ NE_SESSFLAG_LAST /* enum sentinel value */
} ne_session_flag; } ne_session_flag;
/* Set a new value for a particular session flag. */ /* Set a new value for a particular session flag. */
void ne_set_session_flag(ne_session *sess, ne_session_flag flag, int value) ; void ne_set_session_flag(ne_session *sess, ne_session_flag flag, int value) ;
/* Return 0 if the given flag is not set, >0 it is set, or -1 if the /* Return 0 if the given flag is not set, >0 it is set, or -1 if the
* flag is not supported. */ * flag is not supported. */
int ne_get_session_flag(ne_session *sess, ne_session_flag flag); int ne_get_session_flag(ne_session *sess, ne_session_flag flag);
/* Bypass the normal name resolution; force the use of specific set of /* Bypass the normal name resolution; force the use of specific set of
* addresses for this session, addrs[0]...addrs[n-1]. The addrs array * addresses for this session, addrs[0]...addrs[n-1]. The addrs array
* must remain valid until the session is destroyed. */ * must remain valid until the session is destroyed. */
void ne_set_addrlist(ne_session *sess, const ne_inet_addr **addrs, size_t n ); void ne_set_addrlist(ne_session *sess, const ne_inet_addr **addrs, size_t n );
/* Progress callback. */ /* DEPRECATED: Progress callback. */
typedef void (*ne_progress)(void *userdata, off_t progress, off_t total); typedef void (*ne_progress)(void *userdata, ne_off_t progress, ne_off_t tot
al);
/* Set a progress callback for the session. */ /* DEPRECATED API: Set a progress callback for the session; this is
void ne_set_progress(ne_session *sess, * deprecated in favour of ne_set_notifier(). The progress callback
ne_progress progress, void *userdata); * is invoked for after each block of the request and response body to
* indicate request and response progress (there is no way to
* distinguish between the two using this interface alone).
*
* NOTE: Use of this interface is mutually exclusive with the use of
* ne_set_notifier(). A call to ne_set_progress() removes the
* notifier callback, and vice versa. */
void ne_set_progress(ne_session *sess, ne_progress progress, void *userdata
);
/* Store an opaque context for the session, 'priv' is returned by a /* Store an opaque context for the session, 'priv' is returned by a
* call to ne_session_get_private with the same ID. */ * call to ne_session_get_private with the same ID. */
void ne_set_session_private(ne_session *sess, const char *id, void *priv); void ne_set_session_private(ne_session *sess, const char *id, void *priv);
void *ne_get_session_private(ne_session *sess, const char *id); void *ne_get_session_private(ne_session *sess, const char *id);
/* Status event type. */
typedef enum { typedef enum {
ne_conn_namelookup, /* lookup up hostname (info = hostname) */ ne_status_lookup = 0, /* looking up hostname */
ne_conn_connecting, /* connecting to host (info = hostname) */ ne_status_connecting, /* connecting to host */
ne_conn_connected, /* connected to host (info = hostname) */ ne_status_connected, /* connected to host */
ne_conn_secure /* connection now secure (info = crypto level) */ ne_status_sending, /* sending a request body */
} ne_conn_status; ne_status_recving, /* receiving a response body */
ne_status_disconnected /* disconnected from host */
} ne_session_status;
typedef void (*ne_notify_status)(void *userdata, /* Status event information union; the relevant structure within
ne_conn_status status, * corresponds to the event type. WARNING: the size of this union is
const char *info); * not limited by ABI constraint; it may be extended with additional
* members of different size, or existing members may be extended. */
typedef union ne_session_status_info_u {
struct /* ne_status_lookup */ {
/* The hostname which is being resolved: */
const char *hostname;
} lu;
struct /* ne_status_connecting */ {
/* The hostname and network address to which a connection
* attempt is being made: */
const char *hostname;
const ne_inet_addr *address;
} ci;
struct /* ne_status_connected, ne_status_disconnected */ {
/* The hostname to which a connection has just been
* established or closed: */
const char *hostname;
} cd;
struct /* ne_status_sending and ne_status_recving */ {
/* Request/response body transfer progress; if total == 0, the
* total size is unknown; else 0 <= progress <= total: */
ne_off_t progress, total;
} sr;
} ne_session_status_info;
/* Callback invoked to notify a new session status event, given by the
* 'status' argument. On invocation, the contents of exactly one of
* the structures in the info union will be valid, as indicated
* above. */
typedef void (*ne_notify_status)(void *userdata, ne_session_status status,
const ne_session_status_info *info);
/* Set a status notification callback for the session, to report /* Set a status notification callback for the session, to report
* connection status. */ * session status events. Only one notification callback per session
void ne_set_status(ne_session *sess, * can be registered; the most recent of successive calls to this
ne_notify_status status, void *userdata); * function takes effect. Note that
*
* NOTE: Use of this interface is mutually exclusive with the use of
* ne_set_progress(). A call to ne_set_notifier() removes the
* progress callback, and vice versa. */
void ne_set_notifier(ne_session *sess, ne_notify_status status, void *userd
ata);
/* Certificate verification failures. /* Certificate verification failures.
* The certificate is not yet valid: */ * The certificate is not yet valid: */
#define NE_SSL_NOTYETVALID (0x01) #define NE_SSL_NOTYETVALID (0x01)
/* The certificate has expired: */ /* The certificate has expired: */
#define NE_SSL_EXPIRED (0x02) #define NE_SSL_EXPIRED (0x02)
/* The hostname for which the certificate was issued does not /* The hostname for which the certificate was issued does not
* match the hostname of the server; this could mean that the * match the hostname of the server; this could mean that the
* connection is being intercepted: */ * connection is being intercepted: */
#define NE_SSL_IDMISMATCH (0x04) #define NE_SSL_IDMISMATCH (0x04)
skipping to change at line 147 skipping to change at line 201
* certificate, or the server cert has other verification problems. */ * certificate, or the server cert has other verification problems. */
void ne_ssl_set_verify(ne_session *sess, ne_ssl_verify_fn fn, void *userdat a); void ne_ssl_set_verify(ne_session *sess, ne_ssl_verify_fn fn, void *userdat a);
/* Use the given client certificate for the session. The client cert /* Use the given client certificate for the session. The client cert
* MUST be in the decrypted state, otherwise behaviour is undefined. * MUST be in the decrypted state, otherwise behaviour is undefined.
* The 'clicert' object is duplicated internally so can be destroyed * The 'clicert' object is duplicated internally so can be destroyed
* by the caller. */ * by the caller. */
void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *clicert ); void ne_ssl_set_clicert(ne_session *sess, const ne_ssl_client_cert *clicert );
/* Indicate that the certificate 'cert' is trusted; the 'cert' object /* Indicate that the certificate 'cert' is trusted; the 'cert' object
* is duplicated internally so can be destroyed by the caller. */ * is duplicated internally so can be destroyed by the caller. This
* function has no effect for non-SSL sessions. */
void ne_ssl_trust_cert(ne_session *sess, const ne_ssl_certificate *cert); void ne_ssl_trust_cert(ne_session *sess, const ne_ssl_certificate *cert);
/* If the SSL library provided a default set of CA certificates, trust /* If the SSL library provided a default set of CA certificates, trust
* this set of CAs. */ * this set of CAs. */
void ne_ssl_trust_default_ca(ne_session *sess); void ne_ssl_trust_default_ca(ne_session *sess);
/* Callback used to load a client certificate on demand. If dncount /* Callback used to load a client certificate on demand. If dncount
* is > 0, the 'dnames' array dnames[0] through dnames[dncount-1] * is > 0, the 'dnames' array dnames[0] through dnames[dncount-1]
* gives the list of CA names which the server indicated were * gives the list of CA names which the server indicated were
* acceptable. The callback should load an appropriate client * acceptable. The callback should load an appropriate client
skipping to change at line 172 skipping to change at line 227
/* Register a function to be called when the server requests a client /* Register a function to be called when the server requests a client
* certificate. */ * certificate. */
void ne_ssl_provide_clicert(ne_session *sess, void ne_ssl_provide_clicert(ne_session *sess,
ne_ssl_provide_fn fn, void *userdata); ne_ssl_provide_fn fn, void *userdata);
/* Set the timeout (in seconds) used when reading from a socket. The /* Set the timeout (in seconds) used when reading from a socket. The
* timeout value must be greater than zero. */ * timeout value must be greater than zero. */
void ne_set_read_timeout(ne_session *sess, int timeout); void ne_set_read_timeout(ne_session *sess, int timeout);
/* Set the timeout (in seconds) used when making a connection. The
* timeout value must be greater than zero. */
void ne_set_connect_timeout(ne_session *sess, int timeout);
/* Sets the user-agent string. neon/VERSION will be appended, to make /* Sets the user-agent string. neon/VERSION will be appended, to make
* the full header "User-Agent: product neon/VERSION". * the full header "User-Agent: product neon/VERSION".
* If this function is not called, the User-Agent header is not sent. * If this function is not called, the User-Agent header is not sent.
* The product string must follow the RFC2616 format, i.e. * The product string must follow the RFC2616 format, i.e.
* product = token ["/" product-version] * product = token ["/" product-version]
* product-version = token * product-version = token
* where token is any alpha-numeric-y string [a-zA-Z0-9]* */ * where token is any alpha-numeric-y string [a-zA-Z0-9]* */
void ne_set_useragent(ne_session *sess, const char *product); void ne_set_useragent(ne_session *sess, const char *product);
/* Returns non-zero if next-hop server does not claim compliance to /* Returns non-zero if next-hop server does not claim compliance to
skipping to change at line 193 skipping to change at line 252
int ne_version_pre_http11(ne_session *sess); int ne_version_pre_http11(ne_session *sess);
/* Returns the 'hostport' URI segment for the end-server, e.g. /* Returns the 'hostport' URI segment for the end-server, e.g.
* "my.server.com:8080". */ * "my.server.com:8080". */
const char *ne_get_server_hostport(ne_session *sess); const char *ne_get_server_hostport(ne_session *sess);
/* Returns the URL scheme being used for the current session, omitting /* Returns the URL scheme being used for the current session, omitting
* the trailing ':'; e.g. "http" or "https". */ * the trailing ':'; e.g. "http" or "https". */
const char *ne_get_scheme(ne_session *sess); const char *ne_get_scheme(ne_session *sess);
/* Sets the host, scheme, and port fields (and no others) of the given /* Sets the host, scheme, and port fields of the given URI structure
* URI structure; host and scheme are malloc-allocated. */ * to that of the configured server and scheme for the session; host
* and scheme are malloc-allocated. No other fields in the URI
* structure are changed. */
void ne_fill_server_uri(ne_session *sess, ne_uri *uri); void ne_fill_server_uri(ne_session *sess, ne_uri *uri);
/* If a proxy is configured, sets the host and port fields in the
* given URI structure to that of the proxy. The hostname is
* malloc-allocated. No other fields in the URI structure are
* changed; if a proxy is not configured, no fields are changed. */
void ne_fill_proxy_uri(ne_session *sess, ne_uri *uri);
/* Set the error string for the session; takes printf-like format /* Set the error string for the session; takes printf-like format
* string. */ * string. */
void ne_set_error(ne_session *sess, const char *format, ...) void ne_set_error(ne_session *sess, const char *format, ...)
ne_attribute((format (printf, 2, 3))); ne_attribute((format (printf, 2, 3)));
/* Retrieve the error string for the session */ /* Retrieve the error string for the session */
const char *ne_get_error(ne_session *sess); const char *ne_get_error(ne_session *sess);
NE_END_DECLS NE_END_DECLS
 End of changes. 12 change blocks. 
20 lines changed or deleted 90 lines changed or added


 ne_socket.h   ne_socket.h 
skipping to change at line 96 skipping to change at line 96
/* Destroys an address object created by ne_addr_resolve. */ /* Destroys an address object created by ne_addr_resolve. */
void ne_addr_destroy(ne_sock_addr *addr); void ne_addr_destroy(ne_sock_addr *addr);
/* Network address type; IPv4 or IPv6 */ /* Network address type; IPv4 or IPv6 */
typedef enum { typedef enum {
ne_iaddr_ipv4 = 0, ne_iaddr_ipv4 = 0,
ne_iaddr_ipv6 ne_iaddr_ipv6
} ne_iaddr_type; } ne_iaddr_type;
/* Create a network address from raw byte representation (in network /* Create a network address object from raw byte representation (in
* byte order) of given type. 'raw' must be four bytes for an IPv4 * network byte order) of given type. 'raw' must be four bytes for an
* address, 16 bytes for an IPv6 address. May return NULL if address * IPv4 address, 16 bytes for an IPv6 address. May return NULL if
* type is not supported. */ * address type is not supported. */
ne_inet_addr *ne_iaddr_make(ne_iaddr_type type, const unsigned char *raw); ne_inet_addr *ne_iaddr_make(ne_iaddr_type type, const unsigned char *raw);
/* Compare two network addresses i1 and i2; return non-zero if they /* Compare two network address objects i1 and i2; returns zero if they
* are not equal. */ * are equivalent or non-zero otherwise. */
int ne_iaddr_cmp(const ne_inet_addr *i1, const ne_inet_addr *i2); int ne_iaddr_cmp(const ne_inet_addr *i1, const ne_inet_addr *i2);
/* Returns the type of the given network address. */ /* Return the type of the given network address object. */
ne_iaddr_type ne_iaddr_typeof(const ne_inet_addr *ia); ne_iaddr_type ne_iaddr_typeof(const ne_inet_addr *ia);
/* Prints the string representation of network address 'ia' into the /* Print the string representation of network address 'ia' into the
* 'buffer', which is of size 'bufsiz'. Returns 'buffer'. */ * buffer 'buffer', which is of length 'bufsiz'. Returns 'buffer'. */
char *ne_iaddr_print(const ne_inet_addr *ia, char *buffer, size_t bufsiz); char *ne_iaddr_print(const ne_inet_addr *ia, char *buffer, size_t bufsiz);
/* Free a network address created using ne_iaddr_make. */ /* Perform the reverse name lookup on network address 'ia', placing
* the returned name in the 'buf' buffer (of length 'bufsiz') if
* successful. Returns zero on success, or non-zero on error. */
int ne_iaddr_reverse(const ne_inet_addr *ia, char *buf, size_t bufsiz);
/* Destroy a network address object created using ne_iaddr_make. */
void ne_iaddr_free(ne_inet_addr *addr); void ne_iaddr_free(ne_inet_addr *addr);
/* Create a TCP socket; returns NULL on error. */ /* Create a socket object; returns NULL on error. */
ne_socket *ne_sock_create(void); ne_socket *ne_sock_create(void);
/* Connect the socket to server at address 'addr' on port 'port'. /* Connect the socket to server at address 'addr' on port 'port'.
* Returns non-zero if a connection could not be established. */ * Returns zero on success, NE_SOCK_TIMEOUT if a timeout occurs when a
* non-zero connect timeout is configured (and is supported), or
* NE_SOCK_ERROR on failure. */
int ne_sock_connect(ne_socket *sock, const ne_inet_addr *addr, int ne_sock_connect(ne_socket *sock, const ne_inet_addr *addr,
unsigned int port); unsigned int port);
/* ne_sock_read reads up to 'count' bytes into 'buffer'. /* Read up to 'count' bytes from socket into 'buffer'. Returns:
* Returns:
* NE_SOCK_* on error, * NE_SOCK_* on error,
* >0 length of data read into buffer. * >0 length of data read into buffer (may be less than 'count')
*/ */
ssize_t ne_sock_read(ne_socket *sock, char *buffer, size_t count); ssize_t ne_sock_read(ne_socket *sock, char *buffer, size_t count);
/* ne_sock_peek reads up to 'count' bytes into 'buffer', but the data /* Read up to 'count' bytes into 'buffer', leaving the data available
* will still be returned on a subsequent call to ne_sock_read or * in the socket buffer to be returned by a subsequent call to
* ne_sock_peek. * ne_sock_read or ne_sock_peek. Returns:
* Returns:
* NE_SOCK_* on error, * NE_SOCK_* on error,
* >0 length of data read into buffer. * >0 length of data read into buffer.
*/ */
ssize_t ne_sock_peek(ne_socket *sock, char *buffer, size_t count); ssize_t ne_sock_peek(ne_socket *sock, char *buffer, size_t count);
/* Block for up to 'n' seconds until data becomes available for reading /* Block for up to 'n' seconds until data becomes available for reading
* on the socket. Returns: * from the socket. Returns:
* NE_SOCK_* on error, * NE_SOCK_* on error,
* NE_SOCK_TIMEOUT if no data arrives in 'n' seconds. * NE_SOCK_TIMEOUT if no data arrives in 'n' seconds,
* 0 if data arrived on the socket. * 0 if data arrived on the socket.
*/ */
int ne_sock_block(ne_socket *sock, int n); int ne_sock_block(ne_socket *sock, int n);
/* Writes 'count' bytes of 'data' to the socket. /* Write 'count' bytes of 'data' to the socket. Guarantees to either
* Returns 0 on success, NE_SOCK_* on error. */ * write all the bytes or to fail. Returns 0 on success, or NE_SOCK_*
* on error. */
int ne_sock_fullwrite(ne_socket *sock, const char *data, size_t count); int ne_sock_fullwrite(ne_socket *sock, const char *data, size_t count);
/* Reads an LF-terminated line into 'buffer', and NUL-terminate it. /* Read an LF-terminated line into 'buffer', and NUL-terminate it.
* At most 'len' bytes are read (including the NUL terminator). * At most 'len' bytes are read (including the NUL terminator).
* Returns: * Returns:
* NE_SOCK_* on error, * NE_SOCK_* on error,
* >0 number of bytes read (including NUL terminator) * >0 number of bytes read (including NUL terminator)
*/ */
ssize_t ne_sock_readline(ne_socket *sock, char *buffer, size_t len); ssize_t ne_sock_readline(ne_socket *sock, char *buffer, size_t len);
/* Read exactly 'len' bytes into buffer; returns 0 on success, /* Read exactly 'len' bytes into buffer, or fail; returns 0 on
* NE_SOCK_* on error. */ * success, NE_SOCK_* on error. */
ssize_t ne_sock_fullread(ne_socket *sock, char *buffer, size_t len); ssize_t ne_sock_fullread(ne_socket *sock, char *buffer, size_t len);
/* Accept a connection on listening socket 'fd'. */ /* Accepts a connection from listening socket 'fd' and places the
* socket in 'sock'. Returns zero on success or -1 on failure. */
int ne_sock_accept(ne_socket *sock, int fd); int ne_sock_accept(ne_socket *sock, int fd);
/* Returns the file descriptor used for socket 'sock'. */ /* Returns the file descriptor used for socket 'sock'. */
int ne_sock_fd(const ne_socket *sock); int ne_sock_fd(const ne_socket *sock);
/* Close the socket, and destroy the socket object. Returns non-zero /* Close the socket and destroy the socket object. Returns zero on
* on error. */ * success, or an errno value if close() failed. */
int ne_sock_close(ne_socket *sock); int ne_sock_close(ne_socket *sock);
/* Return current error string for socket. */ /* Return current error string for socket. */
const char *ne_sock_error(const ne_socket *sock); const char *ne_sock_error(const ne_socket *sock);
/* Set read timeout for socket. */ /* Set read timeout for socket, in seconds; must be a non-zero
* positive integer. */
void ne_sock_read_timeout(ne_socket *sock, int timeout); void ne_sock_read_timeout(ne_socket *sock, int timeout);
/* Set connect timeout for socket, in seconds; must be a positive
* integer. If a timeout of 'zero' is used then then no explicit
* timeout handling will be used for ne_sock_connect(), and the
* connect call will only timeout as dictated by the TCP stack. */
void ne_sock_connect_timeout(ne_socket *sock, int timeout);
/* Negotiate an SSL connection on socket as an SSL server, using given /* Negotiate an SSL connection on socket as an SSL server, using given
* SSL context. */ * SSL context. */
int ne_sock_accept_ssl(ne_socket *sock, ne_ssl_context *ctx); int ne_sock_accept_ssl(ne_socket *sock, ne_ssl_context *ctx);
/* Negotiate an SSL connection on socket as an SSL client, using given /* Negotiate an SSL connection on socket as an SSL client, using given
* SSL context. The 'userdata' parameter is associated with the * SSL context. The 'userdata' parameter is associated with the
* underlying SSL library's socket structure for use in callbacks. * underlying SSL library's socket structure for use in callbacks.
* Returns zero on success, or non-zero on error. */ * Returns zero on success, or non-zero on error. */
int ne_sock_connect_ssl(ne_socket *sock, ne_ssl_context *ctx, int ne_sock_connect_ssl(ne_socket *sock, ne_ssl_context *ctx,
void *userdata); void *userdata);
 End of changes. 19 change blocks. 
30 lines changed or deleted 44 lines changed or added


 ne_ssl.h   ne_ssl.h 
skipping to change at line 120 skipping to change at line 120
int ne_ssl_cert_cmp(const ne_ssl_certificate *c1, int ne_ssl_cert_cmp(const ne_ssl_certificate *c1,
const ne_ssl_certificate *c2); const ne_ssl_certificate *c2);
/* Deallocate memory associated with certificate. */ /* Deallocate memory associated with certificate. */
void ne_ssl_cert_free(ne_ssl_certificate *cert); void ne_ssl_cert_free(ne_ssl_certificate *cert);
/* A client certificate (and private key). */ /* A client certificate (and private key). */
typedef struct ne_ssl_client_cert_s ne_ssl_client_cert; typedef struct ne_ssl_client_cert_s ne_ssl_client_cert;
/* Read a client certificate and private key from a PKCS12 file; /* Read a client certificate and private key from a PKCS12 file;
* returns NULL if the file could not be parsed. If the client cert * returns NULL if the file could not be parsed, or otherwise
* is encrypted, it must be decrypted before use. */ * returning a client certificate object. */
ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename); ne_ssl_client_cert *ne_ssl_clicert_read(const char *filename);
/* Returns the "friendly name" given for the client cert, or NULL if /* Returns the "friendly name" given for the client cert, or NULL if
* none given. This can be called before or after the client cert has * none given. This can be called before or after the client cert has
* been decrypted. Returns a NUL-terminated, UTF-8-encoded string. */ * been decrypted. Returns a NUL-terminated, UTF-8-encoded string. */
const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert); const char *ne_ssl_clicert_name(const ne_ssl_client_cert *ccert);
/* Returns non-zero if client cert is encrypted. */ /* Returns non-zero if client cert is encrypted. */
int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *ccert); int ne_ssl_clicert_encrypted(const ne_ssl_client_cert *ccert);
/* Decrypt the encrypted client cert using given password. Returns /* Decrypt the encrypted client cert using given password. Returns
* non-zero on failure, in which case, the function can be called * non-zero on failure, in which case, the function can be called
* again with a different password. For a ccert on which _encrypted() * again with a different password. For a ccert on which _encrypted()
* returns 0, calling _decrypt results in undefined behaviour. */ * returns 0, calling _decrypt results in undefined behaviour. */
int ne_ssl_clicert_decrypt(ne_ssl_client_cert *ccert, const char *password) ; int ne_ssl_clicert_decrypt(ne_ssl_client_cert *ccert, const char *password) ;
/* Return the actual certificate part of the client certificate (never /* Return the actual certificate part of the client certificate (never
* returns NULL). */ * returns NULL). */
const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *cc ert); const ne_ssl_certificate *ne_ssl_clicert_owner(const ne_ssl_client_cert *cc ert);
/* Deallocate memory associated with a client certificate. */ /* Destroy a client certificate object. */
void ne_ssl_clicert_free(ne_ssl_client_cert *ccert); void ne_ssl_clicert_free(ne_ssl_client_cert *ccert);
/* SSL context object. The interfaces to manipulate an SSL context /* SSL context object. The interfaces to manipulate an SSL context
* are only needed when interfacing directly with ne_socket.h. */ * are only needed when interfacing directly with ne_socket.h. */
typedef struct ne_ssl_context_s ne_ssl_context; typedef struct ne_ssl_context_s ne_ssl_context;
/* Context creation modes: */ /* Context creation modes: */
#define NE_SSL_CTX_CLIENT (0) /* client context */ #define NE_SSL_CTX_CLIENT (0) /* client context */
#define NE_SSL_CTX_SERVER (1) /* default server context */ #define NE_SSL_CTX_SERVER (1) /* default server context */
#define NE_SSL_CTX_SERVERv2 (2) /* SSLv2-specific server context */ #define NE_SSL_CTX_SERVERv2 (2) /* SSLv2-specific server context */
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added


 ne_string.h   ne_string.h 
/* /*
String utility functions String utility functions
Copyright (C) 1999-2006, Joe Orton <joe@manyfish.co.uk> Copyright (C) 1999-2007, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
skipping to change at line 32 skipping to change at line 32
#ifndef NE_STRING_H #ifndef NE_STRING_H
#define NE_STRING_H #define NE_STRING_H
#include "ne_defs.h" #include "ne_defs.h"
#include "ne_alloc.h" #include "ne_alloc.h"
#include <stdarg.h> #include <stdarg.h>
NE_BEGIN_DECLS NE_BEGIN_DECLS
/* ne_token and ne_qtoken return the next token in *str between *str /* ne_token and ne_qtoken return the next token in *str before either
* and separator character 'sep' or the NUL terminator. ne_qtoken * the next separator character 'sep' or the NUL terminator.
* skips over any parts quoted using a pair of any one of the * ne_qtoken skips over any parts quoted using a pair of any one of
* characters given in 'quotes'. After returning, *str will point to * the characters given in 'quotes'. After returning, *str will point
* the next character after the separator, or NULL if no more * to the next character after the separator, or NULL if no separator
* separator characters were found. * character was found.
* *
* ne_qtoken may return NULL if unterminated quotes are found. */ * ne_qtoken will return NULL if unterminated quotes are found. */
char *ne_token(char **str, char sep); char *ne_token(char **str, char sep);
char *ne_qtoken(char **str, char sep, const char *quotes); char *ne_qtoken(char **str, char sep, const char *quotes);
/* Return portion of 'str' with any characters in 'whitespace' shaved /* Return portion of 'str' with any characters in 'whitespace' shaved
* off the beginning and end. Modifies str. */ * off the beginning and end. Modifies str in-place. */
char *ne_shave(char *str, const char *whitespace); char *ne_shave(char *str, const char *whitespace);
/* Cleanse 'str' of non-printable characters. 'str' is modified /* Cleanse 'str' of non-printable (e.g. control) characters. 'str' is
* in-place, and returned. */ * modified in-place, and returned. */
char *ne_strclean(char *str); char *ne_strclean(char *str);
/* A base64 encoder: converts 'len' bytes of 'text' to base64. /* Encode 'len' bytes of 'text' to base64. Returns malloc-allocated
* Returns malloc-allocated buffer; caller must free(). */ * NUL-terminated buffer which the caller must free(). */
char *ne_base64(const unsigned char *text, size_t len); char *ne_base64(const unsigned char *text, size_t len);
/* Base64 decoder; decodes NUL-terminated base64-encoded string /* Decode NUL-terminated base64-encoded string 'data', placing
* 'data', places malloc-allocated raw data in '*out', returns length, * malloc-allocated raw decoder output in '*out'. Returns length, or
* or zero on decode error (in which case *out is undefined). */ * zero on decode error (in which case the content of *out is
* undefined). */
size_t ne_unbase64(const char *data, unsigned char **out); size_t ne_unbase64(const char *data, unsigned char **out);
/* String buffer handling. (Strings are zero-terminated still). A /* Dynamically-allocated string buffer. A string buffer which grows
* string buffer ne_buffer * which grows dynamically with the * dynamically . (Strings are zero-terminated still). A
* string. */ * string buffer ne_buffer which grows dynamically with the string. */
typedef struct { typedef struct {
char *data; /* contents: null-terminated string. */ char *data; /* contents: NUL-terminated string */
size_t used; /* used bytes in buffer */ size_t used; /* strlen(data) + 1 */
size_t length; /* length of buffer */ size_t length; /* number of bytes allocated */
} ne_buffer; } ne_buffer;
/* Create a new string buffer object. */
ne_buffer *ne_buffer_create(void);
/* Create a new string buffer object with at least 'size' bytes of
* allocated space. */
ne_buffer *ne_buffer_ncreate(size_t size);
/* Returns size of data in buffer, equiv to strlen(ne_buffer_data(buf)) */ /* Returns size of data in buffer, equiv to strlen(ne_buffer_data(buf)) */
#define ne_buffer_size(buf) ((buf)->used - 1) #define ne_buffer_size(buf) ((buf)->used - 1)
/* Concatenate all given strings onto the end of the buffer. The /* Concatenate all given strings onto the end of the buffer. The
* strings must all be NUL-terminated, and MUST be followed by a NULL * strings must all be NUL-terminated, and MUST be followed by a NULL
* argument marking the end of the list. */ * argument marking the end of the list. */
void ne_buffer_concat(ne_buffer *buf, ...); void ne_buffer_concat(ne_buffer *buf, ...);
/* Create a new ne_buffer. */
ne_buffer *ne_buffer_create(void);
/* Create a new ne_buffer of given minimum size. */
ne_buffer *ne_buffer_ncreate(size_t size);
/* Destroys (deallocates) a buffer */
void ne_buffer_destroy(ne_buffer *buf);
/* Append a NUL-terminated string 'str' to buf. */ /* Append a NUL-terminated string 'str' to buf. */
void ne_buffer_zappend(ne_buffer *buf, const char *str); void ne_buffer_zappend(ne_buffer *buf, const char *str);
/* Append 'len' bytes of 'data' to buf. 'data' does not need to be /* Append 'len' bytes of 'data' to buf, where 'data' does not contain
* NUL-terminated. The resultant string will have a NUL-terminator, * a NUL terminator. (A NUL terminator is appended to buf) */
* either way. */
void ne_buffer_append(ne_buffer *buf, const char *data, size_t len); void ne_buffer_append(ne_buffer *buf, const char *data, size_t len);
/* Append a literal constant string 'str' to buffer 'buf'. */ /* Print a string to the end of the buffer using printf-style format
* string 'format' and subsqeuent arguments. At most 'max' characters
* are appended; the number of characters appended (excluding the NUL
* terminator) is returned. Behaviour is undefined if 'max' is passed
* as zero. */
size_t ne_buffer_snprintf(ne_buffer *buf, size_t max,
const char *format, ...)
ne_attribute((format(printf, 3, 4)));
/* Append a literal, NUL-terminated constant string 'str' to buffer
* 'buf'. */
#define ne_buffer_czappend(buf, str) \ #define ne_buffer_czappend(buf, str) \
ne_buffer_append((buf), (str), sizeof((str)) - 1) ne_buffer_append((buf), (str), sizeof((str)) - 1)
/* Empties the contents of buf; makes the buffer zero-length. */ /* Clear the string buffer 'buf', making it equivalent to the empty
* string. */
void ne_buffer_clear(ne_buffer *buf); void ne_buffer_clear(ne_buffer *buf);
/* Grows the ne_buffer to a minimum size. */ /* Grow the allocated size of string buffer 'buf' to at least 'size'
* bytes. */
void ne_buffer_grow(ne_buffer *buf, size_t size); void ne_buffer_grow(ne_buffer *buf, size_t size);
/* Re-establish the 'used' invariant if the string buffer data field is
* altered directly. */
void ne_buffer_altered(ne_buffer *buf); void ne_buffer_altered(ne_buffer *buf);
/* Destroys a buffer, WITHOUT freeing the data, and returns the /* Destroy the string buffer object 'buf' without deallocating the
* data. */ * data string. The data string must subsequently be freed using
* ne_free(). */
char *ne_buffer_finish(ne_buffer *buf); char *ne_buffer_finish(ne_buffer *buf);
/* Destroy a string buffer object. */
void ne_buffer_destroy(ne_buffer *buf);
/* Thread-safe strerror() wrapper; place system error for errno value /* Thread-safe strerror() wrapper; place system error for errno value
* 'errnum' in 'buffer', which is of length 'buflen'. Returns * 'errnum' in 'buffer', which is of length 'buflen'. Returns
* 'buffer'. */ * 'buffer'. */
char *ne_strerror(int errnum, char *buffer, size_t buflen); char *ne_strerror(int errnum, char *buffer, size_t buflen);
/* ne_strnzcpy copies at most 'n'-1 bytes of 'src' to 'dest', and /* ne_strnzcpy copies at most 'n'-1 bytes of 'src' to 'dest', and
* ensures that 'dest' is subsequently NUL-terminated. */ * ensures that 'dest' is subsequently NUL-terminated. */
#define ne_strnzcpy(dest, src, n) do { \ #define ne_strnzcpy(dest, src, n) do { size_t ne__nm1 = (n) - 1; \
strncpy(dest, src, n-1); dest[n-1] = '\0'; } while (0) strncpy(dest, src, ne__nm1); dest[ne__nm1] = '\0'; } while (0)
/* Return malloc-allocated concatenation of all NUL-terminated string /* Return malloc-allocated concatenation of all NUL-terminated string
* arguments, up to a terminating NULL. */ * arguments, up to a terminating NULL pointer. */
char *ne_concat(const char *str, ...); char *ne_concat(const char *str, ...);
#define NE_ASC2HEX(x) (((x) <= '9') ? ((x) - '0') : (ne_tolower((x)) + 10 -
'a'))
#define NE_HEX2ASC(x) ((char) ((x) > 9 ? ((x) - 10 + 'a') : ((x) + '0')))
/* Wrapper for snprintf: always NUL-terminates returned buffer, and /* Wrapper for snprintf: always NUL-terminates returned buffer, and
* returns strlen(str). */ * returns strlen(str). */
size_t ne_snprintf(char *str, size_t size, const char *fmt, ...) size_t ne_snprintf(char *str, size_t size, const char *fmt, ...)
ne_attribute((format(printf, 3, 4))); ne_attribute((format(printf, 3, 4)));
/* Wrapper for vsnprintf. */ /* Wrapper for vsnprintf. */
size_t ne_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) size_t ne_vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
ne_attribute((format(printf, 3, 0))); ne_attribute((format(printf, 3, 0)));
/* Implementations of strcasecmp and strncasecmp which behave as /* Implementations of strcasecmp and strncasecmp which behave as
skipping to change at line 154 skipping to change at line 166
* differences in case. */ * differences in case. */
int ne_strncasecmp(const char *s1, const char *s2, size_t n); int ne_strncasecmp(const char *s1, const char *s2, size_t n);
/* Return lowercase 'c' as in POSIX locale; note difference from ANSI /* Return lowercase 'c' as in POSIX locale; note difference from ANSI
* C semantics as both the argument and return value are unsigned * C semantics as both the argument and return value are unsigned
* char. */ * char. */
#define ne_tolower(c) (ne_tolower_array()[(unsigned char)c]) #define ne_tolower(c) (ne_tolower_array()[(unsigned char)c])
const unsigned char *ne_tolower_array(void); const unsigned char *ne_tolower_array(void);
/* Convert an ASCII hexadecimal character in the ranges '0'..'9'
* 'a'..'f' 'A'..'F' to its numeric equivalent. */
#define NE_ASC2HEX(x) (((x) <= '9') ? ((x) - '0') : \
(ne_tolower((x)) + 10 - 'a'))
/* Convert an integer in the range 0..15 to the equivalent (lowercase)
* ASCII hexadecimal equivalent character, in the range '0..9,'a..f' */
#define NE_HEX2ASC(x) ((char) ((x) > 9 ? ((x) - 10 + 'a') : ((x) + '0')))
NE_END_DECLS NE_END_DECLS
#endif /* NE_STRING_H */ #endif /* NE_STRING_H */
 End of changes. 22 change blocks. 
47 lines changed or deleted 67 lines changed or added


 ne_utils.h   ne_utils.h 
skipping to change at line 33 skipping to change at line 33
#define NE_UTILS_H #define NE_UTILS_H
#include <sys/types.h> #include <sys/types.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "ne_defs.h" #include "ne_defs.h"
#ifdef NEON_TRIO #ifdef NEON_TRIO
/* no HAVE_TRIO_H check so this works from outside neon build tree. */
#include <trio.h> #include <trio.h>
#endif #endif
NE_BEGIN_DECLS NE_BEGIN_DECLS
/* Returns a human-readable version string like: /* Returns a human-readable library version string describing the
* "neon 0.2.0: Library build, OpenSSL support" * version and build information; for example:
*/ * "neon 0.2.0: Library build, OpenSSL support" */
const char *ne_version_string(void); const char *ne_version_string(void);
/* Returns non-zero if library version is not of major version /* Returns non-zero if library version is not of major version
* 'major', or if minor version is not greater than or equal to * 'major', or if minor version is not greater than or equal to
* 'minor'. For neon versions with major == 0, all minor versions are * 'minor'. For neon versions with major == 0, all minor versions are
* presumed to be incompatible. */ * presumed to be incompatible. */
int ne_version_match(int major, int minor); int ne_version_match(int major, int minor);
/* Feature codes: */
#define NE_FEATURE_SSL (1) /* SSL/TLS support */ #define NE_FEATURE_SSL (1) /* SSL/TLS support */
#define NE_FEATURE_ZLIB (2) /* zlib compression in compress interface */ #define NE_FEATURE_ZLIB (2) /* zlib compression in compress interface */
#define NE_FEATURE_IPV6 (3) /* IPv6 is supported in resolver */ #define NE_FEATURE_IPV6 (3) /* IPv6 is supported in resolver */
#define NE_FEATURE_LFS (4) /* large file support */ #define NE_FEATURE_LFS (4) /* large file support */
#define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */
#define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */
#define NE_FEATURE_I18N (7) /* i18n error message support */ #define NE_FEATURE_I18N (7) /* i18n error message support */
/* Returns non-zero if neon has support for given feature code /* Returns non-zero if library is built with support for the given
* NE_FEATURE_*. */ * NE_FEATURE_* feature code 'code'. */
int ne_has_support(int feature); int ne_has_support(int feature);
/* CONSIDER: mutt has a nicer way of way of doing debugging output... maybe /* Debugging macro to allow code to be optimized out if debugging is
* switch to like that. */ * disabled at build time. */
#ifndef NE_DEBUGGING #ifndef NE_DEBUGGING
#define NE_DEBUG if (0) ne_debug #define NE_DEBUG if (0) ne_debug
#else /* DEBUGGING */ #else /* DEBUGGING */
#define NE_DEBUG ne_debug #define NE_DEBUG ne_debug
#endif /* DEBUGGING */ #endif /* DEBUGGING */
#define NE_DBG_SOCKET (1<<0) /* Debugging masks. */
#define NE_DBG_HTTP (1<<1) #define NE_DBG_SOCKET (1<<0) /* raw socket */
#define NE_DBG_XML (1<<2) #define NE_DBG_HTTP (1<<1) /* HTTP request/response handling */
#define NE_DBG_HTTPAUTH (1<<3) #define NE_DBG_XML (1<<2) /* XML parser */
#define NE_DBG_HTTPPLAIN (1<<4) #define NE_DBG_HTTPAUTH (1<<3) /* HTTP authentication (hiding credentials)
#define NE_DBG_LOCKS (1<<5) */
#define NE_DBG_XMLPARSE (1<<6) #define NE_DBG_HTTPPLAIN (1<<4) /* plaintext HTTP authentication */
#define NE_DBG_HTTPBODY (1<<7) #define NE_DBG_LOCKS (1<<5) /* WebDAV locking */
#define NE_DBG_SSL (1<<8) #define NE_DBG_XMLPARSE (1<<6) /* low-level XML parser */
#define NE_DBG_FLUSH (1<<30) #define NE_DBG_HTTPBODY (1<<7) /* HTTP response body blocks */
#define NE_DBG_SSL (1<<8) /* SSL/TLS */
#define NE_DBG_FLUSH (1<<30) /* always flush debugging */
/* Send debugging output to 'stream', for all of the given debug /* Send debugging output to 'stream', for all of the given debug
* channels. To disable debugging, pass 'stream' as NULL and 'mask' * channels. To disable debugging, pass 'stream' as NULL and 'mask'
* as 0. */ * as 0. */
void ne_debug_init(FILE *stream, int mask); void ne_debug_init(FILE *stream, int mask);
/* The current debug mask and stream set by the last call to /* The current debug mask and stream set by the last call to
* ne_debug_init. */ * ne_debug_init. */
extern int ne_debug_mask; extern int ne_debug_mask;
extern FILE *ne_debug_stream; extern FILE *ne_debug_stream;
skipping to change at line 108 skipping to change at line 108
int major_version; int major_version;
int minor_version; int minor_version;
int code; /* Status-Code value */ int code; /* Status-Code value */
int klass; /* Class of Status-Code (1-5) */ int klass; /* Class of Status-Code (1-5) */
char *reason_phrase; char *reason_phrase;
} ne_status; } ne_status;
/* NB: couldn't use 'class' in ne_status because it would clash with /* NB: couldn't use 'class' in ne_status because it would clash with
* the C++ reserved word. */ * the C++ reserved word. */
/* Parser for strings which follow the Status-Line grammar from /* Parse 'status_line' using the the RFC2616 Status-Line grammar.
* RFC2616. s->reason_phrase is malloc-allocated if non-NULL, and * s->reason_phrase is malloc-allocated if non-NULL, and must be
* must be free'd by the caller. * free'd by the caller. Returns 0 on success, in which case all
* Returns: * fields of '*s' will be set; or -1 on parse error, in which case
* 0 on success, *s will be filled in. * '*s' is unmodified. */
* -1 on parse error.
*/
int ne_parse_statusline(const char *status_line, ne_status *s); int ne_parse_statusline(const char *status_line, ne_status *s);
NE_END_DECLS NE_END_DECLS
#endif /* NE_UTILS_H */ #endif /* NE_UTILS_H */
 End of changes. 7 change blocks. 
26 lines changed or deleted 25 lines changed or added


 ne_xml.h   ne_xml.h 
/* /*
neon XML parser interface neon XML parser interface
Copyright (C) 1999-2004, Joe Orton <joe@manyfish.co.uk> Copyright (C) 1999-2007, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. Library General Public License for more details.
skipping to change at line 91 skipping to change at line 91
/* Push a new handler on the stack of parser 'p'. 'cdata' and/or /* Push a new handler on the stack of parser 'p'. 'cdata' and/or
* 'endelm' may be NULL; startelm must be non-NULL. */ * 'endelm' may be NULL; startelm must be non-NULL. */
void ne_xml_push_handler(ne_xml_parser *p, void ne_xml_push_handler(ne_xml_parser *p,
ne_xml_startelm_cb *startelm, ne_xml_startelm_cb *startelm,
ne_xml_cdata_cb *cdata, ne_xml_cdata_cb *cdata,
ne_xml_endelm_cb *endelm, ne_xml_endelm_cb *endelm,
void *userdata); void *userdata);
/* ne_xml_failed returns non-zero if there was an error during /* ne_xml_failed returns non-zero if there was an error during
* parsing, or zero if the parse completed successfully. The return * parsing, or zero if the parse completed successfully. The return
* value is equal to that of the last ne_xml_parse call for this * value is equal to that of the last ne_xml_parse() call for this
* parser. */ * parser object. */
int ne_xml_failed(ne_xml_parser *p); int ne_xml_failed(ne_xml_parser *p);
/* Set error string for parser: the string may be truncated. */ /* Set error string for parser. (The string may be truncated
* internally). */
void ne_xml_set_error(ne_xml_parser *p, const char *msg); void ne_xml_set_error(ne_xml_parser *p, const char *msg);
/* Return the error string (never NULL). After ne_xml_failed returns /* Return the error string (and never NULL). After ne_xml_failed
* >0, this will describe the parse error. Otherwise it will be a * returns >0, this will describe the parse error. Otherwise it will
* default error string. */ * be a default error string. */
const char *ne_xml_get_error(ne_xml_parser *p); const char *ne_xml_get_error(ne_xml_parser *p);
/* Destroy the parser object. */
void ne_xml_destroy(ne_xml_parser *p);
/* Parse the given block of input of length len. Parser must be /* Parse the given block of input of length len. Parser must be
* called with len=0 to signify the end of the document (for that * called with len=0 to signify the end of the document (for that
* case, the block argument is ignored). Returns zero on success, or * case, the block argument is ignored). Returns zero on success, or
* non-zero on error: for an XML syntax error, a positive number is * non-zero on error: for an XML syntax error, a positive number is
* returned; if parsing is aborted by a caller-supplied callback, that * returned; if parsing is aborted by a caller-supplied callback, that
* callback's return value is returned. */ * callback's return value is returned. */
int ne_xml_parse(ne_xml_parser *p, const char *block, size_t len); int ne_xml_parse(ne_xml_parser *p, const char *block, size_t len);
/* As above, casting (ne_xml_parser *)userdata internally. /* As ne_xml_parse, casting (ne_xml_parser *)userdata internally.
* (This function can be passed to ne_add_response_body_reader) */ * (This function can be passed to ne_add_response_body_reader) */
int ne_xml_parse_v(void *userdata, const char *block, size_t len); int ne_xml_parse_v(void *userdata, const char *block, size_t len);
/* Return current parse line for errors */ /* Return current line of document during parsing or after parsing is
* complete. */
int ne_xml_currentline(ne_xml_parser *p); int ne_xml_currentline(ne_xml_parser *p);
/* From a start_element callback which was passed 'attrs' using given /* From a start_element callback which was passed 'attrs' using given
* parser, return attribute of given name and namespace. If nspace is * parser, return attribute of given name and namespace. If nspace is
* NULL, no namespace resolution is performed. */ * NULL, no namespace resolution is performed. Note that this call is
* context-specific; if called outside a start_element callback,
* behaviour is undefined. */
const char *ne_xml_get_attr(ne_xml_parser *parser, const char *ne_xml_get_attr(ne_xml_parser *parser,
const char **attrs, const char *nspace, const char **attrs, const char *nspace,
const char *name); const char *name);
/* From a start_element callback, resolve a given XML Namespace
* prefix, if defined. Given a non-NULL prefix, returns the namespace
* URI which corresponds to the prefix 'prefix' (of length 'length'),
* or NULL if no such namespace prefix is defined. Given a NULL
* prefix, returns the default namespace URI or the empty string if
* none is defined. Note that this call is context-specific; if
* called outside a start_element callback, behaviour is undefined. */
const char *ne_xml_resolve_nspace(ne_xml_parser *parser,
const char *prefix, size_t length);
/* Return the encoding of the document being parsed. May return NULL /* Return the encoding of the document being parsed. May return NULL
* if no encoding is defined or if the XML declaration has not yet * if no encoding is defined or if the XML declaration has not yet
* been parsed. */ * been parsed. */
const char *ne_xml_doc_encoding(const ne_xml_parser *p); const char *ne_xml_doc_encoding(const ne_xml_parser *p);
/* Destroy the parser object. */
void ne_xml_destroy(ne_xml_parser *p);
/* A utility interface for mapping {nspace, name} onto an integer. */ /* A utility interface for mapping {nspace, name} onto an integer. */
struct ne_xml_idmap { struct ne_xml_idmap {
const char *nspace, *name; const char *nspace, *name;
int id; int id;
}; };
/* Return the size of an idmap array */ /* Return the size of an idmap array */
#define NE_XML_MAPLEN(map) (sizeof(map) / sizeof(struct ne_xml_idmap)) #define NE_XML_MAPLEN(map) (sizeof(map) / sizeof(struct ne_xml_idmap))
/* Return the 'id' corresponding to {nspace, name}, or zero. */ /* Return the 'id' corresponding to {nspace, name}, or zero. */
 End of changes. 10 change blocks. 
13 lines changed or deleted 27 lines changed or added


 ne_xmlreq.h   ne_xmlreq.h 
skipping to change at line 40 skipping to change at line 40
/* Read the HTTP response body using calls to ne_read_response_block /* Read the HTTP response body using calls to ne_read_response_block
* (so must be enclosed by ne_begin_request/ne_end_request calls), and * (so must be enclosed by ne_begin_request/ne_end_request calls), and
* parse it as an XML document, using the given parser. Returns NE_* * parse it as an XML document, using the given parser. Returns NE_*
* error codes. If an XML parse error occurs, the session error * error codes. If an XML parse error occurs, the session error
* string is set to the XML parser's error string, and NE_ERROR is * string is set to the XML parser's error string, and NE_ERROR is
* returned. */ * returned. */
int ne_xml_parse_response(ne_request *req, ne_xml_parser *parser); int ne_xml_parse_response(ne_request *req, ne_xml_parser *parser);
/* Dispatch the HTTP request, parsing the response body as an XML /* Dispatch the HTTP request, parsing the response body as an XML
* document using the given parser, if the response status class is * document using the given parser, if the response status class is
* 2xx. Returns NE_* error codes. If an XML parse error occurs, the * 2xx and an XML media type is specified for the response entity. If
* a non-2xx response code is given, or a non-XML media type is
* specified, then the response body will be silently discarded.
*
* Returns NE_* error codes. If an XML parse error occurs, the
* session error string is set to the XML parser's error string, and * session error string is set to the XML parser's error string, and
* NE_ERROR is returned. */ * NE_ERROR is returned. */
int ne_xml_dispatch_request(ne_request *req, ne_xml_parser *parser); int ne_xml_dispatch_request(ne_request *req, ne_xml_parser *parser);
NE_END_DECLS NE_END_DECLS
#endif /* NE_XMLREQ_H */ #endif /* NE_XMLREQ_H */
 End of changes. 2 change blocks. 
2 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/