Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Public access to Argv0__[]
Public access to Argv0__[] [message #56628] Mon, 29 March 2021 21:48 Go to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Is it possible to make extern char Argv0__[] publicly visible?
I need it to initialize third-party code in a way similar to the way gtk_init is doing this.

TIA


Regards,
Novo
Re: Public access to Argv0__[] [message #56669 is a reply to message #56628] Fri, 02 April 2021 09:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 29 March 2021 21:48
Is it possible to make extern char Argv0__[] publicly visible?
I need it to initialize third-party code in a way similar to the way gtk_init is doing this.

TIA


Just to be sure: You need the value of argv[0] of main, right? (the name of app)

Something like

String GetArgv0();

(things are complicated as Argv0 is POSIX specific...)

Mirek
Re: Public access to Argv0__[] [message #56675 is a reply to message #56669] Fri, 02 April 2021 15:22 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Fri, 02 April 2021 03:48

Something like

String GetArgv0();

Yes. Exactly.
mirek wrote on Fri, 02 April 2021 03:48

(things are complicated as Argv0 is POSIX specific...)

It is coming from main(int argc, char **argv) ...
A note from the API that I'm using:
Special consideration is required for argv[0]. On Unix, this argument passes the part of the command line that is used to locate the executable. Prolog uses this to find the file holding the running executable. The Windows version uses this to find a module of the running executable. If the specified module cannot be found, it tries the module libswipl.dll, containing the Prolog runtime kernel.



Regards,
Novo
Re: Public access to Argv0__[] [message #56809 is a reply to message #56675] Sat, 17 April 2021 15:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Implemented.
Re: Public access to Argv0__[] [message #56828 is a reply to message #56809] Sun, 18 April 2021 04:46 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Thanks a lot!

Regards,
Novo
Previous Topic: InFilterStream::Out() is buggy: a possible bugfix
Next Topic: Issue with FileCopy() on LinuxMint
Goto Forum:
  


Current Time: Thu Mar 28 12:16:33 CET 2024

Total time taken to generate the page: 0.01166 seconds