[redland-dev] Call a function or use struct directly?

Dave Beckett dave at dajobe.org
Mon Aug 18 19:36:08 EDT 2014


raptor_locator is a public structure (part of the API contract) so
you can use the fields directly.  The methods are for convenience.

Dave


On Tue, 19 Aug 2014, Victor Porton wrote:

> http://librdf.org/raptor/api/raptor2-section-locator.html
>
> describes a structure raptor_locator and several access method which retrieve values from this structure:
>
> int                 raptor_locator_line                 (raptor_locator *locator);
> int                 raptor_locator_column               (raptor_locator *locator);
> int                 raptor_locator_byte                 (raptor_locator *locator);
> const char *        raptor_locator_file                 (raptor_locator *locator);
> const char *        raptor_locator_uri                  (raptor_locator *locator);
>
> In my Ada bindings, can I use the structure directly or should I call these functions?
>
> I suppose that I may need to call functions from forward compatibility reasons, but accessing the fields of the structure directly would be more efficient.
>
> So, should I use the fields of the structure directly or call the above listed functions?
>
> --
> Victor Porton - http://portonvictor.org
> _______________________________________________
> redland-dev mailing list
> redland-dev at lists.librdf.org
> http://lists.librdf.org/mailman/listinfo/redland-dev
>
>


More information about the redland-dev mailing list