[Debburn-devel] What can I assume about libc?

Lorenz Minder lminder at gmx.net
Tue Oct 3 20:49:49 UTC 2006


Hi,

Albert Cahalan wrote:
> On 10/2/06, Lorenz Minder <lminder at gmx.net> wrote:
> 
> >Just a quick question: What functions in libc can I use in cdrkit? I
> >guess probably everything from C89, but what about some widely-used
> >C99-functions?
> 
> If it is possible to write a replacement, then go right ahead.

Thanks for your input. I think that is a reasonable way to go, and if
noone else speaks up, this is the approach I will use, maybe with two
additional constraints:

* It makes it significantly harder to write the code without the
  function in question, and

* The function has been in wide use for a while (i.e., no obscure new
  C99 feature).

I think snprintf qualifies perfectly.

> >* snprintf() and friends. Can I use this? Right now there is a
> >  replacement in libschily, but if that is to go it would be unwise to
> >  add more dependencies on it...
> 
> If somebody loves a crappy platform enough to help out, then
> they can write a snprintf(). It isn't terribly difficult.
> 
> >* <wchar.t> and its related functions. Can I use them, or should I just

(Grr, s/\.t/.h/)

> >  use iconv instead? Will iconv ever be mandatory for building cdrkit?
> 
> Perhaps that sort of thing should be simplified a bit, if only to
> reduce complexity a bit. Windows uses UTF-16 with a 16-bit
> wchar_t, and pretty much everybody else is rapidly headed
> toward UTF-8. It might be reasonable to have two modes,
> the default which enforces valid UTF-8 plus valid UTF-16,
> and an option to just shove raw native characters onto the disk.

Yes. The problem is, if we have UTF-8 strings internally, it is a real
pain to do string processing with them; even replacing a given character
with another becomes a major pain. It seems much easier to use
mbstowcs() and then process these strings, and convert when we write
them to files. IOW, I'm not against writing UTF-8 to files, but I don't
think it is a reasonable in-core representation of strings if you want
to do anything at all with them.

For example, UTF-8 support for cdda2wav would become much easier if we
had wchar_t and all its functions available.

Can anyone having access to AIX comment? Is wchar_t available there?

> (then again, kicking mkisofs out might be a better move)

I think mkisofs is a pretty important program; in fact it is currently
my main reason for being interested in this project.

Best,
--Lorenz



More information about the Debburn-devel mailing list