Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
970b10d0
Commit
970b10d0
authored
Jan 09, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/TagTable: add lookup TagType -> name
parent
61b938d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
TagTable.cxx
src/tag/TagTable.cxx
+10
-0
TagTable.hxx
src/tag/TagTable.hxx
+9
-0
No files found.
src/tag/TagTable.cxx
View file @
970b10d0
...
@@ -51,3 +51,13 @@ tag_table_lookup_i(const struct tag_table *table, const char *name)
...
@@ -51,3 +51,13 @@ tag_table_lookup_i(const struct tag_table *table, const char *name)
return
TAG_NUM_OF_ITEM_TYPES
;
return
TAG_NUM_OF_ITEM_TYPES
;
}
}
const
char
*
tag_table_lookup
(
const
tag_table
*
table
,
TagType
type
)
{
for
(;
table
->
name
!=
nullptr
;
++
table
)
if
(
table
->
type
==
type
)
return
table
->
name
;
return
nullptr
;
}
src/tag/TagTable.hxx
View file @
970b10d0
...
@@ -47,4 +47,13 @@ gcc_pure
...
@@ -47,4 +47,13 @@ gcc_pure
TagType
TagType
tag_table_lookup_i
(
const
tag_table
*
table
,
const
char
*
name
);
tag_table_lookup_i
(
const
tag_table
*
table
,
const
char
*
name
);
/**
* Looks up a #TagType in a tag translation table and returns its
* string representation. Returns nullptr if the specified type was
* not found in the table.
*/
gcc_pure
const
char
*
tag_table_lookup
(
const
tag_table
*
table
,
TagType
type
);
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment