ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

utclib.c
Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * Module Name: cmclib - Local implementation of C library functions
00004  *
00005  *****************************************************************************/
00006 
00007 /******************************************************************************
00008  *
00009  * 1. Copyright Notice
00010  *
00011  * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
00012  * All rights reserved.
00013  *
00014  * 2. License
00015  *
00016  * 2.1. This is your license from Intel Corp. under its intellectual property
00017  * rights.  You may have additional license terms from the party that provided
00018  * you this software, covering your right to use that party's intellectual
00019  * property rights.
00020  *
00021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
00022  * copy of the source code appearing in this file ("Covered Code") an
00023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
00024  * base code distributed originally by Intel ("Original Intel Code") to copy,
00025  * make derivatives, distribute, use and display any portion of the Covered
00026  * Code in any form, with the right to sublicense such rights; and
00027  *
00028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
00029  * license (with the right to sublicense), under only those claims of Intel
00030  * patents that are infringed by the Original Intel Code, to make, use, sell,
00031  * offer to sell, and import the Covered Code and derivative works thereof
00032  * solely to the minimum extent necessary to exercise the above copyright
00033  * license, and in no event shall the patent license extend to any additions
00034  * to or modifications of the Original Intel Code.  No other license or right
00035  * is granted directly or by implication, estoppel or otherwise;
00036  *
00037  * The above copyright and patent license is granted only if the following
00038  * conditions are met:
00039  *
00040  * 3. Conditions
00041  *
00042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
00043  * Redistribution of source code of any substantial portion of the Covered
00044  * Code or modification with rights to further distribute source must include
00045  * the above Copyright Notice, the above License, this list of Conditions,
00046  * and the following Disclaimer and Export Compliance provision.  In addition,
00047  * Licensee must cause all Covered Code to which Licensee contributes to
00048  * contain a file documenting the changes Licensee made to create that Covered
00049  * Code and the date of any change.  Licensee must include in that file the
00050  * documentation of any changes made by any predecessor Licensee.  Licensee
00051  * must include a prominent statement that the modification is derived,
00052  * directly or indirectly, from Original Intel Code.
00053  *
00054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
00055  * Redistribution of source code of any substantial portion of the Covered
00056  * Code or modification without rights to further distribute source must
00057  * include the following Disclaimer and Export Compliance provision in the
00058  * documentation and/or other materials provided with distribution.  In
00059  * addition, Licensee may not authorize further sublicense of source of any
00060  * portion of the Covered Code, and must include terms to the effect that the
00061  * license from Licensee to its licensee is limited to the intellectual
00062  * property embodied in the software Licensee provides to its licensee, and
00063  * not to intellectual property embodied in modifications its licensee may
00064  * make.
00065  *
00066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
00067  * substantial portion of the Covered Code or modification must reproduce the
00068  * above Copyright Notice, and the following Disclaimer and Export Compliance
00069  * provision in the documentation and/or other materials provided with the
00070  * distribution.
00071  *
00072  * 3.4. Intel retains all right, title, and interest in and to the Original
00073  * Intel Code.
00074  *
00075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
00076  * Intel shall be used in advertising or otherwise to promote the sale, use or
00077  * other dealings in products derived from or relating to the Covered Code
00078  * without prior written authorization from Intel.
00079  *
00080  * 4. Disclaimer and Export Compliance
00081  *
00082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
00083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
00084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
00085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
00086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
00087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
00088  * PARTICULAR PURPOSE.
00089  *
00090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
00091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
00092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
00093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
00094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
00095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
00096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
00097  * LIMITED REMEDY.
00098  *
00099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
00100  * software or system incorporating such software without first obtaining any
00101  * required license or other approval from the U. S. Department of Commerce or
00102  * any other agency or department of the United States Government.  In the
00103  * event Licensee exports any such software from the United States or
00104  * re-exports any such software from a foreign destination, Licensee shall
00105  * ensure that the distribution and export/re-export of the software is in
00106  * compliance with all laws, regulations, orders, or other restrictions of the
00107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
00108  * any of its subsidiaries will export/re-export any technical data, process,
00109  * software, or service, directly or indirectly, to any country for which the
00110  * United States government or any agency thereof requires an export license,
00111  * other governmental approval, or letter of assurance, without first obtaining
00112  * such license, approval or letter.
00113  *
00114  *****************************************************************************/
00115 
00116 
00117 #define __CMCLIB_C__
00118 
00119 #include "acpi.h"
00120 #include "accommon.h"
00121 
00122 /*
00123  * These implementations of standard C Library routines can optionally be
00124  * used if a C library is not available.  In general, they are less efficient
00125  * than an inline or assembly implementation
00126  */
00127 
00128 #define _COMPONENT          ACPI_UTILITIES
00129         ACPI_MODULE_NAME    ("cmclib")
00130 
00131 
00132 #ifndef ACPI_USE_SYSTEM_CLIBRARY
00133 
00134 #define NEGATIVE    1
00135 #define POSITIVE    0
00136 
00137 
00138 /*******************************************************************************
00139  *
00140  * FUNCTION:    AcpiUtMemcmp (memcmp)
00141  *
00142  * PARAMETERS:  Buffer1         - First Buffer
00143  *              Buffer2         - Second Buffer
00144  *              Count           - Maximum # of bytes to compare
00145  *
00146  * RETURN:      Index where Buffers mismatched, or 0 if Buffers matched
00147  *
00148  * DESCRIPTION: Compare two Buffers, with a maximum length
00149  *
00150  ******************************************************************************/
00151 
00152 int
00153 AcpiUtMemcmp (
00154     const char              *Buffer1,
00155     const char              *Buffer2,
00156     ACPI_SIZE               Count)
00157 {
00158 
00159     for ( ; Count-- && (*Buffer1 == *Buffer2); Buffer1++, Buffer2++)
00160     {
00161     }
00162 
00163     return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *Buffer1 -
00164         (unsigned char) *Buffer2));
00165 }
00166 
00167 
00168 /*******************************************************************************
00169  *
00170  * FUNCTION:    AcpiUtMemcpy (memcpy)
00171  *
00172  * PARAMETERS:  Dest        - Target of the copy
00173  *              Src         - Source buffer to copy
00174  *              Count       - Number of bytes to copy
00175  *
00176  * RETURN:      Dest
00177  *
00178  * DESCRIPTION: Copy arbitrary bytes of memory
00179  *
00180  ******************************************************************************/
00181 
00182 void *
00183 AcpiUtMemcpy (
00184     void                    *Dest,
00185     const void              *Src,
00186     ACPI_SIZE               Count)
00187 {
00188     char                    *New = (char *) Dest;
00189     char                    *Old = (char *) Src;
00190 
00191 
00192     while (Count)
00193     {
00194         *New = *Old;
00195         New++;
00196         Old++;
00197         Count--;
00198     }
00199 
00200     return (Dest);
00201 }
00202 
00203 
00204 /*******************************************************************************
00205  *
00206  * FUNCTION:    AcpiUtMemset (memset)
00207  *
00208  * PARAMETERS:  Dest        - Buffer to set
00209  *              Value       - Value to set each byte of memory
00210  *              Count       - Number of bytes to set
00211  *
00212  * RETURN:      Dest
00213  *
00214  * DESCRIPTION: Initialize a buffer to a known value.
00215  *
00216  ******************************************************************************/
00217 
00218 void *
00219 AcpiUtMemset (
00220     void                    *Dest,
00221     UINT8                   Value,
00222     ACPI_SIZE               Count)
00223 {
00224     char                    *New = (char *) Dest;
00225 
00226 
00227     while (Count)
00228     {
00229         *New = (char) Value;
00230         New++;
00231         Count--;
00232     }
00233 
00234     return (Dest);
00235 }
00236 
00237 
00238 /*******************************************************************************
00239  *
00240  * FUNCTION:    AcpiUtStrlen (strlen)
00241  *
00242  * PARAMETERS:  String              - Null terminated string
00243  *
00244  * RETURN:      Length
00245  *
00246  * DESCRIPTION: Returns the length of the input string
00247  *
00248  ******************************************************************************/
00249 
00250 
00251 ACPI_SIZE
00252 AcpiUtStrlen (
00253     const char              *String)
00254 {
00255     UINT32                  Length = 0;
00256 
00257 
00258     /* Count the string until a null is encountered */
00259 
00260     while (*String)
00261     {
00262         Length++;
00263         String++;
00264     }
00265 
00266     return (Length);
00267 }
00268 
00269 
00270 /*******************************************************************************
00271  *
00272  * FUNCTION:    AcpiUtStrcpy (strcpy)
00273  *
00274  * PARAMETERS:  DstString       - Target of the copy
00275  *              SrcString       - The source string to copy
00276  *
00277  * RETURN:      DstString
00278  *
00279  * DESCRIPTION: Copy a null terminated string
00280  *
00281  ******************************************************************************/
00282 
00283 char *
00284 AcpiUtStrcpy (
00285     char                    *DstString,
00286     const char              *SrcString)
00287 {
00288     char                    *String = DstString;
00289 
00290 
00291     /* Move bytes brute force */
00292 
00293     while (*SrcString)
00294     {
00295         *String = *SrcString;
00296 
00297         String++;
00298         SrcString++;
00299     }
00300 
00301     /* Null terminate */
00302 
00303     *String = 0;
00304     return (DstString);
00305 }
00306 
00307 
00308 /*******************************************************************************
00309  *
00310  * FUNCTION:    AcpiUtStrncpy (strncpy)
00311  *
00312  * PARAMETERS:  DstString       - Target of the copy
00313  *              SrcString       - The source string to copy
00314  *              Count           - Maximum # of bytes to copy
00315  *
00316  * RETURN:      DstString
00317  *
00318  * DESCRIPTION: Copy a null terminated string, with a maximum length
00319  *
00320  ******************************************************************************/
00321 
00322 char *
00323 AcpiUtStrncpy (
00324     char                    *DstString,
00325     const char              *SrcString,
00326     ACPI_SIZE               Count)
00327 {
00328     char                    *String = DstString;
00329 
00330 
00331     /* Copy the string */
00332 
00333     for (String = DstString;
00334         Count && (Count--, (*String++ = *SrcString++)); )
00335     {;}
00336 
00337     /* Pad with nulls if necessary */
00338 
00339     while (Count--)
00340     {
00341         *String = 0;
00342         String++;
00343     }
00344 
00345     /* Return original pointer */
00346 
00347     return (DstString);
00348 }
00349 
00350 
00351 /*******************************************************************************
00352  *
00353  * FUNCTION:    AcpiUtStrcmp (strcmp)
00354  *
00355  * PARAMETERS:  String1         - First string
00356  *              String2         - Second string
00357  *
00358  * RETURN:      Index where strings mismatched, or 0 if strings matched
00359  *
00360  * DESCRIPTION: Compare two null terminated strings
00361  *
00362  ******************************************************************************/
00363 
00364 int
00365 AcpiUtStrcmp (
00366     const char              *String1,
00367     const char              *String2)
00368 {
00369 
00370 
00371     for ( ; (*String1 == *String2); String2++)
00372     {
00373         if (!*String1++)
00374         {
00375             return (0);
00376         }
00377     }
00378 
00379     return ((unsigned char) *String1 - (unsigned char) *String2);
00380 }
00381 
00382 
00383 #ifdef ACPI_FUTURE_IMPLEMENTATION
00384 /* Not used at this time */
00385 /*******************************************************************************
00386  *
00387  * FUNCTION:    AcpiUtStrchr (strchr)
00388  *
00389  * PARAMETERS:  String          - Search string
00390  *              ch              - character to search for
00391  *
00392  * RETURN:      Ptr to char or NULL if not found
00393  *
00394  * DESCRIPTION: Search a string for a character
00395  *
00396  ******************************************************************************/
00397 
00398 char *
00399 AcpiUtStrchr (
00400     const char              *String,
00401     int                     ch)
00402 {
00403 
00404 
00405     for ( ; (*String); String++)
00406     {
00407         if ((*String) == (char) ch)
00408         {
00409             return ((char *) String);
00410         }
00411     }
00412 
00413     return (NULL);
00414 }
00415 #endif
00416 
00417 /*******************************************************************************
00418  *
00419  * FUNCTION:    AcpiUtStrncmp (strncmp)
00420  *
00421  * PARAMETERS:  String1         - First string
00422  *              String2         - Second string
00423  *              Count           - Maximum # of bytes to compare
00424  *
00425  * RETURN:      Index where strings mismatched, or 0 if strings matched
00426  *
00427  * DESCRIPTION: Compare two null terminated strings, with a maximum length
00428  *
00429  ******************************************************************************/
00430 
00431 int
00432 AcpiUtStrncmp (
00433     const char              *String1,
00434     const char              *String2,
00435     ACPI_SIZE               Count)
00436 {
00437 
00438 
00439     for ( ; Count-- && (*String1 == *String2); String2++)
00440     {
00441         if (!*String1++)
00442         {
00443             return (0);
00444         }
00445     }
00446 
00447     return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *String1 -
00448         (unsigned char) *String2));
00449 }
00450 
00451 
00452 /*******************************************************************************
00453  *
00454  * FUNCTION:    AcpiUtStrcat (Strcat)
00455  *
00456  * PARAMETERS:  DstString       - Target of the copy
00457  *              SrcString       - The source string to copy
00458  *
00459  * RETURN:      DstString
00460  *
00461  * DESCRIPTION: Append a null terminated string to a null terminated string
00462  *
00463  ******************************************************************************/
00464 
00465 char *
00466 AcpiUtStrcat (
00467     char                    *DstString,
00468     const char              *SrcString)
00469 {
00470     char                    *String;
00471 
00472 
00473     /* Find end of the destination string */
00474 
00475     for (String = DstString; *String++; )
00476     { ; }
00477 
00478     /* Concatenate the string */
00479 
00480     for (--String; (*String++ = *SrcString++); )
00481     { ; }
00482 
00483     return (DstString);
00484 }
00485 
00486 
00487 /*******************************************************************************
00488  *
00489  * FUNCTION:    AcpiUtStrncat (strncat)
00490  *
00491  * PARAMETERS:  DstString       - Target of the copy
00492  *              SrcString       - The source string to copy
00493  *              Count           - Maximum # of bytes to copy
00494  *
00495  * RETURN:      DstString
00496  *
00497  * DESCRIPTION: Append a null terminated string to a null terminated string,
00498  *              with a maximum count.
00499  *
00500  ******************************************************************************/
00501 
00502 char *
00503 AcpiUtStrncat (
00504     char                    *DstString,
00505     const char              *SrcString,
00506     ACPI_SIZE               Count)
00507 {
00508     char                    *String;
00509 
00510 
00511     if (Count)
00512     {
00513         /* Find end of the destination string */
00514 
00515         for (String = DstString; *String++; )
00516         { ; }
00517 
00518         /* Concatenate the string */
00519 
00520         for (--String; (*String++ = *SrcString++) && --Count; )
00521         { ; }
00522 
00523         /* Null terminate if necessary */
00524 
00525         if (!Count)
00526         {
00527             *String = 0;
00528         }
00529     }
00530 
00531     return (DstString);
00532 }
00533 
00534 
00535 /*******************************************************************************
00536  *
00537  * FUNCTION:    AcpiUtStrstr (strstr)
00538  *
00539  * PARAMETERS:  String1         - Target string
00540  *              String2         - Substring to search for
00541  *
00542  * RETURN:      Where substring match starts, Null if no match found
00543  *
00544  * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
00545  *              full implementation of strstr, only sufficient for command
00546  *              matching
00547  *
00548  ******************************************************************************/
00549 
00550 char *
00551 AcpiUtStrstr (
00552     char                    *String1,
00553     char                    *String2)
00554 {
00555     char                    *String;
00556 
00557 
00558     if (AcpiUtStrlen (String2) > AcpiUtStrlen (String1))
00559     {
00560         return (NULL);
00561     }
00562 
00563     /* Walk entire string, comparing the letters */
00564 
00565     for (String = String1; *String2; )
00566     {
00567         if (*String2 != *String)
00568         {
00569             return (NULL);
00570         }
00571 
00572         String2++;
00573         String++;
00574     }
00575 
00576     return (String1);
00577 }
00578 
00579 
00580 /*******************************************************************************
00581  *
00582  * FUNCTION:    AcpiUtStrtoul (strtoul)
00583  *
00584  * PARAMETERS:  String          - Null terminated string
00585  *              Terminater      - Where a pointer to the terminating byte is
00586  *                                returned
00587  *              Base            - Radix of the string
00588  *
00589  * RETURN:      Converted value
00590  *
00591  * DESCRIPTION: Convert a string into a 32-bit unsigned value.
00592  *              Note: use AcpiUtStrtoul64 for 64-bit integers.
00593  *
00594  ******************************************************************************/
00595 
00596 UINT32
00597 AcpiUtStrtoul (
00598     const char              *String,
00599     char                    **Terminator,
00600     UINT32                  Base)
00601 {
00602     UINT32                  converted = 0;
00603     UINT32                  index;
00604     UINT32                  sign;
00605     const char              *StringStart;
00606     UINT32                  ReturnValue = 0;
00607     ACPI_STATUS             Status = AE_OK;
00608 
00609 
00610     /*
00611      * Save the value of the pointer to the buffer's first
00612      * character, save the current errno value, and then
00613      * skip over any white space in the buffer:
00614      */
00615     StringStart = String;
00616     while (ACPI_IS_SPACE (*String) || *String == '\t')
00617     {
00618         ++String;
00619     }
00620 
00621     /*
00622      * The buffer may contain an optional plus or minus sign.
00623      * If it does, then skip over it but remember what is was:
00624      */
00625     if (*String == '-')
00626     {
00627         sign = NEGATIVE;
00628         ++String;
00629     }
00630     else if (*String == '+')
00631     {
00632         ++String;
00633         sign = POSITIVE;
00634     }
00635     else
00636     {
00637         sign = POSITIVE;
00638     }
00639 
00640     /*
00641      * If the input parameter Base is zero, then we need to
00642      * determine if it is octal, decimal, or hexadecimal:
00643      */
00644     if (Base == 0)
00645     {
00646         if (*String == '0')
00647         {
00648             if (AcpiUtToLower (*(++String)) == 'x')
00649             {
00650                 Base = 16;
00651                 ++String;
00652             }
00653             else
00654             {
00655                 Base = 8;
00656             }
00657         }
00658         else
00659         {
00660             Base = 10;
00661         }
00662     }
00663     else if (Base < 2 || Base > 36)
00664     {
00665         /*
00666          * The specified Base parameter is not in the domain of
00667          * this function:
00668          */
00669         goto done;
00670     }
00671 
00672     /*
00673      * For octal and hexadecimal bases, skip over the leading
00674      * 0 or 0x, if they are present.
00675      */
00676     if (Base == 8 && *String == '0')
00677     {
00678         String++;
00679     }
00680 
00681     if (Base == 16 &&
00682         *String == '0' &&
00683         AcpiUtToLower (*(++String)) == 'x')
00684     {
00685         String++;
00686     }
00687 
00688     /*
00689      * Main loop: convert the string to an unsigned long:
00690      */
00691     while (*String)
00692     {
00693         if (ACPI_IS_DIGIT (*String))
00694         {
00695             index = (UINT32) ((UINT8) *String - '0');
00696         }
00697         else
00698         {
00699             index = (UINT32) AcpiUtToUpper (*String);
00700             if (ACPI_IS_UPPER (index))
00701             {
00702                 index = index - 'A' + 10;
00703             }
00704             else
00705             {
00706                 goto done;
00707             }
00708         }
00709 
00710         if (index >= Base)
00711         {
00712             goto done;
00713         }
00714 
00715         /*
00716          * Check to see if value is out of range:
00717          */
00718 
00719         if (ReturnValue > ((ACPI_UINT32_MAX - (UINT32) index) /
00720                             (UINT32) Base))
00721         {
00722             Status = AE_ERROR;
00723             ReturnValue = 0;           /* reset */
00724         }
00725         else
00726         {
00727             ReturnValue *= Base;
00728             ReturnValue += index;
00729             converted = 1;
00730         }
00731 
00732         ++String;
00733     }
00734 
00735 done:
00736     /*
00737      * If appropriate, update the caller's pointer to the next
00738      * unconverted character in the buffer.
00739      */
00740     if (Terminator)
00741     {
00742         if (converted == 0 && ReturnValue == 0 && String != NULL)
00743         {
00744             *Terminator = (char *) StringStart;
00745         }
00746         else
00747         {
00748             *Terminator = (char *) String;
00749         }
00750     }
00751 
00752     if (Status == AE_ERROR)
00753     {
00754         ReturnValue = ACPI_UINT32_MAX;
00755     }
00756 
00757     /*
00758      * If a minus sign was present, then "the conversion is negated":
00759      */
00760     if (sign == NEGATIVE)
00761     {
00762         ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
00763     }
00764 
00765     return (ReturnValue);
00766 }
00767 
00768 
00769 /*******************************************************************************
00770  *
00771  * FUNCTION:    AcpiUtToUpper (TOUPPER)
00772  *
00773  * PARAMETERS:  c           - Character to convert
00774  *
00775  * RETURN:      Converted character as an int
00776  *
00777  * DESCRIPTION: Convert character to uppercase
00778  *
00779  ******************************************************************************/
00780 
00781 int
00782 AcpiUtToUpper (
00783     int                     c)
00784 {
00785 
00786     return (ACPI_IS_LOWER(c) ? ((c)-0x20) : (c));
00787 }
00788 
00789 
00790 /*******************************************************************************
00791  *
00792  * FUNCTION:    AcpiUtToLower (TOLOWER)
00793  *
00794  * PARAMETERS:  c           - Character to convert
00795  *
00796  * RETURN:      Converted character as an int
00797  *
00798  * DESCRIPTION: Convert character to lowercase
00799  *
00800  ******************************************************************************/
00801 
00802 int
00803 AcpiUtToLower (
00804     int                     c)
00805 {
00806 
00807     return (ACPI_IS_UPPER(c) ? ((c)+0x20) : (c));
00808 }
00809 
00810 
00811 /*******************************************************************************
00812  *
00813  * FUNCTION:    is* functions
00814  *
00815  * DESCRIPTION: is* functions use the ctype table below
00816  *
00817  ******************************************************************************/
00818 
00819 const UINT8 _acpi_ctype[257] = {
00820     _ACPI_CN,            /* 0x0      0.     */
00821     _ACPI_CN,            /* 0x1      1.     */
00822     _ACPI_CN,            /* 0x2      2.     */
00823     _ACPI_CN,            /* 0x3      3.     */
00824     _ACPI_CN,            /* 0x4      4.     */
00825     _ACPI_CN,            /* 0x5      5.     */
00826     _ACPI_CN,            /* 0x6      6.     */
00827     _ACPI_CN,            /* 0x7      7.     */
00828     _ACPI_CN,            /* 0x8      8.     */
00829     _ACPI_CN|_ACPI_SP,   /* 0x9      9.     */
00830     _ACPI_CN|_ACPI_SP,   /* 0xA     10.     */
00831     _ACPI_CN|_ACPI_SP,   /* 0xB     11.     */
00832     _ACPI_CN|_ACPI_SP,   /* 0xC     12.     */
00833     _ACPI_CN|_ACPI_SP,   /* 0xD     13.     */
00834     _ACPI_CN,            /* 0xE     14.     */
00835     _ACPI_CN,            /* 0xF     15.     */
00836     _ACPI_CN,            /* 0x10    16.     */
00837     _ACPI_CN,            /* 0x11    17.     */
00838     _ACPI_CN,            /* 0x12    18.     */
00839     _ACPI_CN,            /* 0x13    19.     */
00840     _ACPI_CN,            /* 0x14    20.     */
00841     _ACPI_CN,            /* 0x15    21.     */
00842     _ACPI_CN,            /* 0x16    22.     */
00843     _ACPI_CN,            /* 0x17    23.     */
00844     _ACPI_CN,            /* 0x18    24.     */
00845     _ACPI_CN,            /* 0x19    25.     */
00846     _ACPI_CN,            /* 0x1A    26.     */
00847     _ACPI_CN,            /* 0x1B    27.     */
00848     _ACPI_CN,            /* 0x1C    28.     */
00849     _ACPI_CN,            /* 0x1D    29.     */
00850     _ACPI_CN,            /* 0x1E    30.     */
00851     _ACPI_CN,            /* 0x1F    31.     */
00852     _ACPI_XS|_ACPI_SP,   /* 0x20    32. ' ' */
00853     _ACPI_PU,            /* 0x21    33. '!' */
00854     _ACPI_PU,            /* 0x22    34. '"' */
00855     _ACPI_PU,            /* 0x23    35. '#' */
00856     _ACPI_PU,            /* 0x24    36. '$' */
00857     _ACPI_PU,            /* 0x25    37. '%' */
00858     _ACPI_PU,            /* 0x26    38. '&' */
00859     _ACPI_PU,            /* 0x27    39. ''' */
00860     _ACPI_PU,            /* 0x28    40. '(' */
00861     _ACPI_PU,            /* 0x29    41. ')' */
00862     _ACPI_PU,            /* 0x2A    42. '*' */
00863     _ACPI_PU,            /* 0x2B    43. '+' */
00864     _ACPI_PU,            /* 0x2C    44. ',' */
00865     _ACPI_PU,            /* 0x2D    45. '-' */
00866     _ACPI_PU,            /* 0x2E    46. '.' */
00867     _ACPI_PU,            /* 0x2F    47. '/' */
00868     _ACPI_XD|_ACPI_DI,   /* 0x30    48. '0' */
00869     _ACPI_XD|_ACPI_DI,   /* 0x31    49. '1' */
00870     _ACPI_XD|_ACPI_DI,   /* 0x32    50. '2' */
00871     _ACPI_XD|_ACPI_DI,   /* 0x33    51. '3' */
00872     _ACPI_XD|_ACPI_DI,   /* 0x34    52. '4' */
00873     _ACPI_XD|_ACPI_DI,   /* 0x35    53. '5' */
00874     _ACPI_XD|_ACPI_DI,   /* 0x36    54. '6' */
00875     _ACPI_XD|_ACPI_DI,   /* 0x37    55. '7' */
00876     _ACPI_XD|_ACPI_DI,   /* 0x38    56. '8' */
00877     _ACPI_XD|_ACPI_DI,   /* 0x39    57. '9' */
00878     _ACPI_PU,            /* 0x3A    58. ':' */
00879     _ACPI_PU,            /* 0x3B    59. ';' */
00880     _ACPI_PU,            /* 0x3C    60. '<' */
00881     _ACPI_PU,            /* 0x3D    61. '=' */
00882     _ACPI_PU,            /* 0x3E    62. '>' */
00883     _ACPI_PU,            /* 0x3F    63. '?' */
00884     _ACPI_PU,            /* 0x40    64. '@' */
00885     _ACPI_XD|_ACPI_UP,   /* 0x41    65. 'A' */
00886     _ACPI_XD|_ACPI_UP,   /* 0x42    66. 'B' */
00887     _ACPI_XD|_ACPI_UP,   /* 0x43    67. 'C' */
00888     _ACPI_XD|_ACPI_UP,   /* 0x44    68. 'D' */
00889     _ACPI_XD|_ACPI_UP,   /* 0x45    69. 'E' */
00890     _ACPI_XD|_ACPI_UP,   /* 0x46    70. 'F' */
00891     _ACPI_UP,            /* 0x47    71. 'G' */
00892     _ACPI_UP,            /* 0x48    72. 'H' */
00893     _ACPI_UP,            /* 0x49    73. 'I' */
00894     _ACPI_UP,            /* 0x4A    74. 'J' */
00895     _ACPI_UP,            /* 0x4B    75. 'K' */
00896     _ACPI_UP,            /* 0x4C    76. 'L' */
00897     _ACPI_UP,            /* 0x4D    77. 'M' */
00898     _ACPI_UP,            /* 0x4E    78. 'N' */
00899     _ACPI_UP,            /* 0x4F    79. 'O' */
00900     _ACPI_UP,            /* 0x50    80. 'P' */
00901     _ACPI_UP,            /* 0x51    81. 'Q' */
00902     _ACPI_UP,            /* 0x52    82. 'R' */
00903     _ACPI_UP,            /* 0x53    83. 'S' */
00904     _ACPI_UP,            /* 0x54    84. 'T' */
00905     _ACPI_UP,            /* 0x55    85. 'U' */
00906     _ACPI_UP,            /* 0x56    86. 'V' */
00907     _ACPI_UP,            /* 0x57    87. 'W' */
00908     _ACPI_UP,            /* 0x58    88. 'X' */
00909     _ACPI_UP,            /* 0x59    89. 'Y' */
00910     _ACPI_UP,            /* 0x5A    90. 'Z' */
00911     _ACPI_PU,            /* 0x5B    91. '[' */
00912     _ACPI_PU,            /* 0x5C    92. '\' */
00913     _ACPI_PU,            /* 0x5D    93. ']' */
00914     _ACPI_PU,            /* 0x5E    94. '^' */
00915     _ACPI_PU,            /* 0x5F    95. '_' */
00916     _ACPI_PU,            /* 0x60    96. '`' */
00917     _ACPI_XD|_ACPI_LO,   /* 0x61    97. 'a' */
00918     _ACPI_XD|_ACPI_LO,   /* 0x62    98. 'b' */
00919     _ACPI_XD|_ACPI_LO,   /* 0x63    99. 'c' */
00920     _ACPI_XD|_ACPI_LO,   /* 0x64   100. 'd' */
00921     _ACPI_XD|_ACPI_LO,   /* 0x65   101. 'e' */
00922     _ACPI_XD|_ACPI_LO,   /* 0x66   102. 'f' */
00923     _ACPI_LO,            /* 0x67   103. 'g' */
00924     _ACPI_LO,            /* 0x68   104. 'h' */
00925     _ACPI_LO,            /* 0x69   105. 'i' */
00926     _ACPI_LO,            /* 0x6A   106. 'j' */
00927     _ACPI_LO,            /* 0x6B   107. 'k' */
00928     _ACPI_LO,            /* 0x6C   108. 'l' */
00929     _ACPI_LO,            /* 0x6D   109. 'm' */
00930     _ACPI_LO,            /* 0x6E   110. 'n' */
00931     _ACPI_LO,            /* 0x6F   111. 'o' */
00932     _ACPI_LO,            /* 0x70   112. 'p' */
00933     _ACPI_LO,            /* 0x71   113. 'q' */
00934     _ACPI_LO,            /* 0x72   114. 'r' */
00935     _ACPI_LO,            /* 0x73   115. 's' */
00936     _ACPI_LO,            /* 0x74   116. 't' */
00937     _ACPI_LO,            /* 0x75   117. 'u' */
00938     _ACPI_LO,            /* 0x76   118. 'v' */
00939     _ACPI_LO,            /* 0x77   119. 'w' */
00940     _ACPI_LO,            /* 0x78   120. 'x' */
00941     _ACPI_LO,            /* 0x79   121. 'y' */
00942     _ACPI_LO,            /* 0x7A   122. 'z' */
00943     _ACPI_PU,            /* 0x7B   123. '{' */
00944     _ACPI_PU,            /* 0x7C   124. '|' */
00945     _ACPI_PU,            /* 0x7D   125. '}' */
00946     _ACPI_PU,            /* 0x7E   126. '~' */
00947     _ACPI_CN,            /* 0x7F   127.     */
00948 
00949     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0x80 to 0x8F    */
00950     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0x90 to 0x9F    */
00951     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xA0 to 0xAF    */
00952     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xB0 to 0xBF    */
00953     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xC0 to 0xCF    */
00954     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xD0 to 0xDF    */
00955     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xE0 to 0xEF    */
00956     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* 0xF0 to 0x100   */
00957 };
00958 
00959 
00960 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
00961 

Generated on Sat May 26 2012 04:25:56 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.