Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
944716c4
Commit
944716c4
authored
5 years ago
by
Nev3r
Browse files
Options
Downloads
Patches
Plain Diff
Add auxiliary functions to the taglist library.
parent
c0b40909
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1097
UDMF: Multitag support
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/taglist.c
+41
-0
41 additions, 0 deletions
src/taglist.c
src/taglist.h
+6
-0
6 additions, 0 deletions
src/taglist.h
with
47 additions
and
0 deletions
src/taglist.c
+
41
−
0
View file @
944716c4
...
...
@@ -8,6 +8,47 @@ void Tag_Add (taglist_t* list, const mtag_t tag)
list
->
tags
[
list
->
count
++
]
=
tag
;
}
/// Sets the first tag entry in a taglist.
void
Tag_FSet
(
taglist_t
*
list
,
const
mtag_t
tag
)
{
if
(
!
list
->
count
)
{
Tag_Add
(
list
,
tag
);
return
;
}
list
->
tags
[
0
]
=
tag
;
}
/// Gets the first tag entry in a taglist.
mtag_t
Tag_FGet
(
const
taglist_t
*
list
)
{
if
(
list
->
count
)
return
list
->
tags
[
0
];
return
0
;
}
boolean
Tag_Find
(
const
taglist_t
*
list
,
const
mtag_t
tag
)
{
size_t
i
;
for
(
i
=
0
;
i
<
list
->
count
;
i
++
)
if
(
list
->
tags
[
i
]
==
tag
)
return
true
;
return
false
;
}
boolean
Tag_Share
(
const
taglist_t
*
list1
,
const
taglist_t
*
list2
)
{
size_t
i
;
for
(
i
=
0
;
i
<
list1
->
count
;
i
++
)
if
(
Tag_Find
(
list2
,
list1
->
tags
[
i
]))
return
true
;
return
false
;
}
boolean
Tag_Compare
(
const
taglist_t
*
list1
,
const
taglist_t
*
list2
)
{
size_t
i
;
...
...
This diff is collapsed.
Click to expand it.
src/taglist.h
+
6
−
0
View file @
944716c4
...
...
@@ -15,6 +15,12 @@ typedef struct
}
taglist_t
;
void
Tag_Add
(
taglist_t
*
list
,
const
mtag_t
tag
);
void
Tag_FSet
(
taglist_t
*
list
,
const
mtag_t
tag
);
mtag_t
Tag_FGet
(
const
taglist_t
*
list
);
boolean
Tag_Find
(
const
taglist_t
*
list
,
const
mtag_t
tag
);
boolean
Tag_Share
(
const
taglist_t
*
list1
,
const
taglist_t
*
list2
);
boolean
Tag_Compare
(
const
taglist_t
*
list1
,
const
taglist_t
*
list2
);
typedef
struct
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment