/*static char *SCCSID = "@(#)cmstrupr.c	6.2 91/02/22";*/
/* static char *SCCSID = "@(#)cmstrupr.c	6.2 91/02/22"; */

/*********************************************************************/
/*	 IBM/Microsoft Confidential				     */
/*								     */
/*	 Copyright (c) IBM Corporation 1987, 1989		     */
/*	 Copyright (c) Microsoft Corporation 1987, 1989 	     */
/*								     */
/*	 All Rights Reserved					     */
/*********************************************************************/

/******** START OF SPECIFICATION ****** IBM CONFIDENTIAL *************/
/*								     */
/* SUBROUTINE NAME:  COM_STRUPR 				     */
/*								     */
/* DESCRIPTIVE NAME:  CONVERTS STRING TO UPPER CASE		     */
/*								     */
/* FUNCTION:							     */
/*								     */
/*								     */
/* NOTES:							     */
/*								     */
/*								     */
/* ENTRY POINT:  com_strupr					     */
/*   LINKAGE  : 						     */
/*								     */
/* INPUT:    string   --- source string pointer (unsigned char ptr)  */
/*								     */
/* EXIT:							     */
/*								     */
/*								     */
/* EXIT-NORMAL: Converted string pointer			     */
/*								     */
/* EXIT-ERROR:	none						     */
/*								     */
/*								     */
/* EFFECTS:							     */
/*								     */
/* INTERNAL REFERENCES: none					     */
/*   ROUTINES:							     */
/*								     */
/* EXTERNAL REFERENCES: 					     */
/*   ROUTINES: strupr						     */
/*								     */
/* RELEASE:							     */
/*								     */
/*   VERSION	  DATE		 REASON 			     */
/*								     */
/*     1.00	6/13/1986      initial version			     */
/*								     */
/* B001 02/20/91 fgw  B718926: warning messages for C6 compiles      */
/******************* END OF SPECIFICATIONS ***************************/
  #include "cmdbcs.h"                            /* dbcs externs          */
  #include "comsub.h"                            /* dbcs externs          */
  #include <stdio.h>				 /* dbcs externs	  */

  #define NULLC '\0'                             /* ;BN001;               */

  unsigned char *com_strupr(string)		 /*			  */
    unsigned char *string;			 /* string to be converted	  */
    {						 /*				  */
     unsigned char *strptr;			 /* string pointer to string	  */
     com_settbl();				 /* initialize DBCS table	  */
     strptr = string;				 /* assign begin of string as a   */
						 /*  character pointer		  */
     while (*strptr != NULLC)			 /* ;BC001; check char pointer	  */
       {					 /*				  */
	if (check_dbcs(*strptr) == DBCS)	 /* if cur char is DBCS lead byte */
	  {					 /* then			  */
	   if (*++strptr == NULLC)		 /* ;BC001; trail byte is null	  */
	     { break;	 }			 /*	then quit search == EOF   */
	   else 				 /*	else			  */
	     { ++strptr; }			 /*	  trail byte is skipped   */
	  }					 /*   endif			  */
	else					 /* else			  */
	  {					 /*   when not DBCS		  */
	   *strptr = casemap_up[*strptr];	 /*   cnv cur char to upper case  */
	   strptr++;				 /*   inc to next char in string  */
	  }					 /*   if DBCS lead byte found	  */
						 /*	 then inc past trail byte */
						 /* endif			  */
       }					 /* end while			  */
     return(string);				 /* return converted string	  */
    }						 /* end of com_strupr		  */
