1 Headers
To use the facilities of C conveniently we first define some classes naming the standard header files.
The class
construction provides a namespace.
The contained header
specification provides
a tag name for a C include line. A use of a
type or function lifted from C depending on the
inclusion of the header text causes the Felix compiler
to emit the header text.
2 C Standards.
Each newer C Standard adds some header files.
The inherit
statement is used to include the headers
from the previous standard into a more recent one.
2.1 C89 Standard.
The original ANSI Standard blessed as an ISO Standard.
share/lib/std/c/c_headers.flx
// reference: Wikipedia: http://en.wikibooks.org/wiki/C_Programming/Reference_Tables#List_of_Standard_Headers // ANSI C89 = ISO C90 class C89_headers { header assert_h = " "; header ctype_h = " "; header errno_h = " "; header float_h = " "; header limits_h = " "; header locale_h = " "; header math_h = " "; header setjmp_h = " "; header signal_h = " "; header stdarg_h = " "; header stddef_h = " "; header stdio_h = " "; header stdlib_h = " "; header string_h = " "; header time_h = " "; }
2.2 C95 Amendment
Added support for wide characters.
share/lib/std/c/c_headers.flx
// ISO C94/95 Amendment 1 class C95_headers { inherit C89_headers; header iso646_h = " "; header wchar_h = " "; header wctype_h = " "; }
2.3 C99 Standard
Added support for complex, exact integer types and bool.
share/lib/std/c/c_headers.flx
// ISO C99 class C99_headers { inherit C95_headers; header complex_h = " "; header fenv_h = " "; header inttypes_h = " "; header wctype_h = " "; header stdbool_h = " "; header stdint_h = " "; header tgmath_h = " "; }
3 C++ Standards.
Each newer C++ Standard adds some header files.
The inherit
statement is used to include the headers
from the previous standard into a more recent one.
3.1 C++90 Standard
The original C++ Standard.
share/lib/std/c/cxx_headers.flx
class Cxx_headers { header exception = ' '; header limits = ' '; header new = ' '; header typeinfo = ' '; header stdexcept = ' '; header utility = ' '; header memory = ' '; header string = ' '; header locale = ' '; // STL header functional = ' '; header algorithm = ' '; header bitset = ' '; header deque = ' '; header iterator = ' '; header list = ' '; header map = ' '; header set = ' '; header stack = ' '; header vector = ' '; header complex = ' '; header numeric = ' '; header valarray = ' '; // I/O header fstream = ' '; header iomanip = ' '; header ios = ' '; header iosfwd = ' '; header iostream = ' '; header istream = ' '; header ostream = ' '; header streambuf = ' '; header sstream = ' '; // ISO C wrappers header cassert = ' '; header cctype = ' '; header cerrno = ' '; header cfloat = ' '; header ciso646 = ' '; header climits = ' '; header clocale = ' '; header cmath = ' '; header csetjmp = ' '; header csignal = ' '; header cstdarg = ' '; header cstdio = ' '; header cstdlib = ' '; header cstring = ' '; header ctime = ' '; header cwchar = ' '; header cwctype = ' '; }
3.2 C++11 Standard.
A more recent standard from 2011. Added a huge number of new features.
share/lib/std/c/cxx_headers.flx
class Cxx11_headers // http://en.cppreference.com/w/cpp/header { inherit Cxx_headers; header system_error = ' '; // std=? header typeidex = ' '; header type_traits = ' '; header chrono = ' '; header initialiser_list = ' '; header tuple = ' '; header scope_allocator = ' '; header cuchar = ' '; header array = ' '; header forward_list = ' '; header unordered_set = ' '; header unordered_map = ' '; header ratio = ' '; header cfenv= ' '; header codecvt = ' '; header regex = ' '; header random = ' '; header atomic = ' '; header thread = ' '; header mutex = ' '; header future = ' '; header condition_variable = ' '; header ctgmath = ' '; header cstdalign = ' '; header cstdbool = ' '; }
4 Posix
There are multiple Posix standards but we just include headers from the most recent, most final one.
share/lib/std/posix/posix_headers.flx
class Posix_headers { header aio_h = " "; header arpa_inet_h = " "; header cpio_h = " "; header dirent_h = " "; header dlfcn_h = " "; header fcntl_h = " "; header fmtmsg_h = " "; header fnmatch_h = " "; header ftw_h = " "; header glob_h = " "; header grp_h = " "; header iconv_h = " "; header langinfo_h = " "; header libgen_h = " "; header monetary_h = " "; header mqueue_h = " "; header ndbm_h = " "; header net_if_h = " "; header netdb_h = " "; header netinet_in_h = " "; header netinet_tcp_h = " "; header nl_types_h = " "; header poll_h = " "; header pthread_h = " "; header pwd_h = " "; header regex_h = " "; header sched_h = " "; header search_h = " "; header semaphore_h = " "; header spawn_h = " "; header strings_h = " "; header stropts_h = " "; header sys_ipc_h = " "; header sys_mman_h = " "; header sys_msg_h = " "; header sys_resource_h = " "; header sys_select_h = " "; header sys_sem_h = " "; header sys_shm_h = " "; header sys_socket_h = " "; header sys_stat_h = " "; header sys_statvfs_h = " "; header sys_time_h = " "; header sys_times_h = " "; header sys_types_h = " "; header sys_uio_h = " "; header sys_un_h = " "; header sys_utsname_h = " "; header sys_wait_h = " "; header syslog_h = " "; header tar_h = " "; header termios_h = " "; header trace_h = " "; header ulimit_h = " "; header unistd_h = " "; header utime_h = " "; header utmpx_h = " "; header wordexp_h = " "; }
5 Windows
The name win32 for the original 32 bit Windows has stuck, even for 64 bit Windows.
share/lib/std/win32/win32_headers.flx
class Win32_headers { header windows_h = " "; header io_h = " "; header direct_h = " "; header sys_timeb_h = " "; header sys_utime_h = " "; header process_h = " "; }