Commit Graph

800 Commits

Author SHA1 Message Date
Vincent Sanders
e181a7fcf2 Fix several doxygen errors 2016-05-05 22:41:03 +01:00
Vincent Sanders
6da3b3102c remove unused warn_user API 2016-05-02 16:09:28 +01:00
Vincent Sanders
7b28db6249 message get API should not raise user errors itself 2016-04-29 09:41:10 +01:00
Vincent Sanders
bf3ee089cb use the miscellaneous table warning entry
change all the frontends to provide the warning callback in the
miscelaneous table instead of using the warn_user function.

Changing all the warn_user callsites still requires completion.
2016-04-25 23:11:55 +01:00
Vincent Sanders
a828150d9c for strtof to be redefined on haiku stdlib must be included beforehand 2016-04-21 23:56:16 +01:00
Vincent Sanders
04841668f0 attempt to fix haiku headers 2016-04-21 23:37:35 +01:00
Vincent Sanders
7d9c9dba36 Split utils header into string functions and everything else
split out the string handling API from the rest of the utils header
and fix up all the fallout.
2016-04-21 22:36:21 +01:00
Vincent Sanders
3488e337b6 remove unused wallclock API 2016-04-21 14:34:36 +01:00
Vincent Sanders
f33d9dcc8c cleanup unneeded includes in utils.h after API simplification 2016-04-20 23:56:29 +01:00
Vincent Sanders
dd31499bf9 move remove underscores utility to alongside the single gtk call site 2016-04-20 23:38:08 +01:00
Vincent Sanders
7ba291037b move regex helper to be with teh single remaining call site 2016-04-20 23:33:31 +01:00
Vincent Sanders
d29bccdb3a add missing explicit dirent includes 2016-04-19 15:56:57 +01:00
Vincent Sanders
afea659fef move dir_sort_alpha function from generic utils to one specific place it is used 2016-04-19 12:01:05 +01:00
Vincent Sanders
1bc010665e Reduce unecessary use of directory entry headers
The config header was causing many source files to unecessarily
include the dirent headers causing extra dependancies. This has been
fixed by providing a utility dirent header that provides a common API
across all platforms while removing the unecessary dirent header usage.
2016-04-19 11:21:06 +01:00
Vincent Sanders
4f38963337 move time function to apropriate header 2016-04-19 10:36:35 +01:00
Vincent Sanders
836ea5679e move sys/time.h support functionality out of generic header
The utils header is a large collection of functionality for several
system headers and API. This splits out the ones from sys/time.h into
a separate header reducing the need for many unconnected source files
to include the system header unecessarily.
2016-04-19 09:16:09 +01:00
Vincent Sanders
ade0cd8bb9 Reduce unecessary use of networking headers
The utility configuration header dragged in a number of bsd sockets
and related API as a side effect of setting up the configuration. By
splitting the header and API setup into a separate header only the
small number of places that need the functionality explitly include
it.
2016-04-17 13:42:28 +01:00
Vincent Sanders
0bc5d2ca4c create date and time to seconds since epoch processing utility function
currently NetSurf uses curl_getdate to convert textural date and time
strings into seconds since epoch. It is betetr to move this
functionality to a utility function so curl_getdate can easily be
replaced if required.
2016-04-16 23:50:22 +01:00
Vincent Sanders
d15ab96a51 Fix size_t printf formatting
The printf formatting for size_t is set in c99 as %zu but in windows
it is %Iu this is solved by adding and inttypes style PRI macro for size_t

This also uses this macro everywhere size_t is formatted.
2016-03-17 22:00:54 +00:00
Vincent Sanders
1d7b305db9 fixup nsurl handling to avoid locale specific character type implementation 2016-03-14 13:01:06 +00:00
Vincent Sanders
5e604235e4 Initial pass removing gtk frontend theme code 2016-03-08 15:45:28 +00:00
Michael Drake
ebfcc6d9a9 Add script for setting files to git last touched date.
This may help with whatever issue is causing a problem with RISC OS
!Boot and !System distributions.

From the base of the netsurf repo, you can run it like this:

  $ ./utils/git-date.sh riscos/distribution/
2016-02-19 15:25:06 +00:00
Vincent Sanders
8915a49b3f setup flags for building monkey on RISC OS 2016-02-15 15:16:23 +00:00
Vincent Sanders
eaed6b1dda Use compiler environment to control riscos header usage
Instead of relying on building the RISC OS frontend to determine correct
include compatability use the compiler __riscos__ macro.
2016-02-15 15:00:57 +00:00
Michael Drake
d39531ff55 Ensure fetch attempts is not reduced to less than 1. 2016-02-15 11:06:37 +00:00
Michael Drake
c207216fa2 Fix constraints on curl_fetch_timeout option.
5 <= n <= 60 seconds.
2016-02-15 09:55:57 +00:00
Vincent Sanders
157f05bc61 enable monkey to be built everywhere it is completely generic now 2016-02-12 14:16:31 +00:00
Vincent Sanders
90f65814c6 fix coverity build generated tar handling 2016-02-11 12:01:41 +00:00
Vincent Sanders
d0334c35e9 fix coverity submission for netsurf 2016-02-09 11:32:21 +00:00
Vincent Sanders
9610dbd210 remove possible null dereference on allocation faliure
fix null dereference is calloc fails. coverity 1316339
2016-02-09 10:31:46 +00:00
Vincent Sanders
1de182a349 ensure mac os x path is correct 2016-02-07 22:10:35 +00:00
Vincent Sanders
bfbd838395 update jenkins build script for yosemite 2016-02-07 21:59:28 +00:00
Vincent Sanders
94b913e5b3 update for aarch64 2016-02-01 16:27:58 +00:00
Vincent Sanders
6847fad653 remove javascript build option from jenkins script 2016-01-25 16:10:42 +00:00
Vincent Sanders
65bdef55ab move the container code to gtk directory as its only ever used there. 2016-01-19 15:10:29 +00:00
Michael Drake
fcaf43ddcc Add 'mailto' lwc corestring. 2016-01-08 17:16:42 +00:00
Vincent Sanders
74fdde2b57 remove necessity for header change in libutf8proc
The combining character class definition was put in the libutf8proc
header instead of being local to the IDNA implementation.
2016-01-03 16:07:40 +00:00
Chris Young
b962d3db82 Revert "Skip invalid commandline args instead of aborting"
This reverts commit 4ad94124a6.
2015-11-27 12:32:13 +00:00
Chris Young
4ad94124a6 Skip invalid commandline args instead of aborting 2015-11-24 23:55:40 +00:00
Daniel Silverstone
b42a910ed9 Ensure that those events listed in 8.1.5.2 as forwarded from body to window, don't get registered for listeners on body 2015-11-22 14:50:35 +00:00
Daniel Silverstone
4d1ef3bac4 Add support for retrying timed-out cURL fetches.
This is an attempt to amelioriate the situation found in #2384 where
we see the cURL connect() failing to complete.  Based on the pcap
from the bug log, we believe that RISC OS is likely failing to signal
the completion of the connection to cURL.  As such, cURL times out.

This change permits retries of timed out connections in the hope that
a fresh socket FD might subsequently function correctly.  The defaults
chosen mean that the previous behaviour of 30 seconds before timeout
is reported will remain the same, but in that time we will make 3 separate
attempts to connect the socket.
2015-11-10 21:51:54 +00:00
Vincent Sanders
c3b7e650c5 Fix segmentation fault when a string option is set to NULL
The check for a user option being a default value was not protecting
against the value being set to NULL.
2015-11-05 14:47:45 +00:00
Michael Drake
b1533a7f76 Stop utf8 conversion leaking its strings. 2015-10-31 13:44:14 +00:00
Michael Drake
67cbdf6bef Don't fail on URLs with no host. 2015-10-31 13:44:14 +00:00
Michael Drake
25cd49034c Style guide adherence. 2015-10-31 13:44:06 +00:00
Michael Drake
1bb7d295bb Make nsurl utf8 string conversion function consistent with nsurl API. 2015-10-25 09:03:20 +00:00
Chris Young
27adf07fb7 Update gtk frontend to new API 2015-10-24 15:12:57 +01:00
Chris Young
65b510fbc3 Rework IDN URL retrieval to return an nserror 2015-10-24 15:12:57 +01:00
Chris Young
5206518a75 Add URL fragment 2015-10-24 15:12:57 +01:00
Chris Young
920cb0571d Check we've obtained the host string 2015-10-24 15:12:56 +01:00
Chris Young
6afda499c2 Show the IDN decoded form in the URL bar on GTK if the option is set. 2015-10-24 15:12:56 +01:00
Chris Young
5f5ca2c205 Add a function to retrieve the decoded version of IDNA URLs 2015-10-24 15:12:56 +01:00
Adrien Destugues
2071c2a91b Fix BeOS build
Mainly C/C++ conflicts:
* Designated initializer are not part of C++
* C++ already defines min() and max()
* Force C99 and remove -O0 since we now use a decent compiler
2015-10-12 21:08:25 +01:00
Vincent Sanders
b50ee13100 Fix checking of distcc 2015-08-12 15:05:28 +01:00
Vincent Sanders
fd21e488e0 Add support for builders with distcc installed 2015-08-12 14:50:54 +01:00
Vincent Sanders
7e9fcada3b Fixup jenkins build scripts to cope with duktape for javascript 2015-08-09 12:46:35 +01:00
Daniel Silverstone
a4455f79ce Add support for BODY, HEAD, html namespaces and keying of html content data 2015-08-09 11:58:42 +01:00
Adrien Destugues
989bc6e190 Fix build on 64-bit Haiku
- Fix path to look for libnetwork to work also on non-hybrid systems
- Remove references to /boot/common as it is not used anymore
- Fix a few type errors
- Use compiler provided va_copy when available
2015-07-14 09:12:44 +01:00
Vincent Sanders
f24b4b94bc Update jenkins build script to cope with arm linux builds 2015-07-13 13:31:28 +01:00
Vincent Sanders
82beca0432 Complete hash table tests and clean up ineterface. 2015-07-12 17:28:03 +01:00
Vincent Sanders
94b5c95676 Add unit test for bloom filter
Adds check based unit test for teh bloom filter implementation. This
is based on Roberts original test code in utils/bloom.c and uses
/usr/share/dict as a source of strings to check bloom creation, no
false negatives and the false positive rate is below 15%.
2015-07-10 10:48:26 +01:00
Vincent Sanders
7b2d15a036 Add tests for all asserts in nsurl API and for access and access_leaf 2015-07-09 23:29:44 +01:00
Vincent Sanders
5b09363597 Add asserts to ensure operations not passed bad pointers 2015-07-09 17:44:51 +01:00
Michael Drake
cd1949bc96 Improve component documentation. 2015-07-09 17:24:03 +01:00
Michael Drake
433f47641e Fix mention of nsurl_destroy. 2015-07-09 15:02:51 +01:00
Vincent Sanders
8e26870e15 Fix logging to stderr if verbose_log was set before nslog_init was called 2015-07-05 00:51:29 +01:00
Vincent Sanders
ccac301176 Fix a signed comparison error in nsurl parsing.
In utils/nsurl.c the function nsurl__create_from_section() has a
section dealing with non-redundant ports (starting line 973).

lwc_intern_string() was being called with negative lengths and as it
takes a size_t (unsigned) so is getting passed a very large length
which causes a segfault.

this is supposed to be protected by the flag setting on line 969
however the arithmetic is all *unsigned* so the condition never
matches

(gdb) p length - (colon - pegs->at + skip)
$9 = 18446744073709551608

changing the check arithmetic to be a simple comparison against length
prevents this issue and reduces the amount of computation required.
2015-07-04 09:36:46 +01:00
Vincent Sanders
a94ae7a80a Allow translation messages to be compiled in as GTK resources 2015-06-21 23:27:22 +01:00
Vincent Sanders
67ded2a02a This moves message loading out of netsurf_init into each frontend
The translated message loading is dependant on configuration of
resource location in each frontend, additionally they should have the
ability to deal with errors in this loading in a implementation
specific manner.

This also extends the message loading API to be capable of loading
from an inline memory buffer instead of from a file.
2015-06-21 23:27:22 +01:00
Vincent Sanders
335bbe4f52 Move the browser identification and machine info logging.
Previously this information was logged when netsurf_init was called
which might be many lines out output into the log.

It is useful to have this information at the beginning of the log to
make it easily found. In addition it makes netsurf_init less complex.
2015-06-21 23:27:21 +01:00
Vincent Sanders
25d7f0c657 use logfile as variable name as cocoa gives an error about the symbol type of logf 2015-05-29 16:32:12 +01:00
Vincent Sanders
faf9b9d919 Improve logging interface to reduce overhead
This reduces logging overhead by only calling the log output function
once instead of three times.

Additionally the nslog_gettime interface no longer needs to be
exported and the static function is directly inlined further reducing
function call overhead.

Finally the appending of a newline uses fputc instead of a full printf
call which is considerably more simple and further reduces overhead
time.
2015-05-29 16:18:18 +01:00
Vincent Sanders
4324bf535f Allow verbose logging to be directed to a file 2015-05-29 16:14:42 +01:00
Vincent Sanders
0d811963c1 fixup all the remaining logging macro callsites
The semantic patch tool appears to have missed some difficult to
reason about callsites which have now been manually cleaned up
2015-05-28 17:06:18 +01:00
Vincent Sanders
c105738fa3 Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.

The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.

A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
2015-05-28 16:08:46 +01:00
Vincent Sanders
2092ab252f utility to translate public suffix data into a c code 2015-05-06 23:45:48 +01:00
Vincent Sanders
408e818cbe Update posix source version on monkey frontend to reflect oyr usage of scandir 2015-05-03 14:46:29 +01:00
Vincent Sanders
47d08b6506 Revert "Fix RISC OS not having a pread/pwrite implementation."
This reverts commit 82c7a7a4ba.

Conflicts:
	content/fs_backing_store.c
2015-04-02 16:37:04 +01:00
Vincent Sanders
82c7a7a4ba Fix RISC OS not having a pread/pwrite implementation. 2015-03-31 22:41:37 +01:00
Michael Drake
78663e9111 Remove fragment from nsurl hash. 2015-03-27 11:58:52 +00:00
Vincent Sanders
a487f7e611 Move win32 window operations into their own module
This splits up a great deal of the win32 window code out from other
gui code. It also remove large quantities of unused and junk
variables and functions.
2015-03-12 23:48:53 +00:00
Michael Drake
7247f48d2f Remove unused #include. 2015-03-05 20:17:42 +00:00
Michael Drake
ac636100e8 Remove include of nsurl from corestrings.h 2015-02-26 16:58:41 +00:00
Michael Drake
30909f8ed5 Move FILE_SCHEME_PREFIX to corestrings. 2015-02-26 16:14:23 +00:00
Vincent Sanders
d61444e703 add missing errno include 2015-01-30 17:13:35 +00:00
Vincent Sanders
791a45141d Updated time_t fallback reading to not fail if the value is 0
The non strptime fallback reading of time_t values would report
faliure if the value it read was 0 which is a valid time. This fixes
this path to only fail if there was an actual error processing the
value.
2015-01-30 17:04:34 +00:00
Chris Young
989a5da334 Cast timeval.usec calculations to int as AmigaOS3 has some conflicting headers which means it can be treated as an unsigned value.
This ensures the log time is always correct.
2015-01-19 19:15:48 +00:00
Vincent Sanders
2d58f8360e jenkins helper script quoting in shell wilidcard case was wrong 2014-12-21 14:15:58 +00:00
Vincent Sanders
3f331a701a add freebsd to jenkins build script for gtk, framebuffer and monkey 2014-12-21 13:59:39 +00:00
Vincent Sanders
8e60d32831 remove some warnings from freebsd build 2014-12-21 02:01:45 +00:00
Vincent Sanders
6684b938e2 Update the coverity build script for buildsystem HOST/BUILD changes 2014-12-19 16:56:43 +00:00
Vincent Sanders
876b6cbeb0 fix BUILD/HOST usage to work with fixed buildsystem 2014-12-19 13:30:20 +00:00
Vincent Sanders
0f6f0a0169 Improve message split generation
This changes the message splitting code to ensure that a translation
is generated for every different key using a specified language as a
fallback if no translation is available.

This also allows for a messages to be generated when there is no
fallback at all and when the translation is the same as the fallback
language
2014-12-02 16:27:24 +00:00
Vincent Sanders
9bc07e8d8f make coverity build script use updated environment variables 2014-11-30 00:37:35 +00:00
Vincent Sanders
669df172ec Fix my spelling of teh everywhere 2014-11-18 17:16:26 +00:00
Vincent Sanders
1deb36759b uipdate jenkins build script to confirm to new core buildsystem 2014-11-16 13:33:08 +00:00
Vincent Sanders
97759f62af USe the externally built conveniance utf8proc library 2014-11-14 13:46:08 +00:00
Vincent Sanders
9fde3502b6 doxygen cleanups in utils 2014-11-12 23:27:13 +00:00
Vincent Sanders
e32a2ad46e Doxygen fixes 2014-11-09 15:28:03 +00:00
Vincent Sanders
8f64d5d223 Improve Doxygen documentation 2014-11-08 12:35:11 +00:00