libcasefix
Goal:
	To make a set of tools which can be used to modify or correct the casing of character blocks (words) of text whether a single character, a character block (word), a group of words, a sentence, a string, a char array or a stream of text that is reliable, robust, concise, easily usable, easily implementable and portable.
	
Design Considerations:
	
	To accomplish that, streaming functions are needed and since streaming functions could "handle" all the other forms of text, it was decided that streaming functions should be the primary means of operation.
	
	Structured programming of course would be important but because the primary tools were to be streaming functions, and since streaming functions are fast, speed became a consideration. So it was decided that subroutine type functions should be used wherever possible but during the operative sections (defined as from the time the first character is read from the input stream until the last character is placed on the output stream), subroutine type functions should not be used, exempting only libc calls which are pretty well optimized and this also because it would make development easier (understandability). Someday these calls may be replaced by inline code, and for sure in the planned speed optimized version. However, subroutine type functions can and should be used throughout the rest of the code, which are basically set up sections.
	
	It was decided that instead of trying to have one primary streaming editor, to have separate streaming editors, one for each casing mode for two reasons, code understandability and since speed has become an important factor, to minimize decisions during the the operative sections.

	For portability, it was decided to do every thing that can be done to make it universally portable. So only ANSI / ISO C90 code is to be used in the prime casefix library. toupper and tolower code substitution macros were implemented to make the code even more portable. Also, no extensions to the standard C library are used. It should compile and be usable on all C platforms unmodified.
	
	A C++ classlib was considered also, and even though the benefit seems negligible, it was decided to have one but to develop libcasefix first. The casefix classlib has not been implemented yet.
	
	To implement robustness, every mode of casing thought of was implemented as a streaming editor and the streaming editors all can accommodate a single character, a character block (word), a group of words, a sentence, a string, a char array or a stream of text.
	
	To implement reliability, every call that has error indication was checked for error indication and every function that is not libc returns an error indicator except and that no use of global is used. Where feasible, argument error is checked with a checking function which is also programmer callable.
	
	easy implementation was designed into the streaming editors, most take only pointers to an input stream and an output stream and two take a third argument a char pointer to a string. Also, to make it as easy as possible to input three functions where made to provide easier access to the streaming editors. One to input char arrays and one to input strings which calls the char array function. These keep the programmer from having to set up and tear down streams.

	conciseness flows

casefix command:
Goal:
	While developed along side of libcasefix (to develop libcasefix), it was always envisioned that casefix was to be a shell command which can be used to modify or correct the casing of character blocks (words) of text whether a single character, a character block (word), a group of words, a sentence or a stream of text that is reliable, robust, concise, easily usable, and portable. It should take input and output in every way possible in the shell. Also, it could serve as a real world working example for implementing libcasefix.

Design Considerations:
	For portability, it was decided to do every thing that can be done to make it universally portable. So only ANSI / ISO C90 code is to be used and no extensions to the standard C library are to be used. It should compile and be usable on all C platforms unmodified.
	
	To implement robustness all streaming editors of libcasefix are callable by a simple short option. Also, It takes input and outputs in every way possible: it takes input from the command line or xargs, including exec or system calls from programs should a programmer not wish to use libcasefix directly for some reason, from stdin, either from the console or via a pipe from another program, or from a file. It outputs to the console or to a pipe to another program or to a file,
	
	To implement reliability, every call that has error indication was checked for error indication and every function that is not libc returns an error indicator except and that no use of global is used,except char array programname.
	
	Structured programming of course used. While theoretically, casefix could run forever in the case the input is a stream, casefix is a one shot, that is it is given a casefix task, it runs until it's done and then it exits. Therefore, it is a command. 
	
	Except for the command line parsing loop, and where scope rules allow, all repeated operations are done with subroutine-like functions.

Other Notes
	casefixarray is the primary interface to the streaming functions for arrays. but to make libcasefix more effective, another function was put on top of casefixarray, casenreplacearray, which requires the same basic inputs but makes the replacement for the programmer. With the input size parameter and the undochararray pointer, the programmer has information to do an "undo", at least as long as that information is kept. To do an undo:
	
					memmove (selectedchararray, undochararray, size);
	
	casenreplacestring saves the programmer from calculating the size of the input array, saves the programmer from allocating an output or undo array, and also saves the programmer from making the replacement. Since no ability to undo the effect of the call is inherent in the casenreplacestring function, the programmer must keep undo info on his own, in which case one might as well use casenreplacearray.

On variadic functions:
	As far as the streaming functions go, all of them require all of their arguments, except prepsentences, and with prepsentences, the "optional argument" is not ignored, but is either a specification of delimiters or if empty a flag to use the defaults. Also, these functions take stream pointers and char array pointers. char array pointers are non-selfpromoting and so could not be the last argument, leaving stream pointers as the natural alternative, while stream pointers currently are integers, they are not as stream pointers, selfpromoting.

	casefixarray, casenreplacearray might need to be variadicized. 5 of the seven don't per se, need char * argstring. int mode, int size or a new required arg would have to be last arg. To have a variadic function for one string argument will make for a ugly man page. A variadic function here de-enhances it. Strict ISO calls for there use; there non-use is portable. What is this ISO requirement about?
	
	And Also no argument is technically ignored, but may not be used. depending on the mode.
	
The bloat to practicality ratio:
	one could have a number of derivatives of the functions allready in libcasefix/
	the bloat to practicality ratio must not get high.


	if one were to make a custom function that had the ability to take a different set of delimiters, one would still need a custom function or default delimiters. such a function would be unwieldy without a default set. Maybe that is the finishing touch.
	
	
On backside custom templating
	if one allowed for backside custom templating (see custom function in the libcasefix Programmer's Reference Guide) using a wildcard to skip over characters until the position of the backside template was reached, ie. "uu*uu" or some such template string, the function would have to store an unknown amount of characters, and buffer over-run would be possible. Better to sort words by length and run custom over each set of words at the user end. Also, bloat to practicality ratio to high.
