OSDN Git Service

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