Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Malcolm McLean Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Wed, 29 May 2024 06:00:47 +0100 Organization: A noiseless patient Spider Lines: 53 Message-ID: References: <00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com> <87msoh5uh6.fsf@nosuchdomain.example.com> <87y18047jk.fsf@nosuchdomain.example.com> <87msoe1xxo.fsf@nosuchdomain.example.com> <87ikz11osy.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 29 May 2024 07:00:47 +0200 (CEST) Injection-Info: dont-email.me; posting-host="caedc23860868fba36e9b00f63855f95"; logging-data="1071966"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sjNCYLAjx8Rjz5ROrYr3gHwYESR1XxD8=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:eMidhBApeZXscCaJ23ZF9TMWseU= Content-Language: en-GB In-Reply-To: Bytes: 3937 On 28/05/2024 11:30, bart wrote: > On 28/05/2024 03:45, Lawrence D'Oliveiro wrote: >> On Mon, 27 May 2024 14:03:16 +0100, bart wrote: >> >>> On 27/05/2024 03:48, Lawrence D'Oliveiro wrote: >>>> >>>>> Apparently that is not so easy as you seem to think. >>>> >>>> Yes, it is as easy as I think. I’ve done this sort of thing, using >>>> suitable build scripts. >>> >>> Show me. >> >> Here is an old >> example, from when I was trying to learn Android programming. It lets >> you browse the Unicode code-point database, and do incremental >> searches by partial matching on code-point names: e.g. you can type >> “right arrow” and see candidate matches such as “U+219B RIGHTWARDS >> ARROW WITH STROKE”, “U+219D RIGHTWARDS WAVE ARROW”, “U+21A0 RIGHTWARDS >> TWO HEADED ARROW” etc. >> >> In the “util” subdirectory, you will find a Python script called >> “get_codes”. This processes a NamesList.txt file as downloaded from >> Unicode.org, and encodes the database as a binary blob with a >> specially-constructed header to allow quick loading and extraction of >> code-point information, including names, categories, related entries >> etc. This blob gets built as a “resource file” into the .apk file, >> where the Java code can find it. > > OK, so basically this writes a file. Or, part of a file? > > Where is the bit in the Java code that embeds it. Or is writing it as > part of the .apk what you consider embedding? > > This is like saying that there's no point in anyone doing: > >  #embed "clang.exe" > > because building that program is so much more complicated. (Or would be > if somebody hadn't already done it.) > > The point is this: /once you already have those discrete files/, how do > you painlessly embed them into your application? > Yes, I've spent a lot of time on the Baby X resource compiler. If it is just a case of converting binary files to C arrays, then of course that is trivial. But people want to do more. I've just added facilities for specifying output formats for arrays of structures. They're not merged in yet, I'm not convinced the approach is right. -- Check out Basic Algorithms and my other books: https://www.lulu.com/spotlight/bgy1mm