The xstdlib (eXtended Standard Library) is a library that ports many essential or miscellaneous high-level language functions (like in PHP, Python or Perl) to C or any functions that are of common use to C developers.
Version: 1.9.0
You can also find this download @ Source Forge
Documentation
Installation
1) Unpack xstdlibversion.tar.gz tar ball by running this in command line: tar -zxvf xstdlibversion.tar.gz
2) cd xstdlib/
3) make
4) sudo make install
5) make clean
Usage and compile instructions
To use this library is just like using any other library in C just include the header file in your source file, like so:
1 | #include <xstdlib.h> |
When compiling a program using the xstdlib library add the flag -lxstdlib …for example:
1 | gcc -Wall mysource.c -o mysource.o -lxstdlib |
Or with cc compiler:
1 | cc -Wall mysource.c -o mysource.o -lxstdlib |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /******************************************************************** * Name: xstdlib_test.c * Author: rashaudteague * Date: 01/10/2012 * License: GNU GPL <http://www.gnu.org/licenses/> * Description: <description> ********************************************************************/ #include <stdio.h> #include <xstdlib.h> int main(void) { float i = 6.066; float rounded = xround(i, 1); printf("%.5f rounded = %.2fn", i, rounded); return 0; } |
Output:
6.06600 rounded = 6.10
