eh, changed my mind, put the exception back in camel_url_new()

svn path=/trunk/; revision=8934
This commit is contained in:
Dan Winship
2001-03-25 23:04:14 +00:00
parent 182c699c39
commit a0b95ac74d
4 changed files with 10 additions and 13 deletions

View File

@ -3,15 +3,11 @@
* camel-url.c (camel_url_new_with_base): New URL parser with full
RFC1808 relative URL support. Yum.
(camel_url_new): Wrapper around camel_url_new_with_base now.
Removed the CamelException since no one ever used it...
* tests/Makefile.am: add misc subdir
* tests/misc/url.c: relative URL test cases from RFC 1808
* camel-session.c (camel_session_get_service): Update
camel_url_new call.
2001-03-25 Jeffrey Stedfast <fejj@ximian.com>
* camel-filter-driver.c (do_copy): Don't use copy_to if the source

View File

@ -291,13 +291,9 @@ camel_session_get_service (CamelSession *session, const char *url_string,
CamelProvider *provider;
CamelService *service;
url = camel_url_new (url_string);
if (!url) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
_("Could not parse URL `%s'"),
url_string);
url = camel_url_new (url_string, ex);
if (!url)
return NULL;
}
/* We need to look up the provider so we can then lookup
the service in the provider's cache */

View File

@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
#include "camel-url.h"
#include "camel-exception.h"
#include "camel-mime-utils.h"
#include "camel-object.h"
@ -267,18 +268,22 @@ copy_param (GQuark key_id, gpointer data, gpointer user_data)
/**
* camel_url_new:
* @url_string: a URL
* @ex: a CamelException
*
* Parses an absolute URL.
*
* Return value: a CamelURL, or %NULL.
**/
CamelURL *
camel_url_new (const char *url_string)
camel_url_new (const char *url_string, CamelException *ex)
{
CamelURL *url = camel_url_new_with_base (NULL, url_string);
if (!url->protocol) {
camel_url_free (url);
camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID,
_("Could not parse URL `%s'"),
url_string);
return NULL;
}
return url;

View File

@ -50,7 +50,7 @@ typedef struct {
} CamelURL;
CamelURL *camel_url_new_with_base (CamelURL *base, const char *url_string);
CamelURL *camel_url_new (const char *url_string);
CamelURL *camel_url_new (const char *url_string, CamelException *ex);
char *camel_url_to_string (CamelURL *url, gboolean show_password);
void camel_url_free (CamelURL *url);