1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** GUIX Component                                                        */
17 /**                                                                       */
18 /**   Display Management (Display)                                        */
19 /**                                                                       */
20 /**************************************************************************/
21 
22 #define GX_SOURCE_CODE
23 
24 
25 /* Include necessary system files.  */
26 
27 #include "gx_api.h"
28 #include "gx_display.h"
29 
30 /* Bring in externs for caller checking code.  */
31 GX_CALLER_CHECKING_EXTERNS
32 /**************************************************************************/
33 /*                                                                        */
34 /*  FUNCTION                                               RELEASE        */
35 /*                                                                        */
36 /*    _gxe_display_string_table_get                       PORTABLE C      */
37 /*                                                           6.1          */
38 /*  AUTHOR                                                                */
39 /*                                                                        */
40 /*    Kenneth Maxwell, Microsoft Corporation                              */
41 /*                                                                        */
42 /*  DESCRIPTION                                                           */
43 /*                                                                        */
44 /*    This function checks for errors in the display string table get     */
45 /*    function call                                                       */
46 /*                                                                        */
47 /*  INPUT                                                                 */
48 /*                                                                        */
49 /*    display                               Pointer to display instance.  */
50 /*    language                              The language the string       */
51 /*                                            table is associated with    */
52 /*    get_table                             Pointer to string table       */
53 /*    get_size                              Number of strings in table    */
54 /*                                                                        */
55 /*  OUTPUT                                                                */
56 /*                                                                        */
57 /*    status                                Completion status             */
58 /*                                                                        */
59 /*  CALLS                                                                 */
60 /*                                                                        */
61 /*    _gx_display_string_table_get         Actual display string table    */
62 /*                                            get routine                 */
63 /*                                                                        */
64 /*  CALLED BY                                                             */
65 /*                                                                        */
66 /*    Application Code                                                    */
67 /*                                                                        */
68 /*  RELEASE HISTORY                                                       */
69 /*                                                                        */
70 /*    DATE              NAME                      DESCRIPTION             */
71 /*                                                                        */
72 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
73 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
74 /*                                            resulting in version 6.1    */
75 /*                                                                        */
76 /**************************************************************************/
77 #if defined(GX_ENABLE_DEPRECATED_STRING_API)
_gxe_display_string_table_get(GX_DISPLAY * display,GX_UBYTE language,GX_CHAR *** put_table,UINT * put_size)78 UINT _gxe_display_string_table_get(GX_DISPLAY *display, GX_UBYTE language, GX_CHAR ***put_table, UINT *put_size)
79 {
80 UINT status;
81 
82     /* Check for appropriate caller.  */
83     GX_INIT_AND_THREADS_CALLER_CHECKING
84 
85     if (display == GX_NULL)
86     {
87         return GX_PTR_ERROR;
88     }
89 
90     if (language >= display -> gx_display_language_table_size)
91     {
92         return GX_NOT_FOUND;
93     }
94 
95     /* Call actual string table get function */
96     status = _gx_display_string_table_get(display, language,
97                                           put_table, put_size);
98     return status;
99 }
100 #endif
101 
102 /**************************************************************************/
103 /*                                                                        */
104 /*  FUNCTION                                               RELEASE        */
105 /*                                                                        */
106 /*    _gxe_display_string_table_get_ext                   PORTABLE C      */
107 /*                                                           6.1          */
108 /*  AUTHOR                                                                */
109 /*                                                                        */
110 /*    Kenneth Maxwell, Microsoft Corporation                              */
111 /*                                                                        */
112 /*  DESCRIPTION                                                           */
113 /*                                                                        */
114 /*    This function checks for errors in the display string table get     */
115 /*    function call                                                       */
116 /*                                                                        */
117 /*  INPUT                                                                 */
118 /*                                                                        */
119 /*    display                               Pointer to display instance.  */
120 /*    language                              The language the string       */
121 /*                                            table is associated with    */
122 /*    get_table                             Pointer to string table       */
123 /*    get_size                              Number of strings in table    */
124 /*                                                                        */
125 /*  OUTPUT                                                                */
126 /*                                                                        */
127 /*    status                                Completion status             */
128 /*                                                                        */
129 /*  CALLS                                                                 */
130 /*                                                                        */
131 /*    _gx_display_string_table_get         Actual display string table    */
132 /*                                            get routine                 */
133 /*                                                                        */
134 /*  CALLED BY                                                             */
135 /*                                                                        */
136 /*    Application Code                                                    */
137 /*                                                                        */
138 /*  RELEASE HISTORY                                                       */
139 /*                                                                        */
140 /*    DATE              NAME                      DESCRIPTION             */
141 /*                                                                        */
142 /*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
143 /*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
144 /*                                            resulting in version 6.1    */
145 /*                                                                        */
146 /**************************************************************************/
_gxe_display_string_table_get_ext(GX_DISPLAY * display,GX_UBYTE language,GX_STRING ** put_table,UINT * put_size)147 UINT _gxe_display_string_table_get_ext(GX_DISPLAY *display, GX_UBYTE language, GX_STRING **put_table, UINT *put_size)
148 {
149 UINT status;
150 
151     /* Check for appropriate caller.  */
152     GX_INIT_AND_THREADS_CALLER_CHECKING
153 
154     if (display == GX_NULL)
155     {
156         return GX_PTR_ERROR;
157     }
158 
159     if (language >= display -> gx_display_language_table_size)
160     {
161         return GX_NOT_FOUND;
162     }
163 
164     /* Call actual string table get function */
165     status = _gx_display_string_table_get_ext(display, language,
166                                               put_table, put_size);
167     return status;
168 }
169 
170