|
From: Jan-Benedict G. <jb...@us...> - 2004-09-20 06:05:42
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9433 Modified Files: CHANGES tparse.c tparse.h util.c Log Message: - Detypedefication for argument parsing functions (these need to be rewritten using the 2.6.x option parsing routines anyway...). Index: CHANGES =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/CHANGES,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CHANGES 20 Sep 2004 05:39:06 -0000 1.3 +++ CHANGES 20 Sep 2004 06:05:29 -0000 1.4 @@ -1,3 +1,7 @@ +Changes from version 0.9.4b to 0.9.4c +===================================== + - Removal for the argument parsing typedefs. + Changes from version 0.9.4a to 0.9.4b ===================================== - Removal of all typedefs. The source now properly uses Index: util.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/util.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- util.c 20 Sep 2004 05:39:07 -0000 1.4 +++ util.c 20 Sep 2004 06:05:29 -0000 1.5 @@ -231,7 +231,7 @@ int -save_dollar (ARGBLK *argblk) +save_dollar (struct argblk *argblk) { struct super_block *sb = (struct super_block *) argblk->arg; struct ods2sb *ods2p = ODS2_SB (sb); @@ -242,7 +242,7 @@ int -save_semicolon (ARGBLK *argblk) +save_semicolon (struct argblk *argblk) { struct super_block *sb = (struct super_block *) argblk->arg; struct ods2sb *ods2p = ODS2_SB (sb); @@ -252,7 +252,9 @@ } -int save_version(ARGBLK *argblk) { +int +save_version (struct argblk *argblk) +{ struct super_block *sb = (struct super_block *) argblk->arg; struct ods2sb *ods2p = ODS2_SB (sb); @@ -261,74 +263,73 @@ } -TPARSE tpa1[]; -TPARSE tpa10[]; -TPARSE tpa11[]; -TPARSE tpa20[]; -TPARSE tpa21[]; -TPARSE tpa30[]; -TPARSE tpa31[]; - +struct tparse tpa1[]; +struct tparse tpa10[]; +struct tparse tpa11[]; +struct tparse tpa20[]; +struct tparse tpa21[]; +struct tparse tpa30[]; +struct tparse tpa31[]; -TPARSE tpa1[] = { - { "dollar", tpa10, NULL, 0, NULL, 0 }, - { "version", tpa20, NULL, 0, NULL, 0 }, - { "semicolon", tpa30, NULL, 0, NULL, 0 }, - { "lowercase", tpa1, save_lowercase, 0, NULL, 0 }, - { "raw", tpa1, save_raw, 0, NULL, 0 }, - { TPA_EOS, TPA_EXIT, NULL, 0, NULL, 0 }, - TPA_END +struct tparse tpa1[] = { + { "dollar", tpa10, NULL, 0, NULL, 0 }, + { "version", tpa20, NULL, 0, NULL, 0 }, + { "semicolon", tpa30, NULL, 0, NULL, 0 }, + { "lowercase", tpa1, save_lowercase, 0, NULL, 0 }, + { "raw", tpa1, save_raw, 0, NULL, 0 }, + { TPA_EOS, TPA_EXIT, NULL, 0, NULL, 0 }, + TPA_END, }; - - -TPARSE tpa10[] = { - { "=", tpa11, NULL, 0, NULL, 0 }, - TPA_END +struct tparse tpa10[] = { + { "=", tpa11, NULL, 0, NULL, 0 }, + TPA_END, }; -TPARSE tpa11[] = { - { TPA_ANY, tpa1, save_dollar, 0, NULL, 0 }, - TPA_END +struct tparse tpa11[] = { + { TPA_ANY, tpa1, save_dollar, 0, NULL, 0 }, + TPA_END, }; -TPARSE tpa20[] = { - { "=", tpa21, NULL, 0, NULL, 0 }, - TPA_END +struct tparse tpa20[] = { + { "=", tpa21, NULL, 0, NULL, 0 }, + TPA_END, }; -TPARSE tpa21[] = { - { "all", tpa1, save_version, SB_M_VERSALL, NULL, 0 }, - { "highest", tpa1, save_version, SB_M_VERSHIGH, NULL, 0 }, - { "none", tpa1, save_version, SB_M_VERSNONE, NULL, 0 }, - TPA_END +struct tparse tpa21[] = { + { "all", tpa1, save_version, SB_M_VERSALL, NULL, 0 }, + { "highest", tpa1, save_version, SB_M_VERSHIGH, NULL, 0 }, + { "none", tpa1, save_version, SB_M_VERSNONE, NULL, 0 }, + TPA_END, }; -TPARSE tpa30[] = { - { "=", tpa31, NULL, 0, NULL, 0 }, - TPA_END +struct tparse tpa30[] = { + { "=", tpa31, NULL, 0, NULL, 0 }, + TPA_END, }; -TPARSE tpa31[] = { - { TPA_ANY, tpa1, save_semicolon, 0, NULL, 0 }, - TPA_END +struct tparse tpa31[] = { + { TPA_ANY, tpa1, save_semicolon, 0, NULL, 0 }, + TPA_END, }; -int parse_options(struct super_block *sb, char *options) { - ARGBLK argblk; +int +parse_options (struct super_block *sb, char *options) { + struct argblk argblk; argblk.str = options; - argblk.arg = (long unsigned)sb; - return tparse(&argblk, tpa1); + argblk.arg = (unsigned long) sb; + return tparse (&argblk, tpa1); } - /* * Ok, I give up :-) for some reason unknown to me the addition of 2 seconds * is needed to get the correct time. * It works for a file created 1-jan-1971 and for a file created 1-jan-2038 * as well as for files created 1992 and 2003. + * + * FIXME: Needs 2.4.x i_[cma]time -> 2.6.x i_[cma]time porting!!! */ time_t vms2unix_sec (u16 *vms_timestamp) @@ -347,7 +348,7 @@ int get_hardsect_size (int xx) { - printk (KERN_ERR "%s: Not implemented!\n", __FUNCTION__); + printk (KERN_ERR "%s: Not implemented, returning 512!\n", __FUNCTION__); return 512; } Index: tparse.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/tparse.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tparse.c 20 Sep 2004 05:51:29 -0000 1.2 +++ tparse.c 20 Sep 2004 06:05:29 -0000 1.3 @@ -17,9 +17,11 @@ #include "tparse.h" -int tparse(ARGBLK *argblk, TPARSE *tpa) { - int idx; - int found; +int +tparse (struct argblk *argblk, struct tparse *tpa) +{ + int idx; + int found; while (1) { char *str = argblk->str; @@ -67,8 +69,8 @@ default: { if (((void **)tpa[idx].type)[0] == (void *)244) { - TPARSE *tmptpa = ((TPARSE **)tpa[idx].type)[1]; - ARGBLK tmpargblk; + struct tparse *tmptpa = ((struct tparse **)tpa[idx].type)[1]; + struct argblk tmpargblk; tmpargblk.options = argblk->options; tmpargblk.arg = argblk->arg; Index: tparse.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/tparse.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tparse.h 20 Sep 2004 05:52:49 -0000 1.2 +++ tparse.h 20 Sep 2004 06:05:29 -0000 1.3 @@ -18,37 +18,36 @@ #define TPA_END {NULL, NULL, NULL, 0, NULL, 0} /* - The following definition must match the size of void * -*/ - -#define lu (long unsigned) + * FIXME: * The following definition must match the size of "void *" + * + * FIXME "lu" is used like a function: lu(something) + */ +#define lu (unsigned long) /* - The string *str is pointing to must be writable - or tparse will fail. -*/ - -typedef struct argblk { - long unsigned options; - char *str; - char *token; - long unsigned number; - long unsigned param; - long unsigned arg; - long unsigned mask; - long unsigned *mskadr; -} ARGBLK; - + * The string *str is pointing to must be writable + * or tparse will fail. + */ +struct argblk { + unsigned long options; + char *str; + char *token; + unsigned long number; + unsigned long param; + unsigned long arg; + unsigned long mask; + unsigned long *mskadr; +}; -typedef struct tparse { - char *type; - struct tparse *label; - int (*action)(ARGBLK *); - unsigned long mask; - unsigned long *mskadr; - unsigned long param; -} TPARSE; +struct tparse { + char *type; + struct tparse *label; + int (*action)(struct argblk *); + unsigned long mask; + unsigned long *mskadr; + unsigned long param; +}; -int tparse(ARGBLK *argblk, TPARSE *tpa); +extern int tparse (struct argblk *argblk, struct tparse *tpa); #endif /* _TPARSE_H */ |