summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2014-10-28 07:03:47 -0700
committerDave Beckett <dave@dajobe.org>2014-10-28 07:03:47 -0700
commitb513d11bc39bb8abb247c457e54ed09d80650222 (patch)
treecbca940f013ec32885716ed0ee52ea68c435238e
parent1331d5d5d59e7b072a5522200d1459c9b2df4d69 (diff)
downloadraptor-b513d11bc39bb8abb247c457e54ed09d80650222.tar.gz
(raptor_world_get_parsers_count, raptor_world_get_serializers_count): Added
Fixes Issue #0000581 http://bugs.librdf.org/mantis/view.php?id=581
-rw-r--r--docs/raptor-changes.tsv2
-rw-r--r--docs/raptor2-sections.txt2
-rw-r--r--src/raptor2.h.in4
-rw-r--r--src/raptor_parse.c19
-rw-r--r--src/raptor_serialize.c19
5 files changed, 46 insertions, 0 deletions
diff --git a/docs/raptor-changes.tsv b/docs/raptor-changes.tsv
index 75133312..0fe9e1ae 100644
--- a/docs/raptor-changes.tsv
+++ b/docs/raptor-changes.tsv
@@ -428,6 +428,8 @@
2.0.13 - - - 2.0.14 unsigned char* raptor_uri_counted_filename_to_uri_string (const char *filename, size_t filename_len) -
2.0.14 - - - 2.0.15 void raptor_sort_r (void *base, size_t nel, size_t width, raptor_data_compare_arg_handler compar, void *user_data) -
2.0.14 - - - 2.0.15 void raptor_sequence_sort_r (raptor_sequence* seq, raptor_data_compare_arg_handler compare, void* user_data) Uses raptor_sort_r() internally.
+2.0.14 - - - 2.0.15 int raptor_world_get_parsers_count (raptor_world* world) -
+2.0.14 - - - 2.0.15 int raptor_world_get_serializers_count (raptor_world* world) -
#
# Types
#
diff --git a/docs/raptor2-sections.txt b/docs/raptor2-sections.txt
index ce1e57bf..63a6ba99 100644
--- a/docs/raptor2-sections.txt
+++ b/docs/raptor2-sections.txt
@@ -16,6 +16,8 @@ raptor_world_is_serializer_name
raptor_world_generate_bnodeid
raptor_world_set_generate_bnodeid_handler
raptor_world_set_generate_bnodeid_parameters
+raptor_world_get_parsers_count
+raptor_world_get_serializers_count
</SECTION>
<SECTION>
diff --git a/src/raptor2.h.in b/src/raptor2.h.in
index 7c9c5657..974ca3d1 100644
--- a/src/raptor2.h.in
+++ b/src/raptor2.h.in
@@ -1068,6 +1068,10 @@ int raptor_world_is_serializer_name(raptor_world* world, const char *name);
/* Syntax descriptions */
RAPTOR_API
+int raptor_world_get_parsers_count(raptor_world* world);
+RAPTOR_API
+int raptor_world_get_serializers_count(raptor_world* world);
+RAPTOR_API
const raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, unsigned int counter);
RAPTOR_API
const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, unsigned int counter);
diff --git a/src/raptor_parse.c b/src/raptor_parse.c
index d02cd036..26911f47 100644
--- a/src/raptor_parse.c
+++ b/src/raptor_parse.c
@@ -247,6 +247,25 @@ raptor_world_get_parser_factory(raptor_world *world, const char *name)
/**
+ * raptor_world_get_parsers_count:
+ * @world: world object
+ *
+ * Get number of parsers
+ *
+ * Return value: number of parsers
+ **/
+int
+raptor_world_get_parsers_count(raptor_world* world)
+{
+ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
+
+ raptor_world_open(world);
+
+ return raptor_sequence_size(world->parsers);
+}
+
+
+/**
* raptor_world_get_parser_description:
* @world: world object
* @counter: index into the list of parsers
diff --git a/src/raptor_serialize.c b/src/raptor_serialize.c
index 12e3f0ac..a1f29d78 100644
--- a/src/raptor_serialize.c
+++ b/src/raptor_serialize.c
@@ -230,6 +230,25 @@ raptor_get_serializer_factory(raptor_world* world, const char *name)
/**
+ * raptor_world_get_serializers_count:
+ * @world: world object
+ *
+ * Get number of serializers
+ *
+ * Return value: number of serializers
+ **/
+int
+raptor_world_get_serializers_count(raptor_world* world)
+{
+ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
+
+ raptor_world_open(world);
+
+ return raptor_sequence_size(world->serializers);
+}
+
+
+/**
* raptor_world_get_serializer_description:
* @world: world object
* @counter: index into the list of serializers