Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.system > #721

Re: Coreutils C question

Newsgroups comp.os.linux.development.system
Date 2014-09-23 06:46 -0700
References <jk8gcr$ddq$1@dont-email.me>
Message-ID <4895477d-1ba6-4f4f-882b-c51ed1c362fc@googlegroups.com> (permalink)
Subject Re: Coreutils C question
From indrajith.k@gmail.com

Show all headers | View raw


Seems here is the explanation.
http://stackoverflow.com/questions/19276701/what-does-initialize-main-argc-argv-do


On Tuesday, March 20, 2012 5:14:27 AM UTC+5:30, Benjamin S. wrote:
> Hi, I'm reading the source code for coreutils. There are a few things I 
> 
> don't understand. The current one is the function:
> 
> 
> 
> initialize_main (&argc, &argv);
> 
> 
> 
> The definition seems to be:
> 
> 
> 
> 
> 
> /* Redirection and wildcarding when done by the utility itself.
> 
>    Generally a noop, but used in particular for native VMS. */
> 
> #ifndef initialize_main
> 
> # define initialize_main(ac, av)
> 
> #endif
> 
> 
> 
> 
> 
> 
> 
> The changelog says:
> 
> 
> 
> 
> 
> 2003-06-17  Jim Meyering  <jim@meyering.net>
> 
> 
> 
> 	* src/system.h (initialize_main): Define.
> 
> 	Use it in every `main'.  Applied via this:
> 
> 	p='initialize_main (&argc, &argv);'
> 
> 	perl -ni -e '/program_name.=.argv.0/ and print "  '"$p"'\n"; 
> 
> print' \
> 
> 	  $(grep -l program_name.=.argv.0 *.c)
> 
> 	test.c uses margc/margv, so I made the change manually for that 
> 
> file.
> 
> 	Based on a patch from Bernard Giroud.
> 
> 
> 
> 
> 
> I really don't understand what it's doing. My current understanding is 
> 
> that it's doing nothing. Any help?

Back to comp.os.linux.development.system | Previous | NextPrevious in thread | Find similar


Thread

Coreutils C question "Benjamin S." <niacin89@yahoo.com> - 2012-03-19 23:44 +0000
  Re: Coreutils C question Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-03-20 00:19 +0000
  Re: Coreutils C question Rainer Weikusat <rweikusat@mssgmbh.com> - 2012-03-20 02:04 +0000
    Re: Coreutils C question "Benjamin S." <niacin89@yahoo.com> - 2012-03-20 16:43 +0000
      Re: Coreutils C question Nix <nix-razor-pit@esperi.org.uk> - 2012-03-21 11:30 +0000
  Re: Coreutils C question indrajith.k@gmail.com - 2014-09-23 06:46 -0700

csiph-web