diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2005-06-02 22:50:02 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2005-06-02 22:50:02 -0400 |
commit | 1367261dc669476df3a799f0de45e4bfb2437b8b (patch) | |
tree | 3bf6e1c020aab95b4133f2c29baffef454d3d60b /WWW/Library/Implementation/SGML.c | |
parent | aaa10562f4a02971f712964cb2fd1014d2a75d33 (diff) | |
download | lynx-snapshots-1367261dc669476df3a799f0de45e4bfb2437b8b.tar.gz |
snapshot of project "lynx", label v2-8-6dev_12
Diffstat (limited to 'WWW/Library/Implementation/SGML.c')
-rw-r--r-- | WWW/Library/Implementation/SGML.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c index eae3db3d..c73d312c 100644 --- a/WWW/Library/Implementation/SGML.c +++ b/WWW/Library/Implementation/SGML.c @@ -20,7 +20,8 @@ #include <SGML.h> #include <HTMLDTD.h> -#include <HTCJK.h> +#include <HTAccess.h> +#include <HTCJK.h> /* FIXME: this doesn't belong in SGML.c */ #include <UCMap.h> #include <UCDefs.h> #include <UCAux.h> @@ -33,6 +34,7 @@ #include <LYGlobalDefs.h> #include <LYStrings.h> #include <LYLeaks.h> +#include <LYUtils.h> #ifdef USE_COLOR_STYLE # include <LYStyle.h> @@ -43,6 +45,8 @@ #define INVALID (-1) +static int sgml_offset; + #ifdef USE_PRETTYSRC static char *entity_string; /* this is used for printing entity name. @@ -854,9 +858,9 @@ static void handle_marked(HTStream *context) charset once it is in include - kw */ } else if (!strncmp(context->string->data, "![CDATA[", 8)) { - (*context->actions->_write) (context->target, - context->string->data + 8, - context->string->size - 11); + (*context->actions->put_block) (context->target, + context->string->data + 8, + context->string->size - 11); } return; @@ -1499,6 +1503,8 @@ static void SGML_character(HTStream *context, char c_in) #endif char saved_char_in = '\0'; + ++sgml_offset; + /* * Now some fun with the preprocessor. Use copies for c and unsign_c == * clong, so that we can revert back to the unchanged c_in. - KW @@ -4474,9 +4480,23 @@ HTStream *SGML_new(const SGML_dtd * dtd, } #endif + sgml_offset = 0; return context; } +/* + * Return the offset within the document where we're parsing. This is used + * to help identify anchors which shift around while reparsing. + */ +int SGML_offset(void) +{ +#ifdef USE_PRETTYSRC + return sgml_offset + psrc_view; +#else + return sgml_offset; +#endif +} + /* Asian character conversion functions * ==================================== * |