File: free.c

package info (click to toggle)
minc 2.2.00-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,624 kB
  • ctags: 8,493
  • sloc: ansic: 84,952; sh: 10,666; yacc: 1,187; makefile: 635; perl: 555; lex: 319; cpp: 69
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);
}