[lib] preparation for user-defined output format
authorChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 30 Apr 2008 09:37:49 +0000 (11:37 +0200)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 30 Apr 2008 09:37:49 +0000 (11:37 +0200)
libmultipath/print.c
libmultipath/print.h

index 641ade6..175c883 100644 (file)
@@ -1223,6 +1223,12 @@ print_map (struct multipath * mpp)
 
 extern void
 print_all_paths (vector pathvec, int banner)
+{
+       print_all_paths_custo(pathvec, banner, PRINT_PATH_LONG);
+}
+
+extern void
+print_all_paths_custo (vector pathvec, int banner, char *fmt)
 {
        int i;
        struct path * pp;
@@ -1238,10 +1244,10 @@ print_all_paths (vector pathvec, int banner)
                fprintf(stdout, "===== paths list =====\n");
 
        get_path_layout(pathvec);
-       snprint_path_header(line, MAX_LINE_LEN, PRINT_PATH_LONG);
+       snprint_path_header(line, MAX_LINE_LEN, fmt);
        fprintf(stdout, "%s", line);
 
        vector_foreach_slot (pathvec, pp, i)
-               print_path(pp, PRINT_PATH_LONG);
+               print_path(pp, fmt);
 }
 
index 73c2f63..1182031 100644 (file)
@@ -54,5 +54,6 @@ void print_multipath (struct multipath * mpp, char * style);
 void print_pathgroup (struct pathgroup * pgp, char * style);
 void print_map (struct multipath * mpp);
 void print_all_paths (vector pathvec, int banner);
+void print_all_paths_custo (vector pathvec, int banner, char *fmt);
 void print_hwtable (vector hwtable);