summaryrefslogtreecommitdiff
path: root/Docs
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-07-18 00:17:50 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-07-18 00:17:50 +0000
commit306f5588f3e9d2fb4e8716537c1f21582a6563ef (patch)
tree5463ceb5e6ef4f1cb3544cb18480900bc7756e45 /Docs
parentfe4938d592cf38f6197b4cc42350f1034f66c060 (diff)
downloadnetsurf-306f5588f3e9d2fb4e8716537c1f21582a6563ef.tar.gz
netsurf-306f5588f3e9d2fb4e8716537c1f21582a6563ef.tar.bz2
Improve documentation of content type handler addition
svn path=/trunk/netsurf/; revision=3430
Diffstat (limited to 'Docs')
-rw-r--r--Docs/01-content21
1 files changed, 21 insertions, 0 deletions
diff --git a/Docs/01-content b/Docs/01-content
index c6e77424f..61a19823d 100644
--- a/Docs/01-content
+++ b/Docs/01-content
@@ -58,6 +58,7 @@ content:
Type functions
--------------
+[[typefunc]]
The type-specific functions for a content are as follows (where 'type' is
replaced by something):
@@ -104,3 +105,23 @@ is provided by the fetchcache functions, which check the memory cache for a url
and fetch, convert, and cache it if not present.
The fetch module provides a low-level URL fetching interface.
+
+Adding support for a new content type
+-------------------------------------
+Addition of support for new content types is fairly simple and the process is
+as follows:
+
+- Implement, or at least stub out, the new content type handler. See the
+ <<typefunc,Type Functions>> section above for details of the type handler API.
+- Add a type value to the 'content_type' enumeration (content_type.h)
+- Add an entry for the new type's private data in the 'data' union within
+ 'struct content' (content.h)
+- Add appropriate mappings in the 'mime_map' table from MIME type strings to
+ the 'content_type' value created. (content.c)
+- Add a textual name for the new content type to 'content_type_name'. This
+ array is indexed by 'content_type'. (content.c)
+- Add an entry for the new content type's handler in the 'handler_map' array.
+ This array is indexed by 'content_type'. (content.c)
+
+For examples of content type handlers, consult the image/ directory. The JPEG
+handler is fairly self-explanatory. \ No newline at end of file