NetSurf
|
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/select.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include "utils/config.h"
#include "utils/sys_time.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/filepath.h"
#include "utils/nsoption.h"
#include "utils/nsurl.h"
#include "netsurf/misc.h"
#include "netsurf/netsurf.h"
#include "netsurf/url_db.h"
#include "netsurf/cookie_db.h"
#include "content/fetch.h"
#include "content/backing_store.h"
#include "monkey/output.h"
#include "monkey/dispatch.h"
#include "monkey/browser.h"
#include "monkey/401login.h"
#include "monkey/filetype.h"
#include "monkey/fetch.h"
#include "monkey/schedule.h"
#include "monkey/bitmap.h"
#include "monkey/layout.h"
Go to the source code of this file.
Macros | |
#define | LANGV_SIZE 32 |
maximum number of languages in language vector More... | |
#define | LANGS_SIZE 4096 |
maximum length of all strings in language vector More... | |
Functions | |
static void | die (const char *const error) |
Cause an abnormal program termination. More... | |
static const char * | get_language (void) |
obtain language from environment More... | |
static const char *const * | get_languagev (void) |
provide a string vector of languages in preference order More... | |
static char ** | nsmonkey_init_resource (const char *resource_path) |
Create an array of valid paths to search for resources. More... | |
static void | monkey_quit (void) |
static nserror | gui_launch_url (struct nsurl *url) |
static nserror | gui_present_cookies (const char *search_term) |
static void | quit_handler (int argc, char **argv) |
static void | monkey_options_handle_command (int argc, char **argv) |
static nserror | set_defaults (struct nsoption_s *defaults) |
Set option defaults for monkey frontend. More... | |
static bool | nslog_stream_configure (FILE *fptr) |
Ensures output logging stream is correctly configured. More... | |
static void | monkey_run (void) |
int | main (int argc, char **argv) |
Normal entry point from OS. More... | |
Variables | |
char ** | respaths |
resource search path vector More... | |
static bool | monkey_done = false |
static struct gui_misc_table | monkey_misc_table |
#define LANGS_SIZE 4096 |
#define LANGV_SIZE 32 |
|
static |
Cause an abnormal program termination.
error | The message to display to the user. |
Definition at line 70 of file main.c.
References MOUT_DIE, and moutf().
Referenced by main().
|
static |
obtain language from environment
start with GNU extension LANGUAGE environment variable and then try POSIX variables LC_ALL, LC_MESSAGES and LANG
Definition at line 83 of file main.c.
Referenced by get_languagev().
|
static |
provide a string vector of languages in preference order
environment variables are processed to aquire a colon separated list of languages which are converted into a string vector. The vector will always have the C language as its last entry.
This implementation creates an internal static representation of the vector when first called and returns that for all subsequent calls. i.e. changing the environment does not change the returned vector on repeated calls.
If the environment variables have more than LANGV_SIZE languages or LANGS_SIZE bytes of data the results list will be curtailed.
Definition at line 126 of file main.c.
References get_language(), LANGS_SIZE, and LANGV_SIZE.
Referenced by nsmonkey_init_resource().
Definition at line 214 of file main.c.
References MOUT_GENERIC, moutf(), NSERROR_OK, and nsurl_access().
|
static |
Definition at line 220 of file main.c.
References MOUT_GENERIC, moutf(), and NSERROR_OK.
int main | ( | int | argc, |
char ** | argv | ||
) |
Normal entry point from OS.
Normal entry point from OS.
/param argc The number of arguments in the string vector. /param argv The argument string vector. /return The return code to the OS
Normal entry point from OS.
Definition at line 389 of file main.c.
References die(), filepath_find(), filepath_sfinddef(), filesystem_llcache_table, messages_add_from_file(), netsurf_table::misc, monkey_bitmap_table, monkey_download_table, monkey_fetch_filetype_init(), monkey_fetch_table, monkey_free_handlers(), monkey_kill_browser_windows(), monkey_layout_table, monkey_login_handle_command(), monkey_misc_table, monkey_options_handle_command(), monkey_register_handler(), monkey_run(), monkey_window_handle_command(), monkey_window_table, MOUT_GENERIC, moutf(), netsurf_exit(), netsurf_init(), netsurf_register(), NSERROR_OK, NSLOG, nslog_finalise(), nslog_init(), nslog_stream_configure(), nsmonkey_init_resource(), nsoption_charp, nsoption_commandline(), nsoption_finalise(), nsoption_init(), nsoption_read(), nsoptions, nsoptions_default, options, PATH_MAX, quit_handler(), respaths, set_defaults(), urldb_load(), and urldb_load_cookies().
|
static |
Definition at line 235 of file main.c.
References nsoption_commandline(), and nsoptions.
Referenced by main().
|
static |
Definition at line 207 of file main.c.
References monkey_fetch_filetype_fin(), nsoption_charp, urldb_save(), and urldb_save_cookies().
|
static |
Definition at line 277 of file main.c.
References fetch_fdset(), monkey_done, monkey_process_command(), monkey_schedule_run(), MOUT_GENERIC, moutf(), and NSLOG.
Referenced by main().
|
static |
|
static |
Create an array of valid paths to search for resources.
The idea is that all the complex path computation to find resources is performed here, once, rather than every time a resource is searched for.
resource_path | A shell style colon separated path list |
Definition at line 190 of file main.c.
References filepath_free_strvec(), filepath_generate(), filepath_path_to_strvec(), and get_languagev().
Referenced by main().
|
static |
Definition at line 230 of file main.c.
References monkey_done.
Referenced by main().
|
static |
Set option defaults for monkey frontend.
defaults | The option table to update. |
Definition at line 246 of file main.c.
References NSERROR_OK, and nsoption_setnull_charp.
Referenced by main().
|
static |
Definition at line 61 of file main.c.
Referenced by monkey_run(), and quit_handler().
|
static |
Definition at line 268 of file main.c.
Referenced by main().
char** respaths |
resource search path vector
Definition at line 59 of file main.c.
Referenced by get_resource_url(), gui_get_resource_url(), main(), nsgtk_get_resource_url(), nsw32_messages_init(), nsw32_option_init(), and WinMain().