xref: /aosp_15_r20/external/e2fsprogs/lib/et/test_cases/heimdal3.c (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Worker /*
2*6a54128fSAndroid Build Coastguard Worker  * heimdal3.c:
3*6a54128fSAndroid Build Coastguard Worker  * This file is automatically generated; please do not edit it.
4*6a54128fSAndroid Build Coastguard Worker  */
5*6a54128fSAndroid Build Coastguard Worker 
6*6a54128fSAndroid Build Coastguard Worker #include <stdlib.h>
7*6a54128fSAndroid Build Coastguard Worker 
8*6a54128fSAndroid Build Coastguard Worker #define N_(a) a
9*6a54128fSAndroid Build Coastguard Worker 
10*6a54128fSAndroid Build Coastguard Worker static const char * const text[] = {
11*6a54128fSAndroid Build Coastguard Worker 	N_("Test message 1"),
12*6a54128fSAndroid Build Coastguard Worker 	N_("Test message 2"),
13*6a54128fSAndroid Build Coastguard Worker     0
14*6a54128fSAndroid Build Coastguard Worker };
15*6a54128fSAndroid Build Coastguard Worker 
16*6a54128fSAndroid Build Coastguard Worker struct error_table {
17*6a54128fSAndroid Build Coastguard Worker     char const * const * msgs;
18*6a54128fSAndroid Build Coastguard Worker     long base;
19*6a54128fSAndroid Build Coastguard Worker     int n_msgs;
20*6a54128fSAndroid Build Coastguard Worker };
21*6a54128fSAndroid Build Coastguard Worker struct et_list {
22*6a54128fSAndroid Build Coastguard Worker     struct et_list *next;
23*6a54128fSAndroid Build Coastguard Worker     const struct error_table * table;
24*6a54128fSAndroid Build Coastguard Worker };
25*6a54128fSAndroid Build Coastguard Worker extern struct et_list *_et_list;
26*6a54128fSAndroid Build Coastguard Worker 
27*6a54128fSAndroid Build Coastguard Worker const struct error_table et_h3test_error_table = { text, 43787520L, 2 };
28*6a54128fSAndroid Build Coastguard Worker 
29*6a54128fSAndroid Build Coastguard Worker static struct et_list link = { 0, 0 };
30*6a54128fSAndroid Build Coastguard Worker 
31*6a54128fSAndroid Build Coastguard Worker void initialize_h3test_error_table_r(struct et_list **list);
32*6a54128fSAndroid Build Coastguard Worker void initialize_h3test_error_table(void);
33*6a54128fSAndroid Build Coastguard Worker 
initialize_h3test_error_table(void)34*6a54128fSAndroid Build Coastguard Worker void initialize_h3test_error_table(void) {
35*6a54128fSAndroid Build Coastguard Worker     initialize_h3test_error_table_r(&_et_list);
36*6a54128fSAndroid Build Coastguard Worker }
37*6a54128fSAndroid Build Coastguard Worker 
38*6a54128fSAndroid Build Coastguard Worker /* For Heimdal compatibility */
initialize_h3test_error_table_r(struct et_list ** list)39*6a54128fSAndroid Build Coastguard Worker void initialize_h3test_error_table_r(struct et_list **list)
40*6a54128fSAndroid Build Coastguard Worker {
41*6a54128fSAndroid Build Coastguard Worker     struct et_list *et, **end;
42*6a54128fSAndroid Build Coastguard Worker 
43*6a54128fSAndroid Build Coastguard Worker     for (end = list, et = *list; et; end = &et->next, et = et->next)
44*6a54128fSAndroid Build Coastguard Worker         if (et->table->msgs == text)
45*6a54128fSAndroid Build Coastguard Worker             return;
46*6a54128fSAndroid Build Coastguard Worker     et = malloc(sizeof(struct et_list));
47*6a54128fSAndroid Build Coastguard Worker     if (et == 0) {
48*6a54128fSAndroid Build Coastguard Worker         if (!link.table)
49*6a54128fSAndroid Build Coastguard Worker             et = &link;
50*6a54128fSAndroid Build Coastguard Worker         else
51*6a54128fSAndroid Build Coastguard Worker             return;
52*6a54128fSAndroid Build Coastguard Worker     }
53*6a54128fSAndroid Build Coastguard Worker     et->table = &et_h3test_error_table;
54*6a54128fSAndroid Build Coastguard Worker     et->next = 0;
55*6a54128fSAndroid Build Coastguard Worker     *end = et;
56*6a54128fSAndroid Build Coastguard Worker }
57