Back to index

texmacs  1.0.7.15
Functions
unicode.h File Reference
#include "pdfobj.h"
#include "agl.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void UC_set_verbose (void)
int UC_sput_UTF16BE (long ucv, unsigned char **dstpp, unsigned char *endptr)
int UC_is_valid (long ucv)

Function Documentation

int UC_is_valid ( long  ucv)

Definition at line 107 of file unicode.c.

{
  if (ucv < 0 || (ucv >= 0x0000D800L && ucv <= 0x0000DFFFL))
    return 0;
  return 1;
}

Here is the caller graph for this function:

void UC_set_verbose ( void  )

Definition at line 57 of file unicode.c.

{
  __verbose++;
}

Here is the caller graph for this function:

int UC_sput_UTF16BE ( long  ucv,
unsigned char **  dstpp,
unsigned char *  endptr 
)

Definition at line 70 of file unicode.c.

{
  int count = 0;
  unsigned char *p = *pp;

  if (ucv >= 0 && ucv <= 0xFFFF) {
    if (p + 2 >= limptr)
      ERROR("Not enough space available...");
    p[0] = (ucv >> 8) & 0xff;
    p[1] = ucv & 0xff;
    count = 2;
  } else if (ucv >= 0x010000L && ucv <= 0x10FFFFL) {
    unsigned short high, low;

    if (p + 4 >= limptr)
      ERROR("Not enough space available...");
    ucv  -= 0x00010000L;
    high = (ucv >> UC_SUR_SHIFT) + UC_SUR_HIGH_START;
    low  = (ucv &  UC_SUR_MASK)  + UC_SUR_LOW_START;
    p[0] = (high >> 8) & 0xff;
    p[1] = (high & 0xff);
    p[2] = (low >> 8) & 0xff;
    p[3] = (low & 0xff);
    count = 4;
  } else {
    if (p + 2 >= limptr)
      ERROR("Not enough space available...");
    p[0] = (UC_REPLACEMENT_CHAR >> 8) & 0xff;
    p[1] = (UC_REPLACEMENT_CHAR & 0xff);
    count = 2;
  }

  *pp += count;
  return count;
}

Here is the caller graph for this function: