chars.c revision 260e9a87725c090ba5835b1f9f0b62fa2f96036f
/* $Id: chars.c,v 1.66 2015/02/17 20:37:16 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "mandoc.h"
#include "mandoc_aux.h"
#include "libmandoc.h"
#define PRINT_HI 126
#define PRINT_LO 32
struct ln {
const char *code;
const char *ascii;
int unicode;
};
#define LINES_MAX 332
#define CHAR_TBL_END };
#include "chars.in"
struct mchars {
};
const char *, size_t);
void
{
}
struct mchars *
mchars_alloc(void)
{
int i, hash;
/*
* Constructs a very basic chaining hashtable. The hash routine
* is simply the integral value of the first character.
* Subsequent entries are chained in the order they're processed.
*/
for (i = 0; i < LINES_MAX; i++) {
continue;
}
/* Scan ahead. */ ;
}
return(tab);
}
int
{
}
int
{
int i;
return(i >= 0 && i < 256 ? i : -1);
}
int
{
int i;
assert(i >= 0 && i <= 0x10FFFF);
return(i);
}
const char *
{
*rsz = 1;
}
}
const char *
mchars_uc2str(int uc)
{
int i;
for (i = 0; i < LINES_MAX; i++)
return("<?>");
}
static const struct ln *
{
int hash;
assert(p);
return(NULL);
return(pp);
return(NULL);
}