TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
tsMain.h File Reference

Define a standard main() function with appropriate checks. More...

Macros

#define TS_MAIN(func)
 A macro which expands to a main() program.
 

Functions

int MainWrapper (int(*func)(int argc, char *argv[]), int argc, char *argv[])
 A function to wrap the entry point of an application.
 

Detailed Description

Define a standard main() function with appropriate checks.

Macro Definition Documentation

◆ TS_MAIN

#define TS_MAIN (   func)

A macro which expands to a main() program.

An explicit reference is made to the TSDuck library version to check that the compilation and runtime versions are identical.

Parameters
funcThe actual main function with the same profile as main().

Function Documentation

◆ MainWrapper()

int MainWrapper ( int(*)(int argc, char *argv[])  func,
int  argc,
char *  argv[] 
)

A function to wrap the entry point of an application.

The application code should use the macro TS_MAIN instead of directly calling this function.

Uncaught exceptions are displayed. On Windows, the COM environment and IP networking are initialized. The Windows console is set to UTF-8 mode and restored to its previous value on exit.

Parameters
[in]funcThe actual main function with the same profile as main().
[in]argcCommand line parameter count.
[in]argvCommand line parameters.
Returns
The process exit code, typically EXIT_SUCCESS or EXIT_FAILURE.