Back to index

glibc  2.9
gconv_close.c File Reference
#include <stdlib.h>
#include <gconv_int.h>

Go to the source code of this file.


int internal_function __gconv_close (__gconv_t cd)

Function Documentation

Definition at line 28 of file gconv_close.c.

  struct __gconv_step *srunp;
  struct __gconv_step_data *drunp;
  size_t nsteps;

  /* Free all resources by calling destructor functions and release
     the implementations.  */
  srunp = cd->__steps;
  nsteps = cd->__nsteps;
  drunp = cd->__data;
      struct __gconv_trans_data *transp;

      transp = drunp->__trans;
      while (transp != NULL)
         struct __gconv_trans_data *curp = transp;
         transp = transp->__next;

         if (__builtin_expect (curp->__trans_end_fct != NULL, 0))
           curp->__trans_end_fct (curp->__data);

         free (curp);

      if (!(drunp->__flags & __GCONV_IS_LAST) && drunp->__outbuf != NULL)
       free (drunp->__outbuf);
  while (!((drunp++)->__flags & __GCONV_IS_LAST));

  /* Free the data allocated for the descriptor.  */
  free (cd);

  /* Close the participating modules.  */
  return __gconv_close_transform (srunp, nsteps);

Here is the call graph for this function:

Here is the caller graph for this function: