notaz.gp2x.de
/
ia32rtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
translate: simplify seed passthrough
[ia32rtools.git]
/
tools
/
protoparse.h
diff --git
a/tools/protoparse.h
b/tools/protoparse.h
index
a34d1a6
..
3d70d86
100644
(file)
--- a/
tools/protoparse.h
+++ b/
tools/protoparse.h
@@
-42,7
+42,8
@@
struct parsed_proto {
unsigned int is_noreturn:1;
unsigned int is_unresolved:1;
unsigned int is_userstack:1;
unsigned int is_noreturn:1;
unsigned int is_unresolved:1;
unsigned int is_userstack:1;
- unsigned int is_oslib:1; // OS/system library func
+ unsigned int is_include:1; // not from top-level header
+ unsigned int is_osinc:1; // OS/system library func
unsigned int is_arg:1; // declared in some func arg
unsigned int has_structarg:1;
unsigned int has_retreg:1;
unsigned int is_arg:1; // declared in some func arg
unsigned int has_structarg:1;
unsigned int has_retreg:1;
@@
-54,16
+55,17
@@
static int hdrfline = 0;
static void pp_copy_arg(struct parsed_proto_arg *d,
const struct parsed_proto_arg *s);
static void pp_copy_arg(struct parsed_proto_arg *d,
const struct parsed_proto_arg *s);
-static int b_pp_c_handler(char *proto, const char *fname, int is_oslib);
+static int b_pp_c_handler(char *proto, const char *fname,
+ int is_include, int is_osinc);
-static int do_protostrs(FILE *fhdr, const char *fname)
+static int do_protostrs(FILE *fhdr, const char *fname
, int is_include
)
{
const char *finc_name;
const char *hdrfn_saved;
char protostr[256];
char path[256];
char fname_inc[256];
{
const char *finc_name;
const char *hdrfn_saved;
char protostr[256];
char path[256];
char fname_inc[256];
- int is_os
lib
;
+ int is_os
inc
;
FILE *finc;
int line = 0;
int ret;
FILE *finc;
int line = 0;
int ret;
@@
-72,7
+74,7
@@
static int do_protostrs(FILE *fhdr, const char *fname)
hdrfn_saved = hdrfn;
hdrfn = fname;
hdrfn_saved = hdrfn;
hdrfn = fname;
- is_os
lib
= strstr(fname, "stdc.hlist")
+ is_os
inc
= strstr(fname, "stdc.hlist")
|| strstr(fname, "win32.hlist");
while (fgets(protostr, sizeof(protostr), fhdr))
|| strstr(fname, "win32.hlist");
while (fgets(protostr, sizeof(protostr), fhdr))
@@
-99,7
+101,7
@@
static int do_protostrs(FILE *fhdr, const char *fname)
fname_inc, line, finc_name);
continue;
}
fname_inc, line, finc_name);
continue;
}
- ret = do_protostrs(finc, finc_name);
+ ret = do_protostrs(finc, finc_name
, 1
);
fclose(finc);
if (ret < 0)
break;
fclose(finc);
if (ret < 0)
break;
@@
-116,7
+118,8
@@
static int do_protostrs(FILE *fhdr, const char *fname)
hdrfline = line;
hdrfline = line;
- ret = b_pp_c_handler(protostr, hdrfn, is_oslib);
+ ret = b_pp_c_handler(protostr, hdrfn, is_include,
+ is_osinc);
if (ret < 0)
break;
}
if (ret < 0)
break;
}
@@
-661,7
+664,8
@@
static struct parsed_proto *pp_cache;
static int pp_cache_size;
static int pp_cache_alloc;
static int pp_cache_size;
static int pp_cache_alloc;
-static int b_pp_c_handler(char *proto, const char *fname, int is_oslib)
+static int b_pp_c_handler(char *proto, const char *fname,
+ int is_include, int is_osinc)
{
int ret;
{
int ret;
@@
-679,7
+683,8
@@
static int b_pp_c_handler(char *proto, const char *fname, int is_oslib)
if (ret < 0)
return -1;
if (ret < 0)
return -1;
- pp_cache[pp_cache_size].is_oslib = is_oslib;
+ pp_cache[pp_cache_size].is_include = is_include;
+ pp_cache[pp_cache_size].is_osinc = is_osinc;
pp_cache_size++;
return 0;
}
pp_cache_size++;
return 0;
}
@@
-692,7
+697,7
@@
static void build_pp_cache(FILE *fhdr)
pos = ftell(fhdr);
rewind(fhdr);
pos = ftell(fhdr);
rewind(fhdr);
- ret = do_protostrs(fhdr, hdrfn);
+ ret = do_protostrs(fhdr, hdrfn
, 0
);
if (ret < 0)
exit(1);
if (ret < 0)
exit(1);