~steve-sk2/mingw-w64/oneiric

« back to all changes in this revision

Viewing changes to mingw-w64-libraries/libmangle/include/libmangle.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-11-18 00:04:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101118000446-xe24b423su55onyl
Tags: 1.0+20101003-1
* New maintainer. (Closes: #594371.)
* New upstream snapshot:
  - Includes getopt.h. (Closes: #569914.)
* Build g++ for Win64. (Closes: #600451.)
* Standards-Version 3.9.1 (new packaging).
* Include patch from
  http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64?view=revision&revision=3715
  as suggested by Rafaël Carré.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
   Copyright (c) 2009, 2010 mingw-w64 project
3
 
 
4
 
   Contributing authors: Kai Tietz, Jonathan Yong
5
 
 
6
 
   Permission is hereby granted, free of charge, to any person obtaining a
7
 
   copy of this software and associated documentation files (the "Software"),
8
 
   to deal in the Software without restriction, including without limitation
9
 
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
 
   and/or sell copies of the Software, and to permit persons to whom the
11
 
   Software is furnished to do so, subject to the following conditions:
12
 
 
13
 
   The above copyright notice and this permission notice shall be included in
14
 
   all copies or substantial portions of the Software.
15
 
 
16
 
   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
 
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
 
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
 
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
 
   DEALINGS IN THE SOFTWARE.
23
 
*/
24
 
 
25
 
#ifndef _LIBMANGLE_HXX
26
 
#define _LIBMANGLE_HXX
27
 
 
28
 
#ifdef __cplusplus
29
 
extern "C" {
30
 
#endif
31
 
 
32
 
/**
33
 
 * Garbage collector elements.
34
 
 * Tracks allocated memory and points to the next element from the same context.
35
 
 * @see sGcCtx
36
 
 */
37
 
typedef void *pGcElem;
38
 
 
39
 
/**
40
 
 * Garbage collector context.
41
 
 * Tracks first and last of elements in gc context.
42
 
 * @see generate_gc()
43
 
 * @see release_gc()
44
 
 */
45
 
typedef struct sGcCtx {
46
 
  pGcElem head;                /**< Pointer to first gc element in context.*/
47
 
  pGcElem tail;                /**< Pointer to last gc element in context. */
48
 
} sGcCtx;
49
 
 
50
 
/**
51
 
 * Generic token instances.
52
 
 * Type of token determined by base descriptor in members.
53
 
 * Base descriptor header available in all members through type punning.
54
 
 * @see gen_tok()
55
 
 */
56
 
typedef void *pMToken;
57
 
 
58
 
/**
59
 
 * Releases memory tracked by context.
60
 
 * @param[in] gc Garbage collection context to work on.
61
 
 * @see generate_gc()
62
 
 */
63
 
void release_gc (sGcCtx *gc);
64
 
 
65
 
/**
66
 
 * Constructs a garbage collection context token.
67
 
 * @return Pointer to context.
68
 
 * @see release_gc()
69
 
 */
70
 
sGcCtx *generate_gc (void);
71
 
 
72
 
/**
73
 
 * Dumps pMToken to a file descriptor for debugging.
74
 
 * @param[in] fp File descriptor to print the token to.
75
 
 * @param[in] p pMToken chain to print.
76
 
 */
77
 
void dump_tok (FILE *fp, pMToken p);
78
 
 
79
 
/** 
80
 
 * Prints C++ name to file descriptor.
81
 
 * @param[in] fp Output file descriptor.
82
 
 * @param[in] p Token containing information about the C++ name.
83
 
 * @see decode_ms_name()
84
 
 */
85
 
void print_decl (FILE *fp, pMToken p);
86
 
 
87
 
/** 
88
 
 * Get pointer to decoded C++ name string.
89
 
 * Use free() to release returned string.
90
 
 * @param[in] r C++ name token.
91
 
 * @return pointer to decoded C++ name string.
92
 
 * @see decode_ms_name()
93
 
 */
94
 
char *sprint_decl (pMToken r);
95
 
 
96
 
/**
97
 
 * Decodes an MSVC export name.
98
 
 * @param[in] gc sGcCtx pointer for collecting memory allocations.
99
 
 * @param[in] name MSVC C++ mangled export string.
100
 
 * @see sprint_decl()
101
 
 * @see release_gc()
102
 
 * @see pMToken
103
 
 * @return Token containing information about the mangled string,
104
 
 * use release_gc() to free after use.
105
 
 */
106
 
pMToken decode_ms_name (sGcCtx *gc, const char *name);
107
 
char *encode_ms_name (sGcCtx *gc, pMToken tok);
108
 
 
109
 
#ifdef __cplusplus
110
 
}
111
 
#endif
112
 
 
113
 
#endif