Пример #1
0
static IDL_VPTR IDLOldRawWriteHeader(int argc,IDL_VPTR *argv) {
  int s=0;
  IDL_LONG unit=0;
  IDL_FILE_STAT stat;

  struct RadarIDLParm *iprm=NULL;
  struct RawIDLData *iraw=NULL;
  FILE *fp;

  char vstring[256];

  IDL_ENSURE_SCALAR(argv[0]);
  IDL_ENSURE_STRUCTURE(argv[1]);
  IDL_ENSURE_STRUCTURE(argv[2]);
  IDL_EXCLUDE_EXPR(argv[1]);
  IDL_EXCLUDE_EXPR(argv[2]);

  unit=IDL_LongScalar(argv[0]);

  s=IDL_FileEnsureStatus(IDL_MSG_RET,unit,IDL_EFS_USER);

  if (s==FALSE) {
    s=-1;
    return (IDL_GettmpLong(s));
  }

  /* Get information about the file */

  IDL_FileFlushUnit(unit);
  IDL_FileStat(unit,&stat);

  /* Find the file pointer */

  fp=stat.fptr;

  if (fp==NULL) {
    s=-1;
    return (IDL_GettmpLong(s));
  }

  iprm=(struct RadarIDLParm *) argv[1]->value.s.arr->data;
  iraw=(struct RawIDLData *) argv[2]->value.s.arr->data;

  sprintf(vstring,"%d.%.3d",(int) iraw->revision.major,
	                    (int) iraw->revision.minor);
  s=OldRawHeaderFwrite(fp,"rawwrite",vstring,iraw->thr,"IDL output");

  return (IDL_GettmpLong(s));
}
Пример #2
0
int32 OldRawIDLWriteHeader(int argc,char *argv[]) {

  struct RadarIDLParm *idlprm;
  struct RawIDLData *idlraw;

  IDL_FILE_STAT stat;
  FILE *fp;
  int unit; 
  int s;

  char vstring[256];

 
  unit = *( (int32 *) argv[0]);

  /* Make sure that the "STDIO" keyword was used to
   * open the file in IDL.
   */

  s=IDL_FileEnsureStatus(IDL_MSG_RET,unit,IDL_EFS_STDIO);
  if (s==FALSE) return -1;

  /* Get information about the file */

  IDL_FileStat(unit,&stat);
 
  /* Find the file pointer */

  fp=stat.fptr; 

  fflush(fp);
  
  if (fp==NULL) return -1;

  idlprm=(struct RadarIDLParm *) argv[1];
  idlraw=(struct RawIDLData *) argv[2];

  sprintf(vstring,"%d.%.3d",idlraw->revision.major,idlraw->revision.minor);
  s=OldRawHeaderFwrite(fp,"rawwrite",vstring,idlraw->thr,"IDL output");

  return s;
}