Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 63 lines (51 sloc) 1.365 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#! /bin/sh
# buildaliastbl.sh
# Copyright (C) 2011-2012 Akira TAGOH
#
# Authors:
# Akira TAGOH <akira@tagoh.org>
#
# You may distribute under the terms of either the GNU
# Lesser General Public License or the Mozilla Public
# License, as specified in the README file.

if [ $# -ne 1 ]; then
    cat<<EOF
Usage: $0 /path/to/locale.alias

This tool is to generate the alias table in C from locale.alias.
EOF
    exit 1
fi

cat<<EOF
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* THIS HEADER FILE WAS GENERATED BY THE SCRIPT.
* ANY CHANGES MADE BY THE HAND MAY BE MISSED.
*/
/*
* lt-localealias.h
* Copyright (C) 2011-2012 Akira TAGOH
*
* Authors:
* Akira TAGOH <akira@tagoh.org>
*
* You may distribute under the terms of either the GNU
* Lesser General Public License or the Mozilla Public
* License, as specified in the README file.
*/
#ifndef __LT_LOCALEALIAS_H__
#define __LT_LOCALEALIAS_H__

#include <liblangtag/lt-macros.h>

LT_BEGIN_DECLS

typedef struct _lt_localealias_t lt_localealias_t;

struct _lt_localealias_t {
char *alias;
char *locale;
};

static lt_localealias_t __lt_localealias_tables[] = {
EOF

iconv -f iso8859-1 -t utf-8 $1 | sed -e '/^#.*/{d};/^$/{d};' -e 's/^\([^ \t]*\)[ \t]*\([^ \t]*\)$/\t{"\1", "\2"},/'

cat<<EOF
{NULL, NULL}
};

LT_END_DECLS

#endif /* __LT_LOCALEALIAS_H__ */
EOF
Something went wrong with that request. Please try again.