Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2001 16:02:53 +0300
From:      "Alexey Zelkin" <phantom@cris.crimea.ua>
To:        "Andrey A. Chernov" <ache@nagual.pp.ru>
Cc:        <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/lib/libc/locale ldpart.c ldpart.h
Message-ID:  <000e01c09686$8b6e0040$ce8f6ed4@spider.cris.net>

next in thread | raw e-mail | index | archive | help
hi,


>> > phantom     2001/02/13 07:29:39 PST
>> >
>> >   Modified files:
>> >     lib/libc/locale      ldpart.c ldpart.h
>> >   Log:
>> >   add additional function parameter: bufsize_min. it's possible
>> >   to check two sizes per one function invocation now.
>>
>> Why only two hardcoded? It prevents additional locale extensions - there
>> must be unlimited number of possible extensions. It means that ldpart
must
>> just return line count, and upper level code must decide which level of
>> extensions used and what actions are needed to compensate missing
>> parts for each returned line count.
>
>In "C" terms I mean something like:
>
> ret = load_part(... &line_count, ..., &using_that_locale, ...)
>
> if (ret == 0 && using_that_locale) {
> if (line_count < EXT1) { /* min */
> compensate_ext1;
> }
> if (line_count < EXT2) { /* EXT2 > EXT1 */
> compensate_ext2;
> }
> ... EXT3, etc. ...   /* EXT3 > EXT2, etc. */
> }


It's not such simple as you propose. First of all, num_lines check should be
located
before code which fills internal structures (i.e. before set_from_buf()
call).

It means that we need to make function which should check num_lines and
return TRUE/FALSE
for correct/incorrect amount of numbers and pass pointer to this function in
__part_load_locale()
or split out set_from_buf() call from ldpart.c and implement same code after
each __part_load_locale()
call.

IMHO, both variants are just overheads and includes a lot of unneeded code
to libc. I think we don't
need such changes until we really need them. BTW, I don't propose to add
__part_load_locale()
calls to libc anymore because it's already used in all places there I
proposed to use it. Also __part_load_locale() is libc internal function and
will not be used in any external programs.
Logicaly next step is optimization and not universalization, isn't it ?




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000e01c09686$8b6e0040$ce8f6ed4>