Method main()
- Method
main
int|string|Concurrent.Futuremain(intargc,array(string)argv)
int|string|Concurrent.Futuremain(array(string)argv)
__async__int|stringmain(intargc,array(string)argv)
__async__int|stringmain(array(string)argv)- Description
Main program entry point.
- Parameter
argc The number of elements in
argv.- Parameter
argv The arguments passed to the pike binary excluding arguments intended for the master, but including the name of the main program script.
- Note
This function is provided by the user.
- Returns
Returns one of:
int(0)Program completed successfully.
int(1..127)Progam failed with the specified exit code.
int(..-1)Enter backend mode. The program will complete when exit() or _exit() is called.
string(8bit)Program completed successfully with diagnostic on Stdio.stdout.
Concurrent.FutureEnter backend mode. The program will exit with code
10and an error message on Stdio.stderr if the future fails. Otherwise the success value of the future will be handled as the return value of main() recursively.- Note
Support for omitting
argcwas added to the master in Pike 8.0.0.- Note
Support for return of Concurrent.Futures was added in Pike 9.0.4.
- See also