2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
5 Write the functionlist to a file that can be included in the .conf file.
9 void writefunclist(struct config
*cfg
)
13 struct functionhead
*funclistit
;
14 struct functionarg
*arglistit
;
15 struct stringlist
*aliaslistit
;
18 snprintf(line
, 255, "%s/%s.funclist", cfg
->gendir
, cfg
->modulename
);
19 out
= fopen(line
, "w");
27 /* When not a BOOPSI class write out the functionlist even if it is empty
28 * when it is a BOOPSI write only the list when it is not empty
29 * When cfg->basename != cfg->classlist->basename this means we are not in a BOOPSI class
30 * but there are extra classes defined
32 if (cfg
->classlist
== NULL
33 || strcmp(cfg
->basename
, cfg
->classlist
->basename
) != 0
34 || cfg
->funclist
!= NULL
)
36 fprintf(out
, "##begin functionlist\n");
38 for (funclistit
= cfg
->funclist
, lvo
= cfg
->firstlvo
- 1;
40 funclistit
= funclistit
->next
43 if (funclistit
->libcall
== REGISTERMACRO
)
45 if (funclistit
->lvo
> lvo
+1)
47 if (funclistit
->lvo
== lvo
+2)
50 fprintf(out
, ".skip %u\n", funclistit
->lvo
- lvo
- 1);
55 funclistit
->type
, funclistit
->name
58 for (arglistit
= funclistit
->arguments
;
60 arglistit
= arglistit
->next
63 /* Print a , separator when not the first function argument */
64 if (arglistit
!= funclistit
->arguments
)
67 fprintf(out
, "%s", arglistit
->arg
);
71 for (arglistit
= funclistit
->arguments
;
73 arglistit
= arglistit
->next
76 /* Print a , separator when not the first function argument */
77 if (arglistit
!= funclistit
->arguments
)
80 fprintf(out
, "%s", arglistit
->reg
);
84 for (aliaslistit
= funclistit
->aliases
;
86 aliaslistit
= aliaslistit
->next
89 fprintf(out
, ".alias %s\n", aliaslistit
->s
);
92 if (funclistit
->novararg
)
93 fprintf(out
, ".novararg\n");
96 fprintf(out
, ".private\n");
98 lvo
= funclistit
->lvo
;
102 fprintf(out
, "##end functionlist\n");
105 if (cfg
->classlist
!= NULL
&& strcmp(cfg
->basename
, cfg
->classlist
->basename
) == 0)
107 fprintf(out
, "##begin methodlist\n");
109 for(funclistit
= cfg
->classlist
->methlist
;
111 funclistit
= funclistit
->next
114 fprintf(out
, "%s\n", funclistit
->name
);
117 fprintf(out
, "##end methodlist\n");