MIGRATION commands


PROGRAM NAME

kfix - Update source code from khoros 1.0 library calls to 2.0 calls

DESCRIPTION

This program converts source code written to Khoros 1.0 or to normal unix system calls to use the equivalent library calls that exist in Khoros 2.0. The user of the program can choose to fix some or all of the routine calls according to a several categories. The supported conversions are bsd library to posix library calls, Khoros 1.0 xvimage input data functions to Khoros 2.0 retro toolbox calls, vexpr to kexpr, vmath to kmath, Khoros 1.0 transport calls and unix file system calls to 2.0 transport and OS abstraction calls, and Khoros 1.0 string and general utility calls to Khoros 2.0 utility calls.

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.

REQUIRED ARGUMENTS

none

OPTIONAL ARGUMENTS

none

EXAMPLES

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 calls

Converting 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 calls

Converting 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 calls

Converting 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 calls

Converting 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.c

This 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

SEE ALSO

kdarwin(1), sed(1), csh(1)

RESTRICTIONS

This program uses unix regular expressions and the substitution capabilities of sed to implement the conversions.

REFERENCES

None

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.