aboutsummaryrefslogtreecommitdiff
path: root/e2fslib/ext2_err.c
blob: a8b50977d3e4ff7a8bf9a2e81612db280976c470 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
 * :
 * This file is automatically generated; please do not edit it.
 */

#include <stdlib.h>

static const char * const text[] = {
		"EXT2FS Library version 1.25",
		"Wrong magic number for ext2_filsys structure",
		"Wrong magic number for badblocks_list structure",
		"Wrong magic number for badblocks_iterate structure",
		"Wrong magic number for inode_scan structure",
		"Wrong magic number for io_channel structure",
		"Wrong magic number for unix io_channel structure",
		"Wrong magic number for io_manager structure",
		"Wrong magic number for block_bitmap structure",
		"Wrong magic number for inode_bitmap structure",
		"Wrong magic number for generic_bitmap structure",
		"Wrong magic number for test io_channel structure",
		"Wrong magic number for directory block list structure",
		"Wrong magic number for icount structure",
		"Wrong magic number for Powerquest io_channel structure",
		"Wrong magic number for ext2 file structure",
		"Wrong magic number for Ext2 Image Header",
		"Wrong magic number --- RESERVED_8",
		"Wrong magic number --- RESERVED_9",
		"Bad magic number in super-block",
		"Filesystem revision too high",
		"Attempt to write to filesystem opened read-only",
		"Can't read group descriptors",
		"Can't write group descriptors",
		"Corrupt group descriptor: bad block for block bitmap",
		"Corrupt group descriptor: bad block for inode bitmap",
		"Corrupt group descriptor: bad block for inode table",
		"Can't write an inode bitmap",
		"Can't read an inode bitmap",
		"Can't write an block bitmap",
		"Can't read an block bitmap",
		"Can't write an inode table",
		"Can't read an inode table",
		"Can't read next inode",
		"Filesystem has unexpected block size",
		"EXT2 directory corrupted",
		"Attempt to read block from filesystem resulted in short read",
		"Attempt to write block from filesystem resulted in short write",
		"No free space in the directory",
		"Inode bitmap not loaded",
		"Block bitmap not loaded",
		"Illegal inode number",
		"Illegal block number",
		"Internal error in ext2fs_expand_dir",
		"Not enough space to build proposed filesystem",
		"Illegal block number passed to ext2fs_mark_block_bitmap",
		"Illegal block number passed to ext2fs_unmark_block_bitmap",
		"Illegal block number passed to ext2fs_test_block_bitmap",
		"Illegal inode number passed to ext2fs_mark_inode_bitmap",
		"Illegal inode number passed to ext2fs_unmark_inode_bitmap",
		"Illegal inode number passed to ext2fs_test_inode_bitmap",
		"Attempt to fudge end of block bitmap past the real end",
		"Attempt to fudge end of inode bitmap past the real end",
		"Illegal indirect block found" ,
		"Illegal doubly indirect block found" ,
		"Illegal triply indirect block found" ,
		"Block bitmaps are not the same",
		"Inode bitmaps are not the same",
		"Illegal or malformed device name",
		"A block group is missing an inode table",
		"The ext2 superblock is corrupt",
		"Illegal generic bit number passed to ext2fs_mark_generic_bitmap",
		"Illegal generic bit number passed to ext2fs_unmark_generic_bitmap",
		"Illegal generic bit number passed to ext2fs_test_generic_bitmap",
		"Too many symbolic links encountered.",
		"The callback function will not handle this case",
		"The inode is from a bad block in the inode table",
		"Filesystem has unsupported feature(s)",
		"Filesystem has unsupported read-only feature(s)",
		"IO Channel failed to seek on read or write",
		"Memory allocation failed",
		"Invalid argument passed to ext2 library",
		"Could not allocate block in ext2 filesystem",
		"Could not allocate inode in ext2 filesystem",
		"Ext2 inode is not a directory",
		"Too many references in table",
		"File not found by ext2_lookup",
		"File open read-only",
		"Ext2 directory block not found",
		"Ext2 directory already exists",
		"Unimplemented ext2 library function",
		"User cancel requested",
		"Ext2 file too big",
		"Supplied journal device not a block device",
		"Journal superblock not found",
		"Journal must be at least 1024 blocks",
		"Unsupported journal version",
		"Error loading external journal",
    0
};

struct error_table {
    char const * const * msgs;
    long base;
    int n_msgs;
};
struct et_list {
    struct et_list *next;
    const struct error_table * table;
};
extern struct et_list *_et_list;

const struct error_table et_ext2_error_table = { text, 2133571328L, 88 };

static struct et_list link = { 0, 0 };

void initialize_ext2_error_table_r(struct et_list **list);
void initialize_ext2_error_table(void);

void initialize_ext2_error_table(void) {
    initialize_ext2_error_table_r(&_et_list);
}

/* For Heimdal compatibility */
void initialize_ext2_error_table_r(struct et_list **list)
{
    struct et_list *et, **end;

    for (end = list, et = *list; et; end = &et->next, et = et->next)
        if (et->table->msgs == text)
            return;
    et = malloc(sizeof(struct et_list));
    if (et == 0) {
        if (!link.table)
            et = &link;
        else
            return;
    }
    et->table = &et_ext2_error_table;
    et->next = 0;
    *end = et;
}