When it converts, it saves the original file as its previous name with a .old extension. Also, there are times when C syntax cannot be parsed easily with a regular expression parser, so it marks that code with '####' followed by the routine name in all capitol letters. Thus, you can just do a grep for '####' to find any code that must be converted by hand.
Note, most often, this shell script will be called from kdarwin while converting an old vroutine to a kroutine in the new object system.
This section has two examples of how kfix is used. These two examples show the two modes of operation available to kfix. In the first mode, it scans the current directory for source code files, and offers the user a menu allowing the user to choose which library conversions to perform.The default operation of kfix is to scan the current directory for all files ending in .c, and to giving the user a menu of conversions that can be performed on each file. In this mode, it will also offer to convert the .h files. The following example illustrates how this mode of operation works.
% ls
config.c ghost.h internals.h keynames.c readprog.c% kfix
NOTICE: '.h' files exist. Do you want to convert them also? (y/n) y
Khoros 2.0 conversion script
This script will convert library calls for the following libraries, or all of the 2.0 libraries.
1. Convert bsd2posix library calls 2. Convert dataserv library calls 3. Convert kexpr library calls 4. Convert kmath library calls 5. Convert ktransport library calls 6. Convert kutils library calls 7. Convert all library calls
Please enter your selection: 7
Converting config.c for bsd2posix library calls
Converting config.c for dataserv library calls
Converting config.c for kexpr library calls
Converting config.c for kmath library calls
Converting config.c for ktransport library calls
Converting config.c for kutils library callsConverting keynames.c for bsd2posix library calls
Converting keynames.c for dataserv library calls
Converting keynames.c for kexpr library calls
Converting keynames.c for kmath library calls
Converting keynames.c for ktransport library calls
Converting keynames.c for kutils library callsConverting readprog.c for bsd2posix library calls
Converting readprog.c for dataserv library calls
Converting readprog.c for kexpr library calls
Converting readprog.c for kmath library calls
Converting readprog.c for ktransport library calls
Converting readprog.c for kutils library callsConverting ghost.h for bsd2posix library calls
Converting ghost.h for dataserv library calls
Converting ghost.h for kexpr library calls
Converting ghost.h for kmath library calls
Converting ghost.h for ktransport library calls
Converting ghost.h for kutils library callsConverting internals.h for bsd2posix library calls
Converting internals.h for dataserv library calls
Converting internals.h for kexpr library calls
Converting internals.h for kmath library calls
Converting internals.h for ktransport library calls
Converting internals.h for kutils library calls% ls
config.c ghost.h.old keynames.c readprog.c.old
config.c.old internals.h keynames.c.old
ghost.h internals.h.old readprog.cThis next example shows how to convert just one file.
% ls ~joe/cfiles
myfile.c other.c% kfix ~joe/cfiles/myfile.c
Khoros 2.0 conversion script
This script will convert all 2.0 library calls.
Converting /home/joe/cfiles/myfile.c for bsd2posix library calls
Converting /home/joe/cfiles/myfile.c for dataserv library calls
Converting /home/joe/cfiles/myfile.c for kexpr library calls
Converting /home/joe/cfiles/myfile.c for kmath library calls
Converting /home/joe/cfiles/myfile.c for ktransport library calls
Converting /home/joe/cfiles/myfile.c for kutils library calls% ls ~joe/cfiles
myfile.c myfile.c.old other.c