diff options
| author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
| commit | fc05505b77f7900a1bb74fb3f3a4343dee4265a4 (patch) | |
| tree | 6517919cb60bd9465078512cacbefd8c77f94b76 /include/linux/nls.h | |
| parent | a2ab67fae1ab9226679495a8d260f4e6555efc5f (diff) | |
| parent | 11c79740d3c03cb81f84e98cf2e2dbd8d9bb53cd (diff) | |
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 into devel
Diffstat (limited to 'include/linux/nls.h')
| -rw-r--r-- | include/linux/nls.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/nls.h b/include/linux/nls.h index 6a882208301..52b1a76c1b4 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h | |||
| @@ -58,6 +58,25 @@ static inline int nls_strnicmp(struct nls_table *t, const unsigned char *s1, | |||
| 58 | return 0; | 58 | return 0; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | /* | ||
| 62 | * nls_nullsize - return length of null character for codepage | ||
| 63 | * @codepage - codepage for which to return length of NULL terminator | ||
| 64 | * | ||
| 65 | * Since we can't guarantee that the null terminator will be a particular | ||
| 66 | * length, we have to check against the codepage. If there's a problem | ||
| 67 | * determining it, assume a single-byte NULL terminator. | ||
| 68 | */ | ||
| 69 | static inline int | ||
| 70 | nls_nullsize(const struct nls_table *codepage) | ||
| 71 | { | ||
| 72 | int charlen; | ||
| 73 | char tmp[NLS_MAX_CHARSET_SIZE]; | ||
| 74 | |||
| 75 | charlen = codepage->uni2char(0, tmp, NLS_MAX_CHARSET_SIZE); | ||
| 76 | |||
| 77 | return charlen > 0 ? charlen : 1; | ||
| 78 | } | ||
| 79 | |||
| 61 | #define MODULE_ALIAS_NLS(name) MODULE_ALIAS("nls_" __stringify(name)) | 80 | #define MODULE_ALIAS_NLS(name) MODULE_ALIAS("nls_" __stringify(name)) |
| 62 | 81 | ||
| 63 | #endif /* _LINUX_NLS_H */ | 82 | #endif /* _LINUX_NLS_H */ |
