collate.c revision 4297a3b0d0a35d80f86fff155e288e885a100e6d
/*
* Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua>
* at Electronni Visti IA, Kiev, Ukraine.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "lint.h"
#include "file64.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sysexits.h>
#include "collate.h"
#include "setlocale.h"
#include "ldpart.h"
int __collate_load_error = 1;
int
__collate_load_tables(const char *encoding)
{
/* 'encoding' must be already checked. */
__collate_load_error = 1;
return (_LDP_CACHE);
}
/*
* If the locale name is the same as our cache, use the cache.
*/
__collate_load_error = 0;
return (_LDP_CACHE);
}
/*
* Slurp the locale file into the cache.
*/
/* 'PathLocale' must be already set & checked. */
/* Range checking not needed, encoding has fixed size */
return (_LDP_ERROR);
return (_LDP_ERROR);
}
chains = -1;
chains = 0;
chains = 1;
if (chains < 0) {
return (_LDP_ERROR);
}
if (chains) {
return (_LDP_ERROR);
}
return (_LDP_ERROR);
}
} else
chains = TABLE_SIZE;
if ((TMP_substitute_table =
return (_LDP_ERROR);
}
if ((TMP_char_pri_table =
return (_LDP_ERROR);
}
if ((TMP_chain_pri_table =
return (_LDP_ERROR);
}
#define FREAD(a, b, c, d) \
{ \
if (fread(a, b, c, d) != c) { \
(void) fclose(d); \
return (_LDP_ERROR); \
} \
}
if (__collate_substitute_table_ptr != NULL)
if (__collate_char_pri_table_ptr != NULL)
for (i = 0; i < UCHAR_MAX + 1; i++) {
}
if (__collate_chain_pri_table != NULL)
for (i = 0; i < chains; i++) {
}
for (i = 0; i < UCHAR_MAX + 1; i++) {
if (__collate_substitute_table[i][0] != i ||
__collate_substitute_table[i][1] != 0) {
break;
}
}
__collate_load_error = 0;
return (_LDP_LOADED);
}
char *
__collate_substitute(const char *str)
{
int delta;
if (s == NULL || *s == '\0') {
return (strdup(""));
}
return (NULL);
len = 0;
while (*s) {
char *new_str;
return (NULL);
}
}
(char *)__collate_substitute_table[*s++]);
}
return (dest_str);
}
void
{
struct __collate_st_chain_pri *p2;
*len = 1;
return;
}
}
}