CSC 265 -- Exercise 1
DUE: midnight on Tuesday 24 September 1996
~csc265/Exercises/Ex1/kwic_ex1This directory contains all the source code to build the existing non-interactive version of KWIC.
kwic_ex1 directory)
the command:
make kwicYou can run the program by supplying one or more files on the command line. For example,
kwic input/test0will run the program using a short test file supplied with the KWIC system. A much longer test file is provided as
input/test1.
XDialog.h
and the README file for information about
the module's services.
You can run the test program, testXD, to see the nature
of the GUI interface that XD supplies.)
~csc265/Exercises/Ex1/XDialog,
into your copy of the KWIC directory tree.
The XDialog directory should be an equal partner
with the other modules (Input, ShiftSort,
etc.)
XDialog.h)
from the XDialog directory
to the directory named include.
Makefile in the root
of your KWIC directory tree with the new Makefile provided as
~csc265/Exercises/Ex1/Makefile-new.
include/Output.h with the new file
Output-new.h.
main.c so that it contains
a call to the XD module initialization function,
XDinit.
The call should appear with the other calls to
module initialization functions.
The exact coding of this call should be:
XDinit("KWIC Program", OUNROWS, OUNCOLS);
You must also add the line
#include "XDialog.h"near the beginning of the
main.c file.
Output.c)
so that
OUPrint does nothing more than call
the function XDactivateWindow, and
XDcreateDisplayText,
which is required by the XD module.
XDcreateDisplayText function takes a keyword string
as its argument.
The function must search through the lines of text
produced by the ShiftSort module to find the first line which
begins with the characters of the given keyword.
That line plus the 23 succeeding lines are then copied into
a character array, which is returned as the result of the
XDcreateDisplayText function.
~csc265/Exercises/Ex1/Output-new.c
XDcreateDisplayText function may receive
a keyword string that contains spaces.
In that situation, you must consider the string to consist of
one or more complete keywords followed by, perhaps, the partial
text of a final keyword.
rcp -- remote file copy cp -- copy files cpio -- copy file archives in and out dd -- convert a file while copying itthen the user can enter the keyword string as
copy fiand see output like the following displayed in the window:
copy file archives in and out, cpio -- copy files, cp -- copying it, dd -- convert a file while ...
main.c
specified above, all your coding changes must be confined to the
Output.c file.
You are not permitted to change any other files.
/home/csc265/bin/kwic inputfile
where you supply the name of a text file to use as the input
instead of the name inputfile.
(As with all software, we do not guarantee the correctness of this
kwic program.
If you lose points for submitting an incorrect program for this
assignment, you cannot use the excuse that example solution has
the same behaviour.)
csc265@gulf.
When you are ready to submit, carefully follow the instructions below:
Output.c file correctly
identifies your team and its members in the initial comment.
Output directory
-- which holds your new version of the Output.c file.
mail -s 'Exercise 1 submission' csc265 < Output.cThis command will e-mail the file to user csc265.