Commit Graph

32 Commits

Author SHA1 Message Date
Vincent Sanders
7c3da95a07 Resolve resource leak on error (coverity issue 1390560) 2018-05-18 10:02:03 +01:00
Vincent Sanders
b94b96e272 add hash table population from file or memory 2018-04-22 14:03:18 +01:00
Vincent Sanders
75018632a9 Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done

@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 18:45:27 +01:00
Michael Drake
c6717f1ade Messages: Correct code comment. 2017-08-30 09:47:49 +01:00
Michael Drake
c2ac1a713f Errorcodes: Add SPRITE_ERROR and use it in sprite content handler. 2017-08-30 09:43:13 +01:00
Michael Drake
41f30992aa Messages: Return the unknown message if we get to the unhandled errorcode.
We shouldn't get there though.
2017-08-28 12:21:03 +01:00
Michael Drake
7ba93407ad Messages: Do message lookups for all errorcodes. 2017-08-28 11:39:21 +01:00
Michael Drake
3a0e87e89f Errorcodes: Remove redundant MNG error. 2017-08-28 11:11:40 +01:00
Chris Young
4ad375c3b0 Ensure memory used by Messages is freed on exit 2016-12-11 16:43:48 +00:00
Vincent Sanders
7b28db6249 message get API should not raise user errors itself 2016-04-29 09:41:10 +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
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
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
7cf5cf7cb7 fix doc comments 2014-10-25 17:12:16 +01:00
Vincent Sanders
94ab63319f Improve the message loading API to return error codes.
Returning an error instead of simply calling die allows more robust
error handling. Secondly initialisation may continue even if the
messages have not been loaded which is more friendly than simply
dropping dead with no communication to the user.
2014-10-25 12:45:32 +01:00
Vincent Sanders
ce309aa5a9 add message retrival of error codes ensuring there are messages for all codes 2012-11-26 17:32:57 +00:00
Vincent Sanders
c0b0dbd373 fix incorrect type in message loading
zlib has changed 
typedef voidp gzFile;
to 
typedef struct gzFile_s *gzFile;

historically the gzFile *fp has efectively expanded to void**fp
The compiler considerd void ** to be identical to void* as void cannot 
be dereferenced and compilation suceeded. 
With a concrete type it does not work.


svn path=/trunk/netsurf/; revision=13517
2012-03-14 16:42:02 +00:00
John Mark Bell
6173bb0e6c Merge treeview-redux to trunk
svn path=/trunk/netsurf/; revision=10865
2010-10-05 19:14:46 +00:00
Vincent Sanders
bda534e12a Clean up how GTK frontend finds resources
svn path=/trunk/netsurf/; revision=10668
2010-07-28 15:22:44 +00:00
Rob Kendrick
94dea065b9 Add support for gzipped Messages files
svn path=/trunk/netsurf/; revision=4739
2008-07-26 15:18:21 +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
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
Michael Drake
ba23e4b693 Update project URL.
svn path=/trunk/netsurf/; revision=3073
2006-11-27 15:35:18 +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
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
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
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
67b0b7be62 [project @ 2004-07-27 20:44:46 by jmb]
Language configuration menu
Make adjust clicks on font size arrows style guide compliant

svn path=/import/netsurf/; revision=1154
2004-07-27 20:44:46 +00:00
Richard Wilson
3f0f5d7be9 [project @ 2004-05-12 10:23:07 by rjw]
Interactive help keys made more descriptive.
Message key length increased to 24.

svn path=/import/netsurf/; revision=856
2004-05-12 10:23:07 +00:00
James Bursa
7356aa96c9 [project @ 2004-05-08 18:13:27 by bursa]
Clean up and make more efficient.

svn path=/import/netsurf/; revision=843
2004-05-08 18:13:27 +00:00
James Bursa
15d57a6634 [project @ 2003-08-16 18:39:10 by bursa]
New portable messages module.

svn path=/import/netsurf/; revision=244
2003-08-16 18:39:10 +00:00