Back to index

salome-med  6.5.0
Functions
mprint_version.cxx File Reference
#include <med.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file mprint_version.cxx.

{
  med_idt aFid = MEDfileOpen(argv[1],MED_ACC_RDONLY);
  if(aFid < 0)
    exit(1);

  med_int aMajor, aMinor, aRelease;
  med_err aRet = MEDfileNumVersionRd(aFid,&aMajor,&aMinor,&aRelease);
  MEDfileClose(aFid);
  if(aRet < 0) {
    // VSR: simulate med 2.3.6 behavior, med file version is assumed to 2.1
    aMajor=2;
    aMinor=aRelease=-1;
  }

  printf("%d.%d.%d\n",aMajor,aMinor,aRelease);
}