-------------------------------------------------------------------------------
History
=======

Ages Ago (ADH): Created and routinely updated.

08/06/97 (ADH): Added this history. Want to add in the various
                compile-time definable errors (e.g. the
                STRICT_PARSER) stuff soon, but be warned that if
                this isn't mentioned in any history entries
                below, this information is still missing.

18/06/97 (ADH): Add NoMemTab error.

03/09/97 (ADH): Added contents.
-------------------------------------------------------------------------------


Contents
========

Overview
Mild errors
  NoMemFet
  NoMemRea
  NoMemTab
  NoMemGen
  NoMemImg
More serious errors
  FontMem
  StrNotFd
  BadType
  BadTRef


Overview
========

Some errors can be generated from several places. To signal where they came from, a function name or number can be put after the error message. For mild errors (which the user might see) a 'cryptic' number looks best. For more serious internal errors (which the user should not usually see) a function name is more useful, typically. For very serious errors (which the user should never see) the full details are usually hard coded in the error message itself to prevent any possible complications when argument substitution tries to occur.

This file describes the errors (named by token as in the Messages file) that have extra information given about the caller, and details who the callers are and what the problem is.

Errors which are specific to a single callee are not detailed further than their presence in the Messages file, which should prove self explanatory, as should errors which occur only in trace builds. These are generally hard coded rather than looked up from Messages, since they're only needed in a debug browsers.


Mild errors
===========

* NoMemFet
  --------

Report the generator by a number in brackets after the error. Built through the make_no_fetch_memory_error function. Typically signal a memory allocation failure during early stages of a fetch. Generator numbers are as follows:

Number   Generator                   Reason

1        html_get                    malloc for urlstat structure failed in
         (FetchHTML.c)               early stages of fetch.
2        html_get                    flex alloc for extra forms data failed.
         (FetchHTML.c)
3        html_get                    Call to html_insert_header failed due to
         (FetchHTML.c)               it not being able to claim enough memory.
                                     This was to insert Content-Length string.
4        html_get                    As number 3, but to insert Content-Type
         (FetchHTML.c)               string.
5        html_get                    As number 3, but to insert Mailserv-User
         (FetchHTML.c)               string.
6        html_get                    As number 3, but to insert X-NoProxy
         (FetchHTML.c)               string.
7        fetchpage_new               malloc for URL string failed.
         (FetchPage.c)
8        fetchpage_new_add           malloc for URL string and additional
         (FetchPage.c)               data failed.
9        handle_clicks               malloc for URL string for reloading a
         (Handlers.c)                URL in a new view failed.
10       fetchpage_process_internal  malloc for substitute URL string failed.
         (FetchPage.c)
11       authorise_remember          flex_alloc or flex_extend for authoris-
         (Authorise.c)               ation data failed.
12       fetch_authorisation_proceed flex_alloc or flex_extend for encoded
         (Fetch.c)                   authorisation data failed.
13       image_add_usage             malloc for image_usage structure
         (Images.c)                  failed.
14       fetchpage_postprocess_uri   malloc for URI from URI handler that
         (FetchPage.c)               was to be fetched, failed.
15       urlutils_dispatch           malloc for URI_Queue structure prior
         (URLutils.c)                to sending out a URI failed.
16       browser_inherit             flex_alloc for copy of parent's
         Browser.c                   'extradata' block failed.


* NoMemRea
  --------

Report the generator by a number in brackets after the error. Built through the make_no_cont_memory function. Typically signal a memory allocation failure during a fetch. Generator numbers are as follows:

Number   Generator               Reason

1        html_get_next_token     flex_alloc for store for page data from the
         (FetchHTML.c)           URL module failed.
2        form_ensure_free        flex_alloc or flex_extend returned 0 when
         (Forms.c)               trying to ensure 'n' bytes were available.
3        form_create_menu        malloc failed when trying to create space
         (Forms.c)               for a new menu.
4        form_build_data         1st call to form_extend_flex() in Forms.c
         (Forms.c)               failed to extend the flex block.
5        form_build_data         2nd call to form_extend_flex() in Forms.c
         (Forms.c)               failed to extend the flex block.
6        form_build_data         3rd call to form_extend_flex() in Forms.c
         (Forms.c)               failed to extend the flex block.
7        form_build_data         Call to form_encode_flex_data() in Forms.c
         (Forms.c)               failed, indicating it couldn't claim the
                                 memory it required to operate.
8        html_get_next_token     malloc for buffer to fetch data in through
         (FetchHTML.c)           failed.
10       memory_set_chunk_size   flex_alloc or flex_extend returned 0,
         (Memory.c)              i.e. chunk memory claim failed.
11       plugin_setup_stream     Can't allocate a block for a plugin_stream
         (PlugIn.c)              structure.
12       about_build_page        Failure to allocate various blocks for the
                                 'about:' internal page.


* NoMemTab
  --------

Report the generator by a number in brackets after the error. Built through the make_no_table_memory_error function. Typically signal a memory allocation failure when dealing with tables. Generator numbers are as follows:

Number   Generator                   Reason

1        tables_count_tables         malloc for RowSpill array failed at
         (Tables.c)                  first stage of cell counting.
2        tables_position_table       malloc for RowSpill array failed at
         (Tables.c)                  first stage of cell positioning.
3        tables_width_table          malloc for maxs array failed at
         (Tables.c)                  first stage of cell widthing.
4        tables_width_table          malloc for mins array failed at
         (Tables.c)                  first stage of cell widthing.
5        tables_width_table          malloc for overmaxs array failed at
         (Tables.c)                  first stage of cell widthing.
6        tables_width_table          malloc for overmins array failed at
         (Tables.c)                  first stage of cell widthing.
7        tables_width_table          malloc for pcwidths array failed at
         (Tables.c)                  first stage of cell widthing.
8        tables_width_table          malloc for colmins, colmaxs or
         (Tables.c)                  cellflags arrays failed at the first
                                     stage of cell widthing.
9        reformat_token_width        HtmlMalloc for cell array failed
         (Reformat.c)                after count and position of cells.
10       tables_count_table          HtmlMalloc for column offset array
         (Tables.c)                  failed prior to position of cells.
11       tables_count_table          HtmlMalloc for row offset array failed
         (Tables.c)                  prior to position of cells.

(Numbers 7 and 8 were present in an earlier version of the widthing code but have since been removed).


* NoMemGen
  --------

Report the generator by a number in brackets after the error. Built through the make_no_memory_error function. Typically signal a memory allocation failure for some immediate operation. Generator numbers are as follows:

No.  Generator                         What failed

1    tokenutils_line_range_r           malloc for array of token_path structs
     (TokenUtils.c)                    when trying to find a token.
2    hotlist_load_directory            malloc to read a line from the input
     (Hotlist.c)                       file.
3    hotlist_load_directory            malloc to store a directory name from
     (Hotlist.c)                       the input file.
4    hotlist_new_directory             malloc for a new hotlist_item structure.
     (Hotlist.c)
5    hotlist_new_directory             malloc for the name of the new directory.
     (Hotlist.c)
6    protocols_atatl_got_data_save     malloc for RAM transfer buffer.
     (Protocols.c)
7    protocols_atatl_got_ram_transmit  malloc or realloc of buffer for loading
     (Protocols.c)                     a URI/URL file.
8    html_get_next_token               Not enough room for GSTrans expansion of
     (FetchHTML.c)                     sysvar when fetching an external image.
9    protocols_atats_data_open_bounced malloc for a command buffer to run
     (Protocols.c)                     an external editor with.
10   save_transfer_uri                 malloc for temporary URI file buffer
     (Save.c)                          during RAM transfer.
11   protocols_atatl_got_data_save     malloc for pending Acknowledge message
     (Protocols.c)                     block.
12   unifont_widefont_init             malloc for font file.
     (Unifont.c)
13   protocols_atats_got_data_save_ack malloc for WimpMessage struct for a
     (Protocols.c)                     pending DataLoad message.
14   save_save_choices                 Various allocations when trying to
     (Save.c)                          save the global Choices.
15   hotlist_newedit_url_handler       malloc for URL or description text.
     (Hotlist.c)
16   hotlist_newren_directoryl_handler malloc for directory name.
     (Hotlist.c)
17   choices_get_contents              malloc for Home Page string.
     (Choices.c)
18   choices_set_encoding_field        malloc for encoding name.
     (Choices.c)
19   choices_set_save_field            malloc for save type (for hotlist or
     (Choices.c)                       history).
20   choices_set_display_field         malloc for hotlist display type.
     (Choices.c)
21   plugin_add_queue_entry            malloc for a new structure in the
     (PlugIn.c)                        Plug-In queue.
22   rma_claim                         malloc / realloc for new array item
     (RMA.c)                           or RMA claim itself
23   plugin_add_file_entry             malloc for list item or strings within
     (PlugIn.c)                        that item.
24   plugin_add_instance_entry         malloc for list item recording a
     (PlugIn.c)                        Plug-In instance.
25   history_record and history_load   Various allocations whilst trying to
     (History.c)                       a History structure record.
26   history_add_title                 malloc for title string.
     (History.c)
27   history_load                      Temporary buffer mallocs for loading
     (History.c)                       items.
28   imghistory_record                 malloc for array entry and URL when
     (ImgHistory.c)                    adding an item to the image history.
29   imghistory_load                   malloc for entries array or URLs when
     (ImgHistory.c)                    loading new items to the image history.
30   utils_canonicalise_path           malloc for canonicalised pathname.
     (Utils.c)
31   utils_build_tree                  malloc for local copy of pathname.
     (Utils.c)


* NoMemImg
  --------

Report the generator by a number in brackets after the error. Typically signal a browser side (as opposed to image library side) memory allocation failure when dealing with errors. Generator numbers are as follows:

Number   Generator               Reason

1        image_new_image         flex_alloc or flex_extend for image_info
         (Images.c)              structure or image data failed.
2        image_process_null      flex_alloc for data in ddata block failed
         (Images.c)              during fetching of an image.


More serious errors
===================

* FontMem
  -------

Report the generator by name. fm_define_typeface_explicit (FontManage.c) is the only generator at present, signalling that its internal call to fm_new_typeface (also in FontManage.c) failed to allocate enough memory for an fm_facelist structure to hold the new typeface.


* StrNotFd
  --------

Report the generator by name. These are pretty nasty...

Generator                        Reason

html_close                       The urlstat structure that a particular
(FetchHTML.c)                    fetch handle refers to cannot be found in
                                 the list. The handle is thus wrong, or the
                                 urlstat list is corrupted / out of date.
html_get_next_token              As above, for html_close.
(FetchHTML.c)
html_get_next_chunk              As above, for html_close.
(FetchHTML.c)


* BadType
  -------

Report the generator by name. fm_define_typeface (FontManage.c) is the only generator at present, signalling that a typeface string passed to it has the wrong syntax (in one way or another).


* BadTRef
  -------

Report the generator by name.

Generator                        Reason

fm_write_descriptor              A name of a typeface couldn't be found by
(FontManage.c)                   fm_find_typeface (also in FontManage.c),
                                 so the decriptor string couldn't be given.
fm_write_name                    Same reason as above for fm_write_descriptor,
(FontManage.c)                   only this time a specific font name
                                 within that descriptor couldn't be given.
fm_read_typeface                 A name of a typeface couldn't be found by
(FontManage.c)                   fm_find_typeface - the name was inside an
                                 fm_typeface structure and the function can't
                                 fill in the rest of the details as it can't
                                 find the typeface.