Commit a3c25960 authored by Peter Berg Larsen's avatar Peter Berg Larsen Committed by Alexandre Julliard

Allow several -I parameters to be given - currently just the last is

used. Remove obvious wrong binaries when searching for the definition of a functions definition. Really just strip a '.dll' extension and not also '.dll.foorbar.spec'.
parent 5b2159c4
......@@ -27,16 +27,24 @@ _globals globals; /* All global variables */
static void do_include (const char *arg)
{
globals.directory = arg;
char *newIncludes;
if (!globals.directory)
globals.directory = strdup(arg);
else {
newIncludes = str_create (3,globals.directory," ",arg);
free(globals.directory);
globals.directory = newIncludes;
}
globals.do_code = 1;
}
static inline const char* strip_ext (const char *str)
{
char *ext = strstr(str, ".dll");
if (ext)
return str_substring (str, ext);
int len = strlen(str);
if (len>4 && strcmp(str+len-4,".dll") == 0)
return str_substring (str, str+len-4);
else
return strdup (str);
}
......@@ -193,7 +201,7 @@ static const struct option option_table[] = {
{"-t", SPEC, 0, do_trace, "-t TRACE arguments (implies -c)"},
{"-f", SPEC, 1, do_forward, "-f dll Forward calls to 'dll' (implies -t)"},
{"-D", SPEC, 0, do_document, "-D Generate documentation"},
{"-o", SPEC, 1, do_name, "-o name Set the output dll name (default: dll)"},
{"-o", SPEC, 1, do_name, "-o name Set the output dll name (default: dll). note: strips .dll extensions"},
{"-C", SPEC, 0, do_cdecl, "-C Assume __cdecl calls (default: __stdcall)"},
{"-s", SPEC, 1, do_start, "-s num Start prototype search after symbol 'num'"},
{"-e", SPEC, 1, do_end, "-e num End prototype search after symbol 'num'"},
......
......@@ -81,10 +81,20 @@ int symbol_search (parsed_symbol *sym)
while (fgets (grep_buff, MAX_RESULT_LEN, grep))
{
int i;
for (i = 0; grep_buff[i] && grep_buff[i] != '\n' ; i++)
;
const char *extension = grep_buff;
for (i = 0; grep_buff[i] && grep_buff[i] != '\n' ; i++) {
if (grep_buff[i] == '.')
extension = &grep_buff[i];
}
grep_buff[i] = '\0';
/* Definitly not in these: */
if (strcmp(extension,".dll") == 0 ||
strcmp(extension,".lib") == 0 ||
strcmp(extension,".so") == 0 ||
strcmp(extension,".o") == 0)
continue;
if (VERBOSE)
puts (grep_buff);
......@@ -344,4 +354,3 @@ void search_cleanup (void)
free (fgrep_buff);
}
#endif
......@@ -126,7 +126,7 @@ typedef struct __globals
int start_ordinal; /* -s */
int end_ordinal; /* -e */
search_symbol *search_symbol; /* -S */
const char *directory; /* -I */
char *directory; /* -I */
const char *forward_dll; /* -f */
const char *dll_name; /* -o */
char *uc_dll_name; /* -o */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment