# include/libmangle.h File Reference

Go to the source code of this file.

## Data Structures

struct | libmangle_gc_context_t

## Typedefs

typedef void * | libmangle_gc_t
typedef void * | libmangle_tokens_t

## Functions

void | libmangle_release_gc (libmangle_gc_context_t *gc)
libmangle_gc_context_t * | libmangle_generate_gc (void)
void | libmangle_dump_tok (FILE *fp, libmangle_tokens_t p)
void | libmangle_print_decl (FILE *fp, libmangle_tokens_t p)
char * | libmangle_sprint_decl (libmangle_tokens_t r)
libmangle_tokens_t | libmangle_decode_ms_name (libmangle_gc_context_t *gc, const char *name)
char * | libmangle_encode_ms_name (libmangle_gc_context_t *gc, libmangle_tokens_t tok)

## Typedef Documentation

typedef void* libmangle_gc_t

Garbage collector elements. Tracks allocated memory and points to the next element from the same context. Opaque structure.

See also:
  libmangle_gc_context_t

typedef void* libmangle_tokens_t

Generic token instances. Type of token determined by base descriptor in members. Opaque structure.

See also:
  gen_tok()

## Function Documentation

libmangle_tokens_t libmangle_decode_ms_name | ( | libmangle_gc_context_t * | gc,
|  | const char * | name |
| ) |  |  |

Decodes an MSVC export name.

Parameters:

  `[in]` | gc | libmangle_gc_context_t pointer for collecting memory allocations.
  `[in]` | name | MSVC C++ mangled export string.

See also:
  libmangle_sprint_decl()
  libmangle_release_gc()
  libmangle_tokens_t

Returns:
  Token containing information about the mangled string, use libmangle_release_gc() to free after use.

void libmangle_dump_tok | ( | FILE * | fp,
|  | libmangle_tokens_t | p |
| ) |  |  |

Dumps pMToken to a file descriptor for debugging.

Parameters:

  `[in]` | fp | File descriptor to print the token to.
  `[in]` | p | libmangle_tokens_t chain to print.

char* libmangle_encode_ms_name | ( | libmangle_gc_context_t * | gc,
|  | libmangle_tokens_t | tok |
| ) |  |  |

libmangle_gc_context_t* libmangle_generate_gc | ( | void |  | ) |

Constructs a garbage collection context token.

Returns:
  Pointer to context.

See also:
  libmangle_release_gc()

void libmangle_print_decl | ( | FILE * | fp,
|  | libmangle_tokens_t | p |
| ) |  |  |

Prints C++ name to file descriptor.

Parameters:

  `[in]` | fp | Output file descriptor.
  `[in]` | p | Token containing information about the C++ name.

See also:
  libmangle_decode_ms_name()

void libmangle_release_gc | ( | libmangle_gc_context_t * | gc | ) |

Releases memory tracked by context.

Parameters:

  `[in]` | gc | Garbage collection context to work on.

See also:
  libmangle_generate_gc()

char* libmangle_sprint_decl | ( | libmangle_tokens_t | r | ) |

Get pointer to decoded C++ name string. Use free() to release returned string.

Parameters:

  `[in]` | r | C++ name token.

Returns:
  pointer to decoded C++ name string.

See also:
  libmangle_decode_ms_name()