Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alex037yang
OpenXG-RAN
Commits
dca2143b
Commit
dca2143b
authored
Apr 27, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some functions in database.c
parent
7dbb2b8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
common/utils/T/tracer/database.c
common/utils/T/tracer/database.c
+15
-0
common/utils/T/tracer/database.h
common/utils/T/tracer/database.h
+2
-0
No files found.
common/utils/T/tracer/database.c
View file @
dca2143b
...
...
@@ -422,6 +422,15 @@ char *event_name_from_id(void *_database, int id)
return
d
->
i
[
d
->
pos
[
id
]].
name
;
}
int
event_id_from_name
(
void
*
_database
,
char
*
name
)
{
database
*
d
=
_database
;
id
*
i
=
(
id
*
)
bsearch
(
&
(
id
){
name
:
name
},
d
->
i
,
d
->
isize
,
sizeof
(
id
),
id_cmp
);
if
(
i
==
NULL
)
{
printf
(
"%s:%d: '%s' not found
\n
"
,
__FILE__
,
__LINE__
,
name
);
abort
();
}
return
i
->
id
;
}
database_event_format
get_format
(
void
*
_database
,
int
event_id
)
{
database
*
d
=
_database
;
...
...
@@ -438,3 +447,9 @@ database_event_format get_format(void *_database, int event_id)
return
ret
;
}
int
number_of_ids
(
void
*
_d
)
{
database
*
d
=
_d
;
return
d
->
isize
;
}
common/utils/T/tracer/database.h
View file @
dca2143b
...
...
@@ -8,6 +8,8 @@ void list_ids(void *database);
void
list_groups
(
void
*
database
);
void
on_off
(
void
*
d
,
char
*
item
,
int
*
a
,
int
onoff
);
char
*
event_name_from_id
(
void
*
database
,
int
id
);
int
event_id_from_name
(
void
*
database
,
char
*
name
);
int
number_of_ids
(
void
*
database
);
/****************************************************************************/
/* get format of an event */
...
...
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