From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/FUNCTIONS/Makefile.am | 5 + reference/C/FUNCTIONS/Makefile.in | 410 +++++++++++++++++++ reference/C/FUNCTIONS/Master.html | 64 +++ reference/C/FUNCTIONS/abort.htm | 69 ++++ reference/C/FUNCTIONS/arglists.html | 46 +++ reference/C/FUNCTIONS/atexit.htm | 81 ++++ reference/C/FUNCTIONS/atof.html | 59 +++ reference/C/FUNCTIONS/atoi.html | 72 ++++ reference/C/FUNCTIONS/atol.html | 60 +++ reference/C/FUNCTIONS/bsearch.html | 60 +++ reference/C/FUNCTIONS/close.html | 78 ++++ reference/C/FUNCTIONS/clrscr.html | 48 +++ reference/C/FUNCTIONS/dec_tab.html | 62 +++ reference/C/FUNCTIONS/directory.html | 134 ++++++ reference/C/FUNCTIONS/env.html | 66 +++ reference/C/FUNCTIONS/errno.htm | 64 +++ reference/C/FUNCTIONS/escape.html | 86 ++++ reference/C/FUNCTIONS/execl.html | 67 +++ reference/C/FUNCTIONS/exit.html | 66 +++ reference/C/FUNCTIONS/fclose.html | 66 +++ reference/C/FUNCTIONS/fgetc.html | 69 ++++ reference/C/FUNCTIONS/fgets.html | 90 +++++ reference/C/FUNCTIONS/files.html | 89 ++++ reference/C/FUNCTIONS/fopen.html | 108 +++++ reference/C/FUNCTIONS/fork.html | 88 ++++ reference/C/FUNCTIONS/format.html | 315 +++++++++++++++ reference/C/FUNCTIONS/fprintf.html | 52 +++ reference/C/FUNCTIONS/fputc.html | 77 ++++ reference/C/FUNCTIONS/free.html | 80 ++++ reference/C/FUNCTIONS/funcframe.htm | 15 + reference/C/FUNCTIONS/funcquery.htm | 37 ++ reference/C/FUNCTIONS/funcref.htm | 760 +++++++++++++++++++++++++++++++++++ reference/C/FUNCTIONS/getchar.html | 75 ++++ reference/C/FUNCTIONS/getopt.html | 54 +++ reference/C/FUNCTIONS/gets.html | 81 ++++ reference/C/FUNCTIONS/hex_tab.html | 79 ++++ reference/C/FUNCTIONS/kill.html | 64 +++ reference/C/FUNCTIONS/malloc.html | 123 ++++++ reference/C/FUNCTIONS/memcpy.htm | 118 ++++++ reference/C/FUNCTIONS/open.html | 86 ++++ reference/C/FUNCTIONS/passwd.html | 92 +++++ reference/C/FUNCTIONS/pclose.html | 68 ++++ reference/C/FUNCTIONS/pipe.html | 100 +++++ reference/C/FUNCTIONS/popen.html | 88 ++++ reference/C/FUNCTIONS/printf.html | 106 +++++ reference/C/FUNCTIONS/puts.html | 46 +++ reference/C/FUNCTIONS/qsort.html | 100 +++++ reference/C/FUNCTIONS/rand.html | 73 ++++ reference/C/FUNCTIONS/read.html | 75 ++++ reference/C/FUNCTIONS/setuid.html | 102 +++++ reference/C/FUNCTIONS/sprintf.html | 61 +++ reference/C/FUNCTIONS/srand.html | 73 ++++ reference/C/FUNCTIONS/sscanf.html | 66 +++ reference/C/FUNCTIONS/stat.html | 124 ++++++ reference/C/FUNCTIONS/stdlib.html | 44 ++ reference/C/FUNCTIONS/strchr.html | 80 ++++ reference/C/FUNCTIONS/strcmp.html | 88 ++++ reference/C/FUNCTIONS/strcpy.html | 127 ++++++ reference/C/FUNCTIONS/strlen.html | 72 ++++ reference/C/FUNCTIONS/strncmp.html | 78 ++++ reference/C/FUNCTIONS/strncpy.html | 76 ++++ reference/C/FUNCTIONS/strpbrk.html | 75 ++++ reference/C/FUNCTIONS/strstr.html | 74 ++++ reference/C/FUNCTIONS/strtok.html | 100 +++++ reference/C/FUNCTIONS/strtol.html | 90 +++++ reference/C/FUNCTIONS/strtoul.html | 99 +++++ reference/C/FUNCTIONS/system.html | 67 +++ reference/C/FUNCTIONS/time.html | 86 ++++ reference/C/FUNCTIONS/uname.html | 59 +++ reference/C/FUNCTIONS/write.html | 78 ++++ 70 files changed, 6590 insertions(+) create mode 100644 reference/C/FUNCTIONS/Makefile.am create mode 100644 reference/C/FUNCTIONS/Makefile.in create mode 100644 reference/C/FUNCTIONS/Master.html create mode 100644 reference/C/FUNCTIONS/abort.htm create mode 100644 reference/C/FUNCTIONS/arglists.html create mode 100644 reference/C/FUNCTIONS/atexit.htm create mode 100644 reference/C/FUNCTIONS/atof.html create mode 100644 reference/C/FUNCTIONS/atoi.html create mode 100644 reference/C/FUNCTIONS/atol.html create mode 100644 reference/C/FUNCTIONS/bsearch.html create mode 100644 reference/C/FUNCTIONS/close.html create mode 100644 reference/C/FUNCTIONS/clrscr.html create mode 100644 reference/C/FUNCTIONS/dec_tab.html create mode 100644 reference/C/FUNCTIONS/directory.html create mode 100644 reference/C/FUNCTIONS/env.html create mode 100644 reference/C/FUNCTIONS/errno.htm create mode 100644 reference/C/FUNCTIONS/escape.html create mode 100644 reference/C/FUNCTIONS/execl.html create mode 100644 reference/C/FUNCTIONS/exit.html create mode 100644 reference/C/FUNCTIONS/fclose.html create mode 100644 reference/C/FUNCTIONS/fgetc.html create mode 100644 reference/C/FUNCTIONS/fgets.html create mode 100644 reference/C/FUNCTIONS/files.html create mode 100644 reference/C/FUNCTIONS/fopen.html create mode 100644 reference/C/FUNCTIONS/fork.html create mode 100644 reference/C/FUNCTIONS/format.html create mode 100644 reference/C/FUNCTIONS/fprintf.html create mode 100644 reference/C/FUNCTIONS/fputc.html create mode 100644 reference/C/FUNCTIONS/free.html create mode 100644 reference/C/FUNCTIONS/funcframe.htm create mode 100644 reference/C/FUNCTIONS/funcquery.htm create mode 100644 reference/C/FUNCTIONS/funcref.htm create mode 100644 reference/C/FUNCTIONS/getchar.html create mode 100644 reference/C/FUNCTIONS/getopt.html create mode 100644 reference/C/FUNCTIONS/gets.html create mode 100644 reference/C/FUNCTIONS/hex_tab.html create mode 100644 reference/C/FUNCTIONS/kill.html create mode 100644 reference/C/FUNCTIONS/malloc.html create mode 100644 reference/C/FUNCTIONS/memcpy.htm create mode 100644 reference/C/FUNCTIONS/open.html create mode 100644 reference/C/FUNCTIONS/passwd.html create mode 100644 reference/C/FUNCTIONS/pclose.html create mode 100644 reference/C/FUNCTIONS/pipe.html create mode 100644 reference/C/FUNCTIONS/popen.html create mode 100644 reference/C/FUNCTIONS/printf.html create mode 100644 reference/C/FUNCTIONS/puts.html create mode 100644 reference/C/FUNCTIONS/qsort.html create mode 100644 reference/C/FUNCTIONS/rand.html create mode 100644 reference/C/FUNCTIONS/read.html create mode 100644 reference/C/FUNCTIONS/setuid.html create mode 100644 reference/C/FUNCTIONS/sprintf.html create mode 100644 reference/C/FUNCTIONS/srand.html create mode 100644 reference/C/FUNCTIONS/sscanf.html create mode 100644 reference/C/FUNCTIONS/stat.html create mode 100644 reference/C/FUNCTIONS/stdlib.html create mode 100644 reference/C/FUNCTIONS/strchr.html create mode 100644 reference/C/FUNCTIONS/strcmp.html create mode 100644 reference/C/FUNCTIONS/strcpy.html create mode 100644 reference/C/FUNCTIONS/strlen.html create mode 100644 reference/C/FUNCTIONS/strncmp.html create mode 100644 reference/C/FUNCTIONS/strncpy.html create mode 100644 reference/C/FUNCTIONS/strpbrk.html create mode 100644 reference/C/FUNCTIONS/strstr.html create mode 100644 reference/C/FUNCTIONS/strtok.html create mode 100644 reference/C/FUNCTIONS/strtol.html create mode 100644 reference/C/FUNCTIONS/strtoul.html create mode 100644 reference/C/FUNCTIONS/system.html create mode 100644 reference/C/FUNCTIONS/time.html create mode 100644 reference/C/FUNCTIONS/uname.html create mode 100644 reference/C/FUNCTIONS/write.html (limited to 'reference/C/FUNCTIONS') diff --git a/reference/C/FUNCTIONS/Makefile.am b/reference/C/FUNCTIONS/Makefile.am new file mode 100644 index 0000000..28d46b6 --- /dev/null +++ b/reference/C/FUNCTIONS/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = $(wildcard *.html) $(wildcard *.htm) $(wildcard *.gif) +docs_DATA = $(EXTRA_DIST) + +docsdir = $(kde_htmldir)/en/kdevelop/$(subdir) + diff --git a/reference/C/FUNCTIONS/Makefile.in b/reference/C/FUNCTIONS/Makefile.in new file mode 100644 index 0000000..abc6499 --- /dev/null +++ b/reference/C/FUNCTIONS/Makefile.in @@ -0,0 +1,410 @@ +# KDE tags expanded automatically by am_edit - $Revision: 1.2 $ +# Makefile.in generated automatically by automake 1.5 from Makefile.am. + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +AMTAR = @AMTAR@ +ARTSCCONFIG = @ARTSCCONFIG@ +AS = @AS@ +AUTODIRS = @AUTODIRS@ +AWK = @AWK@ +CC = @CC@ +CONF_FILES = @CONF_FILES@ +CPP = @CPP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +DCOPIDL = @DCOPIDL@ +DCOPIDL2CPP = @DCOPIDL2CPP@ +DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DPMSINC = @DPMSINC@ +DPMSLIB = @DPMSLIB@ +EXEEXT = @EXEEXT@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +GLINC = @GLINC@ +GLLIB = @GLLIB@ +GMSGFMT = @GMSGFMT@ +IDL = @IDL@ +IDL_DEPENDENCIES = @IDL_DEPENDENCIES@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JAR = @JAR@ +JAVAC = @JAVAC@ +JAVAH = @JAVAH@ +JVMLIBS = @JVMLIBS@ +KDECONFIG = @KDECONFIG@ +KDE_CXXFLAGS = @KDE_CXXFLAGS@ +KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@ +KDE_INCLUDES = @KDE_INCLUDES@ +KDE_LDFLAGS = @KDE_LDFLAGS@ +KDE_PLUGIN = @KDE_PLUGIN@ +KDE_RPATH = @KDE_RPATH@ +KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@ +KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@ +KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@ +KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@ +KDE_XSL_STYLESHEET = @KDE_XSL_STYLESHEET@ +LIBCOMPAT = @LIBCOMPAT@ +LIBCRYPT = @LIBCRYPT@ +LIBDL = @LIBDL@ +LIBGEN = @LIBGEN@ +LIBJPEG = @LIBJPEG@ +LIBMICO = @LIBMICO@ +LIBOBJS = @LIBOBJS@ +LIBPNG = @LIBPNG@ +LIBPTHREAD = @LIBPTHREAD@ +LIBPYTHON = @LIBPYTHON@ +LIBQIMGIO = @LIBQIMGIO@ +LIBRESOLV = @LIBRESOLV@ +LIBSHADOW = @LIBSHADOW@ +LIBSM = @LIBSM@ +LIBSOCKET = @LIBSOCKET@ +LIBTIFF = @LIBTIFF@ +LIBTOOL = @LIBTOOL@ +LIBUCB = @LIBUCB@ +LIBUTIL = @LIBUTIL@ +LIBXINERAMA = @LIBXINERAMA@ +LIBZ = @LIBZ@ +LIB_KAB = @LIB_KAB@ +LIB_KDECORE = @LIB_KDECORE@ +LIB_KDEUI = @LIB_KDEUI@ +LIB_KFILE = @LIB_KFILE@ +LIB_KFM = @LIB_KFM@ +LIB_KFORMULA = @LIB_KFORMULA@ +LIB_KHTML = @LIB_KHTML@ +LIB_KIMGIO = @LIB_KIMGIO@ +LIB_KIO = @LIB_KIO@ +LIB_KPARTS = @LIB_KPARTS@ +LIB_KSPELL = @LIB_KSPELL@ +LIB_KSYCOCA = @LIB_KSYCOCA@ +LIB_KWRITE = @LIB_KWRITE@ +LIB_QT = @LIB_QT@ +LIB_SMB = @LIB_SMB@ +LIB_X11 = @LIB_X11@ +LN_S = @LN_S@ +MCOPIDL = @MCOPIDL@ +MEINPROC = @MEINPROC@ +MICO_INCLUDES = @MICO_INCLUDES@ +MICO_LDFLAGS = @MICO_LDFLAGS@ +MOC = @MOC@ +MSGFMT = @MSGFMT@ +NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@ +NOREPO = @NOREPO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PAMLIBS = @PAMLIBS@ +PASSWDLIBS = @PASSWDLIBS@ +PYTHONINC = @PYTHONINC@ +PYTHONLIB = @PYTHONLIB@ +PYTHONMODDIR = @PYTHONMODDIR@ +QT_INCLUDES = @QT_INCLUDES@ +QT_LDFLAGS = @QT_LDFLAGS@ +RANLIB = @RANLIB@ +REPO = @REPO@ +SETUIDFLAGS = @SETUIDFLAGS@ +STRIP = @STRIP@ +TOPSUBDIRS = @TOPSUBDIRS@ +UIC = @UIC@ +UIC_TR = @UIC_TR@ +USER_INCLUDES = @USER_INCLUDES@ +USER_LDFLAGS = @USER_LDFLAGS@ +USE_EXCEPTIONS = @USE_EXCEPTIONS@ +USE_RTTI = @USE_RTTI@ +USE_THREADS = @USE_THREADS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XPMINC = @XPMINC@ +XPMLIB = @XPMLIB@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_INCLUDES = @X_INCLUDES@ +X_LDFLAGS = @X_LDFLAGS@ +X_PRE_LIBS = @X_PRE_LIBS@ +all_includes = @all_includes@ +all_libraries = @all_libraries@ +am__include = @am__include@ +am__quote = @am__quote@ +idldir = @idldir@ +install_sh = @install_sh@ +jni_includes = @jni_includes@ +kde_appsdir = @kde_appsdir@ +kde_bindir = @kde_bindir@ +kde_confdir = @kde_confdir@ +kde_datadir = @kde_datadir@ +kde_htmldir = @kde_htmldir@ +kde_icondir = @kde_icondir@ +kde_includes = @kde_includes@ +kde_libraries = @kde_libraries@ +kde_libs_htmldir = @kde_libs_htmldir@ +kde_libs_prefix = @kde_libs_prefix@ +kde_locale = @kde_locale@ +kde_mimedir = @kde_mimedir@ +kde_moduledir = @kde_moduledir@ +kde_qtver = @kde_qtver@ +kde_servicesdir = @kde_servicesdir@ +kde_servicetypesdir = @kde_servicetypesdir@ +kde_sounddir = @kde_sounddir@ +kde_templatesdir = @kde_templatesdir@ +kde_wallpaperdir = @kde_wallpaperdir@ +micodir = @micodir@ +qt_includes = @qt_includes@ +qt_libraries = @qt_libraries@ +x_includes = @x_includes@ +x_libraries = @x_libraries@ + +EXTRA_DIST = $(wildcard *.html) $(wildcard *.htm) $(wildcard *.gif) +docs_DATA = $(EXTRA_DIST) + +docsdir = $(kde_htmldir)/en/kdevelop/$(subdir) +subdir = reference/C/FUNCTIONS +mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DATA = $(docs_DATA) + +DIST_COMMON = Makefile.am Makefile.in +#>- all: all-am +#>+ 1 +all: docs-am all-am + +.SUFFIXES: + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +#>- cd $(top_srcdir) && \ +#>- $(AUTOMAKE) --gnu reference/C/FUNCTIONS/Makefile +#>+ 3 + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu reference/C/FUNCTIONS/Makefile + cd $(top_srcdir) && perl admin/am_edit reference/C/FUNCTIONS/Makefile.in +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status +uninstall-info-am: +install-docsDATA: $(docs_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(docsdir) + @list='$(docs_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(docsdir)/$$f"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(docsdir)/$$f; \ + done + +uninstall-docsDATA: + @$(NORMAL_UNINSTALL) + @list='$(docs_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(docsdir)/$$f"; \ + rm -f $(DESTDIR)$(docsdir)/$$f; \ + done +tags: TAGS +TAGS: + + +#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +#>+ 4 +KDE_DIST=pclose.html qsort.html errno.htm getchar.html env.html escape.html fputc.html printf.html exit.html srand.html atexit.htm strncmp.html execl.html sprintf.html stat.html memcpy.htm strtol.html clrscr.html fprintf.html free.html read.html strtok.html fclose.html system.html uname.html strcmp.html dec_tab.html atol.html malloc.html puts.html hex_tab.html arglists.html rand.html fgetc.html funcquery.htm setuid.html write.html funcframe.htm bsearch.html atoi.html close.html passwd.html fopen.html strchr.html fgets.html files.html pipe.html kill.html directory.html abort.htm atof.html Master.html strncpy.html open.html time.html strlen.html gets.html strtoul.html format.html strstr.html sscanf.html strpbrk.html funcref.htm getopt.html strcpy.html popen.html fork.html stdlib.html + +DISTFILES= $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST) + + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ + if test -d $$d/$$file; then \ + cp -pR $$d/$$file $(distdir) \ + || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(docsdir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +#>- clean: clean-am +#>+ 1 +clean: kde-rpo-clean clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-docsDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +uninstall-am: uninstall-docsDATA uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-docsDATA install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool uninstall uninstall-am uninstall-docsDATA \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +#>+ 2 +docs-am: + +#>+ 6 +force-reedit: + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu reference/C/FUNCTIONS/Makefile + cd $(top_srcdir) && perl admin/am_edit reference/C/FUNCTIONS/Makefile.in + + +#>+ 2 +final: + $(MAKE) all-am +#>+ 2 +final-install: + $(MAKE) install-am +#>+ 2 +no-final: + $(MAKE) all-am +#>+ 2 +no-final-install: + $(MAKE) install-am +#>+ 3 +cvs-clean: + $(MAKE) -f $(top_srcdir)/admin/Makefile.common cvs-clean + +#>+ 3 +kde-rpo-clean: + -rm -f *.rpo diff --git a/reference/C/FUNCTIONS/Master.html b/reference/C/FUNCTIONS/Master.html new file mode 100644 index 0000000..6a9b6bf --- /dev/null +++ b/reference/C/FUNCTIONS/Master.html @@ -0,0 +1,64 @@ +XXXX function + + + + + + +
+
+

XXXX function

+
+
+XXXX +

+


+
+	Library:   stdlib.h
+
+	Prototype: char *gets(char *s);
+
+	Syntax:    char read_line[80];
+
+                   gets( read_line);
+
+
+
+

Examples:

+ + example +program. + +
+

See Also:

+ + +malloc function.

+ + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/abort.htm b/reference/C/FUNCTIONS/abort.htm new file mode 100644 index 0000000..2a00c99 --- /dev/null +++ b/reference/C/FUNCTIONS/abort.htm @@ -0,0 +1,69 @@ +ABORT function + + + + + + +


+
+

ABORT function

+
+
+The abort causes a program to abnormaly terminate. +

+


+
+
+	Library:   stdlib.h
+
+	Prototype: void abort(void);
+
+	Syntax:    main()
+                   {
+                     abort();
+                   }
+
+
+
+ +

+


+

Examples:

+ +No example program. + +
+

See Also:

+ + abort function.

+ exit function.

+ atext function.

+ + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/arglists.html b/reference/C/FUNCTIONS/arglists.html new file mode 100644 index 0000000..8f0842e --- /dev/null +++ b/reference/C/FUNCTIONS/arglists.html @@ -0,0 +1,46 @@ +Function argument lists. + + + + + + +


+
+

Function argument lists.

+
+

+ + +Normally, a function has a fixed number of arguments passed to it. But if +you have used something like 'printf' or 'scanf' you will know that a +variable number of arguments can be passed. This ability is defined by the use +of ... (three periods). Here is an example. + + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/atexit.htm b/reference/C/FUNCTIONS/atexit.htm new file mode 100644 index 0000000..330fabf --- /dev/null +++ b/reference/C/FUNCTIONS/atexit.htm @@ -0,0 +1,81 @@ +ATEXIT function + + + + + + +


+
+

ATEXIT function

+
+
+atexit regesters a function to be executed when the program +terminates normally. +

+


+
+
+	Library:   stdlib.h
+
+	Prototype: int atexit(void (*function)(void));
+
+	Syntax:    void End(void);
+        
+                   main()
+                   {
+                     atexit(End);
+                   }
+
+                   void End(void)
+                   {
+                     printf("The End\n");
+                   }
+
+
+ +
+Please see +function pointers +for information on how this works. + +

+


+

Examples:

+ + example +program. + +
+

See Also:

+ + exit function.

+ abort function.

+ +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + + diff --git a/reference/C/FUNCTIONS/atof.html b/reference/C/FUNCTIONS/atof.html new file mode 100644 index 0000000..f6d8f6b --- /dev/null +++ b/reference/C/FUNCTIONS/atof.html @@ -0,0 +1,59 @@ +atof function + + + + + + +


+
+

atof function

+
+
+

+atof to be done. + +

+Library:   stdlib.h
+
+Prototype: double atof(const char *ptr);
+
+Syntax:	  
+
+ +example program.

+


+See also:

+

atoi String to integer conversion. +
atol String to long integer conversion. +
strtod String to double conversion. +
strtol String to long integer conversion. +
strtoul String to unsigned long integer +conversion. + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/atoi.html b/reference/C/FUNCTIONS/atoi.html new file mode 100644 index 0000000..279c0fb --- /dev/null +++ b/reference/C/FUNCTIONS/atoi.html @@ -0,0 +1,72 @@ +atoi function + + + + + + +


+
+

atoi function

+
+
+

+atoi to be done. + +

+Library:   stdlib.h
+
+Prototype: 
+
+Syntax:	  
+
+
+

Example:

+ + example program.

+


+

See also:

+

+ +atof String to floating point conversion. +
+ +atol String to long integer conversion. +
+ +strtod String to double conversion. +
+ +strtol String to long integer conversion. +
+ +strtoul String to unsigned long integer +conversion. + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + + diff --git a/reference/C/FUNCTIONS/atol.html b/reference/C/FUNCTIONS/atol.html new file mode 100644 index 0000000..2a5099c --- /dev/null +++ b/reference/C/FUNCTIONS/atol.html @@ -0,0 +1,60 @@ +atol function + + + + +


+
+

atol function

+
+
+

+atol to be done. + +

+Library:   stdlib.h
+
+Prototype: 
+
+Syntax:	  
+
+ + +example program.

+


+

See also:

+

+

atof String to floating point conversion. +
atoi String to integer conversion. +
strtod String to double conversion. +
strtol String to long integer conversion. +
strtoul String to unsigned long integer +conversion. + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + + diff --git a/reference/C/FUNCTIONS/bsearch.html b/reference/C/FUNCTIONS/bsearch.html new file mode 100644 index 0000000..2c508e1 --- /dev/null +++ b/reference/C/FUNCTIONS/bsearch.html @@ -0,0 +1,60 @@ +bsearch function + + + + +


+

bsearch function

+
+

+bsearch will look for an item in a list by performing a binry chop. +The data should be pre-sorted for the search to work. +

+ +


+
+Library:   stdlib.h
+
+Prototype:
+
+Syntax:	 
+
+ + + +
+

See Also:

+ + +
+

Example:

+ + +Search an integer list. + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/close.html b/reference/C/FUNCTIONS/close.html new file mode 100644 index 0000000..89c3cea --- /dev/null +++ b/reference/C/FUNCTIONS/close.html @@ -0,0 +1,78 @@ +close function + + + + +


+
+

close function

+
+
+close +

+


+
+	Library:   unistd.h
+
+	Prototype: int close(int fd);
+
+	Syntax:    int fd;
+
+		   close(fd);
+
+
+
+

+ +


+

Examples:

+ + pipe example +program. + +
+

Man Pages:

+ close man page. + +
+

See Also:

+ + +pipe function.

+ + +open function.

+ + +write function.

+ + +fclose function.

+ + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/clrscr.html b/reference/C/FUNCTIONS/clrscr.html new file mode 100644 index 0000000..bfd2eb1 --- /dev/null +++ b/reference/C/FUNCTIONS/clrscr.html @@ -0,0 +1,48 @@ +clrscr function + + + + +

clrscr function

+clrscr clears the screen. This is non standard. + +
+Library:   conio.h
+
+Prototype: 
+
+Syntax:	   
+
+ +See also: + +Clear the screen using VT escape codes.

+ + + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + diff --git a/reference/C/FUNCTIONS/dec_tab.html b/reference/C/FUNCTIONS/dec_tab.html new file mode 100644 index 0000000..b9b7346 --- /dev/null +++ b/reference/C/FUNCTIONS/dec_tab.html @@ -0,0 +1,62 @@ +Decimal Ascii table + + + + +


+
+

Decimal Ascii table.

+
+
+Here is the Ascii table in base 10. +
+	000    001    002    003    004    005    006    007    
+	008    009    010    011    012    013    014    015    
+	016    017    018    019    020    021    022    023    
+	024    025    026    027    028    029    030    031    
+	032    033 !  034 "  035 #  036 $  037 %  038 &  039 '  
+	040 (  041 )  042 *  043 +  044 ,  045 -  046 .  047 /  
+	048 0  049 1  050 2  051 3  052 4  053 5  054 6  055 7  
+	056 8  057 9  058 :  059 ;  060 <  061 =  062 >  063 ?  
+	064 @  065 A  066 B  067 C  068 D  069 E  070 F  071 G  
+	072 H  073 I  074 J  075 K  076 L  077 M  078 N  079 O  
+	080 P  081 Q  082 R  083 S  084 T  085 U  086 V  087 W  
+	088 X  089 Y  090 Z  091 [  092 \  093 ]  094 ^  095 _  
+	096 `  097 a  098 b  099 c  100 d  101 e  102 f  103 g  
+	104 h  105 i  106 j  107 k  108 l  109 m  110 n  111 o  
+	112 p  113 q  114 r  115 s  116 t  117 u  118 v  119 w  
+	120 x  121 y  122 z  123 {  124 |  125 }  126 ~  127    
+
+ +And the hex table is here.

+ +A program to generate this table. + + +

+ +


+

+

+ + + + +
+ Top + + Master Index + + Keywords + + Functions +
+
+

+


+
Martin Leslie +

+ + + diff --git a/reference/C/FUNCTIONS/directory.html b/reference/C/FUNCTIONS/directory.html new file mode 100644 index 0000000..2e426f0 --- /dev/null +++ b/reference/C/FUNCTIONS/directory.html @@ -0,0 +1,134 @@ +Directory functions. + + + + +


+
+

Directory functions

+
+
+

+ +OK. First things first. These functions are NOT part of the ANSI standard +library. They may not be supported on your platform. +

+ +Here is a quick summary of each function, they are listed in the order in +which you may want to execute them. + +

  • opendir Open a directory stream. +
  • readdir read the current entry in the stream. +
  • scandir Find an entry in a direcory. +
  • seekdir Jump to a directory offset. +
  • telldir Return the current location within the directory stream. +
  • rewinddir Return to the start of the directory stream. +
  • closedir Close a directory. + + +
    + + + + + +
    +
    +
    +  Library:   dirent.h
    +
    +  Prototype: DIR *opendir(const char *name);
    +
    +             struct dirent *readdir(DIR *dir);
    +
    +             int scandir(const char *dir, struct dirent ***namelist,  
    +                 int (*select)(const struct dirent *),
    +                 int (*compar)(const void *, const void *));
    +		
    +	     void seekdir(DIR *dir, off_t offset);
    +
    +	     off_t telldir(DIR *dir);
    +
    +	     void rewinddir(DIR *dir);
    +
    +	     int closedir(DIR *dir);
    +
    +
    + +The dirent structure does not seem to be documented in the man pages, +so here it is. +

    + + + + +
    +
    +
    +	struct dirent 
    +	{
    +          long            d_ino;
    +       	  off_t           d_off;
    +       	  unsigned short  d_reclen;
    +       	  char            d_name[NAME_MAX+1];
    +	};
    +
    +
    + + + example program using opendir, readdir and closedir. +

    +


    +

    See Also:

    + +stat function. +

    +


    +

    man Pages:

    + +opendir + +readdir + +scandir + +seekdir + +telldir + +rewinddir + +closedir + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + + + + + diff --git a/reference/C/FUNCTIONS/env.html b/reference/C/FUNCTIONS/env.html new file mode 100644 index 0000000..0692d5c --- /dev/null +++ b/reference/C/FUNCTIONS/env.html @@ -0,0 +1,66 @@ +Enviornmental variable functions + + + + +


    +
    +

    Enviornmental variable functions

    +
    +
    + +

    +The following functions allow you to manipulate environmental variables. +

    + + +getenv Get the value of an environmental variable. +

    + + +putenv +Change or add an environmental variable. +

    + + +setenv +Change or add an environmental variable. +

    + + +unsetenv +Remove an environmental variable. +

    + + +printenv +program. +

    + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/errno.htm b/reference/C/FUNCTIONS/errno.htm new file mode 100644 index 0000000..a6051f4 --- /dev/null +++ b/reference/C/FUNCTIONS/errno.htm @@ -0,0 +1,64 @@ +XXXX function + + + + + + +


    +
    +

    XXXX function

    +
    +
    +XXXX +

    +


    +
    +	Library:   stdlib.h
    +
    +	Prototype: char *gets(char *s);
    +
    +	Syntax:    char read_line[80];
    +
    +                   gets( read_line);
    +
    +
    +
    +

    Examples:

    + + example +program. + +
    +

    See Also:

    + + +malloc function.

    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + diff --git a/reference/C/FUNCTIONS/escape.html b/reference/C/FUNCTIONS/escape.html new file mode 100644 index 0000000..3ba17a3 --- /dev/null +++ b/reference/C/FUNCTIONS/escape.html @@ -0,0 +1,86 @@ +Escape sequences + + + + +


    +

    Escape sequences

    +
    +

    + +The following is a list of escape sequences. +

    +

    +	\n 	Newline
    +	\t	Horizontal Tab
    +	\v	Vertical Tab
    +	\b	Backspace
    +	\r	Carriage Return
    +	\f	Form feed
    +	\a	Audible Alert (bell)
    +	\\	Backslash
    +	\?	Question mark
    +	\'	Single quote
    +	\"	Double quote
    +	\000	Oct - No one uses Octal unless they have an ICL background...
    +	\xhh	Hex number
    +	    	Decimal table just for fun.
    +        \       Preprocessor line continuation, must be immediately followed 
    +	        by a newline.
    +
    +These can be used anywhere that C expects to see a character constant. +Must be time for a quick example. +
    +	main()
    +        {
    +	  char word[]="\x6d\x6f\x64\x65\x6d"; 
    +	   
    +	  printf("%s\n", word);
    +	}
    +
    +Cant you work out what will appear if you ran this program?? +
    +

    Examples:

    + + Example program. + + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + + + + + + + + + + + + diff --git a/reference/C/FUNCTIONS/execl.html b/reference/C/FUNCTIONS/execl.html new file mode 100644 index 0000000..4f70f63 --- /dev/null +++ b/reference/C/FUNCTIONS/execl.html @@ -0,0 +1,67 @@ +execl family of functions + + + + +


    +
    +

    execl family of functions

    +
    +
    +execl execlp execle exect execv execvp all performa a simular +function by starting another program. This new program overlays +the existing program, so you can never return to the to original +code unless the call to execl fails. +

    +


    +
    +	Library:   unistd.h
    +
    +	Prototype: int execl(char *Path, char *arg, (char *)0);
    +
    +	Syntax:    execl("newprog", "newprog", NULL);
    +
    +
    +
    +

    Examples:

    + + + example program issuing the execl. +

    + + + The program started by the example above + +


    +

    See Also:

    + + +fork function.

    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + diff --git a/reference/C/FUNCTIONS/exit.html b/reference/C/FUNCTIONS/exit.html new file mode 100644 index 0000000..6612140 --- /dev/null +++ b/reference/C/FUNCTIONS/exit.html @@ -0,0 +1,66 @@ +exit function + + + + +


    +
    +

    exit function

    +
    +
    +exit +causes the program to end and supplies a status code to the +calling environment. + +
    +Library:   stdlib.h
    +
    +Prototype: void exit(int status);
    +
    +Syntax:	  
    +	   main()
    +           {
    +             exit(0);		/* Clean exit */
    +	   }
    +
    + +
    +

    +No example program. +

    +


    +

    See also:

    + return keyword. +

    + atexit function. +

    + abort function. + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/fclose.html b/reference/C/FUNCTIONS/fclose.html new file mode 100644 index 0000000..d490814 --- /dev/null +++ b/reference/C/FUNCTIONS/fclose.html @@ -0,0 +1,66 @@ +fclose function + + + + +

    +
    +

    fclose function

    +
    +
    +

    + +fclose is used to close a file.

    + +

    +Library:   stdio.h
    +
    +Prototype: int fclose( FILE *stream);
    +
    +Syntax:    FILE *fp;
    +	   fclose(fp);
    +
    +
    + + + +example program.

    +


    +

    See Also:

    +
      +
    • fgetc Get a character from a file. +
    • fputc Put a character into a file. +
    • fprintf Put a formatted line into a file. +
    • fopen Open a file. +
    • popen Open a pipe. +
    • pclose Close a pipe. +
    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/fgetc.html b/reference/C/FUNCTIONS/fgetc.html new file mode 100644 index 0000000..3258acb --- /dev/null +++ b/reference/C/FUNCTIONS/fgetc.html @@ -0,0 +1,69 @@ +fgetc/getc function + + + + +


    +
    +

    fgetc/getc function

    +
    +
    +fgetc and getc both read a character from a file (input stream) +and have the same syntax. They are for all intents and purposes the same! + +
    +Library:   stdio.h
    +
    +Prototype: int fgetc(FILE *stream);
    +
    +Syntax:    FILE *file_pointer;
    +	   char ch;
    +
    +	   ch = fgetc(file_pointer);
    +           ch = getc(file_pointer);
    +
    +
    +
    +

    Examples:

    + + Example program. +

    +


    +

    +

    See also:

    + +

    +getch, getche (non standard) + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/fgets.html b/reference/C/FUNCTIONS/fgets.html new file mode 100644 index 0000000..204a4bc --- /dev/null +++ b/reference/C/FUNCTIONS/fgets.html @@ -0,0 +1,90 @@ +fgets function + + + + +


    +

    fgets function

    +
    +

    +fgets is used to read a line of data from an external source.

    +


    + +
    +Library:   stdio.h
    +
    +Prototype: char *fgets(char *s, int n, FILE *stream);
    +
    +Syntax:    char  Data[80];
    +	   char *ReturnCode;
    +	   FILE *FilePointer;
    +
    +	   ReturnCode=fgets(Data, 80, FilePointer);
    +
    +	   ReturnCode == NULL when an error occours. The EOF is 
    +	   considered to be an ERROR!
    +
    + +
    +

    Notes

    +
      +
    • fgets should be used in preference to gets +as it checks that the incoming data does not exceed the buffer size. +

      + +

    • If fgets is reading STDIN, the +NEWLINE character is placed into +the buffer. gets removes the NEWLINE. +
    +
    + + + example program number one.

    + + + example program number two.

    + + + program comparing the action of gets and fgets when reading STDIN.

    + +


    +

    See Also:

    +
      +
    • gets Read STDIN (keyboard by default). +
    • fgetc Get a character from a file. +
    • fputc Put a character into a file. +
    • fprintf Put a formatted line into a file. +
    • fopen Open a file. +
    • fclose Close a file. +
    • popen Open a pipe. +
    • pclose Close a pipe. +
    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/files.html b/reference/C/FUNCTIONS/files.html new file mode 100644 index 0000000..7053fb7 --- /dev/null +++ b/reference/C/FUNCTIONS/files.html @@ -0,0 +1,89 @@ +Files - Character I/P & O/P functions. + + + + +


    +
    +

    Files - character I/P & O/P functions.

    +
    +
    + +The following functions allow you to read & write characters in files. +

    +


    +

    man pages.

    + +fputs +Write a string. +

    +fgetc +Read a character. +

    +getc +Read a character. +

    + +fputc +Write a character to a file. + +

    +ungetc +Return a character. +

    +puts +Write a string. +

    +putchar +Write a string. +

    +putc +Write a string. +

    + +gets +Read a string. + +

    +getchar +Read a character. + +


    +

    Some of my notes

    +fopen Open a file for read or write. +

    +fputc Write a character to a file. +

    +fclose Close a file. + +


    +Example program. + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/fopen.html b/reference/C/FUNCTIONS/fopen.html new file mode 100644 index 0000000..e85afbc --- /dev/null +++ b/reference/C/FUNCTIONS/fopen.html @@ -0,0 +1,108 @@ +fopen function + + + + +


    +
    +

    fopen function

    +
    +
    +

    +fopen is used to open a file for read, write or update. +stdin, stdout & stderr are opened +by the system at execution time. +

    + + + + + +
    +
    +
    +Library:   stdio.h
    +
    +Prototype: FILE *fopen(const char *filename, const char *mode);
    +
    +Syntax:    FILE *fp;
    +	   fp = fopen( "/etc/printcap", "r");
    +
    +
    +
    + +

    Notes:

    +
    +	filename - is the name of the file.
    +	mode     - r - read file.
    +                 - w - Write to file.
    +                 - a - Append to file.
    +
    +
    + +
    +

    Example Programs:

    + + + Example program.

    +


    +

    See Also:

    +
    +
    +
    fgetc Get a character from a file. + +
    +
    fgets Get a record from a file. + +
    +
    fputc Put a character into a file. MAN PAGE. + +
    +
    fprintf Put a formatted line into a file. + +
    +
    fclose Close a file. + +
    +
    pclose Close a pipe. + +
    +
    system Open a pipe. + +
    +
    ferror. +Check error code on a file stream. + +
    +
    feof. +Check for EOF on a file stream. +
    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/fork.html b/reference/C/FUNCTIONS/fork.html new file mode 100644 index 0000000..0601423 --- /dev/null +++ b/reference/C/FUNCTIONS/fork.html @@ -0,0 +1,88 @@ +fork function + + + + +


    +
    +

    fork function

    +
    +
    +fork spawns a copy of the running process. The copy (or child) +has a copy of the parent process stack, data area and heap and starts +execution after the fork statement. fork is of use when you wish to +write daemon processes. +

    +


    +
    + + + + +
    +
    +
    +	Library:   unistd.h
    +
    +	Prototype: pid_t fork(void);
    +
    +	Syntax:    pid_t PID
    +
    +                   PID = fork();
    +
    +
    +
    +

    +On completion, PID will have one of the following values: + +

    + > 0 == the childs process ID.
    +   0 == is returned to the child process.
    + < 0 == an error occoured. No child created, errno is set to 
    +        indicate the problem
    +
    +
    +

    Examples:

    + + example +program. + +
    +

    See Also:

    + + +pipe function.

    + + +execl function.

    + + +threads

    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + diff --git a/reference/C/FUNCTIONS/format.html b/reference/C/FUNCTIONS/format.html new file mode 100644 index 0000000..0d18e69 --- /dev/null +++ b/reference/C/FUNCTIONS/format.html @@ -0,0 +1,315 @@ +printf format identifiers. + + + + +


    +
    +

    printf format identifiers.

    +
    +
    +

    +printf formatting is controlled by 'format identifiers' which, are shown +below in their simplest form. +

    +

    + + + + +
    +
    +
    +    %d %i     Decimal signed integer.
    +    %o	      Octal integer.
    +    %x %X     Hex integer.
    +    %u	      Unsigned integer.
    +    %c	      Character.
    +    %s	      String. See below.
    +    %f	      double
    +    %e %E     double.
    +    %g %G     double.
    +    %p        pointer.
    +    %n	      Number of characters written by this printf.
    +              No argument expected.
    +    %%	      %. No argument expected.
    +
    +
    +
    +
    +

    + +These identifiers actually have upto 6 parts as shown in the table below. +They MUST be used in the order shown. +

    + +

    + + + + + + + + + + + + + + + + +
    %FlagsMinimum field widthPeriodPrecision. Maximum field widthArgument type
    RequiredOptionalOptionalOptionalOptionalRequired
    +
    +

    + + +


    +

    %

    +The % marks the start and therfore is manatory. +

    + + +


    +

    Flags

    +The format identifers can be altered from their default function by +applying the following flags: +

    + +

    + + + + +
    +
    +
    +   -      Left justify.
    +   0  	  Field is padded with 0's instead of blanks.
    +   +	  Sign of number always O/P.
    +   blank  Positive values begin with a blank.
    +   # 	  Various uses:
    +	  %#o (Octal) 0 prefix inserted.
    +	  %#x (Hex)   0x prefix added to non-zero values.
    +	  %#X (Hex)   0X prefix added to non-zero values.
    +	  %#e         Always show the decimal point.
    +	  %#E         Always show the decimal point.
    +	  %#f         Always show the decimal point.
    +	  %#g         Always show the decimal point trailing 
    +	  	      zeros not removed.
    +	  %#G         Always show the decimal point trailing
    +		      zeros not removed.
    +          
    +
    +
    +
    + +
    +Here are a few more examples. +

    + +

    + + + + +
    +
    +
    +    printf(" %-10d \n", number);
    +    printf(" %010d \n", number);
    +    printf(" %-#10x \n", number);  
    +    printf(" %#x \n", number);
    +
    +
    +
    + +

    + +


    +

    Minimum field width.

    +By default the width of a field will be the minimum required to hold +the data. If you want to increase the field width you can use the +following syntax. +

    +

    + + + + +
    +
    +
    +  main()
    +  {
    +      int number    =  5;
    +      char *pointer = "little";
    +
    +      printf("Here is a number-%4d-and a-%10s-word.\n", number, pointer);
    +  }
    +  
    +  /*********************************
    +   *
    +   *	Program result is:
    +   *
    +   * 	Here is a number-   5-and a-    little-word.
    +   *
    +   *********************************/
    +
    +
    +
    +

    +As you can see, the data is right justified within the field. It can +be left justified by using the - flag. +A maximum string width can also be specified. +

    +The width can also be given as a variable as shown below. +

    +

    + + + + +
    +
    +
    +    main()
    +    {
    +        int number=5;
    +
    +        printf("---%*d----\n", 6, number);
    +    }
    +  
    +    /*********************************
    +     *
    +     *    Program result is:
    +     *
    +     *    ----     5---
    +     *
    +     *********************************/
    +
    +
    +
    +

    +The * is replaced with the supplied int to provide the ability to +dynamically specify the field width. +

    +


    + +

    Period

    +If you wish to specify the
    precision of an argument, +it MUST be prefixed with the period. +

    + +


    +

    Precision

    + +The Precision takes different meanings for the different format types. + +

    Float Precision

    +
    +	%8.2f
    +
    +This says you require a total field of 8 characters, within the 8 +characters the last 2 will hold the decimal part. + +
    +	%.2f
    +
    + +The example above requests the minimum field width and the last two +characters are to hold the decimal part. + +

    Character String Maximum field width

    + +The precision within a string format specifies the maximum +field width. +
    +	%4.8s
    +
    +Specifies a minimum width of 4 and a maximum width +of 8 characters. If the string is greater than 8 characters, +it will be cropped down to size. +

    + +Here is a little program +that shows an alternative to strncpy. + +

    * Precision

    + +As with the 'width' above, the precision does not have to be hard +coded, the * symbol can be used and an integer supplied to give its +value. +

    +


    + +

    Format Identifiers

    +The format identifier describes the expected data. The identifier is the +character that ends +Here is a list of the format identifers as used in 'printf' ,'sprintf' +,'fprintf' and 'scanf'. + +
      +
    1. Except for '%' and 'n', all the identifiers expect to extract an argument +from the printf parameter list. +
    2. All of the parmameters should be the value +to be inserted. EXCEPT %s, this expects a +pointer to be passed. +
    +

    An example.

    +

    +

    + + + + +
    +
    +
    +	main()
    +        {
    +            int number=5;
    +	    char *pointer="little";
    +
    +	    printf("Here is a number %d and a %s word.\n", number, pointer);
    +	}
    +	/*********************************
    +	 *
    +	 *	Program result is:
    +	 *
    +	 * 	Here is a number 5 and a little word.
    +	 *
    +	 *********************************/
    +
    +
    +
    +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + diff --git a/reference/C/FUNCTIONS/fprintf.html b/reference/C/FUNCTIONS/fprintf.html new file mode 100644 index 0000000..e7ff8e2 --- /dev/null +++ b/reference/C/FUNCTIONS/fprintf.html @@ -0,0 +1,52 @@ +fprintf function + + + + +


    +
    +

    fprintf function

    +
    +
    +

    +fprintf is used to format data and O/P to a file. It +is basically a printf and so uses the same + escape sequences and format +identifers.

    +A related function is +sprintf which will O/P formatted text to +a character array.

    + + + +example program. +

    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/fputc.html b/reference/C/FUNCTIONS/fputc.html new file mode 100644 index 0000000..7ce91b4 --- /dev/null +++ b/reference/C/FUNCTIONS/fputc.html @@ -0,0 +1,77 @@ +fputc function + + + + +

    +
    +

    fputc function

    +
    +
    +

    + +fputc writes one character to a file.

    +


    + +
    +Library:   stdio.h
    +
    +Prototype: int fputc(int c,  FILE *stream);
    +
    +Syntax:    FILE *fp;
    +           int  ch = 'a';
    +
    +           fp = fopen("/tmp/file", "w");
    +	   fputc(ch, fp);
    +           fclose(fp);
    +
    +
    + +
    + + +Example program. Copy a file. +

    +


    +

    Man pages

    +fputc +Write a character. +

    +


    +

    See Also:

    +
      +
    • fgetc Get a character from a file. +
    • fprintf Put a formatted line into a file. +
    • fopen Open a file. +
    • popen Open a pipe. +
    • pclose Close a pipe. +
    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/free.html b/reference/C/FUNCTIONS/free.html new file mode 100644 index 0000000..439c3c9 --- /dev/null +++ b/reference/C/FUNCTIONS/free.html @@ -0,0 +1,80 @@ +free function + + + + +


    +
    +

    free function

    +
    +
    +

    +free is used to return allocated memory to the system. +

    +


    +
    +	Library:   sdlib.h
    +
    +	Prototype: void free(void *s);
    +
    +	Syntax:    char *StrPtr;
    +		   StrPtr = (char *) malloc(100);
    +                   free(StrPtr);
    +
    +
    +
    +

    Notes:

    +
      +
    • If you use malloc inside a loop and dont free +the memory, you run the risk of the program crashing. +

      +

    • If a program ends without issuing a free, any allocated memory +is returned to the system. +
    +

    +


    +

    Examples:

    + + example +program. + +
    +

    See Also:

    + + +malloc function.

    + + +new C++ replacement for malloc.

    + + +delete C++ replacement for free.

    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/funcframe.htm b/reference/C/FUNCTIONS/funcframe.htm new file mode 100644 index 0000000..405dc06 --- /dev/null +++ b/reference/C/FUNCTIONS/funcframe.htm @@ -0,0 +1,15 @@ + + +Function reference + + + + + + + + + +Your browser does not support frames. + + diff --git a/reference/C/FUNCTIONS/funcquery.htm b/reference/C/FUNCTIONS/funcquery.htm new file mode 100644 index 0000000..9fa6576 --- /dev/null +++ b/reference/C/FUNCTIONS/funcquery.htm @@ -0,0 +1,37 @@ + + + + + + + +

    +Please enter a search string. + + + +
    + + + + diff --git a/reference/C/FUNCTIONS/funcref.htm b/reference/C/FUNCTIONS/funcref.htm new file mode 100644 index 0000000..f97e076 --- /dev/null +++ b/reference/C/FUNCTIONS/funcref.htm @@ -0,0 +1,760 @@ + + +C Functions - Quick Ref + + + + + + +
    +
    +Functions +
    +
    +

    +This is a summary of +ANSI and +POSIX functions grouped by library. If you want an alphabetical +list, please use the master index. +Please refer +to a manual for a complete list of functions available to you. +

    + +

    +

    + +


    + + +

    ANSI standard library.

    + + The ANSI library is declared in the following header files. +

    + + + + + + + +
    + assert.h + + + ctype.h + + + errno.h + + + float.h + + + limits.h +
    + locale.h + + + math.h + + + setjmp.h + + + signal.h + + + stdarg.h +
    + stddef.h + + + stdio.h + + + stdlib.h + + + string.h + + + time.h +
    + +

    + +


    +

    POSIX library

    + The
    POSIX library contains + the following headers. +

    + + + + + + + +
    + cpio.h + + + dirent.h + + + fcntl.h + + + grp.h + + + pwd.h +
    + sys/stat.h + + + sys/times.h + + + sys/types.h + + + sys/utsname.h + + + sys/wait.h +
    + tar.h + + + termios.h + + + unistd.h + + + utime.h + +
    +

    + +

    + +
    + +

    ANSII Library headers

    + + + + +

    +

    assert.h

    + + + + + + +
    +

    +

    ctype.h

    + + + + + + +

    +

    errno.h

    + + + + + +
    +

    +

    float.h

    + +No functions are declared in stddef.h. + + + +

    +

    limits.h

    + +No functions are declared in stddef.h. + + + +

    +

    locale.h

    + + + + + + +

    + +

    math.h

    + + + +

    Note

    For some reason abs is in
    stdlib.h + + + + +

    + +

    setjmp.h

    + + + + + + +

    +

    signal.h

    + + + + + + +

    +

    stdarg.h

    + + +

    +See also vprintf vfprintf and vsprintf which all print the contents of a va_list + + + +


    +

    stddef.h

    +No functions are declared in stddef.h. + + + + + +

    +

    stdio.h

    + +This header defines all the ANSI I/O functions that allow you to read +and write to files and devices. +
    Low level (non ANSI) functions are also available. +

    + + + + + + + +


    +

    stdlib.h

    + + + + + + + + +

    +

    string.h

    + + + + + + + +

    +

    time.h

    + + + +

    +

    POSIX functions start here....

    + +
    +

    + +

    cpio.h

    + + +
    +

    + +

    dirent.h

    + + + + +
    +

    + +

    fcntl.h

    + + +
    +

    + +

    grp.h

    + + +
    +

    + +

    pwd.h

    + + +
    +

    + +

    sys/stat.h

    + + +
    +

    + +

    sys/times.h

    + + +
    +

    + +

    sys/types.h

    + + +
    +

    + +

    sys/utsname.h

    + + +
    +

    + +

    sys/wait.h

    + + +
    +

    + +

    tar.h

    + + +
    +

    + +

    termios.h

    + + +
    +

    + +

    unistd.h

    + +It seems that this library contains headers for many functions that originally came with the ANSII +standard library but did not have headers. +My documentation for this POSIX library is incomplete. + + + + +
    +

    + +

    utime.h

    + +

    + + +

    + +

    conio.h

    +Dos Specific functions in conio.h Not very portable as conio.h +is NOT in the ANSI standard library and does not +appear on the Sun or Linux machines. +

    + + + +

    +

    + +
    +

    Non ANSI Standard Unix Functions.

    +These functions are not in the ANSI standard libraries but are handy +all the same. +

    + +

    + +
    + + + + + + + +
    +
    +

    Ungrouped functions

    +
    + + + + +
    +
    +

    getchar function

    +
    +
    +

    +getchar is used to read data from the keyboard ( +stdin). Effectivly +it is a fgetc(stdin).

    +The problem with this function is that the characters are buffered until +RETURN is hit! This means that getchar does not see the characters +until the user presses return. The non standard function getche +gets around this problem and sees each character as it is pressed. +I have not been able to produce the same function on Linux. +The nearest I can get is by using 'curses' but it keeps clearing the screen! + +

    +Library:   stdio.h
    +
    +Prototype: int getchar(void);
    +
    +Syntax:    ch = getchar();
    +
    +
    + + + +example program. +

    + +


    +

    +See also: +

    + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + diff --git a/reference/C/FUNCTIONS/getopt.html b/reference/C/FUNCTIONS/getopt.html new file mode 100644 index 0000000..e6f3cb3 --- /dev/null +++ b/reference/C/FUNCTIONS/getopt.html @@ -0,0 +1,54 @@ +getopt function + + + + +


    +
    +

    getopt function

    +
    +
    + + + +
    +

    Examples:

    + + Example using argc and argv +
    +

    See Also:

    + +command line arguments (argc/argv). + +
    +

    +getopt man page. + + +

    + +


    +

    +

    + + + + +
    + Top + + Master Index + + Keywords + + Functions +
    +
    +

    +


    +
    Martin Leslie +

    + + + diff --git a/reference/C/FUNCTIONS/gets.html b/reference/C/FUNCTIONS/gets.html new file mode 100644 index 0000000..400b7a5 --- /dev/null +++ b/reference/C/FUNCTIONS/gets.html @@ -0,0 +1,81 @@ +fgets function + + + + +


    +

    gets function

    +
    +

    +gets is used to read a line of data from +STDIN. By default STDIN is the +keyboard. gets continues to read characters until NEWLINE or EOF +is seen. +

    + +

    +Library:   stdio.h
    +
    +Prototype: char *gets(char *s);
    +
    +Syntax:    char read_line[80];
    +
    +	   gets( read_line);
    +
    + +

    Notes

    +
      +
    1. gets does NOT check the size of the buffer and overflow on the +stack can occour. Because of this, you should use +fgets in preferance. +

      + +

    2. The +NEWLINE +character is NOT placed in the buffer. +fgets will retain the +NEWLINE. + + + +example +showing fgets and gets in action.

      +


      +

      See Also:

      +
        +
      • fgets Get a string from a file. +
      • fgetc Get a character from a file. +
      • fputc Put a character into a file. +
      • fprintf Put a formatted line into a file. +
      • fopen Open a file. +
      • fclose Close a file. +
      • popen Open a pipe. +
      • pclose Close a pipe. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/hex_tab.html b/reference/C/FUNCTIONS/hex_tab.html new file mode 100644 index 0000000..5a9c3d9 --- /dev/null +++ b/reference/C/FUNCTIONS/hex_tab.html @@ -0,0 +1,79 @@ +Hex Ascii table + + + + + + +


        +
        +

        Hex Ascii table.

        +
        +
        +Here is the Ascii table in base 16. +

        +

        + + + + +
        +
        +  00    01    02    03    04    05    06    07    
        +  08    09    0A    0B    0C    0D    0E    0F    
        +  10    11    12    13    14    15    16    17    
        +  18    19    1A    1B    1C    1D    1E    1F    
        +  20    21 !  22 "  23 #  24 $  25 %  26 &  27 '  
        +  28 (  29 )  2A *  2B +  2C ,  2D -  2E .  2F /  
        +  30 0  31 1  32 2  33 3  34 4  35 5  36 6  37 7  
        +  38 8  39 9  3A :  3B ;  3C <  3D =  3E >  3F ?  
        +  40 @  41 A  42 B  43 C  44 D  45 E  46 F  47 G  
        +  48 H  49 I  4A J  4B K  4C L  4D M  4E N  4F O  
        +  50 P  51 Q  52 R  53 S  54 T  55 U  56 V  57 W  
        +  58 X  59 Y  5A Z  5B [  5C \  5D ]  5E ^  5F _  
        +  60 `  61 a  62 b  63 c  64 d  65 e  66 f  67 g  
        +  68 h  69 i  6A j  6B k  6C l  6D m  6E n  6F o  
        +  70 p  71 q  72 r  73 s  74 t  75 u  76 v  77 w  
        +  78 x  79 y  7A z  7B {  7C |  7D }  7E ~  7F    
        +
        +
        +
        +

        +

        +
        The decimal table is here.

        +

        + +

        A program to generate this table. +

        + +

        Conversion between Dec,Hec,Binary +

        +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/kill.html b/reference/C/FUNCTIONS/kill.html new file mode 100644 index 0000000..3c280ce --- /dev/null +++ b/reference/C/FUNCTIONS/kill.html @@ -0,0 +1,64 @@ +kill function + + + + + + +


        +
        +

        kill function

        +
        +
        +kill +

        +


        +
        +	Library:   signal.h
        +
        +	Prototype: int kill(Pitd_t Pid, int Signal);
        +
        +	Syntax:    
        +
        +
        +
        +
        +

        Examples:

        + + example +program. + +
        +

        See Also:

        + + +malloc function.

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + + diff --git a/reference/C/FUNCTIONS/malloc.html b/reference/C/FUNCTIONS/malloc.html new file mode 100644 index 0000000..d4f7e0f --- /dev/null +++ b/reference/C/FUNCTIONS/malloc.html @@ -0,0 +1,123 @@ +malloc function + + + + + + +


        +
        +

        malloc function

        +
        +
        +malloc (memory allocation) is used to dynamically allocate memory +at run time. Possible uses for this function are: + +
          +
        • Read records of an unknown length. +
        • Read an unknown number of database records. +
        • Link lists. +
        + +The simplest way to reserve memory is to code something like: +

        + + + + +
        +
        +
        +	main()
        +        {
        +            char string[1000];
        +
        +            strcpy (string, "Some text");
        +        }
        +
        +
        +

        +The example above has two problems: +

          +
        • If the data is less than + +1000 bytes we are wasting memory. +
        • If the data is greater than 1000 bytes the program is going to crash. +
        • The 1000 bytes are reserved throught out the life of the program. +If this was a long running program that rarely used the memory, it would +again be wasteful. +
        +malloc allows us to allocate exactly the correct amount of memory and +with the use of free only for the time it is required. +

        +


        +
        +	Library:   stdlib.h
        +
        +	Prototype: void *malloc(size_t size);
        +
        +	Syntax:    char * String;
        +
        +                   String = (char *) malloc(1000);
        +
        +
        +

        +Looking at the example syntax above, 1000 bytes are reserved and the pointer +String points to the first byte. The 1000 bytes are NOT initialized +by malloc. If the memory is NOT available, a +NULL pointer is returned. + +Please note, the cast cast is required to +return a pointer of the correct type. +

        Examples:

        + + example +program. + +

        +


        +

        See Also:

        + +char data type.

        + +free function.

        + + +sizeof operator.

        +


        + +

        C++

        + +new is the C++ equivalent to malloc.

        + + +delete is the C++ equivalent to +free.

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/memcpy.htm b/reference/C/FUNCTIONS/memcpy.htm new file mode 100644 index 0000000..d2dafe8 --- /dev/null +++ b/reference/C/FUNCTIONS/memcpy.htm @@ -0,0 +1,118 @@ +memcpy function + + + + + + +


        +
        +

        memcpy function

        +
        +
        +

        +memcpy copies data between two memory locations. This function will copy the +supplied number of bytes +stored at the location pointed to by 's2' to the location pointed to by 's1'. + +

        +

        + + +
        +
        +
        +     	s1		s2
        +	|		|
        +	V		V
        +        - - - -		---------------	
        +       | | | | |       | a | b | c | d |
        +        - - - -		---------------	
        +	^ ^		|    |
        +	| |		|    |
        +	 -|-------------     |
        +	   ------------------
        +
        +
        +
        +

        +


        + +

        Prototype

        + +
        + +
        +
        +    Library:   string.h
        +
        +    Prototype: char memcpy(void *s1, void *s2, int num);
        +
        +    Syntax:
        +               float data1;
        +               char  data2[64];
        +               
        +               memcpy(data1, data2, sizeof(data2));
        +
        +

        +


        + +

        Notes

        + +This is a handy function for moving data between data types + +

        See also:

        + + + +
        + + +
        strncpy +
        + + +strcpy +
        + + +sprintf +
        + + +strcat +
        + + +strings +
        + + +memcpy Copy data from one memory location to another. + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/open.html b/reference/C/FUNCTIONS/open.html new file mode 100644 index 0000000..5c785f8 --- /dev/null +++ b/reference/C/FUNCTIONS/open.html @@ -0,0 +1,86 @@ +open function + + + + + + +


        +
        +

        open function

        +
        +
        +open +

        +


        +
        +	Library:   unistd.h
        +		   sys/types.h
        +		   sys/stat.h
        +		   fcntl.h
        +
        +	Prototype: int open(char *Path, int Flags);
        +
        +	Syntax:    int fd;
        +		   char *Path="/tmp/file";
        +		   int Flags= O_WRONLY;
        +
        +		   fd = open(Path, Flags);
        +
        +
        +
        +

        +Flags specify the file attributes. They must contain one of +O_RDONLY, O_WRONLY or O_RDWR and may also have any of the following. +O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, O_NONBLOCK, O_NDELAY, +O_SYNC. See the man page for full details. + +


        +

        Examples:

        + + pipe example +program. + +
        +

        See Also:

        + + +pipe function.

        + + +close function.

        + + +write function.

        + + +fopen function.

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + + diff --git a/reference/C/FUNCTIONS/passwd.html b/reference/C/FUNCTIONS/passwd.html new file mode 100644 index 0000000..b0db88b --- /dev/null +++ b/reference/C/FUNCTIONS/passwd.html @@ -0,0 +1,92 @@ +Password file functions. + + + + + + +


        +
        +

        Password file functions.

        +
        +
        +

        +Various functions to extract information from the /etc/passwd file. +This will not work on DOS machines. +

        + +


        +

        man pages.

        +Some of these links may not work as your system may not support +all the functions. +

        + + +getpwuid +Get a record by keying on the UID (numeric). +

        + + +getpwnam +Get a record by keying on the user name. +

        + + +fgetpwent +

        + + +getpwent +

        + + +setpwent +

        + + +endpwent +

        + + +getpw +

        + + +putpwent +

        + +


        +

        Some notes

        + +
        + +Example program. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + + diff --git a/reference/C/FUNCTIONS/pclose.html b/reference/C/FUNCTIONS/pclose.html new file mode 100644 index 0000000..48f9694 --- /dev/null +++ b/reference/C/FUNCTIONS/pclose.html @@ -0,0 +1,68 @@ +pclose function + + + + + + +


        +

        pclose function

        +
        +

        +pclose is used to close a pipe created with +popen.

        + +

        +Library:   stdio.h
        +
        +Prototype: int pclose( FILE *stream);
        +
        +Syntax:    FILE *fp;
        +	   pclose(fp);
        +
        +
        +
        +

        Example:

        + + + +example program.

        +


        +

        See Also:

        + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/pipe.html b/reference/C/FUNCTIONS/pipe.html new file mode 100644 index 0000000..5f2682c --- /dev/null +++ b/reference/C/FUNCTIONS/pipe.html @@ -0,0 +1,100 @@ +pipe function + + + + + + +


        +
        +

        pipe function

        +
        +
        +

        +pipe creates two file descriptors which can be used by +parent and child processes to communicate data. A child process can +be created with the fork function. +

        +


        +
        + + + + +
        +
        +
        +	Library:   unistd.h
        +
        +	Prototype: int pipe(int fd[2]);
        +
        +	Syntax:    int fd[2];
        +		   pipe(fd);
        +
        +
        +
        +

        +


        +On error, pipe returns -1.

        +Once the pipe has been executed, the data can be transfered +using read and +write. +


        +

        Notes:

        +Make sure that when you read +exactly the same number of bytes that are +written! I spend HOURS +trying to figure out why I was loosing data because of this feature!! +
        +

        Examples:

        + + + read and write fixed length records. +

        + + + read and write variable length records. + +


        +

        See Also:

        + + +fork

        + +popen function.

        + +pclose function.

        + + +read function.

        + + +write function.

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/popen.html b/reference/C/FUNCTIONS/popen.html new file mode 100644 index 0000000..ac93bec --- /dev/null +++ b/reference/C/FUNCTIONS/popen.html @@ -0,0 +1,88 @@ +popen function + + + + + + +


        +
        +

        popen function

        +
        +
        +

        +popen is used to read and write to a unix pipe.

        This function is NOT +included in 'C Programming Language' (ANSI) but can be found in 'The Standard +C Library' book. + +

        +Library:   stdio.h
        +
        +Prototype: FILE *popen(const char *command, const char *type);
        +
        +Syntax:    FILE *fp;
        +	   fp = popen( "ls -l", "r");
        +
        +Notes:
        +	command - is the command to be issued.
        +	type    - r - read O/P from command.
        +                - w - Write data as I/P to command.
        +
        +
        +
        +

        Examples:

        + + example program.

        + +


        +

        Notes:

        +
          +
        • popen will always execute the command from within the Bourne shell. +
        • popen feeds the STDOUT back to your program. If you want STDERR, +the following will do the trick. +
          +	fp=popen("ls -l 2>&1", "w");
          +		        AAAA
          +		        ||||
          +
          +
        +
        +

        See Also:

        +
          +
        • fgetc Get a character from a file. +
        • fputc Put a character into a file.man pages +
        • fprintf Put a formatted line into a file. +
        • fopen Open a file. +
        • fclose Close a file. +
        • pclose Close a pipe. +
        • system Open a pipe. +
        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + + diff --git a/reference/C/FUNCTIONS/printf.html b/reference/C/FUNCTIONS/printf.html new file mode 100644 index 0000000..111a8e7 --- /dev/null +++ b/reference/C/FUNCTIONS/printf.html @@ -0,0 +1,106 @@ +printf function + + + + + + +


        +
        +

        printf function

        +
        +
        +

        +printf is used to O/P data to +STDOUT (usually the screen). It has many +formatting options which we shall look at in a moment. + +


        +

        printf syntax

        +This is an example of printf in its simplest form. +

        +

        + + + + +
        +
        +
        +  #include <stdio.h>
        +
        +  main()
        +  {
        +    printf("This text will appear on the screen\n");  
        +  }
        +
        +
        +
        +

        +printf is passed one formatting argument. +The unusual thing about the example (in my mind) is \n, this is actually +an escape sequence that signals a new line. Without +it, any printf's +that follow would O/P to the same line. +printf also takes extra arguments which are inserted into the format +string at locations marked with a %. +

        +

        + + + + +
        +
        +
        +  #include <stdio.h>
        +
        +  main()
        +  {
        +    int number=42;
        +    printf("The answer is %i\n", number);  
        +  }
        +
        +
        +
        +

        +What happens here is the %i is seen as a +formatting identifer for the +next argument (number). In this case an integer is expected.

        + +


        +

        See also

        +
          +
        1. puts Much easier to use - but not as powerfull. +
        2. sprintf Same as 'printf' but O/P to a string array. +
        3. Strings. +
        4. A dead handy printf idiom.. +
        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/puts.html b/reference/C/FUNCTIONS/puts.html new file mode 100644 index 0000000..1e31e79 --- /dev/null +++ b/reference/C/FUNCTIONS/puts.html @@ -0,0 +1,46 @@ +puts function + + + + + + +


        +
        +

        puts function

        +
        +
        +

        +puts is used to print data on the screen (or to a file). +Another related +function is printf which is much more powerfull. +

        +Anyway here is an example of the puts function. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/qsort.html b/reference/C/FUNCTIONS/qsort.html new file mode 100644 index 0000000..466cd4e --- /dev/null +++ b/reference/C/FUNCTIONS/qsort.html @@ -0,0 +1,100 @@ +qsort function + + + + + + +

        +
        +

        qsort function

        +
        +
        +

        +qsort will sort an array of elements. This is a wild function that +uses a pointer to another function that performs +the required comparisons. + +

        +Library:   stdlib.h
        +
        +Prototype: void qsort(void *base, 
        +		      size_t num, 
        +		      size_t size, 
        + 		      int (*comp_func)(const void *, const void *))
        +
        +
        +
        +

        Some explanation.

        +
          +
        • void * base
          Is a pointer to the array to be sorted. This can +be a pointer to any datatype. +

          +

        • size_t num
          The number of elements. +

          +

        • size_t size
          The element size. +

          +

        • int (*comp_func)(const void *, const void *))
          This is a +pointer to +a function. +
        + + +
        +

        Notes

        +
          +
        1. Well... This caused me alot of trouble! Although the prototype above is +exactly as shown in the documentation, the last parm kept giving compiler +warnings (invalid pointer type) this is the fix. +
          +	
          +Prototype: void qsort(void *base, 
          +		      size_t num, 
          +		      size_t size, 
          + 		      (void *) (*comp_func)(const void *, const void *))
          +
          +does anyone know the answer to this problem?? +

          +

        2. I think void * needs an explanation. +

          +

        3. And cast aswell +

          +

        +
        + + +Example program 1 As basic as I can make it.

        + + +Example program with user input.

        + + +O'Reilly 'Using C' example.

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/rand.html b/reference/C/FUNCTIONS/rand.html new file mode 100644 index 0000000..afbba99 --- /dev/null +++ b/reference/C/FUNCTIONS/rand.html @@ -0,0 +1,73 @@ +rand function + + + + + + +

        rand function

        +rand will generate a random number between 0 and 'RAND_MAX' +(at least 32767). + +
        +Library:   stdlib.h
        +
        +Prototype: int rand(void);
        +
        +Syntax:	   int r;                 		/* Random number	*/
        +
        +           r = rand();
        +
        + +
        +

        Notes

        +
          +
        • +Rand will always produce the same sequence of numbers unless +srand is called to seed the start point. +
        • +RAND_MAX is only defined in ANSII header files. +
        • A non standard function random is available on the Sun. +
        +
        + +example program.

        + +


        +

        See also:

        + +

        +
        +
        srand Seed the randon number generator. + +
        +
        rand man page. +
        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/read.html b/reference/C/FUNCTIONS/read.html new file mode 100644 index 0000000..c4541bb --- /dev/null +++ b/reference/C/FUNCTIONS/read.html @@ -0,0 +1,75 @@ +read function + + + + + + +


        +
        +

        read function

        +
        +
        +read +

        +


        +
        +	Library:   unistd.h
        +		   sys/types.h
        +
        +	Prototype: int read(int fd, char *Buff, int NumBytes);
        +
        +	Syntax:    int fd;
        +                   char Buff[50];
        +
        +		   read(fd, Buff, sizeof(Buff));
        +
        +
        +
        +

        Examples:

        + + pipe example +program. + +
        +

        See Also:

        + + +pipe function.

        + + +open function.

        + + +close function.

        + + +write function.

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/setuid.html b/reference/C/FUNCTIONS/setuid.html new file mode 100644 index 0000000..423ceeb --- /dev/null +++ b/reference/C/FUNCTIONS/setuid.html @@ -0,0 +1,102 @@ +User ID. + + + + + + +

        User ID.

        + +Various functions to change and see a User or Group ID. These are NOT +ANSII standard functions. Do not expect them all to work on your machine.... +

        +


        +

        Man pages.

        + + +getuid +Get a users real ID. +

        + + +geteuid +Get a users effective ID. +

        + +


        +

        + +setuid +Set real and effective process ID. +

        + + +seteuid +Set effective process ID. +

        + + +setruid +Set real process ID. +

        + + +setgid +Set real and effective Group ID. +

        + + +setegid +Set effective Group ID. +

        + +


        + +setreuid +Seems to have different uses on Sun and RS/6000. +

        + + +setuidx +RS/6000 (AIX only). +

        + + +getuidx +RS/6000 (AIX only). +

        + +


        +

        Some notes

        + +
        + +Example program. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/sprintf.html b/reference/C/FUNCTIONS/sprintf.html new file mode 100644 index 0000000..362818c --- /dev/null +++ b/reference/C/FUNCTIONS/sprintf.html @@ -0,0 +1,61 @@ +sprintf function + + + + + + +


        +
        +

        sprintf function

        +
        +
        +sprintf is used to format data and put it into a string array. It +is basically a printf and so uses the same + escape sequences and format +identifers.

        + + +example program.

        + +


        +

        See also

        +fprintf which will O/P formatted text to a file. +

        +printf O/P formatted text to STDOUT. +

        +puts O/P text to STDOUT. +

        +strcpy Copy strings. +

        + +strcat Concatinate strings. MAN PAGE. +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/srand.html b/reference/C/FUNCTIONS/srand.html new file mode 100644 index 0000000..f0d42ee --- /dev/null +++ b/reference/C/FUNCTIONS/srand.html @@ -0,0 +1,73 @@ +srand function + + + + + + +


        +
        +

        srand function

        +
        +
        +

        + +srand seeds the random number generation function +rand +so it does not produce the same sequence of numbers. +

        +Library:   stdlib.h
        +
        +Prototype: void srand(unsigned int seed);
        +
        +Syntax:	   unsigned int seed=10;       		/* seed value 		*/
        +
        +           srand();
        +
        + +
        +

        Notes

        +
          +
        • +Obviously the seed has to change every time the program is run. +One way to do this is to feed it the O/P from time +
        +
        + + +example program. +

        + +


        +See also:

        +

        rand Generate a randon number generator. +
        time get the calender time (Number of seconds +since 1st Jan 1970. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/sscanf.html b/reference/C/FUNCTIONS/sscanf.html new file mode 100644 index 0000000..dc0934b --- /dev/null +++ b/reference/C/FUNCTIONS/sscanf.html @@ -0,0 +1,66 @@ +sscanf function + + + + + + +


        +
        +

        sscanf function

        +
        +
        +

        +To be done..... +


        +
        +Library:   stdio.h
        +
        +Prototype: char sscanf(const char *buff, const char *format,
        +...);
        +
        +
        + +

        Notes

        + +
        +

        Examples

        + + +example program. +
        + +

        See also:

        + + sprintf + + strtok + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/stat.html b/reference/C/FUNCTIONS/stat.html new file mode 100644 index 0000000..601aeaa --- /dev/null +++ b/reference/C/FUNCTIONS/stat.html @@ -0,0 +1,124 @@ +stat/fstat/lstat functions. + + + + + + +


        +
        +

        stat/fstat/lstat functions.

        +
        +
        +

        + +All three functions return information about a file. Please note +that devices are seen as files to Unix, so you could 'stat' things +like /dev/mouse to see when the mouse was last moved.

        + +stat return the status of a file.

        + +fstat stats an open file.

        + +lstat reports on a link, not the file it points too.

        +

        +Libraries: sys/stat.h
        +	   unistd.h
        +
        +Syntax:    struct stat stat_p;
        +           stat ("martin", &stat_p);
        +
        +Stat Structure:
        +
        +           struct stat
        +           {
        +             dev_t         st_dev;      /* device */
        +             ino_t         st_ino;      /* inode */
        +             umode_t       st_mode;     /* protection */
        +             nlink_t       st_nlink;    /* number of hard links */
        +             uid_t         st_uid;      /* user ID of owner */
        +             gid_t         st_gid;      /* group ID of owner */
        +             dev_t         st_rdev;     /* device type (if inode device) */
        +             off_t         st_size;     /* total size, in bytes */
        +             unsigned long st_blksize;  /* blocksize for filesystem I/O */
        +             unsigned long st_blocks;   /* number of blocks allocated */
        +             time_t        st_atime;    /* time of last access */
        +             time_t        st_mtime;    /* time of last modification */
        +             time_t        st_ctime;    /* time of last change */
        +           };
        +
        +
        + +st_mode can be used with the following macros to discover the +type of file being statted. + + +
        +	S_ISLNK(st_mode)  is it a symbolic link
        +
        +        S_ISREG(st_mode)  regular file
        +
        +        S_ISDIR(st_mode)  directory
        +
        +        S_ISCHR(st_mode)  character device
        +
        +        S_ISBLK(st_mode)  block device
        +
        +        S_ISFIFO(st_mode) fifo
        +
        +        S_ISSOCK(st_mode) socket	
        +
        + +These functions return a large amount of information. See the man page +(below) for details. You will need to understand +
        structures to work with stat.

        + + + +man page to provide all the details. +

        +


        +

        Examples

        + + +example program. +

        +


        +

        See also:

        + +POSIX functions to read directory information. +

        +


        +

        Note

        +I have seen a problem with the 'access time', it only seems to get updated +if the file system is local. If the filesystem is NFS mounted and +accessed via 'cat' or 'head' the access date is not updated. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + + diff --git a/reference/C/FUNCTIONS/stdlib.html b/reference/C/FUNCTIONS/stdlib.html new file mode 100644 index 0000000..ec05ac4 --- /dev/null +++ b/reference/C/FUNCTIONS/stdlib.html @@ -0,0 +1,44 @@ + + + + + + +


        +

        +
        stdlib.h
        +

        +
        + +This page is obsolete and has been replaced with +this new page. + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + + diff --git a/reference/C/FUNCTIONS/strchr.html b/reference/C/FUNCTIONS/strchr.html new file mode 100644 index 0000000..0d1b39b --- /dev/null +++ b/reference/C/FUNCTIONS/strchr.html @@ -0,0 +1,80 @@ +strchr strrchr functions + + + + + + +


        +

        strchr strrchr functions

        +

        +


        +
          +
        • strchr will find the first matching character in a string.
          +

          +

        • strrchr will find the last matching character in a string.

          +

        + +The functions will return a pointer to the character or +NULL if +the character is not found. + +
        +
        +Library:   string.h
        +
        +Prototype: char * strchr(const char *string, int character);
        +
        +Syntax:	   int character='w';
        +	   char *string="red dwarf";
        +           if(strchr(string, character)) puts("Character found");
        +
        + +
        +

        See Also:

        + + +strstr which looks for a sub-string in a string. +

        + + +strpbrk +

        + + +index and rindex do the same as strchr +and strrchr but are non standard. + + +


        + + Example program (from Dave Doolin).

        + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strcmp.html b/reference/C/FUNCTIONS/strcmp.html new file mode 100644 index 0000000..003ba5b --- /dev/null +++ b/reference/C/FUNCTIONS/strcmp.html @@ -0,0 +1,88 @@ +strcmp function + + + + + + +


        +
        +

        strcmp function

        +
        +
        +

        +strcmp will test two strings for equallity. +

        +	Returns :
        +		< 0 if s1 is less than s2
        +		  0 if s1 == s2
        +		> 0 if s1 is greater than s2
        +
        +This function probably provides too much information +by indicating which string is lexicographically greater. The net result +means that the strcmp return code is logically incorrect because +it returns a FALSE value +when the strings match. +

        +


        +

        Example:

        +o +Function that compares two strings +and returns a sensible return code. + +
        +

        See Also:

        +o +strncmp +

        + +o +strstr Find a sub string in a string. +

        + +o +strchrLocate a character in a string. +

        + +o +index Locate a character in a string. +

        + +o +strcasecmp Compare strings, ignoring case. +

        + +o +toupper +

        + +o +tolower + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strcpy.html b/reference/C/FUNCTIONS/strcpy.html new file mode 100644 index 0000000..2a15dbb --- /dev/null +++ b/reference/C/FUNCTIONS/strcpy.html @@ -0,0 +1,127 @@ +strcpy function + + + + + + +


        +
        +

        strcpy function

        +
        +
        +

        +strcpy copies a string. This function will copy the bytes +stored at the location pointed to by 's2' to the location pointed to by 's1'. + +

        +
        +     	s1		s2
        +	|		|
        +	V		V
        +        - - - -		- - - --	
        +       | | | | |       |a|b|c|\0|
        +        - - - -		- - - --	
        +	^ ^		| |
        +	| |		| |
        +	 -|-------------  |
        +	   ---------------
        +
        + +
        +
        +Library:   string.h
        +
        +Prototype: char strcpy(char *s1, const char *s2);
        +
        +Syntax:	  
        +	   char string2[20]="red dwarf";
        +	   char string1[20]="";
        +           strcpy(string1, string2);
        +
        + +
        + +

        Notes

        + +Dont forget that strings are terminated with a +'\0' so allow space for it... +

        +There is another way to code the example above. Consider this piece of +code. +

        +	main()
        +	{
        +	  char *string2="red dwarf";
        +	  char *string1;
        +
        +	  string1=string2;
        +	}
        +
        + +'string2' is now a character pointer (only one byte) that points to a +storage location containing "red dwarf" (a +string constant). So +string1=string2; copies the address of "red dwarf" into +'string1'. This version of the code will execute quicker than strcpy +because less data is being moved around the system. + + +
        + +example program. +
        + +

        See also:

        + + +strtok +
        + + +strncpy +
        + + +sprintf +
        + + +strcat +
        + + +strings +
        + + +memcpy Copy data between tow memory locations. +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strlen.html b/reference/C/FUNCTIONS/strlen.html new file mode 100644 index 0000000..4473955 --- /dev/null +++ b/reference/C/FUNCTIONS/strlen.html @@ -0,0 +1,72 @@ +strlen function + + + + + + +


        +
        +

        strlen function

        +
        +
        +

        +strlen will give you the length of a string, NOT including the '\0' +terminator. It should not be confused with the +sizeof operator +which returns the size of a variable (that could hold a string).

        + +

        +Library:   string.h
        +
        +Prototype: size_t strlen(const char *s);
        +
        +Syntax:	   size_t size;
        +	   char string[20]="red dwarf";
        +           size = strlen(string);
        +
        + +
        +

        Examples

        + + Example program. +
        +

        See Also

        + + strlen man page. +

        + + +sizeof operator. +

        + + + lenstr - User written version of strlen. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strncmp.html b/reference/C/FUNCTIONS/strncmp.html new file mode 100644 index 0000000..023b622 --- /dev/null +++ b/reference/C/FUNCTIONS/strncmp.html @@ -0,0 +1,78 @@ +strncmp function + + + + + + +


        +
        +

        strncmp function

        +
        +
        +

        +strncmp will test at most 'n' characters in s1 to s2 for equallity. +

        +Library:   string.h
        +
        +Prototype: int strncmp(const char *s1, const char *s2, int n);
        +
        +Syntax:	   char string1[]="red dwarf";
        +	   char string2[]="red";
        +
        +           strncmp(string1, string2, 3);
        +Returns :
        +           < 0 if s1 is less than s2
        +	     0 if s1 == s2
        +	   > 0 id s1 > s2
        +
        +Could do with more explanation.... +
        +

        See Also:

        + +strcmp +

        + +o +strcasecmp Compare strings, ignoring case. +

        + + +toupper +

        + + +tolower +

        + + +Strings +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strncpy.html b/reference/C/FUNCTIONS/strncpy.html new file mode 100644 index 0000000..19c2ae9 --- /dev/null +++ b/reference/C/FUNCTIONS/strncpy.html @@ -0,0 +1,76 @@ +strncpy function + + + + + + +

        +
        +

        strncpy function

        +
        +
        +

        +strncpy copies 'n' bytes from one string to another.

        + +

        +Library:   string.h
        +
        +Prototype: char strncpy(char s1, const char *s2, size_t n);
        +
        +Syntax:	   size_t n;
        +	   char string1[20]="red dwarf";
        +	   char string2[20]=";
        +           strncpy(string2, string1, 4);
        +
        + +
        +

        Notes

        +
          +
        • It may be nessacary to add your own +NULL terminator. +
        +
        + +example program.

        + +An alternative method using 'sprintf'...

        + + +


        +

        See also:

        + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strpbrk.html b/reference/C/FUNCTIONS/strpbrk.html new file mode 100644 index 0000000..6e9909b --- /dev/null +++ b/reference/C/FUNCTIONS/strpbrk.html @@ -0,0 +1,75 @@ +strpbrk function + + + + + + +


        +

        strpbrk function

        +
        +

        +strpbrk locates characters in a string. +

        + +


        +
        +Library:   string.h
        +
        +Prototype: char * strpbrk(const char *string1, const char *string2);
        +
        +Syntax:	   char *ptr;
        +	   char string1[]="martin was ere";
        +	   char string2[]="ea";
        +
        +	   ptr=strpbrk(string1, string2);
        +
        + +In this example ptr will be pointing to the first a +within martin was ere + + +
        +

        See Also:

        + + + +
        +

        Example:

        + + +Change field seperators to 'blank'.

        + + + MAN PAGE +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strstr.html b/reference/C/FUNCTIONS/strstr.html new file mode 100644 index 0000000..4df5542 --- /dev/null +++ b/reference/C/FUNCTIONS/strstr.html @@ -0,0 +1,74 @@ +strstr function + + + + + + +


        +
        +

        strstr function

        +
        +
        +

        +strstr will find a sub-string within a string. +See also strchr which will look for a character in a +string. + +

        +Library:   string.h
        +
        +Prototype: char * strstr(const char *s1, const char *s2);
        +
        +Syntax:	   char string1[]="red dwarf";
        +	   char string2[]="dwarf";
        +	   void *pointer;
        +           pointer = strstr(string1, string2);
        +
        +strstr returns a pointer to the beginning of the sub-string or NULL +if not found. +
        +

        Example:

        + + + +example program. + +
        +

        See Also:

        + + +strstr man page. +

        + + +strchr Find a character in a string. +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strtok.html b/reference/C/FUNCTIONS/strtok.html new file mode 100644 index 0000000..4d15b2f --- /dev/null +++ b/reference/C/FUNCTIONS/strtok.html @@ -0,0 +1,100 @@ +strncpy function + + + + + + +


        +
        +

        strtok function

        +
        +
        +

        +All the books that I have read, say that strtok will break a string +into tokens. This is true, but a more obvious +explanation is, that it will break a string into words. +

        +


        +
        +
        +Library:   string.h
        +
        +Prototype: char * strtok(char *s, const char *delim);
        +
        +Syntax:	   char string []="abc def ghi";
        +	   char * word;
        +
        +	   word=strtok(string, " ");
        +	   word=strtok(NULL, " ");
        +
        +
        + +strtok requires a string and the word delimiters, for example: + +
        +
        +	   word = strtok(string, " ");
        +	                   A      A
        +	                   |      |
        +	                   |	  -------  Delimiters.
        +	                   |
        +	                   --------------  String to break up.
        +
        +
        +After the first call to strtok, word will point to abc on the second +call, word will point to def +

        +


        +

        Notes:

        +
          +
        • strtok will alter the I/P string by placing +NULLS at the delimiter +positions. A good habit is to copy +the string to a tempary string +and use the copy in the strtok call. +

          +

        • More than one delimiter can be specified. So you could code: +
          +
          +	word = strtok(string, " \t;:,");
          +	                         
          +
          +
        • You do not have to include \0 or NULL +
        +
        +

        Examples:

        + + Example program. +
        +

        See also:

        +
        strcpy +
        strncpy + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strtol.html b/reference/C/FUNCTIONS/strtol.html new file mode 100644 index 0000000..1a676fc --- /dev/null +++ b/reference/C/FUNCTIONS/strtol.html @@ -0,0 +1,90 @@ +strtol function + + + + + + +


        +
        +

        strtol function

        +
        +
        +

        +strtol will convert a string to a long integer. An important feature +of this function is the ability to accept data in various number bases +and convert to decimal. If +you are just working with decimal numbers, +atoi is probably an easer function to use. +

        +


        +
        +
        +Library:   stdlib.h
        +
        +Prototype: long int strtol(const char *sptr, char **endptr, int base);
        +
        +Syntax:	   char     String[]="ff";		/* string to convert	*/
        +	   int      Base=16;			/* Base 16		*/
        +           long int Ans;			/* Result		*/
        +
        +           Ans = strtol(String, NULL, Base);
        +
        + +
        +

        Notes

        +The second argument (char **endptr) seems to be a waste of space! If +it is set to NULL, STRTOL +seems to work its way down the string until it finds an invalid character +and then stops. All valid chars read are then converted if the string +starts with an invalid character the function returns ZERO (0). +

        +The Third argument (base) can have a value of 0 or 2-32. +

          +
        • 0 - strtol will attempt to pick the base. Only Dec, Oct Hex supported. +
        • 2-31 - The base to use. +
        +
        +

        Examples:

        + + Example program. +

        +


        +

        See also:

        +

        +

        atoi String to integer conversion. +
        atof String to floating point conversion. +
        atol String to long integer conversion. +
        strtod String to double conversion. +
        strtoul String to unsigned long integer +conversion. +
        Conversion table. +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/strtoul.html b/reference/C/FUNCTIONS/strtoul.html new file mode 100644 index 0000000..c4f3ea3 --- /dev/null +++ b/reference/C/FUNCTIONS/strtoul.html @@ -0,0 +1,99 @@ +strtoul function + + + + + + +


        +
        +

        strtoul function

        +
        +
        +

        +strtoul will convert a string to an unsigned long integer. An important +feature +of this function is the ability to accept data in various number bases +and convert to decimal. If +you are just working with decimal numbers, +atoi is probably an easer function to use. +


        +
        +Library:   stdlib.h
        +
        +Prototype: long int strtoul(const char *sptr, char **endptr, int base);
        +
        +Syntax:	   char string1[]="ff";			/* string to convert	*/
        +	   int  base=16;			/* Base 16		*/
        +           unsigned long int ans;		/* Result		*/
        +
        +           ans = strtoul(string, NULL, 16);
        +
        + +
        +

        Notes

        +The first argument must not contain a + or -.

        + +The second argument (char **endptr) seems to be a waste of space! If +it is set to NULL, STRTOL +seems to work its way down the string until it finds an invalid character +and then stops. All valid chars read are then converted if the string +starts with an invalid character the function returns ZERO (0). +

        +The Third argument (base) can have a value of 0 or 2-32. +

          +
        • 0 - strtol will attempt to pick the base. Only Dec, Oct Hex supported. +
        • 2-31 - The base to use. +
        +
        +

        Examples

        + + example program (actually the strtol example, but its near enough).

        +


        +

        See also:

        +

        + + +atoi String to integer conversion. +
        + +atof String to floating point conversion. +
        + +atol String to long integer conversion. +
        + +strtod +String to double conversion. +
        + +strtol String to long integer +conversion. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/system.html b/reference/C/FUNCTIONS/system.html new file mode 100644 index 0000000..3f508de --- /dev/null +++ b/reference/C/FUNCTIONS/system.html @@ -0,0 +1,67 @@ +system function + + + + + + +

        +
        +

        system function

        +
        +
        +

        +The system function is used to issue a command. +Execution of your program will not continue until the command has completed. +

        + +

        +Library:   stdlib.h
        +
        +Prototype: int system(const char *cmd);
        +
        +Syntax:    system( "cat /etc/hosts");
        +
        +Notes:
        +	   In Unix systems, the command is passed to "/bin/sh -c" for 
        +           execution. I do not know what handles the command in DOS systems.
        +           
        +
        + + example program. +

        +


        +

        See Also:

        + +

        + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/time.html b/reference/C/FUNCTIONS/time.html new file mode 100644 index 0000000..82d00f3 --- /dev/null +++ b/reference/C/FUNCTIONS/time.html @@ -0,0 +1,86 @@ +time and date related functions + + + + + + +


        +
        +

        time and date related functions.

        +
        +
        +

        +The following information gives a taste of the date and time related functions. +It stikes me that this is overly complicated, but what do I know... +To review all the functions available in the standard library, +click here. +

        +

        + + + + +
        +
        +
        +  Library:   time.h
        +
        +  Prototype: char *asctime( const struct tm *time);
        +             char *ctime(const time_t *timer);
        +             struct tm *localtime(const time_t *timer);
        +             size_t strftime(char *s, 
        +          		     size_t maxsize, 
        +		   	     const *format,
        +	   		     const struct tm *time);
        +
        +  Syntax:    
        +
        +
        +
        +
        +

        +The prototype list does NOT list all the functions that are +described in time.h - only the ones I have used and shown in the +example that follows.

        + + +Example program. +

        + +Here is a time related problem. +

        +


        +

        See also:

        + + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/uname.html b/reference/C/FUNCTIONS/uname.html new file mode 100644 index 0000000..8a3eba4 --- /dev/null +++ b/reference/C/FUNCTIONS/uname.html @@ -0,0 +1,59 @@ +uname function. + + + + + + +

        uname function.

        + +uname is NOT in the ANSII library but is handy for getting +system information. It will return handy things like: +

        +System type (name).

        +Host name (Nodename).

        +Software release.

        +Software date.

        +Machine type.

        +Domainname.

        + +


        +

        man pages.

        + +uname +man Page. +

        +gethostname +man Page. +

        + +


        +Example program. + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + diff --git a/reference/C/FUNCTIONS/write.html b/reference/C/FUNCTIONS/write.html new file mode 100644 index 0000000..f3957ed --- /dev/null +++ b/reference/C/FUNCTIONS/write.html @@ -0,0 +1,78 @@ +write function + + + + + + +


        +
        +

        write function

        +
        +
        +write +

        +


        +
        +	Library:   unistd.h
        +		   sys/types.h
        +
        +	Prototype: int write(int fd, char *Buff, int NumBytes);
        +
        +	Syntax:    int fd;
        +                   char Buff[]="V8 cars are coool";
        +
        +		   write(fd, Buff, strlen(Buff)+1);
        +
        +
        +
        +

        Examples:

        + + pipe example +program. + +
        +

        See Also:

        + + +pipe function.

        + + +open function.

        + + +close function.

        + + + + +read function.

        + + + +

        + +


        +

        +

        + + + + +
        + Top + + Master Index + + Keywords + + Functions +
        +
        +

        +


        +
        Martin Leslie +

        + + -- cgit v1.2.3-54-g00ecf