MISR Toolkit  1.5.1
MtkDataBufferFree3D.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkDataBufferFree3D =
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_DataBuffer3D *databuf )
35 {
37  /* Data buffer structure */
38 
39  if (databuf == NULL)
40  return MTK_SUCCESS;
41 
42  /* Free 3D buffer */
43  if (databuf->dataptr != NULL)
44  free(databuf->dataptr);
45 
46  /* Free Illiffe vectors */
47  if (databuf->vdata != NULL) {
48  if (databuf->vdata[0] != NULL) {
49  /* Free 2D Illiffe vector */
50  free(databuf->vdata[0]);
51  }
52  /* Free 1D Illiffe vector */
53  free(databuf->vdata);
54  }
55 
56  *databuf = dbuf;
57 
58  return MTK_SUCCESS;
59 }
void *** vdata
Definition: MisrUtil.h:136
3-dimensional Data Buffer
Definition: MisrUtil.h:129
MTKt_status MtkDataBufferFree3D(MTKt_DataBuffer3D *databuf)
Free 3-dimensional data buffer (a buffer stack)
#define MTKT_DATABUFFER3D_INIT
Definition: MisrUtil.h:140
MTKt_status
Definition: MisrError.h:11

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