Skip to content

Commit

Permalink
readtags: export the function for printing tag values
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Apr 29, 2023
1 parent 5205c95 commit a67d1ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions extra-cmds/printtags.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ static void printValue (const char *val, int printingWithEscaping,
print_str (val, outfp);
}

extern int tagsPrintValue (const char *val,
int escaping,
tagPrintProcs *procs,
void *outfp)
{
if (!procs)
procs = &printFILEProcs;

printValue (val, escaping,
procs->printStr, procs->printChar,
outfp);
return 1;
}

static void tagsPrintTag (const tagEntry *entry,
int printingExtensionFields,
int printingLineNumber,
Expand Down
2 changes: 2 additions & 0 deletions extra-cmds/printtags.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ extern int tagsPrint (const tagEntry *entry,
extern int tagsPrintPseudoTag (const tagEntry *entry,
tagPrintOptions *opts, tagPrintProcs *procs, void *outfp);

extern int tagsPrintValue (const char *val, int escaping, tagPrintProcs *procs, void *outfp);

#ifdef __cplusplus
};
#endif
Expand Down

0 comments on commit a67d1ed

Please sign in to comment.