MISR Toolkit  1.5.1
MtkDataBufferFree.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkDataBufferFree =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11  Copyright 2005, California Institute of Technology.
12  ALL RIGHTS RESERVED.
13  U.S. Government Sponsorship acknowledged.
14 
15 ============================================================================*/
16 
17 #include "MisrUtil.h"
18 #include "MisrError.h"
19 #include <stdlib.h>
20 
34  MTKt_DataBuffer *databuf )
35 {
37  /* Data buffer structure */
38 
39  if (databuf == NULL)
40  return MTK_SUCCESS;
41 
42  /* Free 2D buffer */
43  if (!databuf->imported)
44  if (databuf->dataptr != NULL)
45  free(databuf->dataptr);
46 
47  /* Free 1D Illiffe vector */
48  if (databuf->vdata != NULL)
49  free(databuf->vdata);
50 
51  *databuf = dbuf;
52 
53  return MTK_SUCCESS;
54 }
2-dimensional Data Buffer
Definition: MisrUtil.h:98
void ** vdata
Definition: MisrUtil.h:105
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
#define MTKT_DATABUFFER_INIT
Definition: MisrUtil.h:109
void * dataptr
Definition: MisrUtil.h:106
MTKt_status
Definition: MisrError.h:11
MTKt_boolean imported
Definition: MisrUtil.h:103

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:51