Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsParserService.h File Reference
#include "nsIParserService.h"
#include "nsDTDUtils.h"
#include "nsVoidArray.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nsParserService

Functions

int MOZ_XMLIsLetter (const char *ptr)
int MOZ_XMLIsNCNameChar (const char *ptr)
PRBool MOZ_XMLTranslateEntity (const char *ptr, const char *end, const char **next, PRUnichar *result)

Function Documentation

int MOZ_XMLIsLetter ( const char *  ptr)

Definition at line 123 of file moz_extensions.c.

{
  switch (BYTE_TYPE(ptr)) {
  case BT_NONASCII:
    if (!IS_NMSTRT_CHAR_MINBPC(ptr)) {
      return 0;
    }
  case BT_NMSTRT:
  case BT_HEX:
    return 1;
  default:
    return 0;
  }
}

Here is the caller graph for this function:

int MOZ_XMLIsNCNameChar ( const char *  ptr)

Definition at line 138 of file moz_extensions.c.

{
  switch (BYTE_TYPE(ptr)) {
  case BT_NONASCII:
    if (!IS_NAME_CHAR_MINBPC(ptr)) {
      return 0;
    }
  case BT_NMSTRT:
  case BT_HEX:
  case BT_DIGIT:
  case BT_NAME:
  case BT_MINUS:
    return 1;
  default:
    return 0;
  }
}

Here is the caller graph for this function:

PRBool MOZ_XMLTranslateEntity ( const char *  ptr,
const char *  end,
const char **  next,
PRUnichar result 
)

Definition at line 156 of file moz_extensions.c.

{
  const ENCODING* enc = XmlGetUtf16InternalEncodingNS();
  int tok = PREFIX(scanRef)(enc, ptr, end, next);
  if (tok <= XML_TOK_INVALID) {
    return 0;
  }

  if (tok == XML_TOK_CHAR_REF) {
    int n = XmlCharRefNumber(enc, ptr);

    // We could get away with just < 0, but better safe than sorry.
    if (n <= 0) {
      return 0;
    }

    return XmlUtf16Encode(n, (unsigned short*)result);
  }

  if (tok == XML_TOK_ENTITY_REF) {
    XML_Char ch = (XML_Char)XmlPredefinedEntityName(enc, ptr, *next - 2);
    if (!ch) {
      return 0;
    }

    *result = ch;
    return 1;
  }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: