fs/nls/nls_ucs2_utils.h
Source file repositories/reference/linux-study-clean/fs/nls/nls_ucs2_utils.h
File Facts
- System
- Linux kernel
- Corpus path
fs/nls/nls_ucs2_utils.h- Extension
.h- Size
- 6505 bytes
- Lines
- 286
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/byteorder.hlinux/types.hlinux/nls.hlinux/unicode.hnls_ucs2_data.h
Detected Declarations
function Copyrightfunction UniStrcmpfunction UniStrlenfunction stringfunction UniStrncmpfunction UniStrncmp_lefunction UniToupper
Annotated Snippet
if (*ucs1 == *ucs2) {
/* Partial match found */
ucs1++;
ucs2++;
} else {
if (!*ucs2) /* Match found */
return (wchar_t *)anchor1;
ucs1 = ++anchor1; /* No match */
ucs2 = anchor2;
}
}
if (!*ucs2) /* Both end together */
return (wchar_t *)anchor1; /* Match found */
return NULL; /* No match */
}
#ifndef UNIUPR_NOUPPER
/*
* UniToupper: Convert a unicode character to upper case
*/
static inline wchar_t UniToupper(register wchar_t uc)
{
register const struct UniCaseRange *rp;
if (uc < sizeof(NlsUniUpperTable)) {
/* Latin characters */
return uc + NlsUniUpperTable[uc]; /* Use base tables */
}
rp = NlsUniUpperRange; /* Use range tables */
while (rp->start) {
if (uc < rp->start) /* Before start of range */
return uc; /* Uppercase = input */
if (uc <= rp->end) /* In range */
return uc + rp->table[uc - rp->start];
rp++; /* Try next range */
}
return uc; /* Past last range */
}
/*
* UniStrupr: Upper case a unicode string
*/
static inline __le16 *UniStrupr(register __le16 *upin)
{
register __le16 *up;
up = upin;
while (*up) { /* For all characters */
*up = cpu_to_le16(UniToupper(le16_to_cpu(*up)));
up++;
}
return upin; /* Return input pointer */
}
#endif /* UNIUPR_NOUPPER */
#endif /* _NLS_UCS2_UTILS_H */
Annotation
- Immediate include surface: `asm/byteorder.h`, `linux/types.h`, `linux/nls.h`, `linux/unicode.h`, `nls_ucs2_data.h`.
- Detected declarations: `function Copyright`, `function UniStrcmp`, `function UniStrlen`, `function string`, `function UniStrncmp`, `function UniStrncmp_le`, `function UniToupper`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.