File: free.c

package info (click to toggle)
libminc 2.4.07-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,288 kB
  • sloc: ansic: 57,268; cpp: 3,654; sh: 100; makefile: 23; ruby: 18
file content (35 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (9)
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);
}

/**
 * Free list of names
 * 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);
}

/* kate: indent-mode cstyle; indent-width 2; replace-tabs on; */