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_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_name_get() is deprecated. Do not use it in new code.
36 *
37 * WHY: Does not accept a destination buffer length; writes up to FX_MAX_LONG_NAME_LEN*2 bytes regardless of the caller's buffer size, risking a buffer overrun.
38 *
39 * WHAT TO DO: replace calls with fx_unicode_name_get_extended(), passing the actual
40 * destination buffer size as an additional argument.
41 */
42 #pragma message("fx_unicode_name_get() is deprecated. " \
43 "Use fx_unicode_name_get_extended() and pass the actual buffer size.")
44
45 /**************************************************************************/
46 /* */
47 /* FUNCTION RELEASE */
48 /* */
49 /* _fx_unicode_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 unicode name associated with the supplied */
58 /* short 8.3 name. */
59 /* */
60 /* DEPRECATED. Use fx_unicode_name_get_extended() instead, passing the */
61 /* actual destination buffer length. This function takes no buffer */
62 /* length and writes up to FX_MAX_LONG_NAME_LEN * 2 bytes whatever the */
63 /* size of the caller's buffer, risking an overrun. */
64 /* */
65 /* INPUT */
66 /* */
67 /* media_ptr Pointer to media */
68 /* source_short_name Pointer to short file name */
69 /* destination_unicode_name Pointer to destination name */
70 /* destination_unicode_length Destination for name length */
71 /* */
72 /* OUTPUT */
73 /* */
74 /* Completion Status */
75 /* */
76 /* CALLS */
77 /* */
78 /* _fx_unicode_name_get_extended Actual unicode name get */
79 /* service */
80 /* */
81 /* CALLED BY */
82 /* */
83 /* Application Code */
84 /* */
85 /**************************************************************************/
86 108 UINT _fx_unicode_name_get(FX_MEDIA *media_ptr, CHAR *source_short_name,
87 UCHAR *destination_unicode_name, ULONG *destination_unicode_length)
88 {
89
90 /* Call the extended version with 13 bytes short name length. */
91 108 return(_fx_unicode_name_get_extended(media_ptr, source_short_name, destination_unicode_name, destination_unicode_length, FX_MAX_LONG_NAME_LEN * 2));
92 }
93
94