Question: int main ( int argc, char * argv [ ] ) { / / PROVIDED: print a usage message and exit if no arguments are
int mainint argc, char argv
PROVIDED: print a usage message and exit if no arguments are
provided to the program.
ifargc
printfusage: s
argv;
printfs fontfile
argv;
printfs textfile
argv;
printfs textfile fontfile
argv;
printfArguments can appear in any order only one of or can be used
;
printf
;
printfNote: In some shells, embedded newline
characters, require
;
printfthe syntax $'text' as in
;
printfs $'HELLO
WORLD
argv;
printfto be treated correctly. This is NOT necessary on grace.umd.edu
;
printfThis is NOT necessary on grace.umd.edu where the syntax
;
printfs 'HELLO
WORLD
argv;
printfwill behave correctly to embed newlines due to tcsh being used.
;
return ;
PROVIDED: Set default options
char text NULL; text to print, from command line or file
int usetextfile ; free 'text' or not?
fontt font &fontstandard; default to built in standard font
REQUIRED: Command line parsing loop which handles fontfile,
textfile, and text arguments, sets variables above
appropriately.
forint i; i; i
REQUIRED: Call to printfontified to print the banner text
printfontifiedtext font;
REQUIRED: Checks to free memory if needed. If a font was loaded
from a file, free it If text was loaded from a file was loaded,
free it
PROVIDED: return on a normal exit.
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
