mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Daniel Cegiełka" <daniel.cegielka@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Priorities for next release?
Date: Sat, 11 Aug 2012 20:41:57 +0200	[thread overview]
Message-ID: <CAPLrYERUnznyH7B5Q6Sn=_o1b=D+QnM2ge5TZutG06kREnGaPA@mail.gmail.com> (raw)
In-Reply-To: <20120812015536.3caa3999@sibserver.ru>

>> Couldn't this code just be fixed to add an argument to usage() and
>> call usage(argv[0]) or even usage(basename(argv[0])) if preferred?
>>
>> Rich
>
> Or even progname = basename(argv[0]) with global char *progname ?

Usually it looks like this:

extern char *__progname;

'extern' means __progname must be available to external objects, so in
code with main():

#include <stdio.h>

char *__progname;

int main(int argc, char *argv[])
{
        __progname = argv[0];
        printf("%s\n", __progname);
        return 0;
}

what you think? It works for me... so why basename(argv[0])?

Daniel


  reply	other threads:[~2012-08-11 18:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 19:12 Rich Felker
2012-08-10 19:23 ` Nathan McSween
2012-08-10 19:39   ` Unit/regression testing (was Re: [musl] Priorities for next release?) Rich Felker
2012-08-10 22:03 ` Priorities for next release? Luca Barbato
2012-08-11  0:05   ` Rich Felker
2012-08-11  0:54     ` Luca Barbato
2012-08-11  1:07       ` Rich Felker
2012-08-11  2:21       ` idunham
2012-08-11  2:36         ` Rich Felker
2012-08-11 12:21           ` Daniel Cegiełka
2012-08-11 12:27             ` Rich Felker
2012-08-11 12:35               ` Daniel Cegiełka
2012-08-11 16:09                 ` Rich Felker
2012-08-11 16:35                   ` Daniel Cegiełka
2012-08-11 16:50                     ` Rich Felker
2012-08-11 17:55                       ` orc
2012-08-11 18:41                         ` Daniel Cegiełka [this message]
2012-08-11 18:47                           ` orc
2012-08-11 19:05                             ` Daniel Cegiełka
2012-08-11 19:28                               ` Rich Felker
2012-08-11 19:56 ` Rich Felker
2012-08-11 20:26   ` Daniel Cegiełka
2012-08-11 20:51     ` Rich Felker
2012-08-11 20:56       ` Rich Felker
2012-08-11 21:22       ` Rich Felker
2012-08-12 12:52         ` Daniel Cegiełka
2012-08-11 22:25   ` Rich Felker
2012-08-12 12:40     ` Szabolcs Nagy
2012-08-13  8:40   ` Luca Barbato
2012-08-13 13:41     ` Rich Felker
2012-08-13 15:49       ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPLrYERUnznyH7B5Q6Sn=_o1b=D+QnM2ge5TZutG06kREnGaPA@mail.gmail.com' \
    --to=daniel.cegielka@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).