Skip to main content

Crate smartcols_sys

Crate smartcols_sys 

Source
Expand description

crates.io docs.rs license

§smartcols-sys: Unsafe Rust bindings for libsmartcols

libsmartcols helps format tables when structured data is output.

This crate is Linux-specific. Building it for non-Linux platforms, or for the Linux kernel, results in an empty crate.

This crate links to libsmartcols, and requires it to be installed. See below for example installation instructions.

§Installing libsmartcols

This crate links to libsmartcols, and requires it to be installed.

The library, its C header files, and the clang compiler need to be installed on the build machine. On Debian, for example, one can install that as follows:

sudo apt-get install clang libsmartcols-dev

If the library is linked dynamically (most typical configuration), then it needs to be installed on the target computer in order to run the resulting program. On Debian, for example, one can install it as follows:

sudo apt-get install libsmartcols1

§Supported environment variables

This crate depends on some environment variables, and variants of those. For each environment variable (e.g., CC), the following are the accepted variants of it:

  • <var>_<target>, e.g., CC_aarch64-unknown-linux-gnu.
  • <var>_<target-with-underscores>, e.g., CC_aarch64_unknown_linux_gnu.
  • TARGET_<var>, e.g., TARGET_CC.
  • <var>, e.g., CC.

The following environment variables (and their variants) affect how this crate is built:

  • SMARTCOLS_STATIC
  • SMARTCOLS_PATH
  • SMARTCOLS_INCLUDE_DIR
  • SMARTCOLS_LIB_DIR
  • SYSROOT
  • CC
  • CFLAGS

§Dynamic or static linking

This crate links to libsmartcols dynamically if possible, except when targeting platforms based on the musl C library.

This behavior can be changed either by setting the environment variable SMARTCOLS_STATIC to 1, or by enabling the crate feature static. If both are defined, then the value of SMARTCOLS_STATIC takes precedence.

Setting SMARTCOLS_STATIC to 0 mandates dynamic linking.

§Finding smartcols library and headers

By default, this crate finds smartcols headers and library based on the default target C compiler.

This behavior can be changed by:

  • Either defining the environment variable SMARTCOLS_PATH to the path of a directory containing the sub-directories include and lib where the headers and library are installed.
  • Or by defining one or both of the environment variables SMARTCOLS_INCLUDE_DIR and SMARTCOLS_LIB_DIR to paths to the directories where headers and library are present. If SMARTCOLS_PATH is also defined, then SMARTCOLS_INCLUDE_DIR and SMARTCOLS_LIB_DIR take precedence.

§Depending on this crate

This crate provides the following variables to other crates that depend on it:

  • DEP_SMARTCOLS_INCLUDE: Path of the directory where library C header files reside.
  • DEP_SMARTCOLS_LIB: Path of the directory where the library binary resides.

§Documentation-only build mode

The documentation-only build mode allows building documentation even if libsmartcols and its headers are unavailable. To build in this mode, set the environment variable DOCS_RS to 1:

env DOCS_RS=1 cargo doc --open

The generated documentation is based on libsmartcols version 2.40.4.

⚠️ The generated crate might be unusable in this mode.

§Versioning

This project adheres to Semantic Versioning. The CHANGELOG.md file details notable changes over time.

Structs§

__va_list_tag
libscols_cell
libscols_cell:
libscols_column
libscols_column:
libscols_counter
libscols_counter:
libscols_filter
libscols_filter:
libscols_iter
libscols_iter:
libscols_line
libscols_line:
libscols_symbols
libscols_symbols:
libscols_table
libscols_table:

Constants§

LIBSMARTCOLS_VERSION
SCOLS_CELL_FL_CENTER
SCOLS_CELL_FL_LEFT
SCOLS_CELL_FL_RIGHT
SCOLS_COUNTER_COUNT
SCOLS_COUNTER_MAX
SCOLS_COUNTER_MIN
SCOLS_COUNTER_SUM
SCOLS_DATA_BOOLEAN
SCOLS_DATA_FLOAT
SCOLS_DATA_NONE
SCOLS_DATA_STRING
SCOLS_DATA_U64
SCOLS_DEBUG_ALL
SCOLS_DEBUG_BUFF
SCOLS_DEBUG_CELL
SCOLS_DEBUG_COL
SCOLS_DEBUG_FLTR
SCOLS_DEBUG_FPARAM
SCOLS_DEBUG_GROUP
SCOLS_DEBUG_HELP
SCOLS_DEBUG_INIT
SCOLS_DEBUG_LINE
SCOLS_DEBUG_TAB
SCOLS_FL_HIDDEN
SCOLS_FL_NOEXTREMES
SCOLS_FL_RIGHT
SCOLS_FL_STRICTWIDTH
SCOLS_FL_TREE
SCOLS_FL_TRUNC
SCOLS_FL_WRAP
SCOLS_ITER_BACKWARD
SCOLS_ITER_FORWARD
SCOLS_JSON_ARRAY_NUMBER
SCOLS_JSON_ARRAY_STRING
SCOLS_JSON_BOOLEAN
SCOLS_JSON_BOOLEAN_OPTIONAL
SCOLS_JSON_FLOAT
SCOLS_JSON_NUMBER
SCOLS_JSON_STRING
SCOLS_TERMFORCE_ALWAYS
SCOLS_TERMFORCE_AUTO
SCOLS_TERMFORCE_NEVER
__SCOLS_NCOUNTES

Functions§

scols_cell_copy_content⚠
scols_cell_disable_uri⚠
scols_cell_get_alignment⚠
scols_cell_get_color⚠
scols_cell_get_data⚠
scols_cell_get_datasiz⚠
scols_cell_get_flags⚠
scols_cell_get_uri⚠
scols_cell_get_userdata⚠
scols_cell_refer_data⚠
scols_cell_refer_memory⚠
scols_cell_set_color⚠
scols_cell_set_data⚠
scols_cell_set_flags⚠
scols_cell_set_uri⚠
scols_cell_set_userdata⚠
scols_cmpstr_cells⚠
scols_column_get_annotation⚠
scols_column_get_color⚠
scols_column_get_data_type⚠
scols_column_get_flags⚠
scols_column_get_header⚠
scols_column_get_headercolor⚠
scols_column_get_json_type⚠
scols_column_get_name⚠
scols_column_get_name_as_shellvar⚠
scols_column_get_safechars⚠
scols_column_get_table⚠
scols_column_get_uri⚠
scols_column_get_whint⚠
scols_column_get_width⚠
scols_column_get_wrap_data⚠
scols_column_has_data_func⚠
scols_column_is_customwrap⚠
scols_column_is_hidden⚠
scols_column_is_noextremes⚠
scols_column_is_right⚠
scols_column_is_strict_width⚠
scols_column_is_tree⚠
scols_column_is_trunc⚠
scols_column_is_wrap⚠
scols_column_refer_annotation⚠
scols_column_set_cmpfunc⚠
scols_column_set_color⚠
scols_column_set_data_func⚠
scols_column_set_data_type⚠
scols_column_set_flags⚠
scols_column_set_headercolor⚠
scols_column_set_json_type⚠
scols_column_set_name⚠
scols_column_set_properties⚠
scols_column_set_safechars⚠
scols_column_set_uri⚠
scols_column_set_whint⚠
scols_column_set_wrapfunc⚠
scols_copy_column⚠
scols_copy_line⚠
scols_copy_symbols⚠
scols_copy_table⚠
scols_counter_get_name⚠
scols_counter_get_result⚠
scols_counter_set_func⚠
scols_counter_set_name⚠
scols_counter_set_param⚠
scols_dump_filter⚠
scols_filter_assign_column⚠
scols_filter_get_errmsg⚠
scols_filter_has_holder⚠
scols_filter_new_counter⚠
scols_filter_next_counter⚠
scols_filter_next_holder⚠
scols_filter_parse_string⚠
scols_filter_set_filler_cb⚠
scols_free_iter⚠
scols_get_library_version⚠
scols_init_debug⚠
scols_iter_get_direction⚠
scols_line_add_child⚠
scols_line_alloc_cells⚠
scols_line_apply_filter⚠
scols_line_free_cells⚠
scols_line_get_cell⚠
scols_line_get_color⚠
scols_line_get_column_cell⚠
scols_line_get_column_data⚠
scols_line_get_ncells⚠
scols_line_get_parent⚠
scols_line_get_userdata⚠
scols_line_has_children⚠
scols_line_is_ancestor⚠
scols_line_is_filled⚠
scols_line_link_group⚠
scols_line_next_child⚠
scols_line_refer_column_data⚠
scols_line_refer_data⚠
scols_line_remove_child⚠
scols_line_set_color⚠
scols_line_set_column_data⚠
scols_line_set_data⚠
scols_line_set_userdata⚠
scols_line_sprintf⚠
scols_line_sprintf_column⚠
scols_line_vprintf⚠
scols_line_vprintf_column⚠
scols_new_column⚠
scols_new_filter⚠
scols_new_iter⚠
scols_new_line⚠
scols_new_symbols⚠
scols_new_table⚠
scols_parse_version_string⚠
scols_print_table⚠
scols_print_table_to_string⚠
scols_ref_column⚠
scols_ref_filter⚠
scols_ref_line⚠
scols_ref_symbols⚠
scols_ref_table⚠
scols_reset_cell⚠
scols_reset_iter⚠
scols_shellvar_name⚠
scols_sort_table⚠
scols_sort_table_by_tree⚠
scols_symbols_set_branch⚠
scols_symbols_set_cell_padding⚠
scols_symbols_set_group_first_member⚠
scols_symbols_set_group_horizontal⚠
scols_symbols_set_group_last_child⚠
scols_symbols_set_group_last_member⚠
scols_symbols_set_group_middle_child⚠
scols_symbols_set_group_middle_member⚠
scols_symbols_set_group_vertical⚠
scols_symbols_set_right⚠
scols_symbols_set_title_padding⚠
scols_symbols_set_vertical⚠
scols_table_add_column⚠
scols_table_add_line⚠
scols_table_colors_wanted⚠
scols_table_enable_ascii⚠
scols_table_enable_colors⚠
scols_table_enable_export⚠
scols_table_enable_header_repeat⚠
scols_table_enable_json⚠
scols_table_enable_maxout⚠
scols_table_enable_minout⚠
scols_table_enable_noencoding⚠
scols_table_enable_noheadings⚠
scols_table_enable_nolinesep⚠
scols_table_enable_nowrap⚠
scols_table_enable_raw⚠
scols_table_enable_shellvar⚠
scols_table_get_column⚠
scols_table_get_column_by_name⚠
scols_table_get_column_separator⚠
scols_table_get_cursor⚠
scols_table_get_line⚠
scols_table_get_line_separator⚠
scols_table_get_name⚠
scols_table_get_ncols⚠
scols_table_get_nlines⚠
scols_table_get_stream⚠
scols_table_get_symbols⚠
scols_table_get_termforce⚠
scols_table_get_termheight⚠
scols_table_get_termwidth⚠
scols_table_get_title⚠
scols_table_group_lines⚠
scols_table_is_ascii⚠
scols_table_is_empty⚠
scols_table_is_export⚠
scols_table_is_header_repeat⚠
scols_table_is_json⚠
scols_table_is_maxout⚠
scols_table_is_minout⚠
scols_table_is_noencoding⚠
scols_table_is_noheadings⚠
scols_table_is_nolinesep⚠
scols_table_is_nowrap⚠
scols_table_is_raw⚠
scols_table_is_shellvar⚠
scols_table_is_tree⚠
scols_table_move_column⚠
scols_table_new_column⚠
scols_table_new_line⚠
scols_table_next_column⚠
scols_table_next_line⚠
scols_table_print_range⚠
scols_table_print_range_to_string⚠
scols_table_reduce_termwidth⚠
scols_table_remove_column⚠
scols_table_remove_columns⚠
scols_table_remove_line⚠
scols_table_remove_lines⚠
scols_table_set_column_separator⚠
scols_table_set_columns_iter⚠
scols_table_set_default_symbols⚠
scols_table_set_line_separator⚠
scols_table_set_name⚠
scols_table_set_stream⚠
scols_table_set_symbols⚠
scols_table_set_termforce⚠
scols_table_set_termheight⚠
scols_table_set_termwidth⚠
scols_unref_column⚠
scols_unref_filter⚠
scols_unref_line⚠
scols_unref_symbols⚠
scols_unref_table⚠
scols_wrapnl_chunksize⚠
scols_wrapnl_nextchunk⚠
scols_wrapzero_nextchunk⚠

Type Aliases§

FILE
__builtin_va_list
_bindgen_ty_1
_bindgen_ty_2
_bindgen_ty_3
_bindgen_ty_4
_bindgen_ty_5
_bindgen_ty_6
_bindgen_ty_7
va_list