2010-07-23 Jonathan Yong <jon_y@users.sourceforge.net>
* include/libmangle.h: Rename libmangle_gc_context to
libmangle_gc_context_t to better conform to standards.
Likewise for libmangle_gc to libmangle_gc_t.
Likewise for libmangle_tokens to libmangle_tokens_t.
* src/m_token.h: Likewise.
* src/m_ms.h: Likewise.
* src/m_token.c: Likewise.
* src/m_ms.c: Likewise.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@2929 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-libraries/libmangle/ChangeLog b/mingw-w64-libraries/libmangle/ChangeLog
index 6959c8b..36cd9e9 100644
--- a/mingw-w64-libraries/libmangle/ChangeLog
+++ b/mingw-w64-libraries/libmangle/ChangeLog
@@ -1,6 +1,17 @@
+2010-07-23 Jonathan Yong <jon_y@users.sourceforge.net>
+
+ * include/libmangle.h: Rename libmangle_gc_context to
+ libmangle_gc_context_t to better conform to standards.
+ Likewise for libmangle_gc to libmangle_gc_t.
+ Likewise for libmangle_tokens to libmangle_tokens_t.
+ * src/m_token.h: Likewise.
+ * src/m_ms.h: Likewise.
+ * src/m_token.c: Likewise.
+ * src/m_ms.c: Likewise.
+
2010-07-22 Jonathan Yong <jon_y@users.sourceforge.net>
- * include/libmangle: Rename pGcElem to libmangle_gc.
+ * include/libmangle.h: Rename pGcElem to libmangle_gc.
Rename sGcCtx to libmangle_gc_context.
Rename pMToken to libmangle_tokens.
Rename release_gc to libmangle_release_gc.
diff --git a/mingw-w64-libraries/libmangle/include/libmangle.h b/mingw-w64-libraries/libmangle/include/libmangle.h
index 6fb31be..a689d16 100644
--- a/mingw-w64-libraries/libmangle/include/libmangle.h
+++ b/mingw-w64-libraries/libmangle/include/libmangle.h
@@ -32,9 +32,10 @@
/**
* Garbage collector elements.
* Tracks allocated memory and points to the next element from the same context.
- * @see libmangle_gc_context
+ * Opaque structure.
+ * @see libmangle_gc_context_t
*/
-typedef void *libmangle_gc;
+typedef void *libmangle_gc_t;
/**
* Garbage collector context.
@@ -42,39 +43,39 @@
* @see generate_gc()
* @see release_gc()
*/
-typedef struct libmangle_gc_context {
- libmangle_gc head; /**< Pointer to first gc element in context.*/
- libmangle_gc tail; /**< Pointer to last gc element in context. */
-} libmangle_gc_context;
+typedef struct libmangle_gc_context_t {
+ libmangle_gc_t head; /**< Pointer to first gc element in context.*/
+ libmangle_gc_t tail; /**< Pointer to last gc element in context. */
+} libmangle_gc_context_t;
/**
* Generic token instances.
* Type of token determined by base descriptor in members.
- * Base descriptor header available in all members through type punning.
+ * Opaque structure.
* @see gen_tok()
*/
-typedef void *libmangle_tokens;
+typedef void *libmangle_tokens_t;
/**
* Releases memory tracked by context.
* @param[in] gc Garbage collection context to work on.
* @see libmangle_generate_gc()
*/
-void libmangle_release_gc (libmangle_gc_context *gc);
+void libmangle_release_gc (libmangle_gc_context_t *gc);
/**
* Constructs a garbage collection context token.
* @return Pointer to context.
* @see libmangle_release_gc()
*/
-libmangle_gc_context *libmangle_generate_gc (void);
+libmangle_gc_context_t *libmangle_generate_gc (void);
/**
* Dumps pMToken to a file descriptor for debugging.
* @param[in] fp File descriptor to print the token to.
- * @param[in] p libmangle_tokens chain to print.
+ * @param[in] p libmangle_tokens_t chain to print.
*/
-void libmangle_dump_tok (FILE *fp, libmangle_tokens p);
+void libmangle_dump_tok (FILE *fp, libmangle_tokens_t p);
/**
* Prints C++ name to file descriptor.
@@ -82,7 +83,7 @@
* @param[in] p Token containing information about the C++ name.
* @see libmangle_decode_ms_name()
*/
-void libmangle_print_decl (FILE *fp, libmangle_tokens p);
+void libmangle_print_decl (FILE *fp, libmangle_tokens_t p);
/**
* Get pointer to decoded C++ name string.
@@ -91,20 +92,20 @@
* @return pointer to decoded C++ name string.
* @see libmangle_decode_ms_name()
*/
-char *libmangle_sprint_decl (libmangle_tokens r);
+char *libmangle_sprint_decl (libmangle_tokens_t r);
/**
* Decodes an MSVC export name.
- * @param[in] gc libmangle_gc_context pointer for collecting memory allocations.
+ * @param[in] gc libmangle_gc_context_t pointer for collecting memory allocations.
* @param[in] name MSVC C++ mangled export string.
* @see libmangle_sprint_decl()
* @see libmangle_release_gc()
- * @see libmangle_tokens
+ * @see libmangle_tokens_t
* @return Token containing information about the mangled string,
* use libmangle_release_gc() to free after use.
*/
-libmangle_tokens libmangle_decode_ms_name (libmangle_gc_context *gc, const char *name);
-char *libmangle_encode_ms_name (libmangle_gc_context *gc, libmangle_tokens tok);
+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);
#ifdef __cplusplus
}
diff --git a/mingw-w64-libraries/libmangle/src/m_ms.c b/mingw-w64-libraries/libmangle/src/m_ms.c
index 239e574..49479df 100644
--- a/mingw-w64-libraries/libmangle/src/m_ms.c
+++ b/mingw-w64-libraries/libmangle/src/m_ms.c
@@ -90,7 +90,7 @@
static uMToken *get_ext_data_type (sMSCtx *c, uMToken *superType);
uMToken *
-libmangle_decode_ms_name (libmangle_gc_context *gc, const char *name)
+libmangle_decode_ms_name (libmangle_gc_context_t *gc, const char *name)
{
sMSCtx ctx;
sCached ZNameList, ArgList, TempArgList;
@@ -141,7 +141,7 @@
}
char *
-libmangle_encode_ms_name (libmangle_gc_context *gc, uMToken *tok)
+libmangle_encode_ms_name (libmangle_gc_context_t *gc, uMToken *tok)
{
return NULL;
}
diff --git a/mingw-w64-libraries/libmangle/src/m_ms.h b/mingw-w64-libraries/libmangle/src/m_ms.h
index 75a14c6..240a3ba 100644
--- a/mingw-w64-libraries/libmangle/src/m_ms.h
+++ b/mingw-w64-libraries/libmangle/src/m_ms.h
@@ -62,7 +62,7 @@
} sCached;
typedef struct sMSCtx {
- libmangle_gc_context *gc;
+ libmangle_gc_context_t *gc;
const char *name; /**< MSVC export name. */
const char *end; /**< Last character in the export name. */
const char *pos; /**< Export name processing position marker. */
@@ -89,7 +89,7 @@
* @return Token containing information about the mangled string,
* use libmangle_release_gc() to free after use.
*/
-uMToken *libmangle_decode_ms_name (libmangle_gc_context *gc, const char *name);
-char *libmangle_encode_ms_name (libmangle_gc_context *gc, uMToken *tok);
+uMToken *libmangle_decode_ms_name (libmangle_gc_context_t *gc, const char *name);
+char *libmangle_encode_ms_name (libmangle_gc_context_t *gc, uMToken *tok);
#endif
diff --git a/mingw-w64-libraries/libmangle/src/m_token.c b/mingw-w64-libraries/libmangle/src/m_token.c
index 9c5598e..a4b6e92 100644
--- a/mingw-w64-libraries/libmangle/src/m_token.c
+++ b/mingw-w64-libraries/libmangle/src/m_token.c
@@ -40,17 +40,17 @@
static char *mt_strcat (char *h, const char *add);
-libmangle_gc_context *
+libmangle_gc_context_t *
libmangle_generate_gc (void)
{
- libmangle_gc_context *h = (libmangle_gc_context *) malloc (sizeof (libmangle_gc_context));
+ libmangle_gc_context_t *h = (libmangle_gc_context_t *) malloc (sizeof (libmangle_gc_context_t));
if (h)
- memset (h, 0, sizeof (libmangle_gc_context));
+ memset (h, 0, sizeof (libmangle_gc_context_t));
return h;
}
static void *
-alloc_gc (libmangle_gc_context *gc, size_t size)
+alloc_gc (libmangle_gc_context_t *gc, size_t size)
{
sGcElem *n = (sGcElem *) malloc (size + sizeof (sGcElem));
if (!n)
@@ -70,7 +70,7 @@
}
void
-libmangle_release_gc (libmangle_gc_context *gc)
+libmangle_release_gc (libmangle_gc_context_t *gc)
{
sGcElem *n;
if (!gc)
@@ -85,7 +85,7 @@
}
static void
-free_gc (libmangle_gc_context *gc, const void *p)
+free_gc (libmangle_gc_context_t *gc, const void *p)
{
sGcElem *n, *l = NULL;
@@ -112,7 +112,7 @@
}
uMToken *
-gen_tok (libmangle_gc_context *gc, enum eMToken kind, enum eMSToken subkind, size_t addend)
+gen_tok (libmangle_gc_context_t *gc, enum eMToken kind, enum eMSToken subkind, size_t addend)
{
uMToken *ret;
switch (kind)
@@ -228,7 +228,7 @@
}
uMToken *
-gen_value (libmangle_gc_context *gc, enum eMSToken skind, uint64_t val, int is_signed, int size)
+gen_value (libmangle_gc_context_t *gc, enum eMSToken skind, uint64_t val, int is_signed, int size)
{
uMToken *ret = gen_tok (gc, eMToken_value, skind, 0);
MTOKEN_VALUE (ret) = val;
@@ -239,7 +239,7 @@
}
uMToken *
-gen_name (libmangle_gc_context *gc, enum eMSToken skind, const char *name)
+gen_name (libmangle_gc_context_t *gc, enum eMSToken skind, const char *name)
{
uMToken *ret;
@@ -252,7 +252,7 @@
}
uMToken *
-gen_dim (libmangle_gc_context *gc, enum eMSToken skind, uint64_t val, const char *non_tt_param, int fSigned, int fNegate)
+gen_dim (libmangle_gc_context_t *gc, enum eMSToken skind, uint64_t val, const char *non_tt_param, int fSigned, int fNegate)
{
uMToken *ret = gen_tok (gc, eMToken_dim, skind, 0);
@@ -264,7 +264,7 @@
}
uMToken *
-gen_unary (libmangle_gc_context *gc, enum eMSToken skind, uMToken *un)
+gen_unary (libmangle_gc_context_t *gc, enum eMSToken skind, uMToken *un)
{
uMToken *ret = gen_tok (gc, eMToken_unary, skind, 0);
MTOKEN_UNARY (ret) = un;
@@ -272,7 +272,7 @@
}
uMToken *
-gen_binary (libmangle_gc_context *gc, enum eMSToken skind, uMToken *l, uMToken *r)
+gen_binary (libmangle_gc_context_t *gc, enum eMSToken skind, uMToken *l, uMToken *r)
{
uMToken *ret = gen_tok (gc, eMToken_binary, skind, 0);
MTOKEN_BINARY_LEFT (ret) = l;
@@ -577,7 +577,7 @@
char *txt;
for (i = 0; szTest[i]!=NULL; i++)
{
- libmangle_gc_context *gc = libmangle_generate_gc ();
+ libmangle_gc_context_t *gc = libmangle_generate_gc ();
h = libmangle_decode_ms_name (gc, szTest[i]);
txt = libmangle_sprint_decl (h);
fprintf (stderr, "%s\n", txt);
diff --git a/mingw-w64-libraries/libmangle/src/m_token.h b/mingw-w64-libraries/libmangle/src/m_token.h
index e52e83c..720fc72 100644
--- a/mingw-w64-libraries/libmangle/src/m_token.h
+++ b/mingw-w64-libraries/libmangle/src/m_token.h
@@ -27,7 +27,7 @@
/**
* Garbage collector elements.
* Tracks allocated memory and points to the next element from the same context.
- * @see libmangle_gc_context
+ * @see libmangle_gc_context_t
*/
typedef struct sGcElem {
struct sGcElem *chain; /**< Next element in chain. */
@@ -41,10 +41,10 @@
* @see libmangle_generate_gc()
* @see libmangle_release_gc()
*/
-typedef struct libmangle_gc_context {
+typedef struct libmangle_gc_context_t {
sGcElem *head; /**< Pointer to first gc element in context.*/
sGcElem *tail; /**< Pointer to last gc element in context. */
-} libmangle_gc_context;
+} libmangle_gc_context_t;
/**
* Token "Kind" enumeration list.
@@ -244,21 +244,21 @@
* @param[in] addend Additional byte padding at the end.
* @see libmangle_release_gc()
*/
-uMToken *libmangle_gen_tok (libmangle_gc_context *gc, enum eMToken kind, enum eMSToken subkind, size_t addend);
+uMToken *libmangle_gen_tok (libmangle_gc_context_t *gc, enum eMToken kind, enum eMSToken subkind, size_t addend);
/**
* Releases memory tracked by context.
* @param[in] gc Garbage collection context to work on.
* @see libmangle_generate_gc()
*/
-void libmangle_release_gc (libmangle_gc_context *gc);
+void libmangle_release_gc (libmangle_gc_context_t *gc);
/**
* Constructs a garbage collection context token.
* @return Pointer to context.
* @see libmangle_release_gc()
*/
-libmangle_gc_context *libmangle_generate_gc (void);
+libmangle_gc_context_t *libmangle_generate_gc (void);
/**
* Chains uMTokens together.
@@ -302,7 +302,7 @@
* @return Pointer to value token.
* @see sMToken_value
*/
-uMToken *gen_value (libmangle_gc_context *gc, enum eMSToken skind, uint64_t val, int is_signed, int size);
+uMToken *gen_value (libmangle_gc_context_t *gc, enum eMSToken skind, uint64_t val, int is_signed, int size);
/**
* Constructs a "name" kind token.
@@ -312,7 +312,7 @@
* @return Pointer to name token.
* @see sMToken_name
*/
-uMToken *gen_name (libmangle_gc_context *gc, enum eMSToken skind, const char *name);
+uMToken *gen_name (libmangle_gc_context_t *gc, enum eMSToken skind, const char *name);
/**
* Constructs a "dim" kind token.
@@ -325,7 +325,7 @@
* @return Pointer to dim token.
* @see sMToken_dim
*/
-uMToken *gen_dim (libmangle_gc_context *gc, enum eMSToken skind, uint64_t val, const char *non_tt_param, int fSigned, int fNegate);
+uMToken *gen_dim (libmangle_gc_context_t *gc, enum eMSToken skind, uint64_t val, const char *non_tt_param, int fSigned, int fNegate);
/**
* Constructs a "unary" kind token.
@@ -335,7 +335,7 @@
* @return Pointer to a unary token.
* @see sMToken_unary
*/
-uMToken *gen_unary (libmangle_gc_context *gc, enum eMSToken skind, uMToken *un);
+uMToken *gen_unary (libmangle_gc_context_t *gc, enum eMSToken skind, uMToken *un);
/**
* Generates a binary node token.
@@ -346,6 +346,6 @@
* @return Pointer to binary token.
* @see sMToken_binary
*/
-uMToken *gen_binary (libmangle_gc_context *gc, enum eMSToken skind, uMToken *l, uMToken *r);
+uMToken *gen_binary (libmangle_gc_context_t *gc, enum eMSToken skind, uMToken *l, uMToken *r);
#endif