5 #define IDENT_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
6 "abcdefghijklmnopqrstuvwxyz" \
9 #define SPACE_CHARS " \f\n\r\t\v"
11 /* FIXME: Nested functions break with -Wmissing-prototypes -Wmissing-declarations */
12 #define CFLAGS "-g -Wall -Wundef -Wstrict-prototypes -Wold-style-definition -Werror"
14 #define COVERAGE_CFLAGS "-fprofile-arcs -ftest-coverage"
16 /* This actually compiles and runs the info file to get dependencies. */
17 char **get_deps(const void *ctx, const char *dir, bool recurse,
20 /* This is safer: just looks for ccan/ strings in info */
21 char **get_safe_ccan_deps(const void *ctx, const char *dir,
22 bool recurse, char **infofile);
24 /* This also needs to compile the info file. */
25 char **get_libs(const void *ctx, const char *dir,
26 unsigned int *num, char **infofile);
29 char *talloc_basename(const void *ctx, const char *dir);
30 char *talloc_dirname(const void *ctx, const char *dir);
31 char *talloc_getcwd(const void *ctx);
32 char *run_command(const void *ctx, unsigned int *time_ms, const char *fmt, ...);
33 char *run_with_timeout(const void *ctx, const char *cmd,
34 bool *ok, unsigned *timeout_ms);
35 char *temp_dir(const void *ctx);
36 char *temp_file(const void *ctx, const char *extension);
37 bool move_file(const char *oldname, const char *newname);
41 * These all compile into a temporary dir, and return the filename.
42 * On failure they return NULL, and errmsg is set to compiler output.
44 /* Compile multiple object files into a single. */
45 char *link_objects(const void *ctx, const char *objs, char **errmsg);
46 /* Compile a single C file to an object file. Returns errmsg if fails. */
47 char *compile_object(const void *ctx, const char *cfile, const char *ccandir,
48 const char *extra_cflags,
50 /* Compile and link single C file, with object files, libs, etc. NULL on
51 * success, error output on fail. */
52 char *compile_and_link(const void *ctx, const char *cfile, const char *ccandir,
53 const char *objs, const char *extra_cflags,
54 const char *libs, const char *outfile);
56 /* If keep is false, return a temporary file. Otherwise, base it on srcname */
57 char *maybe_temp_file(const void *ctx, const char *extension, bool keep,
60 /* Default wait for run_command. Should never time out. */
61 extern const unsigned int default_timeout_ms;
63 #endif /* CCAN_TOOLS_H */