#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "hi_ui_config.h"
#include "hi_ui_iis_unicode_map.h"
#include "hi_util_xmalloc.h"
#include "hi_return_codes.h"
Go to the source code of this file.
Defines | |
#define | MAX_BUFFER 50000 |
#define | CODEPAGE_SEPARATORS " \t\n\r" |
#define | CODEPOINT_SEPARATORS ": \n\r" |
Functions | |
static int | FindCodePage (FILE *fFile, int iCodePage) |
static int | MapCodePoints (FILE *fFile, int *iis_unicode_map) |
int | hi_ui_parse_iis_unicode_map (int **iis_unicode_map, char *filename, int iCodePage) |
NOTES
Definition in file hi_ui_iis_unicode_map.c.
|
Definition at line 32 of file hi_ui_iis_unicode_map.c. Referenced by FindCodePage(), and MapCodePoints(). |
|
Definition at line 33 of file hi_ui_iis_unicode_map.c. Referenced by MapCodePoints(). |
|
Definition at line 31 of file hi_ui_iis_unicode_map.c. Referenced by FindCodePage(). |
|
Locate the codepage mapping the IIS Unicode Map file. We iterate through the file lines until we get to the codepage reference. We then return that it was found successfully, and the FILE pointer is located on the codepoint mapping line.
Definition at line 54 of file hi_ui_iis_unicode_map.c. References buffer, CODEPAGE_SEPARATORS, HI_FATAL_ERR, HI_SUCCESS, MAX_BUFFER, strtok_r, and strtol(). Referenced by hi_ui_parse_iis_unicode_map(). |
|
Parses an IIS Unicode Map file and store in the supplied array. This routine allocates the necessary memory to store the array values in, and parses the supplied filename.
Definition at line 201 of file hi_ui_iis_unicode_map.c. References FindCodePage(), HI_INVALID_ARG, HI_INVALID_FILE, HI_MEM_ALLOC_FAIL, HI_SUCCESS, HI_UI_NON_ASCII_CODEPOINT, MapCodePoints(), memset, NULL, and xmalloc(). Referenced by ProcessIISUnicodeMap(). |
|
Read the codepoint mapping and covert to codepoint and ASCII. This is where the bulk of the work is done. We read in 9 bytes at a time because the mappings are in chunks of 8 (+1 for the NULL at the end). The chunks are as follows: xxxx:xx (the first set of 4 is the codepoint, the second set is the ASCII representation) We then convert and check these values before storing them in the supplied array.
Definition at line 116 of file hi_ui_iis_unicode_map.c. References buffer, CODEPAGE_SEPARATORS, CODEPOINT_SEPARATORS, HI_FATAL_ERR, HI_SUCCESS, NULL, strtok_r, and strtol(). Referenced by hi_ui_parse_iis_unicode_map(). |