use (u)intXX_t types

document: cygwin needs "file" command to be able to build dll's

some platforms may need -D_THREAD_SAFE like solaris needs -D_REENTRANT

document error.h

make sure all system calls that can be interrupted are restarted if they're
	interrupted by a signal
	(or at least have the option of being restarted)

--------------------------------------------------------------------------------

use const's instead of #defines
	const unsigned long	MAX_QUERY_LENGTH=32768;

for class specific #defines
	class A {
		private:
			static const unsigned long	NUM_ELEMENTS;
			int	elements[NUM_ELEMENTS];
	};

	const unsigned long A::NUM_ELEMENTS=5;

--------------------------------------------------------------------------------

memory pool class might be re-implemented like in item 10 in effective c++

--------------------------------------------------------------------------------

use initialization list to initialize variables when posssible

initialization list MUST be used for const or reference types

also, use initialization list for non-primitive types.  This will cause just
the copy constructor to be called rather than the constructor and then
= operator:

	class A {
		public:
			A(const string &str1, const string &str2);
		private:
			string a;
			string b;
	};

	A::A() : a(str1), b(str2) {}
instead of
	A::A() { a=str1; b=str2; }

--------------------------------------------------------------------------------

Base classes are instantiated in the order they're inherited from, member
classes are instantiated in the order they're declared in the class.
Everything is destroyed in the opposite order.

To help make sense of this, keep objects in init list in same order that
they're declared in the inheritance list and in the class.

	class foo : public foo, public baz {
		public:
			foo(const string &str1, const string &str2);
		private:
			string	a;
			string	b;
	};

	foo::foo(const string &a, const string &b) :
			foo(), baz(), a(str1), b(str2) {}

--------------------------------------------------------------------------------

Split all classes into:

foo.h
	class foodata;

	class foo {
		public:
			foo();
			~foo();
		private:
			foodata	*fd;
	};

foo.C
	class foodata {
		...
	};

	foo::foo() {
		fd=new foodata();
	}

	foo::~foo() {
		delete fd;
	}

--------------------------------------------------------------------------------

container class paradigm:
	can be declared like:
		container	c;
	have init() method and clear() methods:
		init() takes paramaters, clear() resets to all 0's
		clear() {
			... for each pointer ...
			if (xxxisattached) {
				delete[] xxx;
			}
		}
	destructor calls clear();
	pointers have setXXX()/getXXX() and attachXXX()/detachXXX() methods:
		manageXXX(bool) causes XXX to be deleted or not during clear()
		isXXXmanaged() returns true if XXX will be deleted during
			clear()
		manageXXX() = manageXXX(true);
		dontManageXXX() = manageXXX(false);
		setXXX(char *XXX, bool attach) {
			if (xxxisattached) {
				delete[] xxx;
			}
			this->XXX=XXX;
			manageXXX(attach);
		}
		setXXX() {
			setXXX(value,false);
		}
		attachXXX() {
			setXXX(value,true);
		}
		getXXX(bool detach) {
			manageXXX(!detach);
			return XXX;
		}
		getXXX() {
			getXXX(false);
		}
		detachXXX() {
			getXXX(true);
		}

make sure all constructors initialize all member variables
	
use STL classes instead of linkedlist, dictionary

daemonprocess constructor initializes static members, this is lame and messy

environment class:
	wrap clearenv()
	make all members static

document shmfile class
document sleep class
document modem*/chat classes

freebsd IPV6_V6ONLY??? socket option
sysctl on netbsd?

should be able to associate a zlib handle with a file descriptor and read/write
	compressed data, just like ssl

fix math class

a bunch of static methods can probably be inlined
	
probably can combine memorypool and variablebuffer classes

add to chat class:
	\K-BREAK
	^C-control character represented by C

xml:
	should be able to validate an xml document against the dtd
	test invalid xml
	handle CDATA/internal subsets better
	xml classes need to support entities defined in the DOCTYPE declaration

file class:
	move create*Link/resolveSymbolicLink into link class

implement these classes:
	directorylisting
	link
	pipe
	serialport
	tty
	pseudotty
	shellcommand
	system
	loginrecord
	messagequeue
	thread
	sslcontext
	table (dynamic 2d array)
	generic parser/lexer classes, use them for xmlsax

tests for:
	intervaltimer
	dynamiclib
	math
	rawbuffer
	memorymap
	mutex
	serialportprofile

need to use internally:
	mutex class instead of pthread_mutex_*()

get a mingw port working

--------------------------------------------------------------------------------

modemutil
serialportutil
inetsocketutil
	- sockaddrin
	- addr
	- port
rawsocketutil
fileutil
unixsocketutil
	- sockaddrun
	- file
msgqueueutil
shmutil
fifoutil
pipeutil

filedescriptor
	- read()
	- write()
	- close()
	file : filedescriptor
		- open(filename,...)
		device : file
		serialport : file
		fifo : file
	pipe : filedescriptor
	client : filedescriptor
		- initialize(namevaluepairs *nvp)=0
		- connect=0
		modemclient : client, modemutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(device,initstring,dialstring,...)
			- connect()
			- connect(device,initstring,dialstring,...)
		serialportclient : client, serialportutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(device,...)
			- connect()
			- connect(device,...)
		socketclient : client
			- nonblock()
			protected:
				- connect(...,timeout)
			inetsocketclient : socketclient, inetsocketutil
				- initialize(namevaluepairs *nvp)=0
				- initialize(host,port,...)
				- connect()
				- connect(host,port,...)
			unixsocketclient : socketclient, unixsocketutil
				- initialize(namevaluepairs *nvp)=0
				- initialize(filename,...)
				- connect()
				- connect(filename,...)
			rawsocketclient : client, rawsocketutil
				- initialize(namevaluepairs *nvp)=0
				- initialize(???,...)
				- connect()
				- connect(???,...)
		fileclient  : client, fileutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(filename,...)
			- connect()
			- connect(filename,...)
		msgqueueclient : client, msgqueueutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(key,...)
			- connect()
			- connect(key,...)
		shmclient : client, shmutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(key,...)
			- connect()
			- connect(key,...)
		fifoclient : client, fifoutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(filename,...)
			- connect()
			- connect(filename,...)
		pipeclient : client, pipeutil
			- initialize(namevaluepairs *nvp)=0
			- initialize(???,...)
			- connect()
			- connect(???,...)
		...
	server : filedescriptor
		- bind()=0
		- listen()=0
		- filedescriptor *accept()=0
		modemserver: server, modemutil
			- initialize(device,initstring,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(device,initstring,...)
		serialportserver: server, serialportutil
			- initialize(device,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(device,...)
		socketserver: server
			- linger()
			- reuseaddr()
			- nonblock()
			- listen()
			protected:
				- sslAccept()
			inetsocketserver: socketserver, inetsocketutil
				- initialize(addr,port,...)
				- bind()
				- filedescriptor *accept()
				- listen(addr,port,...)
			unixsocketserver: socketserver, unixsocketutil
				- initialize(filename,...)
				- bind()
				- filedescriptor *accept()
				- listen(filename,...)
			rawsocketserver: server, rawsocketutil
				- initialize(???,...)
				- bind()
				- filedescriptor *accept()
				- listen(???,...)
		fileserver: server, fileutil
			- initialize(filename,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(filename,...)
		msgqueueserver: server, msgqueueutil
			- initialize(key,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(key,...)
		shmserver: server, shmutil
			- initialize(key,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(key,...)
		fifoserver: server, fifoutil
			- initialize(filename,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(filename,...)
		pipeserver: server, pipeutil
			- initialize(???,...)
			- bind()
			- listen()
			- filedescriptor *accept()
			- listen(???,...)
		...

--------------------------------------------------------------------------------

charstring class:
	stdio.h - sprintf()
	string.h/strings.h -
		strxfrm(_l)()
		strcspn(),strspn(),strpbrk()
	wordexp.h - wordexp()/wordfree() - word expansion???
	gnu extensions -
		stdio.h - asprintf(), open_memstream(), obstack_printf()
		obstack.h - lots of object stack macros for
				building strings char at a time
	not in bsd - 
		monetary.h - strfmon(_l)()

filesystem class:
	bsd/linux only (solaris uses an ioctl) - 
		sys/quota.h - quotactl() function, macros, defines
	bsd/linux only - 
		fstab.h - /etc/fstab parser
			getfsent(),getfsspec(),getfsfile(),setfsent(),endfsent()
	sunos/linux only - 
		mntent.h - read/write fstab, mtab, etc.
				setmntent(),getmntent(_r)()
				addmntent(),endmntent(),hasmntopt()
	linux only -
		sys/mount.h - mount(),umount(),umount2()

commandline class:
	getopt.h - make sure commandline class has full functionality
			getopt(),getopt_long(),getopt_long_only()

timer class:
	not on many systems -
		time.h and sys/time.h -
				clock_getres(), clock_gettime(), clock_settime()
				clock_nanosleep(), clock_getcpuclockid()
				timer_create(), timer_delete(), timer_settime(),
				timer_gettime(), timer_getoverrun()
					CLOCK_REALTIME
					CLOCK_MONOTONIC
					CLOCK_PROCESS_CPUTIME_ID
					CLOCK_THREAD_CPUTIME_ID

filedescriptor class:
	fcntl.h - fcntl()
			F_GET/SETFD - get/set close-on-exec bit
			F_GET/SETFL - get/set flags
				O_APPEND,O_NONBLOCK,O_ASYNC,O_DIRECT
			F_GET/SETOWN - get/set process group that will receive
					signals on i/o availability
			F_GET/SETSIG - get/set what signal to send to process
					group on i/o/availability
	sys/select.h - select(),pselect()
	sys/poll.h - poll()
	sys/uio.h - readv()/writev()
	gnu extensions - 
		stdio.h - dprintf()
	linux only - 
		sys/sendfile.h - sendfile()
	not in many systems - 
		sys/epoll.h - epoll functions for speeding up network io
				epoll_create(),epoll_ctl(),epoll_wait()
		aio.h - aio_init(),aio_read(),aio_write(),lio_listio(),
			aio_error(),aio_return(),aio_cancel(),
			aio_suspend(),aio_fsync()

errors:
	errno.h	- errno
	stdio.h - perror()
	string.h - strerror(_r)()

signals:
	stdlib.h - abort(), atexit(), exit(), _Exit()
	string.h - strsignal()
	unistd.h - pause(), _exit()
	setjmp.h - setjmp()/longjump()/sigsetjump() - save stack contexts
	signal.h - signal stuff - need to implement more of this
			sysv_signal(),bsd_signal(),signal()
			kill(),killpg(),raise()
			ssignal(),gsignal()
			psignal()
			sigpause(),sigblock()
			sigsetmask(),siggetmask()
			sigemptyset(),sigfillset(),sigaddset(),sigdelset()
			sigismember(),sigisemptyset(),sigandset,sigorset()
			sigprocmask(),sigaction(),sigpending(),sigwait(),
			sigwaitinfo(),sigtimedwait(),sigqueue()
			sigvec(),sigreturn(),siginterrupt(),
			sigstack(),signalstack()
			sighold(),sigrelse(),sigignore(),sigset()
	sys/wait.h - wait(),wait3(),wait4(),waitpid()
	not in many systems - 
		stdlib.h - on_exit()
		sys/wait.h - waitid()

catalogs ???:
	nl_types.h - catopen()/catgets()/catclose()

network:
	unistd.h - gethostname()/sethostname()
	netdb.h - netgroup functions
			herror(),hstrerror()
			rcmd(_af)(),rexec(_af)(),ruserok(_af)(),rresvport(_af)()
			gai_strerror(),getnameinfo(),getaddrinfo_a(),
	resolv.h - resolver functions, lots of these
	sys/socket.h - socket(),socketpair(),
			getsockname(),getpeername(),
			bind(),listen(),accept(),
			connect(),
			send(),recv(),
			sendto(),recvfrom(),
			sendmsg(),recvmsg(),
			getsockopt(),setsockopt(),
			shutdown()
	net/if.h - physical interface structs/defines
	net/if_arp.h - arp protocol structs/defines
	net/route.h - routing structs/defines
	netinet/in.h - ntohl,ntohs,htoln,htons
	netinet/icmp6.h - icmp structs
	netinet/if_ether.h - more arp structs???
	netinet/igmp.h - igmp structs???
	netinet/tcp.h - #defines for setsockopt, tcp packet structs
	netinet/udp.h - udp packet structs

	not on solaris -
		unistd.h - getdomainname()/setdomainname()
		netdb.h - gai_suspend(),gai_error(),gai_cancel()
		ifaddrs.h - discover network interfaces
				getifaddrs(),freeifaddrs()
		net/if_packet.h - packet sockets structs/defines
		net/if_ppp.h - ppp interfaces structs/defines
		netinet/in.h - ip/ipv6 address structs,
				bindresvport(),bindresvport6()
				inet6_option_space()
				inet6_option_init()
				inet6_option_append()
				inet6_option_alloc()
				inet6_option_next()
				inet6_option_find()
		netinet/ip.h - ip packet structs
		netinet/ip6.h - ipv6 packet structs
		netinet/ip_icmp.h - icmp packet structs
	not on many systems -
		sys/socket.h - sockatmark()
		net/ethernet.h - ethernet interface structs/defines
		net/if_shaper.h - traffic shaper structs/defines
		net/if_slip.h - slip interfaces structs/defines
		netinet/if_fddi.h - fddi packet struct???
		netinet/if_tr.h - ???
		netinet/ether.h - ethernet addresses to acii and back
					ether_ntoa(_r)()
					ether_aton(_r)()
					ether_ntohost()
					ether_hostton()
					ether_line()
		netpacket/packet.h - raw packet structs

internationalization:
	langinfo.h - locale info functions
	locale.h/xlocale.h - setlocale, localeconv, etc.
	iconv.h - character set conversion
	libintl.h - gettext functions
	stdlib.h - rpmatch() - response match
