Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthieu Dorier
codes
Commits
6d3f2a0a
Commit
6d3f2a0a
authored
Jul 14, 2014
by
Jonathan Jenkins
Browse files
Annotation parsing support in LPGROUPS
parent
94958c20
Changes
3
Hide whitespace changes
Inline
Side-by-side
codes/configuration.h
View file @
6d3f2a0a
...
...
@@ -18,6 +18,7 @@
typedef
struct
config_lptype_s
{
char
name
[
CONFIGURATION_MAX_NAME
];
char
anno
[
CONFIGURATION_MAX_NAME
];
uint64_t
count
;
}
config_lptype_t
;
...
...
src/modelconfig/configlex.l
View file @
6d3f2a0a
...
...
@@ -42,7 +42,7 @@
%option bison-bridge nodefault
DIGIT [0-9]
ID [a-zA-Z][a-zA-Z0-9_\-]*
ID [a-zA-Z][a-zA-Z0-9_\-]*
(@[a-zA-Z0-9_\-]+)?
SECTION_OPEN "{"
SECTION_CLOSE "}"
...
...
src/util/configuration.c
View file @
6d3f2a0a
...
...
@@ -268,10 +268,21 @@ int configuration_get_lpgroups (ConfigHandle *handle,
}
else
{
size_t
s
=
sizeof
(
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
name
);
char
*
nm
=
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
name
;
char
*
anno
=
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
anno
;
// assume these are lptypes and counts
strncpy
(
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
name
,
subse
[
j
].
name
,
sizeof
(
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
name
));
strncpy
(
nm
,
subse
[
j
].
name
,
s
-
1
);
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
name
[
s
-
1
]
=
'\0'
;
char
*
c
=
strchr
(
nm
,
'@'
);
if
(
c
)
{
strcpy
(
anno
,
c
+
1
);
*
c
=
'\0'
;
}
else
{
anno
[
0
]
=
'\0'
;
}
lpgroups
->
lpgroups
[
i
].
lptypes
[
lpt
].
count
=
atoi
(
data
);
lpgroups
->
lpgroups
[
i
].
lptypes_count
++
;
lpt
++
;
...
...
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