Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
023f704e
Commit
023f704e
authored
Aug 19, 2008
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--direct for ccan_depends
parent
40b0fa60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
tools/ccan_depends.c
tools/ccan_depends.c
+11
-4
tools/depends.c
tools/depends.c
+10
-2
tools/tools.h
tools/tools.h
+3
-2
No files found.
tools/ccan_depends.c
View file @
023f704e
...
...
@@ -10,20 +10,27 @@ int main(int argc, char *argv[])
char
**
deps
;
unsigned
int
i
;
bool
compile
=
false
;
bool
recurse
=
true
;
if
(
argv
[
1
]
&&
streq
(
argv
[
1
],
"--direct"
))
{
argv
++
;
argc
--
;
recurse
=
false
;
}
if
(
argv
[
1
]
&&
streq
(
argv
[
1
],
"--compile"
))
{
argv
++
;
argc
--
;
compile
=
true
;
}
if
(
argc
!=
2
)
errx
(
1
,
"Usage: ccan_depends [--compile] <dir>
\n
"
"Spits out all the ccan dependencies (recursively)"
);
errx
(
1
,
"Usage: ccan_depends [--
direct] [--
compile] <dir>
\n
"
"Spits out all the ccan dependencies (recursively
unless --direct
)"
);
if
(
compile
)
deps
=
get_deps
(
talloc_autofree_context
(),
argv
[
1
]);
deps
=
get_deps
(
talloc_autofree_context
(),
argv
[
1
]
,
recurse
);
else
deps
=
get_safe_ccan_deps
(
talloc_autofree_context
(),
argv
[
1
]);
deps
=
get_safe_ccan_deps
(
talloc_autofree_context
(),
argv
[
1
],
recurse
);
for
(
i
=
0
;
deps
[
i
];
i
++
)
if
(
strstarts
(
deps
[
i
],
"ccan/"
))
...
...
tools/depends.c
View file @
023f704e
...
...
@@ -173,13 +173,21 @@ get_all_deps(const void *ctx, const char *dir,
return
deps
;
}
char
**
get_deps
(
const
void
*
ctx
,
const
char
*
dir
)
char
**
get_deps
(
const
void
*
ctx
,
const
char
*
dir
,
bool
recurse
)
{
if
(
!
recurse
)
{
unsigned
int
num
;
return
get_one_deps
(
ctx
,
dir
,
&
num
);
}
return
get_all_deps
(
ctx
,
dir
,
get_one_deps
);
}
char
**
get_safe_ccan_deps
(
const
void
*
ctx
,
const
char
*
dir
)
char
**
get_safe_ccan_deps
(
const
void
*
ctx
,
const
char
*
dir
,
bool
recurse
)
{
if
(
!
recurse
)
{
unsigned
int
num
;
return
get_one_safe_deps
(
ctx
,
dir
,
&
num
);
}
return
get_all_deps
(
ctx
,
dir
,
get_one_safe_deps
);
}
tools/tools.h
View file @
023f704e
#ifndef CCAN_TOOLS_H
#define CCAN_TOOLS_H
#include <stdbool.h>
#define CFLAGS "-O3 -Wall -Wundef -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -Iccan/ -I."
/* This actually compiles and runs the _info.c file to get dependencies. */
char
**
get_deps
(
const
void
*
ctx
,
const
char
*
dir
);
char
**
get_deps
(
const
void
*
ctx
,
const
char
*
dir
,
bool
recurse
);
/* This is safer: just looks for ccan/ strings in _info.c */
char
**
get_safe_ccan_deps
(
const
void
*
ctx
,
const
char
*
dir
);
char
**
get_safe_ccan_deps
(
const
void
*
ctx
,
const
char
*
dir
,
bool
recurse
);
#endif
/* CCAN_TOOLS_H */
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