17b1019aJerry Jelinek/******************************************************************************
27b1019aJerry Jelinek *
37b1019aJerry Jelinek * Name: acclib.h -- C library support. Prototypes for the (optional) local
47b1019aJerry Jelinek *                   implementations of required C library functions.
57b1019aJerry Jelinek *
67b1019aJerry Jelinek *****************************************************************************/
77b1019aJerry Jelinek
835786f6Robert Mustacchi/******************************************************************************
935786f6Robert Mustacchi *
1035786f6Robert Mustacchi * 1. Copyright Notice
1135786f6Robert Mustacchi *
1235786f6Robert Mustacchi * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
137b1019aJerry Jelinek * All rights reserved.
147b1019aJerry Jelinek *
1535786f6Robert Mustacchi * 2. License
1635786f6Robert Mustacchi *
1735786f6Robert Mustacchi * 2.1. This is your license from Intel Corp. under its intellectual property
1835786f6Robert Mustacchi * rights. You may have additional license terms from the party that provided
1935786f6Robert Mustacchi * you this software, covering your right to use that party's intellectual
2035786f6Robert Mustacchi * property rights.
2135786f6Robert Mustacchi *
2235786f6Robert Mustacchi * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2335786f6Robert Mustacchi * copy of the source code appearing in this file ("Covered Code") an
2435786f6Robert Mustacchi * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2535786f6Robert Mustacchi * base code distributed originally by Intel ("Original Intel Code") to copy,
2635786f6Robert Mustacchi * make derivatives, distribute, use and display any portion of the Covered
2735786f6Robert Mustacchi * Code in any form, with the right to sublicense such rights; and
2835786f6Robert Mustacchi *
2935786f6Robert Mustacchi * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3035786f6Robert Mustacchi * license (with the right to sublicense), under only those claims of Intel
3135786f6Robert Mustacchi * patents that are infringed by the Original Intel Code, to make, use, sell,
3235786f6Robert Mustacchi * offer to sell, and import the Covered Code and derivative works thereof
3335786f6Robert Mustacchi * solely to the minimum extent necessary to exercise the above copyright
3435786f6Robert Mustacchi * license, and in no event shall the patent license extend to any additions
3535786f6Robert Mustacchi * to or modifications of the Original Intel Code. No other license or right
3635786f6Robert Mustacchi * is granted directly or by implication, estoppel or otherwise;
3735786f6Robert Mustacchi *
3835786f6Robert Mustacchi * The above copyright and patent license is granted only if the following
3935786f6Robert Mustacchi * conditions are met:
4035786f6Robert Mustacchi *
4135786f6Robert Mustacchi * 3. Conditions
4235786f6Robert Mustacchi *
4335786f6Robert Mustacchi * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4435786f6Robert Mustacchi * Redistribution of source code of any substantial portion of the Covered
4535786f6Robert Mustacchi * Code or modification with rights to further distribute source must include
4635786f6Robert Mustacchi * the above Copyright Notice, the above License, this list of Conditions,
4735786f6Robert Mustacchi * and the following Disclaimer and Export Compliance provision. In addition,
4835786f6Robert Mustacchi * Licensee must cause all Covered Code to which Licensee contributes to
4935786f6Robert Mustacchi * contain a file documenting the changes Licensee made to create that Covered
5035786f6Robert Mustacchi * Code and the date of any change. Licensee must include in that file the
5135786f6Robert Mustacchi * documentation of any changes made by any predecessor Licensee. Licensee
5235786f6Robert Mustacchi * must include a prominent statement that the modification is derived,
5335786f6Robert Mustacchi * directly or indirectly, from Original Intel Code.
5435786f6Robert Mustacchi *
5535786f6Robert Mustacchi * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5635786f6Robert Mustacchi * Redistribution of source code of any substantial portion of the Covered
5735786f6Robert Mustacchi * Code or modification without rights to further distribute source must
5835786f6Robert Mustacchi * include the following Disclaimer and Export Compliance provision in the
5935786f6Robert Mustacchi * documentation and/or other materials provided with distribution. In
6035786f6Robert Mustacchi * addition, Licensee may not authorize further sublicense of source of any
6135786f6Robert Mustacchi * portion of the Covered Code, and must include terms to the effect that the
6235786f6Robert Mustacchi * license from Licensee to its licensee is limited to the intellectual
6335786f6Robert Mustacchi * property embodied in the software Licensee provides to its licensee, and
6435786f6Robert Mustacchi * not to intellectual property embodied in modifications its licensee may
6535786f6Robert Mustacchi * make.
6635786f6Robert Mustacchi *
6735786f6Robert Mustacchi * 3.3. Redistribution of Executable. Redistribution in executable form of any
6835786f6Robert Mustacchi * substantial portion of the Covered Code or modification must reproduce the
6935786f6Robert Mustacchi * above Copyright Notice, and the following Disclaimer and Export Compliance
7035786f6Robert Mustacchi * provision in the documentation and/or other materials provided with the
7135786f6Robert Mustacchi * distribution.
7235786f6Robert Mustacchi *
7335786f6Robert Mustacchi * 3.4. Intel retains all right, title, and interest in and to the Original
7435786f6Robert Mustacchi * Intel Code.
7535786f6Robert Mustacchi *
7635786f6Robert Mustacchi * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7735786f6Robert Mustacchi * Intel shall be used in advertising or otherwise to promote the sale, use or
7835786f6Robert Mustacchi * other dealings in products derived from or relating to the Covered Code
7935786f6Robert Mustacchi * without prior written authorization from Intel.
8035786f6Robert Mustacchi *
8135786f6Robert Mustacchi * 4. Disclaimer and Export Compliance
8235786f6Robert Mustacchi *
8335786f6Robert Mustacchi * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8435786f6Robert Mustacchi * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8535786f6Robert Mustacchi * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
8635786f6Robert Mustacchi * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
8735786f6Robert Mustacchi * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
8835786f6Robert Mustacchi * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8935786f6Robert Mustacchi * PARTICULAR PURPOSE.
9035786f6Robert Mustacchi *
9135786f6Robert Mustacchi * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9235786f6Robert Mustacchi * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9335786f6Robert Mustacchi * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9435786f6Robert Mustacchi * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9535786f6Robert Mustacchi * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9635786f6Robert Mustacchi * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
9735786f6Robert Mustacchi * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9835786f6Robert Mustacchi * LIMITED REMEDY.
9935786f6Robert Mustacchi *
10035786f6Robert Mustacchi * 4.3. Licensee shall not export, either directly or indirectly, any of this
10135786f6Robert Mustacchi * software or system incorporating such software without first obtaining any
10235786f6Robert Mustacchi * required license or other approval from the U. S. Department of Commerce or
10335786f6Robert Mustacchi * any other agency or department of the United States Government. In the
10435786f6Robert Mustacchi * event Licensee exports any such software from the United States or
10535786f6Robert Mustacchi * re-exports any such software from a foreign destination, Licensee shall
10635786f6Robert Mustacchi * ensure that the distribution and export/re-export of the software is in
10735786f6Robert Mustacchi * compliance with all laws, regulations, orders, or other restrictions of the
10835786f6Robert Mustacchi * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10935786f6Robert Mustacchi * any of its subsidiaries will export/re-export any technical data, process,
11035786f6Robert Mustacchi * software, or service, directly or indirectly, to any country for which the
11135786f6Robert Mustacchi * United States government or any agency thereof requires an export license,
11235786f6Robert Mustacchi * other governmental approval, or letter of assurance, without first obtaining
11335786f6Robert Mustacchi * such license, approval or letter.
11435786f6Robert Mustacchi *
11535786f6Robert Mustacchi *****************************************************************************
11635786f6Robert Mustacchi *
11735786f6Robert Mustacchi * Alternatively, you may choose to be licensed under the terms of the
11835786f6Robert Mustacchi * following license:
11935786f6Robert Mustacchi *
1207b1019aJerry Jelinek * Redistribution and use in source and binary forms, with or without
1217b1019aJerry Jelinek * modification, are permitted provided that the following conditions
1227b1019aJerry Jelinek * are met:
1237b1019aJerry Jelinek * 1. Redistributions of source code must retain the above copyright
1247b1019aJerry Jelinek *    notice, this list of conditions, and the following disclaimer,
1257b1019aJerry Jelinek *    without modification.
1267b1019aJerry Jelinek * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1277b1019aJerry Jelinek *    substantially similar to the "NO WARRANTY" disclaimer below
1287b1019aJerry Jelinek *    ("Disclaimer") and any redistribution must be conditioned upon
1297b1019aJerry Jelinek *    including a substantially similar Disclaimer requirement for further
1307b1019aJerry Jelinek *    binary redistribution.
1317b1019aJerry Jelinek * 3. Neither the names of the above-listed copyright holders nor the names
1327b1019aJerry Jelinek *    of any contributors may be used to endorse or promote products derived
1337b1019aJerry Jelinek *    from this software without specific prior written permission.
1347b1019aJerry Jelinek *
1357b1019aJerry Jelinek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1367b1019aJerry Jelinek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
13735786f6Robert Mustacchi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1387b1019aJerry Jelinek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
13935786f6Robert Mustacchi * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
14035786f6Robert Mustacchi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
14135786f6Robert Mustacchi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
14235786f6Robert Mustacchi * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
14335786f6Robert Mustacchi * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14435786f6Robert Mustacchi * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14535786f6Robert Mustacchi * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14635786f6Robert Mustacchi *
14735786f6Robert Mustacchi * Alternatively, you may choose to be licensed under the terms of the
14835786f6Robert Mustacchi * GNU General Public License ("GPL") version 2 as published by the Free
14935786f6Robert Mustacchi * Software Foundation.
15035786f6Robert Mustacchi *
15135786f6Robert Mustacchi *****************************************************************************/
1527b1019aJerry Jelinek
1537b1019aJerry Jelinek#ifndef _ACCLIB_H
1547b1019aJerry Jelinek#define _ACCLIB_H
1557b1019aJerry Jelinek
1567b1019aJerry Jelinek
1577b1019aJerry Jelinek/*
1587b1019aJerry Jelinek * Prototypes and macros for local implementations of C library functions
1597b1019aJerry Jelinek */
1607b1019aJerry Jelinek
1617b1019aJerry Jelinek/* is* functions. The AcpiGbl_Ctypes array is defined in utclib.c */
1627b1019aJerry Jelinek
1637b1019aJerry Jelinekextern const UINT8 AcpiGbl_Ctypes[];
1647b1019aJerry Jelinek
1657b1019aJerry Jelinek#define _ACPI_XA     0x00    /* extra alphabetic - not supported */
1667b1019aJerry Jelinek#define _ACPI_XS     0x40    /* extra space */
1677b1019aJerry Jelinek#define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
1687b1019aJerry Jelinek#define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
1697b1019aJerry Jelinek#define _ACPI_DI     0x04    /* '0'-'9' */
1707b1019aJerry Jelinek#define _ACPI_LO     0x02    /* 'a'-'z' */
1717b1019aJerry Jelinek#define _ACPI_PU     0x10    /* punctuation */
1727b1019aJerry Jelinek#define _ACPI_SP     0x08    /* space, tab, CR, LF, VT, FF */
1737b1019aJerry Jelinek#define _ACPI_UP     0x01    /* 'A'-'Z' */
1747b1019aJerry Jelinek#define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
1757b1019aJerry Jelinek
1767b1019aJerry Jelinek#define isdigit(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_DI))
1777b1019aJerry Jelinek#define isspace(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_SP))
1787b1019aJerry Jelinek#define isxdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_XD))
1797b1019aJerry Jelinek#define isupper(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_UP))
1807b1019aJerry Jelinek#define islower(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO))
1817b1019aJerry Jelinek#define isprint(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
1827b1019aJerry Jelinek#define isalpha(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
1837b1019aJerry Jelinek
18435786f6Robert Mustacchi/* Error code */
18535786f6Robert Mustacchi
18635786f6Robert Mustacchi#define EPERM            1 /* Operation not permitted */
18735786f6Robert Mustacchi#define ENOENT           2 /* No such file or directory */
18835786f6Robert Mustacchi#define EINTR            4 /* Interrupted system call */
18935786f6Robert Mustacchi#define EIO              5 /* I/O error */
19035786f6Robert Mustacchi#define EBADF            9 /* Bad file number */
19135786f6Robert Mustacchi#define EAGAIN          11 /* Try again */
19235786f6Robert Mustacchi#define ENOMEM          12 /* Out of memory */
19335786f6Robert Mustacchi#define EACCES          13 /* Permission denied */
19435786f6Robert Mustacchi#define EFAULT          14 /* Bad address */
19535786f6Robert Mustacchi#define EBUSY           16 /* Device or resource busy */
19635786f6Robert Mustacchi#define EEXIST          17 /* File exists */
19735786f6Robert Mustacchi#define ENODEV          19 /* No such device */
19835786f6Robert Mustacchi#define EINVAL          22 /* Invalid argument */
19935786f6Robert Mustacchi#define EPIPE           32 /* Broken pipe */
20035786f6Robert Mustacchi#define ERANGE          34 /* Math result not representable */
2017b1019aJerry Jelinek
2027b1019aJerry Jelinek/* Strings */
2037b1019aJerry Jelinek
2047b1019aJerry Jelinekchar *
2057b1019aJerry Jelinekstrcat (
2067b1019aJerry Jelinek    char                    *DstString,
2077b1019aJerry Jelinek    const char              *SrcString);
2087b1019aJerry Jelinek
2097b1019aJerry Jelinekchar *
2107b1019aJerry Jelinekstrchr (
2117b1019aJerry Jelinek    const char              *String,
2127b1019aJerry Jelinek    int                     ch);
2137b1019aJerry Jelinek
2147b1019aJerry Jelinekchar *
21535786f6Robert Mustacchistrpbrk (
21635786f6Robert Mustacchi    const char              *String,
21735786f6Robert Mustacchi    const char              *Delimiters);
21835786f6Robert Mustacchi
21935786f6Robert Mustacchichar *
22035786f6Robert Mustacchistrtok (
22135786f6Robert Mustacchi    char                    *String,
22235786f6Robert Mustacchi    const char              *Delimiters);
22335786f6Robert Mustacchi
22435786f6Robert Mustacchichar *
2257b1019aJerry Jelinekstrcpy (
2267b1019aJerry Jelinek    char                    *DstString,
2277b1019aJerry Jelinek    const char              *SrcString);
2287b1019aJerry Jelinek
2297b1019aJerry Jelinekint
2307b1019aJerry Jelinekstrcmp (
2317b1019aJerry Jelinek    const char              *String1,
2327b1019aJerry Jelinek    const char              *String2);
2337b1019aJerry Jelinek
2347b1019aJerry JelinekACPI_SIZE
2357b1019aJerry Jelinekstrlen (
2367b1019aJerry Jelinek    const char              *String);
2377b1019aJerry Jelinek
2387b1019aJerry Jelinekchar *
2397b1019aJerry Jelinekstrncat (
2407b1019aJerry Jelinek    char                    *DstString,
2417b1019aJerry Jelinek    const char              *SrcString,
2427b1019aJerry Jelinek    ACPI_SIZE               Count);
2437b1019aJerry Jelinek
2447b1019aJerry Jelinekint
2457b1019aJerry Jelinekstrncmp (
2467b1019aJerry Jelinek    const char              *String1,
2477b1019aJerry Jelinek    const char              *String2,
2487b1019aJerry Jelinek    ACPI_SIZE               Count);
2497b1019aJerry Jelinek
2507b1019aJerry Jelinekchar *
2517b1019aJerry Jelinekstrncpy (
2527b1019aJerry Jelinek    char                    *DstString,
2537b1019aJerry Jelinek    const char              *SrcString,
2547b1019aJerry Jelinek    ACPI_SIZE               Count);
2557b1019aJerry Jelinek
2567b1019aJerry Jelinekchar *
2577b1019aJerry Jelinekstrstr (
2587b1019aJerry Jelinek    char                    *String1,
2597b1019aJerry Jelinek    char                    *String2);
2607b1019aJerry Jelinek
2617b1019aJerry Jelinek
2627b1019aJerry Jelinek/* Conversion */
2637b1019aJerry Jelinek
2647b1019aJerry JelinekUINT32
2657b1019aJerry Jelinekstrtoul (
2667b1019aJerry Jelinek    const char              *String,
2677b1019aJerry Jelinek    char                    **Terminator,
2687b1019aJerry Jelinek    UINT32                  Base);
2697b1019aJerry Jelinek
2707b1019aJerry Jelinek
2717b1019aJerry Jelinek/* Memory */
2727b1019aJerry Jelinek
2737b1019aJerry Jelinekint
2747b1019aJerry Jelinekmemcmp (
2757b1019aJerry Jelinek    void                    *Buffer1,
2767b1019aJerry Jelinek    void                    *Buffer2,
2777b1019aJerry Jelinek    ACPI_SIZE               Count);
2787b1019aJerry Jelinek
2797b1019aJerry Jelinekvoid *
2807b1019aJerry Jelinekmemcpy (
2817b1019aJerry Jelinek    void                    *Dest,
2827b1019aJerry Jelinek    const void              *Src,
2837b1019aJerry Jelinek    ACPI_SIZE               Count);
2847b1019aJerry Jelinek
2857b1019aJerry Jelinekvoid *
28635786f6Robert Mustacchimemmove (
28735786f6Robert Mustacchi    void                    *Dest,
28835786f6Robert Mustacchi    const void              *Src,
28935786f6Robert Mustacchi    ACPI_SIZE               Count);
29035786f6Robert Mustacchi
29135786f6Robert Mustacchivoid *
2927b1019aJerry Jelinekmemset (
2937b1019aJerry Jelinek    void                    *Dest,
2947b1019aJerry Jelinek    int                     Value,
2957b1019aJerry Jelinek    ACPI_SIZE               Count);
2967b1019aJerry Jelinek
2977b1019aJerry Jelinek
2987b1019aJerry Jelinek/* upper/lower case */
2997b1019aJerry Jelinek
3007b1019aJerry Jelinekint
3017b1019aJerry Jelinektolower (
3027b1019aJerry Jelinek    int                     c);
3037b1019aJerry Jelinek
3047b1019aJerry Jelinekint
3057b1019aJerry Jelinektoupper (
3067b1019aJerry Jelinek    int                     c);
3077b1019aJerry Jelinek
30835786f6Robert Mustacchi/*
30935786f6Robert Mustacchi * utprint - printf/vprintf output functions
31035786f6Robert Mustacchi */
31135786f6Robert Mustacchiconst char *
31235786f6Robert MustacchiAcpiUtScanNumber (
31335786f6Robert Mustacchi    const char              *String,
31435786f6Robert Mustacchi    UINT64                  *NumberPtr);
31535786f6Robert Mustacchi
31635786f6Robert Mustacchiconst char *
31735786f6Robert MustacchiAcpiUtPrintNumber (
31835786f6Robert Mustacchi    char                    *String,
31935786f6Robert Mustacchi    UINT64                  Number);
32035786f6Robert Mustacchi
32135786f6Robert Mustacchiint
32235786f6Robert Mustacchivsnprintf (
32335786f6Robert Mustacchi    char                    *String,
32435786f6Robert Mustacchi    ACPI_SIZE               Size,
32535786f6Robert Mustacchi    const char              *Format,
32635786f6Robert Mustacchi    va_list                 Args);
32735786f6Robert Mustacchi
32835786f6Robert Mustacchiint
32935786f6Robert Mustacchisnprintf (
33035786f6Robert Mustacchi    char                    *String,
33135786f6Robert Mustacchi    ACPI_SIZE               Size,
33235786f6Robert Mustacchi    const char              *Format,
33335786f6Robert Mustacchi    ...);
33435786f6Robert Mustacchi
33535786f6Robert Mustacchiint
33635786f6Robert Mustacchisprintf (
33735786f6Robert Mustacchi    char                    *String,
33835786f6Robert Mustacchi    const char              *Format,
33935786f6Robert Mustacchi    ...);
34035786f6Robert Mustacchi
34135786f6Robert Mustacchi#ifdef ACPI_APPLICATION
34235786f6Robert Mustacchi#define SEEK_SET            0
34335786f6Robert Mustacchi#define SEEK_CUR            1
34435786f6Robert Mustacchi#define SEEK_END            2
34535786f6Robert Mustacchi
34635786f6Robert Mustacchi/*
34735786f6Robert Mustacchi * NOTE: Currently we only need to update errno for file IOs. Other
34835786f6Robert Mustacchi *       Clibrary invocations in ACPICA do not make descisions according to
34935786f6Robert Mustacchi *       the errno.
35035786f6Robert Mustacchi */
35135786f6Robert Mustacchiextern int errno;
35235786f6Robert Mustacchi
35335786f6Robert Mustacchi#ifndef EOF
35435786f6Robert Mustacchi#define EOF                 (-1)
35535786f6Robert Mustacchi#endif
35635786f6Robert Mustacchi
35735786f6Robert Mustacchi#define putchar(c)          fputc(stdout, c)
35835786f6Robert Mustacchi#define getchar(c)          fgetc(stdin)
35935786f6Robert Mustacchi
36035786f6Robert Mustacchiint
36135786f6Robert Mustacchivprintf (
36235786f6Robert Mustacchi    const char              *Format,
36335786f6Robert Mustacchi    va_list                 Args);
36435786f6Robert Mustacchi
36535786f6Robert Mustacchiint
36635786f6Robert Mustacchiprintf (
36735786f6Robert Mustacchi    const char              *Format,
36835786f6Robert Mustacchi    ...);
36935786f6Robert Mustacchi
37035786f6Robert Mustacchiint
37135786f6Robert Mustacchivfprintf (
37235786f6Robert Mustacchi    FILE                    *File,
37335786f6Robert Mustacchi    const char              *Format,
37435786f6Robert Mustacchi    va_list                 Args);
37535786f6Robert Mustacchi
37635786f6Robert Mustacchiint
37735786f6Robert Mustacchifprintf (
37835786f6Robert Mustacchi    FILE                    *File,
37935786f6Robert Mustacchi    const char              *Format,
38035786f6Robert Mustacchi    ...);
38135786f6Robert Mustacchi
38235786f6Robert MustacchiFILE *
38335786f6Robert Mustacchifopen (
38435786f6Robert Mustacchi    const char              *Path,
38535786f6Robert Mustacchi    const char              *Modes);
38635786f6Robert Mustacchi
38735786f6Robert Mustacchivoid
38835786f6Robert Mustacchifclose (
38935786f6Robert Mustacchi    FILE                    *File);
39035786f6Robert Mustacchi
39135786f6Robert Mustacchiint
39235786f6Robert Mustacchifread (
39335786f6Robert Mustacchi    void                    *Buffer,
39435786f6Robert Mustacchi    ACPI_SIZE               Size,
39535786f6Robert Mustacchi    ACPI_SIZE               Count,
39635786f6Robert Mustacchi    FILE                    *File);
39735786f6Robert Mustacchi
39835786f6Robert Mustacchiint
39935786f6Robert Mustacchifwrite (
40035786f6Robert Mustacchi    void                    *Buffer,
40135786f6Robert Mustacchi    ACPI_SIZE               Size,
40235786f6Robert Mustacchi    ACPI_SIZE               Count,
40335786f6Robert Mustacchi    FILE                    *File);
40435786f6Robert Mustacchi
40535786f6Robert Mustacchiint
40635786f6Robert Mustacchifseek (
40735786f6Robert Mustacchi    FILE                    *File,
40835786f6Robert Mustacchi    long                    Offset,
40935786f6Robert Mustacchi    int                     From);
41035786f6Robert Mustacchi
41135786f6Robert Mustacchilong
41235786f6Robert Mustacchiftell (
41335786f6Robert Mustacchi    FILE                    *File);
41435786f6Robert Mustacchi
41535786f6Robert Mustacchiint
41635786f6Robert Mustacchifgetc (
41735786f6Robert Mustacchi    FILE                    *File);
41835786f6Robert Mustacchi
41935786f6Robert Mustacchiint
42035786f6Robert Mustacchifputc (
42135786f6Robert Mustacchi    FILE                    *File,
42235786f6Robert Mustacchi    char                    c);
42335786f6Robert Mustacchi
42435786f6Robert Mustacchichar *
42535786f6Robert Mustacchifgets (
42635786f6Robert Mustacchi    char                    *s,
42735786f6Robert Mustacchi    ACPI_SIZE               Size,
42835786f6Robert Mustacchi    FILE                    *File);
42935786f6Robert Mustacchi#endif
43035786f6Robert Mustacchi
4317b1019aJerry Jelinek#endif /* _ACCLIB_H */
432