File: free.c

package info (click to toggle)
minc 2.1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,160 kB
  • sloc: ansic: 82,507; sh: 10,666; yacc: 1,187; perl: 612; makefile: 586; lex: 319
file content (35 lines) | stat: -rw-r--r-- 643 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/** \file free.c
 * \brief MINC 2.0 "free" functions
 ************************************************************************/
#include "minc2.h"
#include <stdlib.h>

/*!
  Free space allocated for string storage by a MINC function.
 \param name_ptr A pointer to the space to be freed.
 */

int 
mifree_name(char *name_ptr)
{
  if (name_ptr == NULL) {
    return (MI_ERROR);
  }
  free(name_ptr);
  return (MI_NOERROR);
}

/*!
  not certain we really need this...
*/
int
mifree_names(char **name_pptr)
{
  if (name_pptr == NULL) {
    return (MI_ERROR);
  }
  while (*name_pptr != NULL) {
    free(*name_pptr++);
  }
  return (MI_NOERROR);
}