Sha256: 6e0d0870b845d6e8d61dd1718cd571db3db0495c7e2fb293b51d0f1bfd8fd341
Contents?: true
Size: 744 Bytes
Versions: 1
Compression:
Stored size: 744 Bytes
Contents
/////////////////////////////////////////////////////////////////////////////// // /// \file tuklib_mstr_fw.c /// \brief Get the field width for printf() e.g. to align table columns // // Author: Lasse Collin // // This file has been put into the public domain. // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// #include "tuklib_mbstr.h" extern int tuklib_mbstr_fw(const char *str, int columns_min) { size_t len; const size_t width = tuklib_mbstr_width(str, &len); if (width == (size_t)-1) return -1; if (width > (size_t)columns_min) return 0; if (width < (size_t)columns_min) len += (size_t)columns_min - width; return len; }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
laag-xz-5.2.4.0 | vendor/git.tukaani.org/xz/src/common/tuklib_mbstr_fw.c |