VLC  4.0.0-dev
vlc_iso_lang.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_iso_lang.h: function to decode language code (in dvd or a52 for instance).
3  *****************************************************************************
4  * Copyright (C) 1998-2001 VLC authors and VideoLAN
5  *
6  * Author: St├ęphane Borel <stef@via.ecp.fr>
7  * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23 
24 /**
25  * \file
26  * This file defines functions and structures for iso639 language codes
27  */
28 
29 struct iso639_lang_t
30 {
31  const char *psz_eng_name; /* Description in English */
32  const char psz_iso639_1[3]; /* ISO-639-1 (2 characters) code */
33  const char psz_iso639_2T[4]; /* ISO-639-2/T (3 characters) English code */
34  const char psz_iso639_2B[4]; /* ISO-639-2/B (3 characters) native code */
35 };
36 
37 #if defined( __cplusplus )
38 extern "C" {
39 #endif
40 
41 /*
42  * Tries to find the language record for the given ISO-639 language code.
43  *
44  * The provided code should either be a two character ISO-639-1 code, or a three
45  * character ISO-639-2 code. For the latter, a search is done first of the
46  * ISO-639-2B (English) code attributes, falling back to the ISO-639-2T (native)
47  * code attributes if no match. (Case insensitive).
48  *
49  * If `try_name` is set to `true`, then as a last resort, a (case-insensitive)
50  * search of language names will be performed.
51  *
52  * @return A pointer to the matching record, or NULL if no match.
53  */
54 VLC_API const iso639_lang_t * vlc_find_iso639( const char *code, bool try_name );
55 
56 #if defined( __cplusplus )
57 }
58 #endif
VLC_API
#define VLC_API
Definition: fourcc_gen.c:31
vlc_common.h
iso639_lang_t::psz_eng_name
const char * psz_eng_name
Definition: vlc_iso_lang.h:32
iso639_lang_t::psz_iso639_1
const char psz_iso639_1[3]
Definition: vlc_iso_lang.h:33
iso639_lang_t::psz_iso639_2B
const char psz_iso639_2B[4]
Definition: vlc_iso_lang.h:35
iso639_lang_t::psz_iso639_2T
const char psz_iso639_2T[4]
Definition: vlc_iso_lang.h:34
iso639_lang_t
Definition: vlc_iso_lang.h:30
vlc_find_iso639
const VLC_EXPORT iso639_lang_t * vlc_find_iso639(const char *code, bool try_name)
Definition: iso_lang.c:87