mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-23 02:42:11 +03:00
Have netsurf_main() do the real work and main() call it. This allows ports to call it from elsewhere to embed NetSurf in another application.
The netsurf_embedded bool remembers it for later (like, we shouldn't probably save the hotlist and preferences in that case). svn path=/trunk/netsurf/; revision=5579
This commit is contained in:
parent
a6b42a06ff
commit
6330f8e475
@ -40,6 +40,7 @@
|
||||
#include "utils/utils.h"
|
||||
|
||||
bool netsurf_quit = false;
|
||||
bool netsurf_embedded = true;
|
||||
bool verbose_log = false;
|
||||
|
||||
static void netsurf_init(int argc, char** argv);
|
||||
@ -49,10 +50,21 @@ static void lib_init(void);
|
||||
|
||||
|
||||
/**
|
||||
* Gui NetSurf main().
|
||||
* The regular main(), when not embedded
|
||||
*/
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
netsurf_embedded = false;
|
||||
return netsurf_main(argc, argv);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gui NetSurf main().
|
||||
*/
|
||||
|
||||
int netsurf_main(int argc, char** argv)
|
||||
{
|
||||
setbuf(stderr, NULL);
|
||||
netsurf_init(argc, argv);
|
||||
|
@ -22,9 +22,12 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
extern bool netsurf_quit;
|
||||
extern bool netsurf_embedded;
|
||||
extern bool verbose_log;
|
||||
extern const char * const netsurf_version;
|
||||
extern const int netsurf_version_major;
|
||||
extern const int netsurf_version_minor;
|
||||
|
||||
extern int netsurf_main(int argc, char** argv);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user