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
2fa2fdd8
Commit
2fa2fdd8
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
add clear_list function
parent
ddebdbb1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dfs.c
+11
-0
11 additions, 0 deletions
dfs.c
dfs.h
+2
-1
2 additions, 1 deletion
dfs.h
dongle_infrastructure.c
+1
-0
1 addition, 0 deletions
dongle_infrastructure.c
with
14 additions
and
1 deletion
dfs.c
+
11
−
0
View file @
2fa2fdd8
...
@@ -49,4 +49,15 @@ bool is_visited(char *path, struct list_head *visited)
...
@@ -49,4 +49,15 @@ bool is_visited(char *path, struct list_head *visited)
}
}
return
false
;
return
false
;
}
void
clear_list
(
struct
list_head
*
visited
)
{
struct
node
*
n
,
*
tmp
;
list_for_each_entry_safe
(
n
,
tmp
,
visited
,
list
)
{
free
(
n
->
path
);
list_del
(
n
->
list
);
free
(
n
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dfs.h
+
2
−
1
View file @
2fa2fdd8
...
@@ -11,5 +11,6 @@ struct node {
...
@@ -11,5 +11,6 @@ struct node {
void
enqueue_stack
(
struct
node
*
n
,
struct
list_head
*
stack
);
void
enqueue_stack
(
struct
node
*
n
,
struct
list_head
*
stack
);
struct
node
*
dequeue_stack
(
struct
list_head
*
stack
);
struct
node
*
dequeue_stack
(
struct
list_head
*
stack
);
void
add_visited
(
struct
node
*
n
,
struct
list_head
*
visited
);
void
add_visited
(
struct
node
*
n
,
struct
list_head
*
visited
);
bool
is_visited
(
struct
node
*
n
,
struct
list_head
*
visited
);
bool
is_visited
(
char
*
path
,
struct
list_head
*
visited
);
void
clear_list
(
struct
list_head
*
visited
);
#endif
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dongle_infrastructure.c
+
1
−
0
View file @
2fa2fdd8
...
@@ -289,6 +289,7 @@ char *dfs_get_path_name(char *folder_name)
...
@@ -289,6 +289,7 @@ char *dfs_get_path_name(char *folder_name)
}
}
closedir
(
dr
);
closedir
(
dr
);
}
}
clear_list
(
&
visited
);
fail_opendir:
fail_opendir:
return
NULL
;
return
NULL
;
success:
success:
...
...
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