Cloned library NetCDF-C-4.9.2 with extra build files for internal package management.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
768 B

2 years ago
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <hdf5.h>
#include <netcdf.h>
#define LEN 3
int
main(int argc, char** argv)
{
char v5[256];
char vn[256];
char* major, *minor, *patch;
char* p;
int i;
strcpy(v5,H5_VERSION);
major = v5; minor = NULL; patch = NULL;
if((p = strchr(major,'.'))) {*p++ = '\0'; minor = p;}
if((p = strchr(minor,'.'))) {*p++ = '\0'; patch = p;}
vn[0]='\0';
i = LEN - strlen(major);
while(i-- > 0) strcat(vn,"0");
strcat(vn,major);
i = LEN - strlen(minor);
while(i-- > 0) strcat(vn,"0");
strcat(vn,minor);
i = LEN - strlen(patch);
while(i-- > 0) strcat(vn,"0");
strcat(vn,patch);
printf("%s",vn);
return 0;
}