Re: [dev] Better naming for arg.h API

From: Nikita Zlobin <nick87720z_AT_gmail.com>
Date: Wed, 7 Jul 2021 23:19:52 +0500

In Mon, 5 Jul 2021 13:36:50 +0200
Hiltjo Posthuma <hiltjo_AT_codemadness.org> wrote:

> It is based on:
> https://9fans.github.io/plan9port/man/man3/arg.html
>
> argc (count) and argv (array of strings) are the program argument
> names.
>

Btw, I only just looked to header, linked in that man page:
https://9fans.github.io/usr/local/plan9/include/libc.h

Now I know origin of many style elements, looks like authors liked to
intentionally train reader ))).
Yet there's also something I guess error:

#define ARGBEGIN
 for((argv0?0:(argv0=(__fixargv0(),*argv))),argv++,argc--;

Just by symbols name __fixargv0 should be called rather for set argv0,
because in false case its overwriten from *argv.

for((argv0 ? __fixargv0() : (argv0=*argv)),argv++,argc--;
Received on Wed Jul 07 2021 - 20:19:52 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 07 2021 - 20:24:07 CEST