]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - db/type.h
xfs_db: dump refcount btree data
[thirdparty/xfsprogs-dev.git] / db / type.h
CommitLineData
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
19struct field;
20
21#define szof(x,y) sizeof(((x *)0)->y)
22#define szcount(x,y) (szof(x,y) / szof(x,y[0]))
23
24typedef enum typnm
25{
26 TYP_AGF, TYP_AGFL, TYP_AGI, TYP_ATTR, TYP_BMAPBTA,
9fb2cb27 27 TYP_BMAPBTD, TYP_BNOBT, TYP_CNTBT, TYP_RMAPBT, TYP_REFCBT, 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
36typedef void (*opfunc_t)(const struct field *fld, int argc, char **argv);
37typedef void (*pfunc_t)(int action, const struct field *fld, int argc, char **argv);
38
39typedef 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;
86769b32
DC
46 unsigned long crc_off;
47#define TYP_F_NO_CRC_OFF (-1UL)
2bd0ea18 48} typ_t;
c2907bd7 49extern const typ_t *typtab, *cur_typ;
2bd0ea18
NS
50
51extern void type_init(void);
c2907bd7 52extern void type_set_tab_crc(void);
061e316e 53extern void type_set_tab_spcrc(void);
2bd0ea18
NS
54extern void handle_block(int action, const struct field *fields, int argc,
55 char **argv);
56extern void handle_string(int action, const struct field *fields, int argc,
57 char **argv);
58extern void handle_struct(int action, const struct field *fields, int argc,
59 char **argv);
c6b24b3b
NS
60extern void handle_text(int action, const struct field *fields, int argc,
61 char **argv);