/*static char *SCCSID = "@(#)cmstrupr.c	6.2 90/12/10";                                 */
/****************************************************************************/
/*                                                                          */
/*                       IBM/Microsoft Confidential                         */
/*                                                                          */
/*                 Copyright (c) IBM Corporation  1987, 1990                */
/*                 Copyright (c) Microsoft Corp.  1987, 1990                */
/*                           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                       */
/*                                                                   */
/******************* END OF SPECIFICATIONS ***************************/
  #include "cmdbcs.h"                            /* dbcs externs          */
  #include "comsub.h"                            /* dbcs externs          */
  #include <stdio.h>                            /* dbcs externs          */
                                                 /*                       */
                                                 /*                       */
  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 != NULL)                     /* while char pointer not NULL   */
       {                                         /*                               */
        if (check_dbcs(*strptr) == DBCS)         /* if cur char is DBCS lead byte */
          {                                      /* then                          */
           if (*++strptr == NULL)                /*   if 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             */
