summaryrefslogtreecommitdiff
path: root/src/raptor_uri.c
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2010-01-26 19:57:57 -0800
committerDave Beckett <dave@dajobe.org>2010-01-26 19:57:57 -0800
commit64b4814f9c988eb2fda15c2bb0b9f9ad588f48d4 (patch)
tree6a23a3cfe3e015019b43e438e90afb535b5dafbe /src/raptor_uri.c
parent37e766a28a7139de261388b38121f9a9c487a48f (diff)
downloadraptor-64b4814f9c988eb2fda15c2bb0b9f9ad588f48d4.tar.gz
Make all print methods return an int status code
(raptor_statement_print, raptor_uri_print, raptor_sequence_print, raptor_term_print_as_ntriples): Return int success code.
Diffstat (limited to 'src/raptor_uri.c')
-rw-r--r--src/raptor_uri.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/raptor_uri.c b/src/raptor_uri.c
index 618c4a1d..5d00fdd9 100644
--- a/src/raptor_uri.c
+++ b/src/raptor_uri.c
@@ -1304,8 +1304,9 @@ raptor_uri_to_relative_uri_string(raptor_uri *base_uri,
*
* Print a URI to a file handle.
*
+ * Return value: non-0 on failure
**/
-void
+int
raptor_uri_print(const raptor_uri* uri, FILE *stream)
{
int rc = 0;
@@ -1320,9 +1321,12 @@ raptor_uri_print(const raptor_uri* uri, FILE *stream)
rc = fwrite("(NULL URI)", len, 1, stream);
}
- if(rc < (int)len)
+ rc = (rc < (int)len);
+ if(rc)
raptor_log_error_formatted(uri->world, RAPTOR_LOG_LEVEL_ERROR,
NULL, "fwrite failed - %s", strerror(errno));
+
+ return rc;
}