putallmv.c

来自「支持各种栅格图像和矢量图像读取的库」· C语言 代码 · 共 57 行

C
57
字号
#include <stdlib.h>#include "csf.h"#include "csfimpl.h"/* make all cells missing value in map * RputAllMV writes a missing values to all the cells in a * map. For this is allocates a buffer to hold one row at a * time. * returns 1 if succesfull, 0 in case of an error */int RputAllMV(	MAP *m){	size_t i,nc,nr;	void *buffer;	CSF_CR cr;	CHECKHANDLE_GOTO(m, error);	if(! WRITE_ENABLE(m))	{		M_ERROR(NOACCESS);		goto error;	}	cr = RgetCellRepr(m);	nc = RgetNrCols(m);	buffer = Rmalloc(m,nc);	if(buffer == NULL)	{		M_ERROR(NOCORE);		goto error;	}	/*  Fill buffer with determined Missingvalue*/	SetMemMV(buffer, nc, cr);	nr = RgetNrRows(m);	for(i = 0 ; i < nr; i++)	 if (RputRow(m, i, buffer) != nc)	 {	    M_ERROR(WRITE_ERROR);	    goto error_f;	 }	CSF_FREE(buffer);	CsfSetVarTypeMV( &(m->raster.minVal), cr);	CsfSetVarTypeMV( &(m->raster.maxVal), cr);	return(1);error_f:  	CSF_FREE(buffer);error:	return(0);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?