mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-27 00:40:15 +03:00
Had to split main() into parts to have netsurf_init() called from one thread, and the loop in another to avoid a deadlock in replicants... hope nobody minds.
svn path=/trunk/netsurf/; revision=5586
This commit is contained in:
parent
ce07ebcea8
commit
e4407cd7e9
@ -43,9 +43,7 @@ bool netsurf_quit = false;
|
||||
bool netsurf_embedded = true;
|
||||
bool verbose_log = false;
|
||||
|
||||
static void netsurf_init(int argc, char** argv);
|
||||
static void netsurf_poll(void);
|
||||
static void netsurf_exit(void);
|
||||
static void lib_init(void);
|
||||
|
||||
|
||||
@ -55,6 +53,7 @@ static void lib_init(void);
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
setbuf(stderr, NULL);
|
||||
netsurf_embedded = false;
|
||||
return netsurf_main(argc, argv);
|
||||
}
|
||||
@ -66,11 +65,9 @@ int main(int argc, char** argv)
|
||||
|
||||
int netsurf_main(int argc, char** argv)
|
||||
{
|
||||
setbuf(stderr, NULL);
|
||||
netsurf_init(argc, argv);
|
||||
|
||||
while (!netsurf_quit)
|
||||
netsurf_poll();
|
||||
netsurf_main_loop();
|
||||
|
||||
netsurf_exit();
|
||||
|
||||
@ -78,6 +75,19 @@ int netsurf_main(int argc, char** argv)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gui NetSurf main loop.
|
||||
*/
|
||||
|
||||
int netsurf_main_loop(void)
|
||||
{
|
||||
while (!netsurf_quit)
|
||||
netsurf_poll();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise components used by gui NetSurf.
|
||||
*/
|
||||
|
@ -28,6 +28,9 @@ extern const char * const netsurf_version;
|
||||
extern const int netsurf_version_major;
|
||||
extern const int netsurf_version_minor;
|
||||
|
||||
extern void netsurf_init(int argc, char** argv);
|
||||
extern void netsurf_exit(void);
|
||||
extern int netsurf_main(int argc, char** argv);
|
||||
extern int netsurf_main_loop(void);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user