Jump to content

C Library: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Created page with "The '''C library''' is a system library that contains common C language subroutines for file access, string operators, character operations, memory allocation, and other f..."
 
Ak120 (talk | contribs)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
The '''C library''' is a system library that contains common [[C]] language subroutines for file access, string operators, character operations, memory allocation, and other functions.
If the compiler you use supports both C and C++, you can use C libraries with your C++ programs and vice versa, however using C++ libraries from C can be a bit kludgey and can require you to write bindings, while using C libraries with C++ is less problematic it can also require you to write some interfaces, take a look at the [[C++]] for available libraries.


==Library Functions==
===Text UI libraries===
{|class="wikitable"
;Open source
!Header||Function|| ||Extension
*[[nCurses]] - Text UI library
|-
*[[Public Domain Curses]] - Text UI library
|assert.h||assert||Diagnostic message
 
|-
;Commercial
|rowspan=4|conio.h||_cgets||Character read
*C-scape Interface Management System - Screen painter and UI library
|-
*[[Greenleaf Data Windows]] - Text mode windows & UI
|_cprintf||Character print
*Neuron Data Open Interface - Screen painter/UI toolkit
|-
*[[Panel Plus II]] - Screen painter and UI library
|_cputs||String write
 
|-
===Graphics libraries===
|_cscanf||Read from keyboard
;Open source
|-
*[[Cairo]] - 2D graphics library
|rowspan=2|direct.h||chdir||Change directory
*[[Jpeglib]] - Read/write JPEG graphic files
|-
*[[Libpng]] - Read/write PNG files
|_chdrive||Change drive
*[[SVGA-Kit and VESA-EMX]] - Graphic libraries
|-
*[[Pixman]] - Low level graphics library
|rowspan=16|io.h||access||Access mode determination
*[[Simple Directmedia Layer]] - Multimedia
|-
*[[WebM libvpx]] - VP8/VP9 streaming video
|chmod||Change file permission
 
|-
;Commercial
|_chsize||Change file length
*IBM SAA Common User Access Controls Library/2
|-
*XVT - Screen painter and UI library
|close||Close file handle
 
|-
===Database libraries===
|creat||Create file
;Commercial
|-
*[[C/Database Toolchest]] - Database creation and maintenance
|dup||Duplicate file handle
*[[dbfLIB]] - [[xBase]] database library
|-
*[[e_Db]] - Database engine
|dup2||Second handle for open file
*[[Lattice dBC III]] - [[xBase]] database library
|-
;Open Source
|__eof||End of file determination
*[[libdbf]] - reads dbf files
|-
 
|_filelength||File length determination
===Other libraries===
|-
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
|isatty, _isatty||Character device determination||X/Open
;Open Source
|-
* [[Andy's Dynamic Link Library]] - Cross platform DLLs
|lseek||File pointer movement
* [[cstring]] - String manipulation
|-
* [[CUtil]] - Common OS/2 functions
|open||File open
* [[Eco Common Lisp]] - Embedded scripting language
|-
* [[FFTW]] - Fast Fourier Transforms
|read||File read
* [[libcURL]] Internet communications library
|-
* [[Libxml2]] - [[XML]] parser
|_tell||File pointer position
* [[Libxslt]] - XSLT parser
|-
* [[LZO]] - Compression library
|umask||File permission mask setting
* [[LZ4]] - Compression library
|-
* [[OpenSSL]] - SSL & encryption
|write||Write from buffer to file
* [[POSIX Pthreads]] - BSD Pthreads library
|-
* [[Public Domain Project C Library]] - Alternative CLIB
|locale.h||localeconv||Locale information from environment
* [[shwild]] - Wildcard pattern matching
|-
* [[S-Lang]] - Embeddable macro/script language
|rowspan=26|math.h||acos||Arccosine
* [[Snappy]] - Compression library
|-
* [[The Standard Function Library]] - Generic library
|asin||Arcsine
;Commercial
|-
* [[e_Comm]] - Communications and networking
|atan, atan2||Arctangent
* [[e_Fs]] - Virtual file system
|-
* [[Lattice Comm Library]] - ANSI C communication library
|_j0, j1, _jn<br />_y0, _y1, _yn||Bessel
* [[LC-Port]] - [[Lattice C]] porting library
|-
</div>
|ceil||Find integer greater or equal
|-
|cos||Cosine
|-
|cosh||Cosine hyperbolic
|-
|erf, erfc||Error functions
|-
|exp||Exponential
|-
|fabs||Absolute value of floating-point
|-
|floor||Find integer smaller or equal
|-
|fmod||Remainder of floating-point
|-
|frexp||Floating-point value separation
|-
|gamma||Gamma||SAA
|-
|hypot||Hypotenuse||
|-
|ldexp||Power of 2
|-
|log||Natural logarithm
|-
|log10||Decimal logarithm
|-
|_matherr||Math library error processing
|-
|modf||Floating-point value separation
|-
|pow||Power
|-
|sin||Sine
|-
|sinh||Sine hyperbolic
|-
|sqrt||Square root
|-
|tan||Tangent
|-
|tanh||Tangent hyperbolic
|-
|rowspan=3|nl_types.h||catclose||Message catalogue close
|-
|catgets||Message catalogue retrieval
|-
|catgets||Message catalogue open
|-
|rowspan=2|process.h||_cwait||Child process wait
|-
|execl||Child process execution
|-
|search.h||lfind||Find key in array
|-
|rowspan=21|stdio.h||clearerr||Error indicator reset
|-
|fclose||Stream close
|-
|_fcloseall||All open streams close
|-
|fdopen||I/O association with file
|-
|feof||EOF indicator test
|-
|ferror||Read/write error test
|-
|fflush||Buffer write to file
|-
|fgets||Byte read
|-
|fgetpos||File position
|-
|fgets||String read
|-
|fgetwc||Wide character read from stream
|-
|fgetws||Wide char string read from stream
|-
|fileno||File handle determination
|-
|_flushall||Buffers write to files
|-
|fopen||File open
|-
|fprintf||Formatted data write to stream
|-
|fputc||Byte write
|-
|fputs||String write
|-
|fputwc||Wide character write
|-
|fputws||Wide char string write
|-
|fread||Stream read
|-
|rowspan=18|stdlib.h||abort||stop
|-
|abs||Absolute value of integer
|-
|atexit||Record program termination
|-
|atof||Character string to float conversion
|-
|atoi||Character string to integer conversion
|-
|atol||Character string to long integer conversion
|-
|_atold||Character string to long double conversion
|-
|_beginthread||New thread creation
|-
|bsearch||Array search
|-
|calloc||Storage space reservation
|-
|div||Quotient and remainder
|-
|_ecvt||Floating-point to character conversion
|-
|_endthread||Thread termination
|-
|exit||Program exit
|-
|_exit||Process end
|-
|_fcvt||Floating-point to string conversion
|-
|labs||Absolute value of long integer
|-
|ldiv||Long division
|-
|rowspan=5|time.h||asctime||Time to character string conversion
|-
|clock||Processor time
|-
|ctime||Time to character string conversion
|-
|difftime||Time difference
|-
|localtime||Time conversion
|}


[[Category:C]]
[[Category:C]]

Latest revision as of 16:52, 23 February 2020

If the compiler you use supports both C and C++, you can use C libraries with your C++ programs and vice versa, however using C++ libraries from C can be a bit kludgey and can require you to write bindings, while using C libraries with C++ is less problematic it can also require you to write some interfaces, take a look at the C++ for available libraries.

Text UI libraries

Open source
Commercial
  • C-scape Interface Management System - Screen painter and UI library
  • Greenleaf Data Windows - Text mode windows & UI
  • Neuron Data Open Interface - Screen painter/UI toolkit
  • Panel Plus II - Screen painter and UI library

Graphics libraries

Open source
Commercial
  • IBM SAA Common User Access Controls Library/2
  • XVT - Screen painter and UI library

Database libraries

Commercial
Open Source

Other libraries

Open Source
Commercial