summaryrefslogtreecommitdiff
path: root/desktop/netsurf.c
blob: cc53acc0512cda399e565f24388c249802fc5b95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
 * $Id: netsurf.c,v 1.1 2002/09/11 14:24:02 monkeyson Exp $
 */

#include "netsurf/desktop/netsurf.h"
#include "netsurf/desktop/fetch.h"
#include "netsurf/desktop/browser.h"
#include "netsurf/desktop/gui.h"
#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)
{
  gui_init(argc, argv);
}


int main(int argc, char** argv)
{
  netsurf_init(argc, argv);

  while (netsurf_quit == 0)
    netsurf_poll();

  return 0;
}


void Log(char* func, char* msg)
{
#ifdef NETSURF_DUMP
  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
}