GCC Code Coverage Report


Directory: common/src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 2 / 0 / 2
Functions: 100.0% 1 / 0 / 1
Branches: -% 0 / 0 / 0

fx_unicode_short_name_get.c
Line Branch Exec Source
1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 * Copyright (c) 2026-present Eclipse ThreadX contributors
4 *
5 * This program and the accompanying materials are made available under the
6 * terms of the MIT License which is available at
7 * https://opensource.org/licenses/MIT.
8 *
9 * SPDX-License-Identifier: MIT
10 **************************************************************************/
11
12 // Portions of this file were generated with AI assistance.
13
14
15 /**************************************************************************/
16 /**************************************************************************/
17 /** */
18 /** FileX Component */
19 /** */
20 /** Unicode */
21 /** */
22 /**************************************************************************/
23 /**************************************************************************/
24
25 #define FX_SOURCE_CODE
26
27
28 /* Include necessary system files. */
29
30 #include "fx_api.h"
31 #include "fx_unicode.h"
32
33
34 /* DEPRECATION NOTICE
35 * fx_unicode_short_name_get() is deprecated. Do not use it in new code.
36 *
37 * WHY: Does not accept a destination buffer length; writes up to 13 bytes regardless of the caller's buffer size, risking a buffer overrun.
38 *
39 * WHAT TO DO: replace calls with fx_unicode_short_name_get_extended(), passing the actual
40 * destination buffer size as an additional argument.
41 */
42 #pragma message("fx_unicode_short_name_get() is deprecated. " \
43 "Use fx_unicode_short_name_get_extended() and pass the actual buffer size.")
44
45 /**************************************************************************/
46 /* */
47 /* FUNCTION RELEASE */
48 /* */
49 /* _fx_unicode_short_name_get PORTABLE C */
50 /* 6.1 */
51 /* AUTHOR */
52 /* */
53 /* William E. Lamie, Microsoft Corporation */
54 /* */
55 /* DESCRIPTION */
56 /* */
57 /* This function finds the short name associated with the supplied */
58 /* unicode name. */
59 /* */
60 /* DEPRECATED. Use fx_unicode_short_name_get_extended() instead, */
61 /* passing the actual destination buffer length. It takes no buffer */
62 /* length and writes up to 13 bytes whatever the size of the caller's */
63 /* buffer, risking an overrun. */
64 /* */
65 /* INPUT */
66 /* */
67 /* media_ptr Pointer to media */
68 /* source_unicode_name Pointer to unicode name */
69 /* source_unicode_length Length of unicode name */
70 /* destination_short_name Pointer to destination name */
71 /* */
72 /* OUTPUT */
73 /* */
74 /* Completion Status */
75 /* */
76 /* CALLS */
77 /* */
78 /* _fx_unicode_short_name_get_extended Actual unicode short name get */
79 /* service */
80 /* */
81 /* CALLED BY */
82 /* */
83 /* Application Code */
84 /* */
85 /**************************************************************************/
86 992 UINT _fx_unicode_short_name_get(FX_MEDIA *media_ptr, UCHAR *source_unicode_name, ULONG source_unicode_length,
87 CHAR *destination_short_name)
88 {
89
90 /* Call the extended version with 13 bytes short name length. */
91 992 return(_fx_unicode_short_name_get_extended(media_ptr, source_unicode_name, source_unicode_length, destination_short_name, 13));
92 }
93
94