/*cap4 convert first 4 char of input line chLab into chCAP all in caps, null termination */ #include #include "cddefines.h" #include "cap4.h" void cap4( char *chCAP , /* output string, cap'd first 4 char of chLab, */ /* with null terminating */ char *chLab) /* input string ending with eol*/ { long int /*chr,*/ i ; # ifdef DEBUG_FUN fputs( "<+>cap4()\n", debug_fp ); # endif /* convert 4 character string in chLab to ALL CAPS in chCAP */ for( i=0; i < 4; i++ ) { /* toupper is function in ctype that converts to upper case */ chCAP[i] = (char)toupper( chLab[i] ); } /* now end string with eol */ chCAP[4] = '\0'; # ifdef DEBUG_FUN fputs( " <->cap4()\n", debug_fp ); # endif return; }