Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
d14b466b
Commit
d14b466b
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
some style fixes
parent
f4c34cd7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common.c
+8
-12
8 additions, 12 deletions
common.c
dongle.c
+5
-8
5 additions, 8 deletions
dongle.c
with
13 additions
and
20 deletions
common.c
+
8
−
12
View file @
d14b466b
...
...
@@ -69,19 +69,18 @@ char *xml_parser(struct write_result *result, char *tag)
xpathctx_ptr
=
doc_ptr
?
xmlXPathNewContext
(
doc_ptr
)
:
NULL
;
xpathobj_ptr
=
xpathctx_ptr
?
xmlXPathEvalExpression
((
xmlChar
*
)
tag
,
xpathctx_ptr
)
:
NULL
;
if
(
xpathobj_ptr
)
{
if
(
xpathobj_ptr
)
{
int
n
;
xmlNodeSetPtr
nodeset_ptr
=
xpathobj_ptr
->
nodesetval
;
for
(
n
=
0
;
nodeset_ptr
&&
n
<
xmlXPathNodeSetGetLength
(
nodeset_ptr
);
n
++
)
{
for
(
n
=
0
;
nodeset_ptr
&&
n
<
xmlXPathNodeSetGetLength
(
nodeset_ptr
);
n
++
)
{
//if (DEBUG)
//debug_print("n value: %d\n", n);
xmlNodePtr
node_ptr
=
nodeset_ptr
->
nodeTab
[
n
];
if
(
node_ptr
->
type
!=
XML_ATTRIBUTE_NODE
&&
node_ptr
->
type
!=
XML_ELEMENT_NODE
&&
node_ptr
->
type
!=
XML_CDATA_SECTION_NODE
)
continue
;
if
(
node_ptr
->
children
)
{
if
(
node_ptr
->
children
)
{
//tag_content = (char*) node_ptr->children->content;
strcpy
(
tag_content
,
(
char
*
)
node_ptr
->
children
->
content
);
debug_print
(
"tag content: %s
\n
"
,
tag_content
);
...
...
@@ -108,16 +107,13 @@ void xml_to_json(xmlNode *anode, json_object *jobj)
xmlNodePtr
cur_node
=
NULL
;
json_object
*
cur_jstr
=
NULL
;
for
(
cur_node
=
anode
;
cur_node
;
cur_node
=
cur_node
->
next
)
{
for
(
cur_node
=
anode
;
cur_node
;
cur_node
=
cur_node
->
next
)
{
debug_print
(
"child address: %p
\n
"
,
cur_node
);
debug_print
(
"next addres: %p
\n
"
,
cur_node
->
next
);
debug_print
(
"root child content: %s
\n
"
,
(
uint8_t
*
)
xmlNodeGetContent
(
cur_node
));
if
(
cur_node
->
type
==
XML_ELEMENT_NODE
)
{
if
(
xmlChildElementCount
(
cur_node
)
==
0
)
{
if
(
cur_node
->
type
==
XML_ELEMENT_NODE
)
{
if
(
xmlChildElementCount
(
cur_node
)
==
0
)
{
cur_jstr
=
json_object_new_string
((
char
*
)
xmlNodeGetContent
(
cur_node
));
debug_print
(
"xmlNodeGet name: %sn"
,
(
char
*
)
cur_node
->
name
);
...
...
This diff is collapsed.
Click to expand it.
dongle.c
+
5
−
8
View file @
d14b466b
...
...
@@ -41,14 +41,11 @@ int parse_args(int argc, char **argv)
{
char
ch
;
while
((
ch
=
getopt_long
(
argc
,
argv
,
"d:"
,
long_options
,
NULL
))
!=
-
1
)
{
switch
(
ch
)
{
while
((
ch
=
getopt_long
(
argc
,
argv
,
"d:"
,
long_options
,
NULL
))
!=
-
1
)
{
switch
(
ch
)
{
case
'd'
:
debug
=
atoi
(
optarg
);
if
(
debug
>
1
||
debug
<
0
)
{
if
(
debug
>
1
||
debug
<
0
)
{
printf
(
"%s: option '-%c' is invalid.
\n
"
,
argv
[
0
],
optopt
);
//cant exactly do debug print in here...
goto
fail
;
}
...
...
@@ -103,6 +100,7 @@ int tag_missing_devices(void)
int
add_device
(
struct
device
*
new_dev
)
{
struct
device
*
dev
;
dev
=
search_list
(
new_dev
->
usb
.
if_name
);
if
(
dev
)
{
if
(
dev
->
ip
)
...
...
@@ -502,8 +500,7 @@ int list_to_blob(struct blob_buf *bb)
if
(
rv
<
0
)
goto
fail_string
;
if
(
net_dev
->
ip
)
{
if
(
net_dev
->
ip
)
{
rv
=
blobmsg_add_string
(
bb
,
"ip"
,
net_dev
->
ip
);
if
(
rv
<
0
)
goto
fail_string
;
...
...
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