Skip to content

Commit

Permalink
main: pass "Option" global variable to makeTag callback of makeTag if…
Browse files Browse the repository at this point in the history
… it is common in parsers

Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed Sep 25, 2019
1 parent 0f80f0d commit 576f76c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void addCommonPseudoTags (void)
for (int i = 0; i < PTAG_COUNT; i++)
{
if (isPtagCommonInParsers (i))
makePtagIfEnabled (i, NULL);
makePtagIfEnabled (i, &Option);
}
}

Expand Down
6 changes: 6 additions & 0 deletions main/ptag_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ struct sPtagDesc {
bool enabled;
const char* name;
const char* description; /* displayed in --list-pseudo-tags output */

/* For the common ptags, the pointer for optionValues type value
* is passed as the second argument.
* For parser specific ptags, the pointer for parserObject
* of the parser is passed as the second argument.
*/
bool (* makeTag) (ptagDesc *, const void *);
bool commonInParsers;
};
Expand Down

0 comments on commit 576f76c

Please sign in to comment.