]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: add samples directory
authorKarel Zak <kzak@redhat.com>
Mon, 25 Jan 2016 12:17:43 +0000 (13:17 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 25 Jan 2016 12:17:43 +0000 (13:17 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libsmartcols/Makemodule.am
libsmartcols/samples/tree.c [moved from libsmartcols/src/test.c with 98% similarity]
libsmartcols/src/Makemodule.am
libsmartcols/src/column.c

index 2c1ffbc057267c05c992b95fb16caf535fb378a6..cb33535a0e0f6e2831bea0a1a7f1ee3f704e5c27 100644 (file)
@@ -954,7 +954,6 @@ AC_ARG_ENABLE([libsmartcols],
 )
 UL_BUILD_INIT([libsmartcols])
 AM_CONDITIONAL([BUILD_LIBSMARTCOLS], [test "x$build_libsmartcols" = xyes])
-AM_CONDITIONAL([BUILD_LIBSMARTCOLS_TESTS], [test "x$build_libsmartcols" = xyes -a "x$enable_static" = xyes])
 
 AC_SUBST([LIBSMARTCOLS_VERSION])
 AC_SUBST([LIBSMARTCOLS_VERSION_INFO])
index d5b91ffa375efb6a79387e2a98251683aa294905..012848b2b09d4aab2689560f2fb8449748303cc3 100644 (file)
@@ -1,6 +1,7 @@
 if BUILD_LIBSMARTCOLS
 
 include libsmartcols/src/Makemodule.am
+include libsmartcols/samples/Makemodule.am
 
 if ENABLE_GTK_DOC
 # Docs uses separate Makefiles
similarity index 98%
rename from libsmartcols/src/test.c
rename to libsmartcols/samples/tree.c
index f520d4c1c5706e29743872332168c4b37d60ca86..7f41f9eb42644502d7d50d8fc6b6eac5b874bf33 100644 (file)
@@ -212,11 +212,11 @@ int main(int argc, char *argv[])
        }
 
        scols_table_enable_colors(tb, 1);
-       scols_table_set_title(tb, "This is table title", SCOLS_TITLE_CENTER, "red");
-
        setup_columns(tb, notree);
 
-       while (optind < argc)
+       if (optind == argc)
+               add_lines(tb, ".");
+       else while (optind < argc)
                add_lines(tb, argv[optind++]);
 
        scols_print_table(tb);
index 45a7eeab4c63f25a9bd4b3026bd9fe446fcd5139..c2ec515d46199d2212ca89eae9e99a05d6c5c539 100644 (file)
@@ -43,19 +43,6 @@ EXTRA_DIST += \
        libsmartcols/src/libsmartcols.sym \
        libsmartcols/src/libsmartcols.h.in
 
-
-if BUILD_LIBSMARTCOLS_TESTS
-check_PROGRAMS += test_smartcols
-
-libsmartcols_tests_cflags = $(libsmartcols_la_CFLAGS)
-libsmartcols_tests_ldadd  = libsmartcols.la libcommon.la libtcolors.la
-
-test_smartcols_SOURCES = libsmartcols/src/test.c
-test_smartcols_CFLAGS = $(libsmartcols_tests_cflags)
-test_smartcols_LDADD = $(libsmartcols_tests_ldadd)
-endif # BUILD_LIBSMARTCOLS_TESTS
-
-
 # move lib from $(usrlib_execdir) to $(libdir) if needed
 install-exec-hook-libsmartcols:
        if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libsmartcols.so"; then \
index 047373024accd9eeae196e931da767c3c1c07649..ce589684ef57c312c314ba9479ead5eb8a516e47 100644 (file)
@@ -359,6 +359,8 @@ int scols_column_is_noextremes(struct libscols_column *cl)
  * Gets the value of @cl's flag wrap.
  *
  * Returns: wrap flag value, negative value in case of an error.
+ *
+ * Since: 2.28
  */
 int scols_column_is_wrap(struct libscols_column *cl)
 {