[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] Patch for FS#118
From: |
Aleksander Morgado |
Subject: |
Re: [pdf-devel] Patch for FS#118 |
Date: |
Mon, 19 Apr 2010 23:26:49 +0200 |
> Here is a patch for new method pdf_fsys_build_path(). I tested it
> on GNU/Linux.
>
> address@hidden ...
> +Variable-length pdf_text_t object list, last element must be NULL.
>
> It is dangerous to rely on the client of the function to terminate the
> list with a NULL value: if she forgets about the rule then the results
> would be unpredictable.
>
Well, I don't quite find it so dangerous, and I was the one actually
suggesting to gerel such a change (he first used the approach for the
number-of-arguments-variable)... :-)
Just wanted to follow GLib's approach in g_build_filename(), which does
the same thing. And actually, I believe that the approach of marking the
last element in a variadic function with a specific value is
widely-used.
Instead of a plain NULL, we could set a PDF_FSYS_BUILD_PATH_LAST symbol
which will anyway be NULL internally...
I can't right now say which approach is better, but I believe is more
error-prone to actually make the developer manually count how many
elements will be passed to the variadic function...
Cheers
--
Aleksander