Skip to content

Commit

Permalink
tools/mksymtab: support for structure
Browse files Browse the repository at this point in the history
  • Loading branch information
TAiGA authored and xiaoxiang781216 committed Sep 5, 2024
1 parent 7b05a55 commit cc0d4af
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tools/mksymtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ int main(int argc, char **argv, char **envp)
char *finalterm;
char *ptr;
bool cond;
bool parm1;
FILE *instream;
FILE *outstream;
int ch;
Expand Down Expand Up @@ -268,6 +269,12 @@ int main(int argc, char **argv, char **envp)
{
/* Parse the line from the CVS file */

g_parm[NAME_INDEX][0] = 0;
g_parm[HEADER_INDEX][0] = 0;
g_parm[COND_INDEX][0] = 0;
g_parm[RETTYPE_INDEX][0] = 0;
g_parm[PARM1_INDEX][0] = 0;

int nargs = parse_csvline(ptr);
if (nargs < PARM1_INDEX)
{
Expand All @@ -286,8 +293,17 @@ int main(int argc, char **argv, char **envp)

/* Output the symbol table entry */

fprintf(outstream, "%s { \"%s\", (FAR const void *)%s }",
nextterm, g_parm[NAME_INDEX], g_parm[NAME_INDEX]);
parm1 = strlen(g_parm[PARM1_INDEX]) > 0;
if (parm1)
{
fprintf(outstream, "%s { \"%s\", (FAR const void *)%s }",
nextterm, g_parm[NAME_INDEX], g_parm[NAME_INDEX]);
}
else
{
fprintf(outstream, "%s { \"%s\", (FAR const void *)&%s }",
nextterm, g_parm[NAME_INDEX], g_parm[NAME_INDEX]);
}

if (cond)
{
Expand Down

0 comments on commit cc0d4af

Please sign in to comment.