]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | /* |
da23017d NS |
2 | * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
dfc130f3 | 4 | * |
da23017d NS |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as | |
2bd0ea18 | 7 | * published by the Free Software Foundation. |
dfc130f3 | 8 | * |
da23017d NS |
9 | * This program is distributed in the hope that it would be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
dfc130f3 | 13 | * |
da23017d NS |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
2bd0ea18 NS |
17 | */ |
18 | ||
19 | struct field; | |
20 | ||
21 | #define szof(x,y) sizeof(((x *)0)->y) | |
22 | #define szcount(x,y) (szof(x,y) / szof(x,y[0])) | |
23 | ||
24 | typedef enum typnm | |
25 | { | |
26 | TYP_AGF, TYP_AGFL, TYP_AGI, TYP_ATTR, TYP_BMAPBTA, | |
9a048535 | 27 | TYP_BMAPBTD, TYP_BNOBT, TYP_CNTBT, TYP_DATA, |
2bd0ea18 NS |
28 | TYP_DIR2, TYP_DQBLK, TYP_INOBT, TYP_INODATA, TYP_INODE, |
29 | TYP_LOG, TYP_RTBITMAP, TYP_RTSUMMARY, TYP_SB, TYP_SYMLINK, | |
20f35ef4 | 30 | TYP_TEXT, TYP_FINOBT, TYP_NONE |
2bd0ea18 NS |
31 | } typnm_t; |
32 | ||
33 | #define DB_WRITE 1 | |
34 | #define DB_READ 0 | |
35 | ||
36 | typedef void (*opfunc_t)(const struct field *fld, int argc, char **argv); | |
37 | typedef void (*pfunc_t)(int action, const struct field *fld, int argc, char **argv); | |
38 | ||
39 | typedef struct typ | |
40 | { | |
41 | typnm_t typnm; | |
42 | char *name; | |
43 | pfunc_t pfunc; | |
44 | const struct field *fields; | |
6fea8f83 | 45 | const struct xfs_buf_ops *bops; |
2bd0ea18 | 46 | } typ_t; |
c2907bd7 | 47 | extern const typ_t *typtab, *cur_typ; |
2bd0ea18 NS |
48 | |
49 | extern void type_init(void); | |
c2907bd7 | 50 | extern void type_set_tab_crc(void); |
061e316e | 51 | extern void type_set_tab_spcrc(void); |
2bd0ea18 NS |
52 | extern void handle_block(int action, const struct field *fields, int argc, |
53 | char **argv); | |
54 | extern void handle_string(int action, const struct field *fields, int argc, | |
55 | char **argv); | |
56 | extern void handle_struct(int action, const struct field *fields, int argc, | |
57 | char **argv); | |
c6b24b3b NS |
58 | extern void handle_text(int action, const struct field *fields, int argc, |
59 | char **argv); |