]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - db/field.h
2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
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
7 * published by the Free Software Foundation.
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.
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
45 /* attr 3 specific fields */
100 FLDT_DIR2_DATA_UNION
,
105 FLDT_DIR2_LEAF_ENTRY
,
119 FLDT_DIR3_DATA_UNION
,
123 /* dir v2/3 node fields */
157 /* CRC enabled symlink */
176 FLDT_ZZZ
/* mark last entry */
179 typedef int (*offset_fnc_t
)(void *obj
, int startoff
, int idx
);
180 #define OI(o) ((offset_fnc_t)(__psint_t)(o))
182 typedef int (*count_fnc_t
)(void *obj
, int startoff
);
183 #define CI(c) ((count_fnc_t)(__psint_t)(c))
199 #define FLD_ABASE1 1 /* field array base is 1 not 0 */
200 #define FLD_SKIPALL 2 /* skip this field in an all-fields print */
201 #define FLD_ARRAY 4 /* this field is an array */
202 #define FLD_OFFSET 8 /* offset value is a function pointer */
203 #define FLD_COUNT 16 /* count value is a function pointer */
205 typedef int (*size_fnc_t
)(void *obj
, int startoff
, int idx
);
206 #define SI(s) ((size_fnc_t)(__psint_t)(s))
208 typedef struct ftattr
217 const field_t
*subfld
;
219 extern const ftattr_t ftattrtab
[];
224 #define FTARG_SKIPZERO 1 /* skip 0 words */
225 #define FTARG_DONULL 2 /* make -1 words be "null" */
226 #define FTARG_SKIPNULL 4 /* skip -1 words */
227 #define FTARG_SIGNED 8 /* field value is signed */
228 #define FTARG_SIZE 16 /* size field is a function */
229 #define FTARG_SKIPNMS 32 /* skip printing names this time */
230 #define FTARG_OKEMPTY 64 /* ok if this (union type) is empty */
232 extern int bitoffset(const field_t
*f
, void *obj
, int startoff
,
234 extern int fcount(const field_t
*f
, void *obj
, int startoff
);
235 extern const field_t
*findfield(char *name
, const field_t
*fields
,
236 void *obj
, int startoff
);
237 extern int fsize(const field_t
*f
, void *obj
, int startoff
,