17b1019a6SJerry Jelinek /****************************************************************************** 27b1019a6SJerry Jelinek * 37b1019a6SJerry Jelinek * Name: acclib.h -- C library support. Prototypes for the (optional) local 47b1019a6SJerry Jelinek * implementations of required C library functions. 57b1019a6SJerry Jelinek * 67b1019a6SJerry Jelinek *****************************************************************************/ 77b1019a6SJerry Jelinek 8*35786f68SRobert Mustacchi /****************************************************************************** 9*35786f68SRobert Mustacchi * 10*35786f68SRobert Mustacchi * 1. Copyright Notice 11*35786f68SRobert Mustacchi * 12*35786f68SRobert Mustacchi * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp. 137b1019a6SJerry Jelinek * All rights reserved. 147b1019a6SJerry Jelinek * 15*35786f68SRobert Mustacchi * 2. License 16*35786f68SRobert Mustacchi * 17*35786f68SRobert Mustacchi * 2.1. This is your license from Intel Corp. under its intellectual property 18*35786f68SRobert Mustacchi * rights. You may have additional license terms from the party that provided 19*35786f68SRobert Mustacchi * you this software, covering your right to use that party's intellectual 20*35786f68SRobert Mustacchi * property rights. 21*35786f68SRobert Mustacchi * 22*35786f68SRobert Mustacchi * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23*35786f68SRobert Mustacchi * copy of the source code appearing in this file ("Covered Code") an 24*35786f68SRobert Mustacchi * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25*35786f68SRobert Mustacchi * base code distributed originally by Intel ("Original Intel Code") to copy, 26*35786f68SRobert Mustacchi * make derivatives, distribute, use and display any portion of the Covered 27*35786f68SRobert Mustacchi * Code in any form, with the right to sublicense such rights; and 28*35786f68SRobert Mustacchi * 29*35786f68SRobert Mustacchi * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30*35786f68SRobert Mustacchi * license (with the right to sublicense), under only those claims of Intel 31*35786f68SRobert Mustacchi * patents that are infringed by the Original Intel Code, to make, use, sell, 32*35786f68SRobert Mustacchi * offer to sell, and import the Covered Code and derivative works thereof 33*35786f68SRobert Mustacchi * solely to the minimum extent necessary to exercise the above copyright 34*35786f68SRobert Mustacchi * license, and in no event shall the patent license extend to any additions 35*35786f68SRobert Mustacchi * to or modifications of the Original Intel Code. No other license or right 36*35786f68SRobert Mustacchi * is granted directly or by implication, estoppel or otherwise; 37*35786f68SRobert Mustacchi * 38*35786f68SRobert Mustacchi * The above copyright and patent license is granted only if the following 39*35786f68SRobert Mustacchi * conditions are met: 40*35786f68SRobert Mustacchi * 41*35786f68SRobert Mustacchi * 3. Conditions 42*35786f68SRobert Mustacchi * 43*35786f68SRobert Mustacchi * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44*35786f68SRobert Mustacchi * Redistribution of source code of any substantial portion of the Covered 45*35786f68SRobert Mustacchi * Code or modification with rights to further distribute source must include 46*35786f68SRobert Mustacchi * the above Copyright Notice, the above License, this list of Conditions, 47*35786f68SRobert Mustacchi * and the following Disclaimer and Export Compliance provision. In addition, 48*35786f68SRobert Mustacchi * Licensee must cause all Covered Code to which Licensee contributes to 49*35786f68SRobert Mustacchi * contain a file documenting the changes Licensee made to create that Covered 50*35786f68SRobert Mustacchi * Code and the date of any change. Licensee must include in that file the 51*35786f68SRobert Mustacchi * documentation of any changes made by any predecessor Licensee. Licensee 52*35786f68SRobert Mustacchi * must include a prominent statement that the modification is derived, 53*35786f68SRobert Mustacchi * directly or indirectly, from Original Intel Code. 54*35786f68SRobert Mustacchi * 55*35786f68SRobert Mustacchi * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56*35786f68SRobert Mustacchi * Redistribution of source code of any substantial portion of the Covered 57*35786f68SRobert Mustacchi * Code or modification without rights to further distribute source must 58*35786f68SRobert Mustacchi * include the following Disclaimer and Export Compliance provision in the 59*35786f68SRobert Mustacchi * documentation and/or other materials provided with distribution. In 60*35786f68SRobert Mustacchi * addition, Licensee may not authorize further sublicense of source of any 61*35786f68SRobert Mustacchi * portion of the Covered Code, and must include terms to the effect that the 62*35786f68SRobert Mustacchi * license from Licensee to its licensee is limited to the intellectual 63*35786f68SRobert Mustacchi * property embodied in the software Licensee provides to its licensee, and 64*35786f68SRobert Mustacchi * not to intellectual property embodied in modifications its licensee may 65*35786f68SRobert Mustacchi * make. 66*35786f68SRobert Mustacchi * 67*35786f68SRobert Mustacchi * 3.3. Redistribution of Executable. Redistribution in executable form of any 68*35786f68SRobert Mustacchi * substantial portion of the Covered Code or modification must reproduce the 69*35786f68SRobert Mustacchi * above Copyright Notice, and the following Disclaimer and Export Compliance 70*35786f68SRobert Mustacchi * provision in the documentation and/or other materials provided with the 71*35786f68SRobert Mustacchi * distribution. 72*35786f68SRobert Mustacchi * 73*35786f68SRobert Mustacchi * 3.4. Intel retains all right, title, and interest in and to the Original 74*35786f68SRobert Mustacchi * Intel Code. 75*35786f68SRobert Mustacchi * 76*35786f68SRobert Mustacchi * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77*35786f68SRobert Mustacchi * Intel shall be used in advertising or otherwise to promote the sale, use or 78*35786f68SRobert Mustacchi * other dealings in products derived from or relating to the Covered Code 79*35786f68SRobert Mustacchi * without prior written authorization from Intel. 80*35786f68SRobert Mustacchi * 81*35786f68SRobert Mustacchi * 4. Disclaimer and Export Compliance 82*35786f68SRobert Mustacchi * 83*35786f68SRobert Mustacchi * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84*35786f68SRobert Mustacchi * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85*35786f68SRobert Mustacchi * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86*35786f68SRobert Mustacchi * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87*35786f68SRobert Mustacchi * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88*35786f68SRobert Mustacchi * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89*35786f68SRobert Mustacchi * PARTICULAR PURPOSE. 90*35786f68SRobert Mustacchi * 91*35786f68SRobert Mustacchi * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92*35786f68SRobert Mustacchi * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93*35786f68SRobert Mustacchi * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94*35786f68SRobert Mustacchi * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95*35786f68SRobert Mustacchi * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96*35786f68SRobert Mustacchi * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97*35786f68SRobert Mustacchi * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98*35786f68SRobert Mustacchi * LIMITED REMEDY. 99*35786f68SRobert Mustacchi * 100*35786f68SRobert Mustacchi * 4.3. Licensee shall not export, either directly or indirectly, any of this 101*35786f68SRobert Mustacchi * software or system incorporating such software without first obtaining any 102*35786f68SRobert Mustacchi * required license or other approval from the U. S. Department of Commerce or 103*35786f68SRobert Mustacchi * any other agency or department of the United States Government. In the 104*35786f68SRobert Mustacchi * event Licensee exports any such software from the United States or 105*35786f68SRobert Mustacchi * re-exports any such software from a foreign destination, Licensee shall 106*35786f68SRobert Mustacchi * ensure that the distribution and export/re-export of the software is in 107*35786f68SRobert Mustacchi * compliance with all laws, regulations, orders, or other restrictions of the 108*35786f68SRobert Mustacchi * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109*35786f68SRobert Mustacchi * any of its subsidiaries will export/re-export any technical data, process, 110*35786f68SRobert Mustacchi * software, or service, directly or indirectly, to any country for which the 111*35786f68SRobert Mustacchi * United States government or any agency thereof requires an export license, 112*35786f68SRobert Mustacchi * other governmental approval, or letter of assurance, without first obtaining 113*35786f68SRobert Mustacchi * such license, approval or letter. 114*35786f68SRobert Mustacchi * 115*35786f68SRobert Mustacchi ***************************************************************************** 116*35786f68SRobert Mustacchi * 117*35786f68SRobert Mustacchi * Alternatively, you may choose to be licensed under the terms of the 118*35786f68SRobert Mustacchi * following license: 119*35786f68SRobert Mustacchi * 1207b1019a6SJerry Jelinek * Redistribution and use in source and binary forms, with or without 1217b1019a6SJerry Jelinek * modification, are permitted provided that the following conditions 1227b1019a6SJerry Jelinek * are met: 1237b1019a6SJerry Jelinek * 1. Redistributions of source code must retain the above copyright 1247b1019a6SJerry Jelinek * notice, this list of conditions, and the following disclaimer, 1257b1019a6SJerry Jelinek * without modification. 1267b1019a6SJerry Jelinek * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1277b1019a6SJerry Jelinek * substantially similar to the "NO WARRANTY" disclaimer below 1287b1019a6SJerry Jelinek * ("Disclaimer") and any redistribution must be conditioned upon 1297b1019a6SJerry Jelinek * including a substantially similar Disclaimer requirement for further 1307b1019a6SJerry Jelinek * binary redistribution. 1317b1019a6SJerry Jelinek * 3. Neither the names of the above-listed copyright holders nor the names 1327b1019a6SJerry Jelinek * of any contributors may be used to endorse or promote products derived 1337b1019a6SJerry Jelinek * from this software without specific prior written permission. 1347b1019a6SJerry Jelinek * 1357b1019a6SJerry Jelinek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1367b1019a6SJerry Jelinek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 137*35786f68SRobert Mustacchi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1387b1019a6SJerry Jelinek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 139*35786f68SRobert Mustacchi * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 140*35786f68SRobert Mustacchi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 141*35786f68SRobert Mustacchi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 142*35786f68SRobert Mustacchi * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 143*35786f68SRobert Mustacchi * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 144*35786f68SRobert Mustacchi * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 145*35786f68SRobert Mustacchi * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 146*35786f68SRobert Mustacchi * 147*35786f68SRobert Mustacchi * Alternatively, you may choose to be licensed under the terms of the 148*35786f68SRobert Mustacchi * GNU General Public License ("GPL") version 2 as published by the Free 149*35786f68SRobert Mustacchi * Software Foundation. 150*35786f68SRobert Mustacchi * 151*35786f68SRobert Mustacchi *****************************************************************************/ 1527b1019a6SJerry Jelinek 1537b1019a6SJerry Jelinek #ifndef _ACCLIB_H 1547b1019a6SJerry Jelinek #define _ACCLIB_H 1557b1019a6SJerry Jelinek 1567b1019a6SJerry Jelinek 1577b1019a6SJerry Jelinek /* 1587b1019a6SJerry Jelinek * Prototypes and macros for local implementations of C library functions 1597b1019a6SJerry Jelinek */ 1607b1019a6SJerry Jelinek 1617b1019a6SJerry Jelinek /* is* functions. The AcpiGbl_Ctypes array is defined in utclib.c */ 1627b1019a6SJerry Jelinek 1637b1019a6SJerry Jelinek extern const UINT8 AcpiGbl_Ctypes[]; 1647b1019a6SJerry Jelinek 1657b1019a6SJerry Jelinek #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 1667b1019a6SJerry Jelinek #define _ACPI_XS 0x40 /* extra space */ 1677b1019a6SJerry Jelinek #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 1687b1019a6SJerry Jelinek #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 1697b1019a6SJerry Jelinek #define _ACPI_DI 0x04 /* '0'-'9' */ 1707b1019a6SJerry Jelinek #define _ACPI_LO 0x02 /* 'a'-'z' */ 1717b1019a6SJerry Jelinek #define _ACPI_PU 0x10 /* punctuation */ 1727b1019a6SJerry Jelinek #define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */ 1737b1019a6SJerry Jelinek #define _ACPI_UP 0x01 /* 'A'-'Z' */ 1747b1019a6SJerry Jelinek #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 1757b1019a6SJerry Jelinek 1767b1019a6SJerry Jelinek #define isdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_DI)) 1777b1019a6SJerry Jelinek #define isspace(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_SP)) 1787b1019a6SJerry Jelinek #define isxdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_XD)) 1797b1019a6SJerry Jelinek #define isupper(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_UP)) 1807b1019a6SJerry Jelinek #define islower(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO)) 1817b1019a6SJerry Jelinek #define isprint(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) 1827b1019a6SJerry Jelinek #define isalpha(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 1837b1019a6SJerry Jelinek 184*35786f68SRobert Mustacchi /* Error code */ 185*35786f68SRobert Mustacchi 186*35786f68SRobert Mustacchi #define EPERM 1 /* Operation not permitted */ 187*35786f68SRobert Mustacchi #define ENOENT 2 /* No such file or directory */ 188*35786f68SRobert Mustacchi #define EINTR 4 /* Interrupted system call */ 189*35786f68SRobert Mustacchi #define EIO 5 /* I/O error */ 190*35786f68SRobert Mustacchi #define EBADF 9 /* Bad file number */ 191*35786f68SRobert Mustacchi #define EAGAIN 11 /* Try again */ 192*35786f68SRobert Mustacchi #define ENOMEM 12 /* Out of memory */ 193*35786f68SRobert Mustacchi #define EACCES 13 /* Permission denied */ 194*35786f68SRobert Mustacchi #define EFAULT 14 /* Bad address */ 195*35786f68SRobert Mustacchi #define EBUSY 16 /* Device or resource busy */ 196*35786f68SRobert Mustacchi #define EEXIST 17 /* File exists */ 197*35786f68SRobert Mustacchi #define ENODEV 19 /* No such device */ 198*35786f68SRobert Mustacchi #define EINVAL 22 /* Invalid argument */ 199*35786f68SRobert Mustacchi #define EPIPE 32 /* Broken pipe */ 200*35786f68SRobert Mustacchi #define ERANGE 34 /* Math result not representable */ 2017b1019a6SJerry Jelinek 2027b1019a6SJerry Jelinek /* Strings */ 2037b1019a6SJerry Jelinek 2047b1019a6SJerry Jelinek char * 2057b1019a6SJerry Jelinek strcat ( 2067b1019a6SJerry Jelinek char *DstString, 2077b1019a6SJerry Jelinek const char *SrcString); 2087b1019a6SJerry Jelinek 2097b1019a6SJerry Jelinek char * 2107b1019a6SJerry Jelinek strchr ( 2117b1019a6SJerry Jelinek const char *String, 2127b1019a6SJerry Jelinek int ch); 2137b1019a6SJerry Jelinek 214*35786f68SRobert Mustacchi char * 215*35786f68SRobert Mustacchi strpbrk ( 216*35786f68SRobert Mustacchi const char *String, 217*35786f68SRobert Mustacchi const char *Delimiters); 218*35786f68SRobert Mustacchi 219*35786f68SRobert Mustacchi char * 220*35786f68SRobert Mustacchi strtok ( 221*35786f68SRobert Mustacchi char *String, 222*35786f68SRobert Mustacchi const char *Delimiters); 223*35786f68SRobert Mustacchi 2247b1019a6SJerry Jelinek char * 2257b1019a6SJerry Jelinek strcpy ( 2267b1019a6SJerry Jelinek char *DstString, 2277b1019a6SJerry Jelinek const char *SrcString); 2287b1019a6SJerry Jelinek 2297b1019a6SJerry Jelinek int 2307b1019a6SJerry Jelinek strcmp ( 2317b1019a6SJerry Jelinek const char *String1, 2327b1019a6SJerry Jelinek const char *String2); 2337b1019a6SJerry Jelinek 2347b1019a6SJerry Jelinek ACPI_SIZE 2357b1019a6SJerry Jelinek strlen ( 2367b1019a6SJerry Jelinek const char *String); 2377b1019a6SJerry Jelinek 2387b1019a6SJerry Jelinek char * 2397b1019a6SJerry Jelinek strncat ( 2407b1019a6SJerry Jelinek char *DstString, 2417b1019a6SJerry Jelinek const char *SrcString, 2427b1019a6SJerry Jelinek ACPI_SIZE Count); 2437b1019a6SJerry Jelinek 2447b1019a6SJerry Jelinek int 2457b1019a6SJerry Jelinek strncmp ( 2467b1019a6SJerry Jelinek const char *String1, 2477b1019a6SJerry Jelinek const char *String2, 2487b1019a6SJerry Jelinek ACPI_SIZE Count); 2497b1019a6SJerry Jelinek 2507b1019a6SJerry Jelinek char * 2517b1019a6SJerry Jelinek strncpy ( 2527b1019a6SJerry Jelinek char *DstString, 2537b1019a6SJerry Jelinek const char *SrcString, 2547b1019a6SJerry Jelinek ACPI_SIZE Count); 2557b1019a6SJerry Jelinek 2567b1019a6SJerry Jelinek char * 2577b1019a6SJerry Jelinek strstr ( 2587b1019a6SJerry Jelinek char *String1, 2597b1019a6SJerry Jelinek char *String2); 2607b1019a6SJerry Jelinek 2617b1019a6SJerry Jelinek 2627b1019a6SJerry Jelinek /* Conversion */ 2637b1019a6SJerry Jelinek 2647b1019a6SJerry Jelinek UINT32 2657b1019a6SJerry Jelinek strtoul ( 2667b1019a6SJerry Jelinek const char *String, 2677b1019a6SJerry Jelinek char **Terminator, 2687b1019a6SJerry Jelinek UINT32 Base); 2697b1019a6SJerry Jelinek 2707b1019a6SJerry Jelinek 2717b1019a6SJerry Jelinek /* Memory */ 2727b1019a6SJerry Jelinek 2737b1019a6SJerry Jelinek int 2747b1019a6SJerry Jelinek memcmp ( 2757b1019a6SJerry Jelinek void *Buffer1, 2767b1019a6SJerry Jelinek void *Buffer2, 2777b1019a6SJerry Jelinek ACPI_SIZE Count); 2787b1019a6SJerry Jelinek 2797b1019a6SJerry Jelinek void * 2807b1019a6SJerry Jelinek memcpy ( 2817b1019a6SJerry Jelinek void *Dest, 2827b1019a6SJerry Jelinek const void *Src, 2837b1019a6SJerry Jelinek ACPI_SIZE Count); 2847b1019a6SJerry Jelinek 285*35786f68SRobert Mustacchi void * 286*35786f68SRobert Mustacchi memmove ( 287*35786f68SRobert Mustacchi void *Dest, 288*35786f68SRobert Mustacchi const void *Src, 289*35786f68SRobert Mustacchi ACPI_SIZE Count); 290*35786f68SRobert Mustacchi 2917b1019a6SJerry Jelinek void * 2927b1019a6SJerry Jelinek memset ( 2937b1019a6SJerry Jelinek void *Dest, 2947b1019a6SJerry Jelinek int Value, 2957b1019a6SJerry Jelinek ACPI_SIZE Count); 2967b1019a6SJerry Jelinek 2977b1019a6SJerry Jelinek 2987b1019a6SJerry Jelinek /* upper/lower case */ 2997b1019a6SJerry Jelinek 3007b1019a6SJerry Jelinek int 3017b1019a6SJerry Jelinek tolower ( 3027b1019a6SJerry Jelinek int c); 3037b1019a6SJerry Jelinek 3047b1019a6SJerry Jelinek int 3057b1019a6SJerry Jelinek toupper ( 3067b1019a6SJerry Jelinek int c); 3077b1019a6SJerry Jelinek 308*35786f68SRobert Mustacchi /* 309*35786f68SRobert Mustacchi * utprint - printf/vprintf output functions 310*35786f68SRobert Mustacchi */ 311*35786f68SRobert Mustacchi const char * 312*35786f68SRobert Mustacchi AcpiUtScanNumber ( 313*35786f68SRobert Mustacchi const char *String, 314*35786f68SRobert Mustacchi UINT64 *NumberPtr); 315*35786f68SRobert Mustacchi 316*35786f68SRobert Mustacchi const char * 317*35786f68SRobert Mustacchi AcpiUtPrintNumber ( 318*35786f68SRobert Mustacchi char *String, 319*35786f68SRobert Mustacchi UINT64 Number); 320*35786f68SRobert Mustacchi 321*35786f68SRobert Mustacchi int 322*35786f68SRobert Mustacchi vsnprintf ( 323*35786f68SRobert Mustacchi char *String, 324*35786f68SRobert Mustacchi ACPI_SIZE Size, 325*35786f68SRobert Mustacchi const char *Format, 326*35786f68SRobert Mustacchi va_list Args); 327*35786f68SRobert Mustacchi 328*35786f68SRobert Mustacchi int 329*35786f68SRobert Mustacchi snprintf ( 330*35786f68SRobert Mustacchi char *String, 331*35786f68SRobert Mustacchi ACPI_SIZE Size, 332*35786f68SRobert Mustacchi const char *Format, 333*35786f68SRobert Mustacchi ...); 334*35786f68SRobert Mustacchi 335*35786f68SRobert Mustacchi int 336*35786f68SRobert Mustacchi sprintf ( 337*35786f68SRobert Mustacchi char *String, 338*35786f68SRobert Mustacchi const char *Format, 339*35786f68SRobert Mustacchi ...); 340*35786f68SRobert Mustacchi 341*35786f68SRobert Mustacchi #ifdef ACPI_APPLICATION 342*35786f68SRobert Mustacchi #define SEEK_SET 0 343*35786f68SRobert Mustacchi #define SEEK_CUR 1 344*35786f68SRobert Mustacchi #define SEEK_END 2 345*35786f68SRobert Mustacchi 346*35786f68SRobert Mustacchi /* 347*35786f68SRobert Mustacchi * NOTE: Currently we only need to update errno for file IOs. Other 348*35786f68SRobert Mustacchi * Clibrary invocations in ACPICA do not make descisions according to 349*35786f68SRobert Mustacchi * the errno. 350*35786f68SRobert Mustacchi */ 351*35786f68SRobert Mustacchi extern int errno; 352*35786f68SRobert Mustacchi 353*35786f68SRobert Mustacchi #ifndef EOF 354*35786f68SRobert Mustacchi #define EOF (-1) 355*35786f68SRobert Mustacchi #endif 356*35786f68SRobert Mustacchi 357*35786f68SRobert Mustacchi #define putchar(c) fputc(stdout, c) 358*35786f68SRobert Mustacchi #define getchar(c) fgetc(stdin) 359*35786f68SRobert Mustacchi 360*35786f68SRobert Mustacchi int 361*35786f68SRobert Mustacchi vprintf ( 362*35786f68SRobert Mustacchi const char *Format, 363*35786f68SRobert Mustacchi va_list Args); 364*35786f68SRobert Mustacchi 365*35786f68SRobert Mustacchi int 366*35786f68SRobert Mustacchi printf ( 367*35786f68SRobert Mustacchi const char *Format, 368*35786f68SRobert Mustacchi ...); 369*35786f68SRobert Mustacchi 370*35786f68SRobert Mustacchi int 371*35786f68SRobert Mustacchi vfprintf ( 372*35786f68SRobert Mustacchi FILE *File, 373*35786f68SRobert Mustacchi const char *Format, 374*35786f68SRobert Mustacchi va_list Args); 375*35786f68SRobert Mustacchi 376*35786f68SRobert Mustacchi int 377*35786f68SRobert Mustacchi fprintf ( 378*35786f68SRobert Mustacchi FILE *File, 379*35786f68SRobert Mustacchi const char *Format, 380*35786f68SRobert Mustacchi ...); 381*35786f68SRobert Mustacchi 382*35786f68SRobert Mustacchi FILE * 383*35786f68SRobert Mustacchi fopen ( 384*35786f68SRobert Mustacchi const char *Path, 385*35786f68SRobert Mustacchi const char *Modes); 386*35786f68SRobert Mustacchi 387*35786f68SRobert Mustacchi void 388*35786f68SRobert Mustacchi fclose ( 389*35786f68SRobert Mustacchi FILE *File); 390*35786f68SRobert Mustacchi 391*35786f68SRobert Mustacchi int 392*35786f68SRobert Mustacchi fread ( 393*35786f68SRobert Mustacchi void *Buffer, 394*35786f68SRobert Mustacchi ACPI_SIZE Size, 395*35786f68SRobert Mustacchi ACPI_SIZE Count, 396*35786f68SRobert Mustacchi FILE *File); 397*35786f68SRobert Mustacchi 398*35786f68SRobert Mustacchi int 399*35786f68SRobert Mustacchi fwrite ( 400*35786f68SRobert Mustacchi void *Buffer, 401*35786f68SRobert Mustacchi ACPI_SIZE Size, 402*35786f68SRobert Mustacchi ACPI_SIZE Count, 403*35786f68SRobert Mustacchi FILE *File); 404*35786f68SRobert Mustacchi 405*35786f68SRobert Mustacchi int 406*35786f68SRobert Mustacchi fseek ( 407*35786f68SRobert Mustacchi FILE *File, 408*35786f68SRobert Mustacchi long Offset, 409*35786f68SRobert Mustacchi int From); 410*35786f68SRobert Mustacchi 411*35786f68SRobert Mustacchi long 412*35786f68SRobert Mustacchi ftell ( 413*35786f68SRobert Mustacchi FILE *File); 414*35786f68SRobert Mustacchi 415*35786f68SRobert Mustacchi int 416*35786f68SRobert Mustacchi fgetc ( 417*35786f68SRobert Mustacchi FILE *File); 418*35786f68SRobert Mustacchi 419*35786f68SRobert Mustacchi int 420*35786f68SRobert Mustacchi fputc ( 421*35786f68SRobert Mustacchi FILE *File, 422*35786f68SRobert Mustacchi char c); 423*35786f68SRobert Mustacchi 424*35786f68SRobert Mustacchi char * 425*35786f68SRobert Mustacchi fgets ( 426*35786f68SRobert Mustacchi char *s, 427*35786f68SRobert Mustacchi ACPI_SIZE Size, 428*35786f68SRobert Mustacchi FILE *File); 429*35786f68SRobert Mustacchi #endif 430*35786f68SRobert Mustacchi 4317b1019a6SJerry Jelinek #endif /* _ACCLIB_H */ 432