Implemented __unDName and __unDNameEx functions.

This commit is contained in:
Eric Pouech 2004-11-08 22:10:43 +00:00 committed by Alexandre Julliard
parent d1e44d0763
commit 98f94544ac
3 changed files with 1205 additions and 60 deletions

View File

@ -32,6 +32,7 @@ C_SRCS = \
string.c \
thread.c \
time.c \
undname.c \
wcs.c
SUBDIRS = tests

View File

@ -118,63 +118,3 @@ void MSVCRT_I10_OUTPUT(void)
{
/* FIXME: This is probably data, not a function */
}
/*********************************************************************
* __unDNameEx (MSVCRT.@)
*
* Demangle a C++ identifier.
*
* PARAMS
* OutStr [O] If not NULL, the place to put the demangled string
* mangled [I] Mangled name of the function
* OutStrLen[I] Length of OutStr
* memget [I] Function to allocate memory with
* memfree [I] Function to free memory with
* unknown [?] Unknown, possibly a call back
* flags [I] Flags determining demangled format
*
* RETURNS
* Success: A string pointing to the unmangled name, allocated with memget.
* Failure: NULL.
*/
char* __unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
malloc_func_t memget, free_func_t memfree,
void * unknown, unsigned short int flags)
{
FIXME("(%p,%s,%d,%p,%p,%p,%x) stub!\n",
OutStr, mangled, OutStrLen, memget, memfree, unknown, flags);
/* FIXME: The code in tools/winebuild/msmangle.c is pretty complete and
* could be used here.
*/
/* Experimentation reveals the following flag meanings when set:
* 0x0001 - Don't show __ in calling convention
* 0x0002 - Don't show calling convention at all
* 0x0004 - Don't show function/method return value
* 0x0010 - Same as 0x1
* 0x0080 - Don't show access specifier (public/protected/private)
* 0x0200 - Don't show static specifier
* 0x0800 - Unknown, passed by type_info::name()
* 0x1000 - Only report the variable/class name
* 0x2000 - Unknown, passed by type_info::name()
*/
/* Duplicate the mangled name; for comparisons it doesn't matter anyway */
if( OutStr == NULL) {
OutStrLen = strlen(mangled) + 1;
OutStr = memget( OutStrLen);
}
strncpy( OutStr, mangled, OutStrLen);
return OutStr;
}
/*********************************************************************
* __unDName (MSVCRT.@)
*/
char* __unDName(char * OutStr, const char* mangled, int OutStrLen,
malloc_func_t memget, free_func_t memfree,
unsigned short int flags)
{
return __unDNameEx( OutStr, mangled, OutStrLen, memget, memfree, 0, flags);
}

1204
dlls/msvcrt/undname.c Normal file

File diff suppressed because it is too large Load Diff