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.
 
 
 
 
 
 

28 lines
885 B

/*********************************************************************
* This is part of the Unidata netCDF package.
* Copyright 2018, UCAR/Unidata
* See COPYRIGHT file for copying and redistribution conditions.
*
* This program is part of the testing of file lengths done by the
* test script tst_lentghs.sh.
*
* $Id: rewrite-scalar.c,v 1.3 2008/10/20 01:48:08 ed Exp $
*********************************************************************/
#include "config.h"
#include <stdio.h>
#include <netcdf.h>
#define ERR do {fflush(stdout); fprintf(stderr, "Error, %s, line: %d\n", __FILE__, __LINE__); return(1);} while (0)
int
main(int ac, char *av[]) {
int ncid, varid, data[] = {42};
if (nc_open(av[1], NC_WRITE, &ncid)) ERR;
if (nc_inq_varid(ncid, av[2], &varid)) ERR;
if (nc_put_var_int(ncid, varid, data)) ERR;
if (nc_close(ncid)) ERR;
return 0;
}