(need_uid, is_partial): Rename.
(xuheader1, chkflds): Collect all code dealing with index field of vertically split tables in chkflds().
This commit is contained in:
parent
c596577d32
commit
c12cc62875
1 changed files with 7 additions and 6 deletions
|
@ -53,7 +53,7 @@
|
||||||
static char *fname;
|
static char *fname;
|
||||||
static int lineno;
|
static int lineno;
|
||||||
static int human;
|
static int human;
|
||||||
static int ellipsis, need_uid;
|
static int ellipsis, is_partial;
|
||||||
static int cur_type, cur_id;
|
static int cur_type, cur_id;
|
||||||
static void *cur_obj;
|
static void *cur_obj;
|
||||||
static int nflds;
|
static int nflds;
|
||||||
|
@ -325,7 +325,7 @@ defellipsis(int fldno)
|
||||||
if (ca[0].ca_table != cur_type)
|
if (ca[0].ca_table != cur_type)
|
||||||
return gripe("Table %s doesn't support ...", ef_nameof(cur_type));
|
return gripe("Table %s doesn't support ...", ef_nameof(cur_type));
|
||||||
ellipsis = fldno;
|
ellipsis = fldno;
|
||||||
need_uid = 1;
|
is_partial = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,9 +335,12 @@ chkflds(void)
|
||||||
struct castr *ca = ef_cadef(cur_type);
|
struct castr *ca = ef_cadef(cur_type);
|
||||||
int i, len, res = 0;
|
int i, len, res = 0;
|
||||||
|
|
||||||
if (need_uid) {
|
if (is_partial) {
|
||||||
|
/* Require index field */
|
||||||
if (!caflds[0])
|
if (!caflds[0])
|
||||||
return gripe("Header field %s required with ...", ca[0].ca_name);
|
return gripe("Header field %s required with ...", ca[0].ca_name);
|
||||||
|
/* Want the index field again in continued table: */
|
||||||
|
caflds[0] = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -659,8 +662,6 @@ xuheader1(FILE *fp, int type, struct castr ca[])
|
||||||
int ch, i, j, n;
|
int ch, i, j, n;
|
||||||
|
|
||||||
if (human) {
|
if (human) {
|
||||||
/* Allow repetition of the index field in continued table: */
|
|
||||||
caflds[0] = 0;
|
|
||||||
while ((ch = skipfs(fp)) == '\n')
|
while ((ch = skipfs(fp)) == '\n')
|
||||||
lineno++;
|
lineno++;
|
||||||
ungetc(ch, fp);
|
ungetc(ch, fp);
|
||||||
|
@ -760,7 +761,7 @@ xundump(FILE *fp, char *file, int expected_table)
|
||||||
static int
|
static int
|
||||||
xundump2(FILE *fp, int type, struct castr *ca)
|
xundump2(FILE *fp, int type, struct castr *ca)
|
||||||
{
|
{
|
||||||
need_uid = 0;
|
is_partial = 0;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (xuheader1(fp, type, ca) < 0)
|
if (xuheader1(fp, type, ca) < 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue