~ubuntu-branches/ubuntu/gutsy/xmedcon/gutsy

« back to all changes in this revision

Viewing changes to source/m-structs.c

  • Committer: Bazaar Package Importer
  • Author(s): Roland Marcus Rutschmann
  • Date: 2005-10-10 19:34:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010193415-ca472c8k26x2q0ac
Tags: 0.9.8.7-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 *                MdcCleanUpFI()        - Clean up FILEINFO struct         *
38
38
 *                                                                         *
39
39
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
40
 
/* $Id: m-structs.c,v 1.64 2005/05/16 07:35:02 enlf Exp $ 
 
40
/* $Id: m-structs.c,v 1.68 2005/10/04 20:00:34 enlf Exp $ 
41
41
 */
42
42
 
43
43
/*
633
633
    dest->intercept = 0.;
634
634
  }
635
635
 
636
 
  dest->frame_number   = src->frame_number;
637
 
  dest->slice_start    = src->slice_start;
 
636
  dest->frame_number = src->frame_number;
 
637
  dest->slice_start  = src->slice_start;
638
638
 
639
639
  dest->quant_units  = src->quant_units;
640
640
  dest->calibr_units = src->calibr_units;
642
642
  dest->pixel_xsize  = src->pixel_xsize;
643
643
  dest->pixel_ysize  = src->pixel_ysize;
644
644
  dest->slice_width  = src->slice_width;
645
 
  dest->recon_scale      = src->recon_scale;
 
645
  dest->recon_scale  = src->recon_scale;
646
646
 
647
647
  for (i=0; i<3; i++) dest->image_pos_dev[i] = src->image_pos_dev[i];
648
648
  for (i=0; i<6; i++) dest->image_orient_dev[i] = src->image_orient_dev[i];
657
657
    dest->sdata = (STATIC_DATA *)malloc(sizeof(STATIC_DATA));
658
658
    if (dest->sdata == NULL) return("Failed to copy static data struct");
659
659
    MdcCopySD(dest->sdata,src->sdata);
 
660
  }else{
 
661
    dest->sdata = NULL;
660
662
  }
661
663
 
 
664
  /* no copying here; just initialize plugb */
 
665
  dest->plugb = NULL;
 
666
 
662
667
  return(NULL);
663
668
}
664
669
 
665
 
/* KEEP_FILES : preserve file pointers - safe when copy will be replacement */
 
670
/* KEEP_FILES = preserve file pointers; src pointers are masked (!) */
666
671
char *MdcCopyFI(FILEINFO *dest, FILEINFO *src, int COPY_IMAGES, int KEEP_FILES)
667
672
{
668
673
  char *msg=NULL;
671
676
  MdcInitFI(dest,src->ifname);
672
677
 
673
678
  if (KEEP_FILES == MDC_YES) {
 
679
    /* copy pointers */
674
680
    dest->ifp = src->ifp;
675
681
    dest->ifp_raw = src->ifp_raw;
676
682
    dest->ofp = src->ofp;
677
683
    dest->ofp_raw = src->ofp_raw;
 
684
    /* mask src pointers */
 
685
    src->ifp = NULL; src->ifp_raw = NULL;
 
686
    src->ofp = NULL; src->ofp_raw = NULL;
678
687
  }
679
688
 
680
689
  memcpy(dest->ipath,src->ipath,MDC_MAX_PATH);
763
772
      dest->comm_length = src->comm_length;
764
773
      memcpy(dest->comment,src->comment,dest->comm_length);
765
774
    }
 
775
  }else{
 
776
   dest->comm_length = 0; dest->comment = NULL; 
766
777
  }
767
778
 
768
779
  /* copy ACQ_DATA structs */
835
846
    dest->mod = (MOD_INFO *)malloc(sizeof(MOD_INFO));
836
847
    if (dest->mod == NULL) return("Failed to copy MOD_INFO struct");
837
848
    MdcCopyMOD(dest->mod,src->mod);
 
849
  }else{
 
850
    dest->mod = NULL;
838
851
  }
839
852
 
840
853
  return(NULL);