Redland

 view release on metacpan or  search on metacpan

redland/ChangeLog.4  view on Meta::CPAN

	Switch to reentrant lexer.  Pass rdf_parser into code, yyextra
	internally.
	(yywrap): Add scanner arg.
	(copy_string_token, n3_syntax_error): Add rdf_parser arg.
	(main): Use reentrant calls for lexer to set yyin, get_text.  Use
	yylex_init/yylex_destroy.

	* raptor/Makefile.am: n3_lexer_test depends on raptor_utf8

	* raptor/raptor_parse.c:
	Add EXPAT_UTF8_BOM_CRASH fix updates for sax2 changes.

	* raptor/configure.ac: Tweak for old flex version output

	* raptor/configure.ac: Try to check flex is new enough.

2003-09-25  Dave Beckett  <Dave.Beckett@bristol.ac.uk>

	* configure.ac: 3store linking fixes.

	* librdf/rdf_storage_tstore.c: comment out unused context

redland/ChangeLog.4  view on Meta::CPAN


	* raptor/raptor_internal.h: Store raptor_uri of request
	Use new declared write_bytes, content_type handlers
	*fetch methods don't take URI string

	* raptor/raptor.h:
	Declare handlers for raptor www write bytes, content type
	raptor_www_fetch now takes a raptor_uri

	* raptor/raptor_parse.c:
	Fix broken-fix for broken-expat UTF8 BOM crash.
	tokens_count is on the rdf_xml_parser not rdf_parser

	* raptor/configure.ac: tweak

	* raptor/configure.ac: tidy libcurl version

	* raptor/raptor_internal.h, raptor/configure.ac:
	No more gnome-xml/libxml.h

	* raptor/configure.ac: Min libxml2 now 2.4.0

redland/ChangeLog.6  view on Meta::CPAN

	(raptor_libxml_init): send SAX2 events to core raptor_sax2_EVENT
	routines.

	* raptor/src/raptor_internal.h: Removed old and hardly tested
	internal handling of libxml entities

	* raptor/src/raptor_rdfxml.c: Rename raptor_xml_* to
	raptor_rdfxml_* in structs and functions.
	(raptor_rdfxml_start_element_handler,
	raptor_rdfxml_end_element_handler, raptor_cdata_grammar): Move
	expat BOM fixes to raptor_sax2.c
	(raptor_rdfxml_parse_init): Use new raptor_sax2_set_EVENT_handler
	methods. Use raptor_sax2_set_locator.
	(raptor_get_libxml_context, raptor_set_libxml_document_locator,
	raptor_get_libxml_document_locator, raptor_get_libxml_entities,
	raptor_set_libxml_entities, raptor_expat_update_document_locator):
	Deleted or merged into raptor_sax2.c

	* raptor/src/raptor_parse.c
	(raptor_parser_fatal_error_message_handler,
	raptor_parser_error_message_handler,

redland/raptor/ChangeLog  view on Meta::CPAN

	(raptor_libxml_init): send SAX2 events to core raptor_sax2_EVENT
	routines.

	* src/raptor_internal.h: Removed old and hardly tested internal
	handling of libxml entities

	* src/raptor_rdfxml.c: Rename raptor_xml_* to raptor_rdfxml_* in
	structs and functions.
	(raptor_rdfxml_start_element_handler,
	raptor_rdfxml_end_element_handler, raptor_cdata_grammar): Move
	expat BOM fixes to raptor_sax2.c
	(raptor_rdfxml_parse_init): Use new raptor_sax2_set_EVENT_handler
	methods. Use raptor_sax2_set_locator.
	(raptor_get_libxml_context, raptor_set_libxml_document_locator,
	raptor_get_libxml_document_locator, raptor_get_libxml_entities,
	raptor_set_libxml_entities, raptor_expat_update_document_locator):
	Deleted or merged into raptor_sax2.c

	* src/raptor_parse.c (raptor_parser_fatal_error_message_handler,
	raptor_parser_error_message_handler,
	raptor_parser_warning_message_handler): Added handlers that take

redland/raptor/ChangeLog.3  view on Meta::CPAN

	(raptor_new) Initialise entities table count to 0 since
	xmlCreateEntitiesTable sometimes doesn't do it.

2002-04-27  Dave Beckett  <Dave.Beckett@bristol.ac.uk>

	* acconfig.h, configure.in, raptor_parse.c:
	renamed NEED_EXPAT/LIBXML to RAPTOR_XML_EXPAT/LIBXML so that raptor
	can be linked to apps (such as Redland) that may have both

	* configure.in:
	Added configure warning about failure of expat UTF8 BOM and how to fix.

	* configure.in: Perform expat BOM check only when a working expat found

	* raptor_parse.c, configure.in, acconfig.h:
	Rename EXPAT_ERROR_CRASH to EXPAT_NO_UTF8_BOM - expat 1.95.1
	fails on an initial UTF-8 BOM sequence.  expat 1.95.2 onwards fixes
	this.

	* acconfig.h: Added EXPAT_ERROR_CRASH

	* raptor_parse.c:
	If EXPAT_ERROR_CRASH then count XML tokens and only try to get line,
	col, byte counts after 1 token has been seen.

	* configure.in:
	Add test for expat failure in error reporting before <?xml?>

redland/raptor/ChangeLog.4  view on Meta::CPAN

	Switch to reentrant lexer.  Pass rdf_parser into code, yyextra
	internally.
	(yywrap): Add scanner arg.
	(copy_string_token, n3_syntax_error): Add rdf_parser arg.
	(main): Use reentrant calls for lexer to set yyin, get_text.  Use
	yylex_init/yylex_destroy.

	* Makefile.am: n3_lexer_test depends on raptor_utf8

	* raptor_parse.c:
	Add EXPAT_UTF8_BOM_CRASH fix updates for sax2 changes.

	* configure.ac: Tweak for old flex version output

	* configure.ac: Try to check flex is new enough.

2003-09-21  Dave Beckett  <Dave.Beckett@bristol.ac.uk>

	* n3_parser.y: Minor C reformatting

2003-09-20  Dave Beckett  <Dave.Beckett@bristol.ac.uk>

redland/raptor/ChangeLog.4  view on Meta::CPAN

	(raptor_www_file_fetch): pass www to write_bytes
	(raptor_www_fetch): Don't pass URI on.

	* raptor_internal.h: Store raptor_uri of request
	Use new declared write_bytes, content_type handlers
	*fetch methods don't take URI string

	* raptor.h: Declare handlers for raptor www write bytes, content type
	raptor_www_fetch now takes a raptor_uri

	* raptor_parse.c: Fix broken-fix for broken-expat UTF8 BOM crash.
	tokens_count is on the rdf_xml_parser not rdf_parser

	* configure.ac: tweak

	* configure.ac: tidy libcurl version

	* raptor_internal.h, configure.ac: No more gnome-xml/libxml.h

	* configure.ac: Min libxml2 now 2.4.0

redland/raptor/configure  view on Meta::CPAN


  if test $worked = yes; then
    # New expat - expat-1.95.0 or later
    have_expat_lib=1
    have_expat=1
    expat_libs="-lexpat"

    { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

    { echo "$as_me:$LINENO: checking for expat support of UTF-8 BOM" >&5
echo $ECHO_N "checking for expat support of UTF-8 BOM... $ECHO_C" >&6; }
    if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF

redland/raptor/configure  view on Meta::CPAN

#ifdef HAVE_EXPAT_H
#include <expat.h>
#else
#ifdef HAVE_XMLPARSE_H
#include <xmlparse.h>
#endif
#endif

int main(int argc, char **argv) {
  const char *xml_buffer=
     /* UTF-8 BOM */
     "\xef\xbb\xbf<?xml version='1.0' encoding='UTF-8'?><tag/>";
  XML_Parser xp=XML_ParserCreate(NULL);
  int  len=strlen(xml_buffer);

  /* This might cause an error on expat 1.95.1 */
  int rc=XML_Parse(xp, xml_buffer, len, 1);

  /* if expat gives an error ... */
  if(!rc) {
    /* then the next line will crash in normal_updatePosition  */

redland/raptor/configure  view on Meta::CPAN

  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

cat >>confdefs.h <<\_ACEOF
#define EXPAT_UTF8_BOM_CRASH 1
_ACEOF

            { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
            { echo "$as_me:$LINENO: WARNING: The available expat crashes on XML UTF-8 BOM in documents" >&5
echo "$as_me: WARNING: The available expat crashes on XML UTF-8 BOM in documents" >&2;}
            { echo "$as_me:$LINENO: WARNING: Fix either by using libxml or expat 1.95.2+" >&5
echo "$as_me: WARNING: Fix either by using libxml or expat 1.95.2+" >&2;}
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi



  else
    { echo "$as_me:$LINENO: result: no" >&5

redland/raptor/configure.ac  view on Meta::CPAN

             main() {XML_ParserCreate(NULL); return(0);}],
             worked=yes, worked=no, worked=no)
  if test $worked = yes; then
    # New expat - expat-1.95.0 or later
    have_expat_lib=1
    have_expat=1
    expat_libs="-lexpat"

    AC_MSG_RESULT(yes)

    AC_MSG_CHECKING(for expat support of UTF-8 BOM)
    AC_TRY_RUN([
#include <stdio.h>
#include <string.h>
#include <stdarg.h>

#ifdef HAVE_EXPAT_H
#include <expat.h>
#else
#ifdef HAVE_XMLPARSE_H
#include <xmlparse.h>
#endif
#endif

int main(int argc, char **argv) {
  const char *xml_buffer=
     /* UTF-8 BOM */
     "\xef\xbb\xbf<?xml version='1.0' encoding='UTF-8'?><tag/>";
  XML_Parser xp=XML_ParserCreate(NULL);
  int  len=strlen(xml_buffer);
  
  /* This might cause an error on expat 1.95.1 */
  int rc=XML_Parse(xp, xml_buffer, len, 1);

  /* if expat gives an error ... */
  if(!rc) {
    /* then the next line will crash in normal_updatePosition  */
    int line=XML_GetCurrentLineNumber(xp);
  }
  XML_ParserFree(xp);

  return 0;
}
],
            AC_MSG_RESULT(yes),
            AC_DEFINE(EXPAT_UTF8_BOM_CRASH, 1, [does expat crash when it sees an initial UTF8 BOM?])
            AC_MSG_RESULT(no)
            AC_MSG_WARN(The available expat crashes on XML UTF-8 BOM in documents)
            AC_MSG_WARN(Fix either by using libxml or expat 1.95.2+))

  else
    AC_MSG_RESULT(no)
  fi
else
  AC_MSG_RESULT(no)
fi

LIBS="$oLIBS"

redland/raptor/src/raptor_config.h.in  view on Meta::CPAN

/* src/raptor_config.h.in.  Generated from configure.ac by autoheader.  */

/* does expat crash when it sees an initial UTF8 BOM? */
#undef EXPAT_UTF8_BOM_CRASH

/* vsnprint has C99 compatible return value */
#undef HAVE_C99_VSNPRINTF

/* Define to 1 if you have the <curl/curl.h> header file. */
#undef HAVE_CURL_CURL_H

/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H

redland/raptor/src/raptor_internal.h  view on Meta::CPAN

typedef int (*raptor_sax2_external_entity_ref_handler)(void *user_data, const unsigned char* context, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId);

struct raptor_sax2_s {
#ifdef RAPTOR_XML_LIBXML
  int magic;
#endif
  void* user_data;
  
#ifdef RAPTOR_XML_EXPAT
  XML_Parser xp;
#ifdef EXPAT_UTF8_BOM_CRASH
  int tokens_count; /* used to see if trying to get location info is safe */
#endif
#endif
#ifdef RAPTOR_XML_LIBXML
  /* structure holding sax event handlers */
  xmlSAXHandler sax;
  /* parser context */
  xmlParserCtxtPtr xc;
  /* pointer to SAX document locator */
  xmlSAXLocatorPtr loc;

redland/raptor/src/raptor_sax2.c  view on Meta::CPAN

    goto handle_error;
  if(is_end)
    return 0;
#endif

  return 0;

  handle_error:

#ifdef RAPTOR_XML_EXPAT
#ifdef EXPAT_UTF8_BOM_CRASH
  if(sax2->tokens_count) {
#endif
    /* Work around a bug with the expat 1.95.1 shipped with RedHat 7.2
     * which dies here if the error is before <?xml?...
     * The expat 1.95.1 source release version works fine.
     */
    if(sax2->locator)
      raptor_sax2_update_document_locator(sax2, sax2->locator);
#ifdef EXPAT_UTF8_BOM_CRASH
  }
#endif
#endif /* EXPAT */

#if RAPTOR_XML_EXPAT
  if(1) {
    const char *error_prefix="XML Parsing failed - "; /* 21 chars */
    #define ERROR_PREFIX_LEN 21
    const char *error_message=XML_ErrorString(XML_GetErrorCode(xp));
    size_t error_length;

redland/raptor/src/raptor_sax2.c  view on Meta::CPAN

  unsigned char **xml_atts_copy=NULL;
  size_t xml_atts_size=0;
  int all_atts_count=0;
  int ns_attributes_count=0;
  raptor_qname** named_attrs=NULL;
  raptor_xml_element* xml_element=NULL;
  unsigned char *xml_language=NULL;
  raptor_uri *xml_base=NULL;

#ifdef RAPTOR_XML_EXPAT
#ifdef EXPAT_UTF8_BOM_CRASH
  sax2->tokens_count++;
#endif
#endif

#ifdef RAPTOR_XML_LIBXML
  if(atts) {
    int i;
    
    /* Do XML attribute value normalization */
    for (i = 0; atts[i]; i+=2) {

redland/raptor/src/raptor_sax2.c  view on Meta::CPAN



/* end of an element */
void
raptor_sax2_end_element(void* user_data, const unsigned char *name)
{
  raptor_sax2* sax2=(raptor_sax2*)user_data;
  raptor_xml_element* xml_element;

#ifdef RAPTOR_XML_EXPAT
#ifdef EXPAT_UTF8_BOM_CRASH
  sax2->tokens_count++;
#endif
#endif

  xml_element=sax2->current_element;
  if(xml_element) {
#ifdef RAPTOR_DEBUG_VERBOSE
    fprintf(stderr, "\nraptor_rdfxml_end_element_handler: End ns-element: ");
    raptor_qname_print(stderr, xml_element->name);
    fputc('\n', stderr);

redland/raptor/src/raptor_sax2.c  view on Meta::CPAN

    sax2->characters_handler(sax2->user_data, sax2->current_element, s, len);
}


/* like <![CDATA[...]> */
void
raptor_sax2_cdata(void* user_data, const unsigned char *s, int len)
{
  raptor_sax2* sax2=(raptor_sax2*)user_data;
#ifdef RAPTOR_XML_EXPAT
#ifdef EXPAT_UTF8_BOM_CRASH
  sax2->tokens_count++;
#endif
#endif

  if(sax2->cdata_handler)
    sax2->cdata_handler(sax2->user_data, sax2->current_element, s, len);
}


/* comment */



( run in 0.500 second using v1.01-cache-2.11-cpan-131fc08a04b )