Commit Graph

236 Commits

Author SHA1 Message Date
John Mark Bell
ad6fcea6b0 Add url_fragment to extract fragment from URL
Optionally allow url_compare to ignore fragments in comparison
Fix handling of url_compare result in a few places
Fix redirects which contain fragments in the Location header

svn path=/trunk/netsurf/; revision=3826
2008-02-03 12:04:48 +00:00
John Mark Bell
2fa8e656a1 The previous fix was broken -- URI paths include the leafname.
Make url_path() return the full path (including the leafname).
Defaulted cookie path attributes have the leafname and trailing slash stripped.
Add testcase for defaulted path.
Fix testcase conditions for paths with leafnames.

svn path=/trunk/netsurf/; revision=3693
2008-01-07 12:01:11 +00:00
John Mark Bell
252ad5c476 Add url_leafname()
Remove spurious * from url_host_is_ip_address()

svn path=/trunk/netsurf/; revision=3691
2008-01-07 04:54:08 +00:00
Vincent Sanders
2f864eeecc Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text
svn path=/trunk/netsurf/; revision=3486
2007-08-08 16:16:03 +00:00
Vincent Sanders
c032d88ba7 a script which will determine who was the last person to change a line which has a warning upon it (and a which revision)
svn path=/trunk/netsurf/; revision=3484
2007-08-08 14:20:57 +00:00
John Mark Bell
7ec7ba37db Fix debug build
svn path=/trunk/netsurf/; revision=3477
2007-08-06 22:17:42 +00:00
John Mark Bell
3d11398006 Purge NCOS build options; these have been redundant for ages.
svn path=/trunk/netsurf/; revision=3454
2007-07-21 22:17:07 +00:00
Rob Kendrick
04292695be Initial work on RSVG image handler. Still a lot to do.
svn path=/trunk/netsurf/; revision=3433
2007-07-18 17:58:35 +00:00
Rob Kendrick
59f358eb0f Wrap internal SVG renderer with appropriate #ifdef WITH_NS_SVG
svn path=/trunk/netsurf/; revision=3432
2007-07-18 14:49:26 +00:00
Rob Kendrick
36ecbc6be2 Add HAVE_STRNDUP and supporting structure to config.h and make utils.[ch] reflect it.
svn path=/trunk/netsurf/; revision=3351
2007-06-16 23:30:47 +00:00
Rob Kendrick
43257a160b Changes to allow building on Solaris.
* Tested on Solaris Express: Developer Edition,
          which is between Solaris 10 and 11.
        * Used gcc, libmng etc packages using pkg-get and blastwave's resources.
        * Had to build lemon and re2c manually.

svn path=/trunk/netsurf/; revision=3350
2007-06-15 22:07:11 +00:00
Rob Kendrick
89a44d8bc3 FreeBSD portability fixes.
* Remove usage of d_ino from utils/filename.c (it was checking
	  for the inode being 0, and I cannot spot anywhere in UnixLib
	  where it would explicitly do this anyway)
	* Add -D_XOPEN_SOURCE=600 to gcc command line, and replace old
	  -D_POSIX_C_SOURCE to include =200112L (as that's the standard
	  we use).

svn path=/trunk/netsurf/; revision=3347
2007-06-15 18:43:07 +00:00
Daniel Silverstone
9ef3a2cd57 Reflow useragent.c to be 8 char indent. Also rename build_user_agent to user_agent_build_string so that all useragent.c starts user_agent_*
svn path=/trunk/netsurf/; revision=3334
2007-06-10 18:13:59 +00:00
John Mark Bell
87ca206e13 Warning fixes.
svn path=/trunk/netsurf/; revision=3332
2007-06-10 18:08:22 +00:00
Daniel Silverstone
1dd7e97eb3 Merge scheme switcher branch in.
svn path=/trunk/netsurf/; revision=3330
2007-06-10 17:46:44 +00:00
Rob Kendrick
47f9ee3581 Check return value of stat() in filename.c and report oddness using LOG
svn path=/trunk/netsurf/; revision=3318
2007-06-10 11:28:44 +00:00
Rob Kendrick
818a744178 Stop filename.c using d_type member in dirent struct, as this is completely and utterly unportable. Not even Linux has it anymore.
svn path=/trunk/netsurf/; revision=3317
2007-06-10 11:11:46 +00:00
Daniel Silverstone
6807b4208a Remove the netsurf/ from the include paths and rationalise use of <> vs "" in includes
NetSurf includes are now done with ""s and other system includes with <>s as C intended.
The scandeps tool has been updated to only look for ""ed includes, and to verify that the
files exist in the tree before adding them to the dependency lines. The depend rule has
therefore been augmented to make sure the autogenerated files are built before it is run.

This is untested under self-hosted RISC OS builds. All else tested and works.


svn path=/trunk/netsurf/; revision=3307
2007-05-30 22:39:54 +00:00
Daniel Silverstone
25e22eb1f5 Add a -v option to enable debug logging. Pass -v by default to the RO runimage.
svn path=/trunk/netsurf/; revision=3306
2007-05-30 22:27:58 +00:00
James Bursa
0547422534 Move user-agent generation into fetch.c and simplify.
svn path=/trunk/netsurf/; revision=3260
2007-05-02 02:38:38 +00:00
James Bursa
6e6d397e9d Remove defines that were never or are no longer used.
svn path=/trunk/netsurf/; revision=3259
2007-04-30 03:18:17 +00:00
John Mark Bell
d1b79f3e41 Bring percent-encoding closer to what other browsers do.
svn path=/trunk/netsurf/; revision=3179
2007-02-11 22:28:00 +00:00
Rob Kendrick
bdf7affb19 Fix almost all warnings in gtk/
svn path=/trunk/netsurf/; revision=3173
2007-02-10 02:21:32 +00:00
Rob Kendrick
5426a708a9 Generates and use a User-Agent: string based on new netsurf_version_major/minor values, and results of uname().
svn path=/trunk/netsurf/; revision=3158
2007-01-30 19:51:54 +00:00
Rob Kendrick
7c88381a59 Make time taken that is displayed in status bar use gettimeofday()-based time rather than clock()-based time
svn path=/trunk/netsurf/; revision=3157
2007-01-30 15:32:31 +00:00
James Bursa
a0b6661eb6 Make GTK build compile on FreeBSD.
svn path=/trunk/netsurf/; revision=3154
2007-01-29 22:27:15 +00:00
Richard Wilson
ef65cb38bd Fix 1535120, 1528673
svn path=/trunk/netsurf/; revision=3087
2006-12-01 21:09:49 +00:00
Michael Drake
ba23e4b693 Update project URL.
svn path=/trunk/netsurf/; revision=3073
2006-11-27 15:35:18 +00:00
Rob Kendrick
9a2cdc2db8 Skeleton implementation of new themes API, complete with documentation, for discussion purposes.
svn path=/trunk/netsurf/; revision=3021
2006-10-31 16:19:21 +00:00
Rob Kendrick
bbfda21e1c Add verbose flag to theme creation tool - silent unless used.
svn path=/trunk/netsurf/; revision=3019
2006-10-27 14:56:32 +00:00
Rob Kendrick
88fec4362c Make containers use mmap() where available
svn path=/trunk/netsurf/; revision=3018
2006-10-26 23:53:16 +00:00
Rob Kendrick
87a660d1ea Import initial work on theme container handling code and simple command-line tool to create and dismantal them. Still a little grungy, and doesn't check in enough places for memory exhaustion.
svn path=/trunk/netsurf/; revision=3017
2006-10-26 01:10:46 +00:00
Rob Kendrick
8c05d8274d Make hashtable's fnv hash inline - saves 8 instructions and two pipeline flushes per call
svn path=/trunk/netsurf/; revision=3014
2006-10-20 16:56:40 +00:00
Richard Wilson
8be8304bc6 Plug possible memory leak. Reduce memory usage. Add facility to iterate through a hashtable.
svn path=/trunk/netsurf/; revision=3013
2006-10-20 12:13:28 +00:00
Rob Kendrick
7711781f24 Further hash table optimisations and tidies. Test rig now does more lookups to favour the more comment case for speed tests, etc.
svn path=/trunk/netsurf/; revision=3003
2006-10-13 15:50:11 +00:00
Richard Wilson
a8a944bd52 Optimise and tidy up code.
svn path=/trunk/netsurf/; revision=3002
2006-10-13 15:09:30 +00:00
John Mark Bell
cda3154a92 Fix bad pointer increment
svn path=/trunk/netsurf/; revision=2999
2006-10-12 14:01:14 +00:00
John Mark Bell
2caa96dcc9 Fix attempts to call die() before messages_hash exists:
1) Make hash_* more robust in the face of bad parameters
2) Make messages_* more robust in the face of bad parameters
3) Tidy up gui_init such that localised messages are loaded at the 
   earliest opportunity

svn path=/trunk/netsurf/; revision=2998
2006-10-12 14:00:40 +00:00
John Mark Bell
4b09b7b8a0 Correcly encode spaces for url-encoded form submission.
svn path=/trunk/netsurf/; revision=2960
2006-09-19 10:08:33 +00:00
Richard Wilson
1999becb42 Finish event based GUI system transition and begin code cleanup.
svn path=/trunk/netsurf/; revision=2922
2006-09-06 14:44:42 +00:00
Richard Wilson
b0851c9dde Expose url component functions.
svn path=/trunk/netsurf/; revision=2907
2006-09-02 16:42:37 +00:00
Richard Wilson
74fa727509 Experimental new frames code.
svn path=/trunk/netsurf/; revision=2906
2006-09-02 15:52:41 +00:00
Rob Kendrick
8d7172fd17 Make Messages file parsing and searching use new re-usable hash table library
svn path=/trunk/netsurf/; revision=2879
2006-08-21 22:07:10 +00:00
Rob Kendrick
9670b32b7f Add documentation comments to hash table implementation.
svn path=/trunk/netsurf/; revision=2877
2006-08-21 16:51:39 +00:00
James Bursa
efb9fd036b Check for malloc failing in hash_add(). Remove unnecessary casts.
svn path=/trunk/netsurf/; revision=2873
2006-08-20 16:02:22 +00:00
Rob Kendrick
1f9fed8556 Make hash_add() return success/failure bool
svn path=/trunk/netsurf/; revision=2872
2006-08-20 13:46:30 +00:00
Rob Kendrick
d6b1f763ff Implement simple reusable write-once hash table for use in new Messages file handling.
svn path=/trunk/netsurf/; revision=2871
2006-08-20 12:25:41 +00:00
Rob Kendrick
537bc37805 Slightly improve hash table for Messages file. Paves way for more generic use of it, as well as more constant performance.
svn path=/trunk/netsurf/; revision=2870
2006-08-19 23:37:58 +00:00
Richard Wilson
6c4003bf90 Remove URL caching and fix NULL reads.
svn path=/trunk/netsurf/; revision=2855
2006-08-17 14:48:28 +00:00
Richard Wilson
de0c4e2c32 Implement up toolbar icon and menu option.
svn path=/trunk/netsurf/; revision=2705
2006-07-03 21:07:02 +00:00
John Mark Bell
b7af14b591 Implement component-wise URL comparison
svn path=/trunk/netsurf/; revision=2697
2006-07-02 22:34:04 +00:00
John Mark Bell
2cb285209e Use case-insensitive strstr to match "stylesheet"
svn path=/trunk/netsurf/; revision=2689
2006-07-02 10:26:51 +00:00
John Mark Bell
f73bae5c29 Make url_plq ensure url_get_components found a path
Make url_scheme call url_destroy_components in case where no scheme was 
found.

svn path=/trunk/netsurf/; revision=2686
2006-07-01 22:40:41 +00:00
Richard Wilson
f22838ab62 Stop possible pollution of the cache.
svn path=/trunk/netsurf/; revision=2681
2006-06-30 23:09:21 +00:00
Richard Wilson
cea180d752 Rewrite url_join to RFC 3986 compliance, and without the use of regular expressions. This should speed up pages with lots of links and also fix certain cases where URLs were incorrectly returned.
svn path=/trunk/netsurf/; revision=2664
2006-06-28 21:49:41 +00:00
Richard Wilson
d45a56ba7f Fix URL joining for fragments.
svn path=/trunk/netsurf/; revision=2658
2006-06-27 18:47:33 +00:00
Richard Wilson
a0414fd967 Massively optimise common URL functions. This should (a) drastically reduce the start-up time for users with a large history/hotlist, and (b) decrease the loading time for pages with a sizable number of references.
svn path=/trunk/netsurf/; revision=2656
2006-06-27 17:59:32 +00:00
Richard Wilson
83c6568057 Don't use a regexp to extract scheme name.
svn path=/trunk/netsurf/; revision=2655
2006-06-27 00:53:39 +00:00
John Mark Bell
0ef42d4e5e Remove clean_cookiejar; it's been redundant for years
svn path=/trunk/netsurf/; revision=2654
2006-06-27 00:35:48 +00:00
John Mark Bell
9eb3efff78 Make filename_create_directory check if directory already exists
Constify return of filename_request
Make bitmap save code check for filename_request failure
Update ro_gui_view_source to take account of constification

svn path=/trunk/netsurf/; revision=2639
2006-06-20 22:58:36 +00:00
John Mark Bell
4f249f9d0a Merge cookies changes into head - unvalidated transactions and a UI
still need implementing.

svn path=/trunk/netsurf/; revision=2632
2006-06-19 21:49:25 +00:00
James Bursa
77907dd584 Fix crash when a relative URL contains "//../".
svn path=/trunk/netsurf/; revision=2543
2006-04-22 09:07:28 +00:00
John Mark Bell
79946e43c9 Lose spurious RISC OS-specific include (fixes GTK build)
svn path=/trunk/netsurf/; revision=2542
2006-04-22 00:22:28 +00:00
Richard Wilson
546ad9e70a Apparently I need to specify add/deletions too...
svn path=/trunk/netsurf/; revision=2541
2006-04-21 23:50:36 +00:00
John Mark Bell
c09eb457df Unify information databases
svn path=/trunk/netsurf/; revision=2519
2006-04-09 23:21:13 +00:00
Daniel Silverstone
da16158c0a [project @ 2006-03-16 23:30:46 by dsilvers]
Fix another assumption that freeing/dupping/whatever a NULL is safe.

svn path=/import/netsurf/; revision=2132
2006-03-16 23:30:46 +00:00
Richard Wilson
da4a9313f1 [project @ 2006-02-25 18:50:34 by rjw]
Support for BMP files

svn path=/import/netsurf/; revision=2095
2006-02-25 18:51:51 +00:00
John Mark Bell
d4d3e5ee1c [project @ 2006-02-23 15:06:53 by jmb]
Handle invalid SSL certificates better - UI still needs work.
Modify fetch callback data parameter type to remove compiler warnings.
Constify things.
Lose global ssl_verify_certificates option.
Fix issue when closing a dialog without input focus.

svn path=/import/netsurf/; revision=2092
2006-02-23 15:06:54 +00:00
John Mark Bell
5ce5fe084c [project @ 2006-02-19 18:26:23 by jmb]
Rewrite HTTP authentication.
Fix extraction of realm from WWW-Authenticate header.
Tidy up login dialog code.

svn path=/import/netsurf/; revision=2085
2006-02-19 18:26:23 +00:00
John Mark Bell
6b6841f07e [project @ 2006-02-11 18:11:09 by jmb]
Clear cached conversion descriptor if iconv() fails

svn path=/import/netsurf/; revision=2071
2006-02-11 18:11:09 +00:00
Adrian Lees
57c86c8c0e [project @ 2006-02-07 16:16:23 by adrianl]
Confirmation before overwriting with download files; Interface Choices dialog

svn path=/import/netsurf/; revision=2061
2006-02-07 16:16:23 +00:00
John Mark Bell
0f228ada91 [project @ 2006-02-06 00:10:09 by jmb]
Implement HTTP caching algorithm; this should avoid stale cache entries being used.

svn path=/import/netsurf/; revision=2059
2006-02-06 00:10:09 +00:00
Richard Wilson
26e7a21863 [project @ 2006-01-18 00:54:27 by rjw]
Tidy up code to use generic url<->path functions.

svn path=/import/netsurf/; revision=2022
2006-01-18 00:54:27 +00:00
Adrian Lees
1efd4796a2 [project @ 2005-12-10 14:31:32 by adrianl]
ArtWorks support

svn path=/import/netsurf/; revision=1891
2005-12-10 14:31:33 +00:00
James Bursa
4af7520647 [project @ 2005-08-20 23:04:35 by bursa]
Fix strndup() warnings.

svn path=/import/netsurf/; revision=1850
2005-08-20 23:04:35 +00:00
James Bursa
253c199d1f [project @ 2005-07-23 20:43:37 by bursa]
Rewrite and simplify url_nice() to improve suggested filenames. Add option to keep extensions (no UI currently).

svn path=/import/netsurf/; revision=1814
2005-07-23 20:43:37 +00:00
Adrian Lees
77f1158f6b [project @ 2005-07-16 16:15:37 by adrianl]
Faster utf8 next/prev functions

svn path=/import/netsurf/; revision=1797
2005-07-16 16:15:37 +00:00
John Mark Bell
f4ecaaed31 [project @ 2005-07-16 14:35:20 by jmb]
- Convert Messages files to UTF-8 encoding.
- Replace local_encoding_name() with platform specific
  utf8_[to,from]_local_encoding() functions - this allows mapping of 8bit
  characters 0x80->0x9f (inclusive).
- All text that is rendered by the RISC OS Wimp is now converted to the system
  local encoding prior to display.
- Lose the horrendous hack that was messages_get_key()
- Menu text is now translated to system local encoding on the fly (if necessary)
  rather than at menu creation time. This allows the system alphabet to change
  under us and our menus remain usable.
- The Languages menu now lists all languages that are present in the LangNames
  file. In the case of selecting the UI language, those languages which are not
  available are shaded.

svn path=/import/netsurf/; revision=1796
2005-07-16 14:35:25 +00:00
John Mark Bell
46bc8ca154 [project @ 2005-07-11 18:10:10 by jmb]
Cache previous iconv conversion descriptor

svn path=/import/netsurf/; revision=1792
2005-07-11 18:10:10 +00:00
James Bursa
21e5d8ca15 [project @ 2005-07-02 18:18:48 by bursa]
Fix file comment for Doxygen.

svn path=/import/netsurf/; revision=1778
2005-07-02 18:18:48 +00:00
John Mark Bell
b81b983b36 [project @ 2005-07-02 14:35:43 by jmb]
Tidy up

svn path=/import/netsurf/; revision=1773
2005-07-02 14:35:43 +00:00
John Mark Bell
ed5a93caad [project @ 2005-06-28 23:46:16 by jmb]
Using Iconv to convert between an encoding and itself is pretty pointless.

svn path=/import/netsurf/; revision=1772
2005-06-28 23:46:16 +00:00
Adrian Lees
8aed1103b6 [project @ 2005-06-27 01:57:54 by adrianl]
Fix termination of output from url_escape

svn path=/import/netsurf/; revision=1770
2005-06-27 01:57:54 +00:00
John Mark Bell
5817f82ba8 [project @ 2005-06-26 22:18:37 by jmb]
Improve clarity of use of utf8_to_enc.
Remove use of curl_escape - url_escape does similar things, just better.

svn path=/import/netsurf/; revision=1766
2005-06-26 22:18:37 +00:00
John Mark Bell
0bcfdbeb50 [project @ 2005-06-07 21:29:26 by jmb]
Lose cnv_str_local_enc and friends.
UTF-8 conversion functions now return an enumerated type allowing for fallbacks, if appropriate.

svn path=/import/netsurf/; revision=1744
2005-06-07 21:29:26 +00:00
James Bursa
0e894ca80b [project @ 2005-05-24 20:22:14 by bursa]
Remove unnecessary include.

svn path=/import/netsurf/; revision=1737
2005-05-24 20:22:14 +00:00
John Mark Bell
fd99b1e906 [project @ 2005-05-23 22:27:37 by jmb]
Tighten up entry conditions

svn path=/import/netsurf/; revision=1735
2005-05-23 22:27:37 +00:00
James Bursa
5137041fed [project @ 2005-05-11 20:33:25 by bursa]
Remove no longer used memory pool code.

svn path=/import/netsurf/; revision=1720
2005-05-11 20:33:25 +00:00
James Bursa
b05bef4a61 [project @ 2005-04-30 14:31:48 by bursa]
Fix bug in url_up_re which caused /xy/../ not to be recognised when xy was 2 characters. Add defines for match part numbers. Simplify part 6(g) of url_join().

svn path=/import/netsurf/; revision=1704
2005-04-30 14:31:48 +00:00
John Mark Bell
a051b36ae7 [project @ 2005-04-23 22:26:05 by jmb]
Make url_join match the spec - see http://www.ics.uci.edu/~fielding/url/test1.html for testcases.

svn path=/import/netsurf/; revision=1682
2005-04-23 22:26:05 +00:00
Adrian Lees
9c1cb7bb2d [project @ 2005-04-23 02:58:27 by adrianl]
Query windows, desktop save protocol, confirm abort/quit when downloads in progress

svn path=/import/netsurf/; revision=1679
2005-04-23 02:58:27 +00:00
Adrian Lees
8da644f442 [project @ 2005-04-21 21:36:23 by adrianl]
Dragging URLs into toolbar URL icon; keyboard actions in textareas conform to Wimp's icon editing; display of scale % fixed for 120%

svn path=/import/netsurf/; revision=1676
2005-04-21 21:36:23 +00:00
Adrian Lees
f10db1f6f1 [project @ 2005-04-16 08:19:56 by adrianl]
missing #include

svn path=/import/netsurf/; revision=1651
2005-04-16 08:20:20 +00:00
John Mark Bell
1da8ee63a3 [project @ 2005-04-16 05:16:18 by jmb]
Lose \todo

svn path=/import/netsurf/; revision=1649
2005-04-16 05:16:18 +00:00
John Mark Bell
d43dc8839e [project @ 2005-04-16 05:10:08 by jmb]
Don't unescape characters 0x80->0xFF

svn path=/import/netsurf/; revision=1648
2005-04-16 05:10:08 +00:00
John Mark Bell
c17dc661ea [project @ 2005-04-16 05:09:32 by jmb]
Split out UTF-8 handling functions.
Submit URL-encoded forms in sensible encoding:
  * First entry in accept-charset list, if present
  * Document encoding, otherwise
  We may want to explicitly look for UTF-8, to save converting.
Convert cnv_str_local_enc/cnv_local_enc_str to use iconv (they're now veneers for utf8_[to/from]_enc).
Provide mechanism for looking up local system charset (derived from system alphabet, under RISC OS)

svn path=/import/netsurf/; revision=1647
2005-04-16 05:09:33 +00:00
Adrian Lees
25e9cbf55b [project @ 2005-04-15 05:52:04 by adrianl]
Defined NOF_ELEMENTS utility macro

svn path=/import/netsurf/; revision=1635
2005-04-15 05:52:04 +00:00
James Bursa
fef4301a74 [project @ 2005-04-03 10:56:49 by bursa]
Talloc memory allocation functions from Samba.

svn path=/import/netsurf/; revision=1591
2005-04-03 10:56:49 +00:00
John Mark Bell
a91cd77902 [project @ 2005-02-14 22:35:05 by jmb]
Fix bug in regex

svn path=/import/netsurf/; revision=1513
2005-02-14 22:35:05 +00:00
John Mark Bell
0c7b9496ef [project @ 2005-02-14 21:20:26 by jmb]
Make regex work with latest unixlib.
Fix incorrect return value

svn path=/import/netsurf/; revision=1512
2005-02-14 21:20:26 +00:00