Move opt_field_names/babeltrace_verbose/babeltrace_debug into lib
[babeltrace.git] / converter / babeltrace.c
index 9d79c39d3a24b5f7139da59babce6f7a168bc7cf..04d2615e788dd470693c9d7a10a13b2f33545d4f 100644 (file)
@@ -19,7 +19,8 @@
  */
 
 #define _XOPEN_SOURCE 700
-#include <babeltrace/babeltrace.h>
+#include <config.h>
+#include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/format.h>
 #include <popt.h>
 #include <errno.h>
@@ -39,9 +40,6 @@ static char *opt_output_format;
 static const char *opt_input_path;
 static const char *opt_output_path;
 
-int babeltrace_verbose, babeltrace_debug;
-int opt_field_names;
-
 static struct trace_collection trace_collection_read;
 static struct format *fmt_read;
 
@@ -82,9 +80,7 @@ static void list_formats(FILE *fp)
 
 static void usage(FILE *fp)
 {
-       fprintf(fp, "BabelTrace Trace Converter %u.%u\n\n",
-               BABELTRACE_VERSION_MAJOR,
-               BABELTRACE_VERSION_MINOR);
+       fprintf(fp, "BabelTrace Trace Converter %s\n\n", VERSION);
        fprintf(fp, "usage : babeltrace [OPTIONS] INPUT <OUTPUT>\n");
        fprintf(fp, "\n");
        fprintf(fp, "  INPUT                          Input trace path\n");
@@ -96,7 +92,9 @@ static void usage(FILE *fp)
        fprintf(fp, "  -h, --help                     This help message\n");
        fprintf(fp, "  -l, --list                     List available formats\n");
        fprintf(fp, "  -v, --verbose                  Verbose mode\n");
+       fprintf(fp, "                                 (or set BABELTRACE_VERBOSE env. var.)\n");
        fprintf(fp, "  -d, --debug                    Debug mode\n");
+       fprintf(fp, "                                 (or set BABELTRACE_DEBUG env. var.)\n");
        fprintf(fp, "  -n, --names                    Print field names\n");
        list_formats(fp);
        fprintf(fp, "\n");
@@ -213,7 +211,8 @@ static int traverse_dir(const char *fpath, const struct stat *sb,
        } else {
                close(fd);
                close(dirfd);
-               td_read = fmt_read->open_trace(fpath, O_RDONLY);
+               td_read = fmt_read->open_trace(fpath, O_RDONLY, ctf_move_pos_slow,
+                               NULL);
                if (!td_read) {
                        fprintf(stdout, "Error opening trace \"%s\" "
                                        "for reading.\n\n", fpath);
@@ -291,7 +290,7 @@ int main(int argc, char **argv)
                return 0;
        }
 
-       td_write = fmt_write->open_trace(opt_output_path, O_RDWR);
+       td_write = fmt_write->open_trace(opt_output_path, O_RDWR, NULL, NULL);
        if (!td_write) {
                fprintf(stdout, "Error opening trace \"%s\" for writing.\n\n",
                        opt_output_path ? : "<none>");
This page took 0.024746 seconds and 4 git commands to generate.