8 while ((getline < file
) > 0)
15 else if ($
2 ==
"LIBBASE")
19 else if ($
2 ==
"LIBBASETYPEPTR")
25 else if($
2 ==
"NT_TYPE")
27 if( $
3 ==
"NT_RESOURCE" )
32 else if ( $
3 ==
"NT_DEVICE" )
45 verbose_pattern = libbase
"[ \\t]*,[ \\t]*[0-9]+[ \\t]*,[ \\t]*"basename
;
49 BASENAME=
toupper(basename
);
51 print "#ifndef DEFINES_"BASENAME
"_PRIVATE_PROTOS_H"
52 print "#define DEFINES_"BASENAME
"_PRIVATE_PROTOS_H"
55 print " Copyright © 1995-2003, The AROS Development Team. All rights reserved."
56 print " *** Automatically generated by gendefines.awk. Do not edit ***"
58 print " Desc: Prototypes for "basename libext
59 print " Lang: english"
62 print "#ifndef AROS_LIBCALL_H"
63 print "# include <aros/libcall.h>"
65 print "#ifndef EXEC_TYPES_H"
66 print "# include <exec/types.h>"
70 /AROS_LH
[0-9]/ { isprivate=
0; }
71 /AROS_PLH
[0-9]/ { isprivate=
1; }
72 /AROS_
((LHA
)|(LHQUAD
)|(PLH
[0-9]))/ {
74 isarg=
match($
0,/AROS_LHA
/);
76 gsub(/^
[ \t]+/,"",line
);
84 match(line
,/\
(.
+,.
+[^
,]/);
85 line=
substr(line
,RSTART+1,RLENGTH-1);
86 gsub(/[ \t]*,[ \t]*/,",",line
);
96 if (match(line
, /\
/\
*[ \t]*tagcall.
+\
*\
//))
98 tagcall=
substr(line
,RSTART+2,RLENGTH-4)
103 if(match(tagcall
, /\
+[A
-Za
-z0
-9]+/))
105 to_add =
substr(tagcall
,RSTART+1,RLENGTH-1)
111 if(match(tagcall
, /\
-[0-9]+/))
113 to_sub =
substr(tagcall
,RSTART+1,RLENGTH-1)
120 print "Invalid tagcall statement for function \"" fname
"\", argument n. " narg
> "/dev/stderr"
124 tagarg
[ntagarg
, 1] = narg
125 tagarg
[ntagarg
, 2] = to_sub
126 tagarg
[ntagarg
, 3] = to_add
131 match(line
,/\
(.
+\
)/);
132 line=
substr(line
,RSTART+1,RLENGTH-2);
133 gsub(/[ \t]*,[ \t]*/,",",line
);
135 split(line
, arg_args
, ",");
137 arg
[narg
, 1] = arg_args
[1]
138 arg
[narg
, 2] = arg_args
[2]
139 arg
[narg
, 3] = arg_args
[3]
144 /LIBBASE
[ \t]*,[ \t]*[0-9]+/ || $
0 ~ verbose_pattern
{
147 match(line
,/[a
-zA
-Z_0
-9]+.
*[^
)]/);
148 line =
substr(line
,RSTART,RLENGTH);
149 gsub(/[ \t]*,[ \t]*/,",",line
);
157 if (lvo
> firstlvo
&& isprivate
)
159 printf "#define __%s_WB(__%s", fname
, libbase
160 for (t=
0; t
<narg
; t
++)
162 printf ", __%s", arg
[t
, 2]
166 printf " AROS_LC%d(%s, %s, \\\n", narg
, tname
, fname
167 for (t=
0; t
<narg
; t
++)
169 printf " AROS_LCA(%s, (__%s), %s), \\\n", arg
[t
, 1], arg
[t
, 2], arg
[t
, 3]
171 printf " %s, (__%s), %d, %s)\n\n", libbtp
, libbase
, lvo
, basename
173 printf "#define %s(", fname
174 for (t=
0; t
<narg
; t
++)
176 printf "%s", arg
[t
, 2]
177 if (t
!= narg
-1) printf ", "
181 printf " __%s_WB(%s", fname
, libbase
182 for (t=
0; t
<narg
; t
++)
184 printf ", (%s)", arg
[t
, 2]
190 #emit variadic macros for tag-based functions
194 tagarg
[0, 1] = narg
-1
200 if (fname ~
/TagList$
/)
202 tagarg
[0, 1] = narg
-1
204 tagarg
[0, 3] =
"Tags"
208 if (fname ~
/Args$
/ && (tolower(arg
[narg
-1, 2]) ==
"args") || (tolower(arg
[narg
-1, 2]) ==
"arglist"))
210 tagarg
[0, 1] = narg
-1
216 if (arg
[narg
-1, 1] ~
/struct
[ \t]+TagItem
[ \t]*[*]/)
218 tagarg
[0, 1] = narg
-1
220 tagarg
[0, 3] =
"Tags"
227 print "#if !defined(NO_INLINE_STDARG) && !defined(" BASENAME
"_NO_INLINE_STDARG)"
229 for (i =
0; i
< ntagarg
; i
++)
231 printf "#define %s(", substr(fname
, 0, length(fname
) - tagarg
[i
, 2]) tagarg
[i
, 3];
232 for (t=
0; t
<narg
; t
++)
234 if (tagarg
[i
, 1] == t
) continue
236 printf "%s, ", arg
[t
, 2]
241 print " IPTR __args[] = { args }; \\"
244 for (t=
0; t
<narg
; t
++)
246 if (tagarg
[i
, 1] == t
)
247 printf "(%s)__args", arg
[tagarg
[i
, 1], 1]
249 printf "(%s)", arg
[t
, 2]
258 print "#endif /* !NO_INLINE_STDARG */\n"
264 print "#endif /* DEFINES_"BASENAME
"_PRIVATE_PROTOS_H */"