-+-+-+-+-+-+-+-+ START OF PART 6 -+-+-+-+-+-+-+-+ X while(*dest++ = *source++)`09/* cat the source to the destination */ X`09 ; X X dest--;`09`09`09`09/* back over the null character`09 */ X source = va_arg(incrmtr,char*);`09/* get the next argument`09 */ X `7D X X *dest = '\0';`09`09`09/* terminate the destination`09 */ X va_end(incrmtr);`09`09`09/* end varargs session`09`09 */ X X return(retval);`09`09`09/* return pointer to destination */ X X`7D`09/*** cat ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09strins X X Purpose:`09Insert a character string into another at a specified X`09`09position. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09str`09`09`09string to be updated; should be large X`09`09`09`09enough to accomodate the new string X`09new`09`09`09string to be inserted X`09position`09`09place to insert new into str X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09 0`09`09`09string insert successful X`09 -1`09`09`09unable to insert string because position X`09`09`09`09points outside of str X X**************************************************************************** V**** X**************************************************************************** V***/ X Xint strins(str,new,position) X Xregister char`09 *str, X`09`09 *new; Xregister int`09 position; X X`7B`09/*** strins ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ Xregister int`09 i,`09`09`09/* loop and array index`09`09 */ X`09`09 j;`09`09`09/* temporary variable`09`09 */ X`09 int`09 new_len,`09`09/* length of string to insert`09 */ X`09`09 str_len;`09`09/* length of str`09`09 */ X X X str_len = strlen(str);`09`09/* get length of current str`09 */ X X if((position > str_len) `7C`7C (position < 0)) X i = -1; X else X `7B X new_len = strlen(new);`09`09/* get length of string to insert */ X i = new_len + str_len - 1;`09/* get where to start when we shift */ X *(str+i+1) = '\0'; `09`09/* terminate it first `09`09 */ X j = str_len - 1;`09`09`09/* point to last char of str`09 */ X X /* now shift everything over to make room for the new string */ X X while(j >= position) X `7B X`09 *(str+i) = *(str+j); X`09 --i; X`09 --j; X `7D X X /* now add the new string in the right slot */ X X for(i = 0,j = position; *(new+i) != '\0'; i++,j++) X *(str+j) = *(new+i); `20 X X i = 0; X `7D X X return(i); X X`7D`09/*** strins ***/ `20 X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09strlu X X Purpose:`09Convert all lower-case characters in a string to upper-case. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09source`09`09`09source string to be converted X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09none X X**************************************************************************** V**** X**************************************************************************** V***/ X Xvoid strlu(source) X Xregister char`09 *source; X X`7B`09/*** strlu ***/ X X while(*source) X `7B X *source = _toupper(*source); X source++; X `7D X X return; X X`7D`09/*** strlu ***/ $ CALL UNPACK SUBS.C;1 387114389 $ v=f$verify(v) $ EXIT