]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - db/field.h
2 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
104 FLDT_DIR2_LEAF_ENTRY
,
162 FLDT_ZZZ
/* mark last entry */
165 typedef int (*offset_fnc_t
)(void *obj
, int startoff
, int idx
);
166 #define OI(o) ((offset_fnc_t)(__psint_t)(o))
168 typedef int (*count_fnc_t
)(void *obj
, int startoff
);
169 #define CI(c) ((count_fnc_t)(__psint_t)(c))
185 #define FLD_ABASE1 1 /* field array base is 1 not 0 */
186 #define FLD_SKIPALL 2 /* skip this field in an all-fields print */
187 #define FLD_ARRAY 4 /* this field is an array */
188 #define FLD_OFFSET 8 /* offset value is a function pointer */
189 #define FLD_COUNT 16 /* count value is a function pointer */
191 typedef int (*size_fnc_t
)(void *obj
, int startoff
, int idx
);
192 #define SI(s) ((size_fnc_t)(__psint_t)(s))
194 typedef struct ftattr
203 const field_t
*subfld
;
205 extern const ftattr_t ftattrtab
[];
210 #define FTARG_SKIPZERO 1 /* skip 0 words */
211 #define FTARG_DONULL 2 /* make -1 words be "null" */
212 #define FTARG_SKIPNULL 4 /* skip -1 words */
213 #define FTARG_SIGNED 8 /* field value is signed */
214 #define FTARG_SIZE 16 /* size field is a function */
215 #define FTARG_SKIPNMS 32 /* skip printing names this time */
216 #define FTARG_OKEMPTY 64 /* ok if this (union type) is empty */
218 extern int bitoffset(const field_t
*f
, void *obj
, int startoff
,
220 extern int fcount(const field_t
*f
, void *obj
, int startoff
);
221 extern const field_t
*findfield(char *name
, const field_t
*fields
,
222 void *obj
, int startoff
);
223 extern int fsize(const field_t
*f
, void *obj
, int startoff
,