# HG changeset patch # User roug # Date 1033895436 0 # Node ID f0c8d53e5a509f6d7b62b75941dfc05657f7d5a3 # Parent ce6c1122bee678d75d7d3e3970ee3d8a23b694d2 entered: chdir chmod qsort strass toupper tsleep wait diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/ccguide.docbook --- a/docs/ccguide/ccguide.docbook Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/ccguide.docbook Sun Oct 06 09:10:36 2002 +0000 @@ -71,6 +71,7 @@ + diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/ccguide.pdf Binary file docs/ccguide/ccguide.pdf has changed diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/chap1.chapter --- a/docs/ccguide/chap1.chapter Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/chap1.chapter Sun Oct 06 09:10:36 2002 +0000 @@ -26,5 +26,139 @@ parts of C that are obsolete or the constraints imposed by memory size limitations. + + +
+Compiler Option Flags + +The compiler recognizes several command-line option flags which +modify the compilation process where needed. All flags are +recognized before compilation commences so the flags may be placed +anywhere on the command line. Flags may be ran together as in "-ro", +except where a flag is followed by something else; see "-f=" and +"-d" for examples. + + +-A +suppresses assembly, leaving the output as assembler code in a +file whose name is postfixed ".a". + + +-E=<number> +Set the edition number constant byte to the number given. This is +an OS-9 convention for memory modules. + + +-O +inhibits the assembly code optimizer pass. The optimizer will +shorten object code by about 11% with a comparable increase in speed +and is recommended for production versions of de-bugged programs. + + +-P +invokes the profiler to generate function frequency +statistics after program execution. + + +-R +suppresses linking library modules into an executable program. +Outputs are left in files with postfixes ".r". + + +-M=<memory size> +will instruct the linker to allocate <memory size> +for data, stack, and parameter area. Memory size may be expressed +in pages (an integer) or in kilobytes by appending "k" to an +integer. For more details of the use of this option, see the +"Memory Management" section of this manual. + + +-L=<filename> +specifies a library to be searched by the linker +before the Standard Library and system interface. + + +-F=<path> +overrides the above output file naming. The output file +will be left with <filename> as its name. This flag does not make +sense in multiple source mode, and either the -a or -r flag is also +present. The module will be called the last name in <path>. + + +-C +will output the source code as comments with the assembler code. + + +-S +stops the generation of stack-checking code. -S should only be +used with great care when the appication is extremely time-critical +and when the use of the stack by compiler generated code is fully +understood. + + +-D<identifier> +is equivalent to "#define <identifier>" written in +the source file. -D is useful where different versions of a program +are maintained in one source file and differentiated by means of the +"#ifdef" of "#ifndef" pre-processor directives. If the <identifier> +is used as a macro for expansion by the pre-processor, "1"(one) will +be the expanded "value" unless the form "-d<identifier>=<string>" is +used in which case the expansion will be <string>. + + +Command Line and Option Flag Examples + + + + + + + command line + action + output file(s) + + + + + cc prg.c + compile to an executable program + prg + + + + cc prg.c -a + compile to assembly language source code + prg.a + + + cc prg.c -r + compile to relocatable module + prg.r + + + cc prg1.c prg2.c prg3.c + compile to executable program + prg1.r, prg2.r, prg3.r, output + + + cc prg1.c prg2.a prg3.r + compile prg1.c, assemble prg2.a and combine all into +and executable program + prg1.r, prg2.r + + + cc prg1.c prg2.c -a + compile to assembly language source code + prg1.a, prg2.a + + + cc prg1.c prg2.c -f=prg + compile to executable program + prg + + + +
+
diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/chap4.chapter --- a/docs/ccguide/chap4.chapter Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/chap4.chapter Sun Oct 06 09:10:36 2002 +0000 @@ -26,6 +26,7 @@ &longjmpref; &mallocref; &mktempref; +&printfref; &putcref; &putsref; &qsortref; diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/chdir.refentry --- a/docs/ccguide/chdir.refentry Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/chdir.refentry Sun Oct 06 09:10:36 2002 +0000 @@ -9,15 +9,39 @@ chdir - type arg1 + char *dirname + + + + cxdir + char *dirname +Assembler Equivalent + +os9 I$CHGDIR + + Description -Placeholder +These calls change the current data directory and the current +execution directory, respectively, for the running task. +"Dirname" is a pointer to a string that gives a pathname for +a directory. + + +Diagnostics + +Each call returns 0 after a successful call, or -1 if "dirname" +is not a directory path name, or it is not searchable. + + +See Also + +OS-9 shell commands "chd" and "chx". diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/chmod.refentry --- a/docs/ccguide/chmod.refentry Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/chmod.refentry Sun Oct 06 09:10:36 2002 +0000 @@ -11,7 +11,8 @@ chmod - type arg1 + char *fname + int perm diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/printf.refentry --- a/docs/ccguide/printf.refentry Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/printf.refentry Sun Oct 06 09:10:36 2002 +0000 @@ -16,7 +16,7 @@ printf char *control - .. + ... diff -r ce6c1122bee6 -r f0c8d53e5a50 docs/ccguide/qsort.refentry --- a/docs/ccguide/qsort.refentry Sat Oct 05 16:53:43 2002 +0000 +++ b/docs/ccguide/qsort.refentry Sun Oct 06 09:10:36 2002 +0000 @@ -8,7 +8,11 @@ qsort - type arg1 + char *base + int n + int size + int (* compfunc) + void *, void * @@ -16,7 +20,17 @@ Description -Placeholder +Qsort implements the quick-sort algoritm for sortig an +arbitrary array of items. + + +"Base" is the address of the array of "n" items of size "size". +"Compfunc" is a pointer to a comparison routine supplied by +the user. It will be called by qsort with two pointers to +items in the array for comparison and should return an integer +which is less than, equal to, or greater than 0 where, +respectively, the first item is less than, equal to, or greater +than the second.