2002-09-11 18:24:02 +04:00
|
|
|
/**
|
2002-12-30 01:27:35 +03:00
|
|
|
* $Id: netsurf.c,v 1.5 2002/12/29 22:27:35 monkeyson Exp $
|
2002-09-11 18:24:02 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "netsurf/desktop/netsurf.h"
|
|
|
|
#include "netsurf/desktop/fetch.h"
|
|
|
|
#include "netsurf/desktop/browser.h"
|
|
|
|
#include "netsurf/desktop/gui.h"
|
2002-11-03 12:39:53 +03:00
|
|
|
#include "netsurf/desktop/cache.h"
|
2002-09-11 18:24:02 +04:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int netsurf_quit = 0;
|
|
|
|
gui_window* netsurf_gui_windows = NULL;
|
|
|
|
struct fetch* netsurf_fetches = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
void netsurf_poll(void)
|
|
|
|
{
|
|
|
|
gui_poll();
|
|
|
|
netsurf_fetches = fetch_poll(netsurf_fetches);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void netsurf_init(int argc, char** argv)
|
|
|
|
{
|
2002-10-08 13:38:29 +04:00
|
|
|
stdout = stderr;
|
2002-09-11 18:24:02 +04:00
|
|
|
gui_init(argc, argv);
|
2002-11-03 12:39:53 +03:00
|
|
|
cache_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void netsurf_exit(void)
|
|
|
|
{
|
|
|
|
cache_quit();
|
2002-09-11 18:24:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
netsurf_init(argc, argv);
|
|
|
|
|
|
|
|
while (netsurf_quit == 0)
|
|
|
|
netsurf_poll();
|
|
|
|
|
2002-10-15 14:41:12 +04:00
|
|
|
fprintf(stderr, "Netsurf quit!\n");
|
2002-11-03 12:39:53 +03:00
|
|
|
netsurf_exit();
|
2002-10-15 14:41:12 +04:00
|
|
|
|
2002-09-11 18:24:02 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Log(char* func, char* msg)
|
|
|
|
{
|
2002-12-30 01:27:35 +03:00
|
|
|
#ifdef NETSURF_DUMP_MONKEYS
|
2002-09-11 18:24:02 +04:00
|
|
|
FILE* logfile = NULL;
|
|
|
|
logfile = fopen("logfile","a");
|
|
|
|
if (logfile == NULL)
|
|
|
|
die("can't open logfile");
|
|
|
|
fprintf(logfile, "%s: %s\n", func, msg);
|
|
|
|
fclose(logfile);
|
|
|
|
#endif
|
|
|
|
}
|