~ubuntu-branches/ubuntu/precise/krb5/precise-updates

« back to all changes in this revision

Viewing changes to src/windows/identity/doc/plugin_locale.h

  • Committer: Package Import Robot
  • Author(s): Sam Hartman
  • Date: 2011-12-01 19:34:41 UTC
  • mfrom: (28.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20111201193441-9tipg3aru1jsidyv
Tags: 1.10+dfsg~alpha1-6
* Fix segfault with unknown hostnames in krb5_sname_to_principal,
  Closes: #650671
* Indicate that this library breaks libsmbclient versions that depend on
  krb5_locate_kdc, Closes: #650603, #650611

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2005 Massachusetts Institute of Technology
3
 
 * Copyright (c) 2007 Secure Endpoints Inc.
4
 
 *
5
 
 * Permission is hereby granted, free of charge, to any person
6
 
 * obtaining a copy of this software and associated documentation
7
 
 * files (the "Software"), to deal in the Software without
8
 
 * restriction, including without limitation the rights to use, copy,
9
 
 * modify, merge, publish, distribute, sublicense, and/or sell copies
10
 
 * of the Software, and to permit persons to whom the Software is
11
 
 * furnished to do so, subject to the following conditions:
12
 
 *
13
 
 * The above copyright notice and this permission notice shall be
14
 
 * included in all copies or substantial portions of the Software.
15
 
 *
16
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
 
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
 
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20
 
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21
 
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
 
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
 
 * SOFTWARE.
24
 
 */
25
 
 
26
 
/* $Id$ */
27
 
 
28
 
/*!
29
 
\page pi_localization Localization
30
 
 
31
 
If a module requires localized resources, it can register the
32
 
localized resource libraries with the module manager when it receives
33
 
the init_module() callback.  Note that you can only register localized
34
 
resource libraries during init_module().
35
 
 
36
 
The localized resource library is global to a module.  Each plug-in is
37
 
not allowed to define its own localization library, although it is
38
 
free to load and use any library as it sees fit.  The module manager
39
 
does not manage these libraries for the plug-in.
40
 
 
41
 
\section pi_loc_spec Specification of localized resources
42
 
 
43
 
In order to register localized resource libraries, a module calls
44
 
kmm_set_locale_info().  The \a locales parameter to the function holds
45
 
a pointer to an array of ::kmm_module_locale records.  Each record
46
 
specifies one language code and a filename of a library that holds the
47
 
language resources for that language.
48
 
 
49
 
It is recommended that you use the LOCALE_DEF convenience macro when
50
 
defining locale records for use with kmm_set_locale_info().  This will
51
 
ensure that future changes in the API will only minimally affect your
52
 
code.  For example:
53
 
 
54
 
\code
55
 
kmm_module_locale my_locales[] = {
56
 
LOCALE_DEF(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US), L"english.dll", KMM_MLOC_FLAG_DEFAULT),
57
 
LOCALE_DEF(MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH), L"dutch.dll", 0),
58
 
LOCALE_DEF(MAKELANGID(LANG_SPANISH,SUBLANG_SPANISH_MODERN), L"spanish.dll", 0)
59
 
};
60
 
 
61
 
int n_locales = sizeof(my_locales)/sizeof(my_locales[0]);
62
 
 
63
 
...
64
 
 
65
 
kmm_set_locale_info(h_module, my_locales, n_locales);
66
 
 
67
 
...
68
 
\endcode
69
 
 
70
 
See kmm_set_locale_info() and ::kmm_module_locale for more info.
71
 
 
72
 
\section pi_loc_how Selection of localized resource library
73
 
 
74
 
The module manager searches the array of ::kmm_module_locale objects
75
 
passed into the kmm_set_locale_info() function for one that matches
76
 
the current user locale (as opposed to the current system locale).  A
77
 
record matches the locale if it has the same language ID.
78
 
 
79
 
If a match is found, that library is selected.  Otherwise, the list is
80
 
searched for one that is compatible with the current user locale.  A
81
 
locale record is compatible with the user locale if the primary
82
 
language matches.
83
 
 
84
 
If a match is still not found, the first record in the locale array
85
 
that has the ::KMM_MLOC_FLAG_DEFAULT flag set will be selected.
86
 
 
87
 
If a match is still not found, then the kmm_set_locale_info() will
88
 
return ::KHM_ERROR_NOT_FOUND.
89
 
 
90
 
\section pi_loc_usage Using localization
91
 
 
92
 
The following convenience macros are available for using a module
93
 
handle to load resources from the corresponding resource library.
94
 
However, for performance reasons, it is advisable to obtain a handle
95
 
to the resource library loaded by the module manager using
96
 
kmm_get_resource_module() and then use it to access resources using
97
 
the regular WIN32 API.
98
 
 
99
 
- ::kmm_LoadAccelerators
100
 
- ::kmm_LoadBitmap
101
 
- ::kmm_LoadCursor
102
 
- ::kmm_LoadIcon
103
 
- ::kmm_LoadImage
104
 
- ::kmm_LoadMenu
105
 
- ::kmm_LoadString
106
 
 
107
 
*/