Working towards coordination of -compare, -update and -cut_out

This commit is contained in:
2008-03-22 13:00:38 +00:00
parent 9d77ef7700
commit 6eb3d1ea61
5 changed files with 228 additions and 1 deletions

View File

@ -2720,6 +2720,125 @@ int Findjob_set_action_subjob(struct FindjoB *o, int action,
}
/* ---------------------------- SplitparT ------------------------- */
struct SplitparT {
char *name;
int partno;
int total_parts;
off_t offset;
off_t bytes;
off_t total_bytes;
};
int Splitparts_new(struct SplitparT **o, int count, int flag)
{
int i;
(*o)= TSOB_FELD(struct SplitparT, count);
if((*o)==NULL)
return(-1);
for(i= 0; i<count; i++) {
o[i]->name= NULL;
o[i]->partno= 0;
o[i]->total_parts= 0;
o[i]->offset= 0;
o[i]->bytes= 0;
o[i]->total_bytes= 0;
}
return(1);
}
int Splitparts_destroy(struct SplitparT **o, int count, int flag)
{
int i;
if((*o)==NULL)
return(0);
for(i= 0; i<count; i++) {
if(o[i]->name!=NULL)
free(o[i]->name);
}
free(*o);
*o= NULL;
return(1);
}
int Splitpart_set(struct SplitparT *o, char *name, int partno, int total_parts,
off_t offset, off_t bytes, off_t total_bytes, int flag)
{
o->name= name;
o->partno= partno;
o->total_parts= total_parts;
o->offset= offset;
o->bytes= bytes;
o->total_bytes= total_bytes;
return(1);
}
int Splitpart__read_next_num(char *base_pt, char **next_pt, off_t *num,
int flag)
{
char *cpt, *ept, scale[4];
*num= 0;
for(cpt= base_pt; *cpt!=0 && !isdigit(*cpt); cpt++);
if(*cpt==0)
return(0);
for(ept= cpt; *ept!=0 && isdigit(*ept); ept++)
*num= (*num)*10+(*ept)-'0';
scale[0]= '1';
scale[1]= *ept;
scale[2]= 0;
*num *= (off_t) Scanf_io_size(scale, 0);
if(*ept!=0)
ept++;
*next_pt= ept;
return(1);
}
int Splitpart__parse(char *name, int *partno, int *total_parts,
off_t *offset, off_t *bytes, off_t *total_bytes, int flag)
{
int ret;
off_t num;
char *cpt, *ept;
cpt= name;
ret= Splitpart__read_next_num(name, &ept, &num, 0);
if(ret<=0)
return(ret);
*partno= num;
cpt= ept;
ret= Splitpart__read_next_num(name, &ept, &num, 0);
if(ret<=0)
return(ret);
*total_parts= num;
cpt= ept;
ret= Splitpart__read_next_num(name, &ept, offset, 0);
if(ret<=0)
return(ret);
cpt= ept;
ret= Splitpart__read_next_num(name, &ept, bytes, 0);
if(ret<=0)
return(ret);
cpt= ept;
ret= Splitpart__read_next_num(name, &ept, total_bytes, 0);
if(ret<=0)
return(ret);
return(1);
}
/* ---------------------------- End SplitparT ------------------------- */
/* ------------------------------- Xorriso -------------------------------- */
/** The list of startup file names */
@ -4222,6 +4341,7 @@ much_too_long:;
return(1);
}
/*
@param result Bitfield indicationg type of mismatch
bit0= disk_adr not existing