xref: /netbsd-src/sys/external/bsd/acpica/dist/tools/acpibin/acpibin.h (revision b757af438b42b93f8c6571f026d8b8ef3eaf5fc9)
1 
2 /******************************************************************************
3  *
4  * Module Name: acpibinh - Include file for AcpiBin utility
5  *
6  *****************************************************************************/
7 
8 /*
9  * Copyright (C) 2000 - 2011, Intel Corp.
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions, and the following disclaimer,
17  *    without modification.
18  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19  *    substantially similar to the "NO WARRANTY" disclaimer below
20  *    ("Disclaimer") and any redistribution must be conditioned upon
21  *    including a substantially similar Disclaimer requirement for further
22  *    binary redistribution.
23  * 3. Neither the names of the above-listed copyright holders nor the names
24  *    of any contributors may be used to endorse or promote products derived
25  *    from this software without specific prior written permission.
26  *
27  * Alternatively, this software may be distributed under the terms of the
28  * GNU General Public License ("GPL") version 2 as published by the Free
29  * Software Foundation.
30  *
31  * NO WARRANTY
32  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42  * POSSIBILITY OF SUCH DAMAGES.
43  */
44 
45 #include "acpi.h"
46 #include "accommon.h"
47 
48 #include <stdio.h>
49 #include <sys/stat.h>
50 #include <sys/types.h>
51 #include <fcntl.h>
52 #include <ctype.h>
53 #include <errno.h>
54 
55 #ifdef WIN32
56 #include <stdlib.h>
57 #include <io.h>
58 #include <direct.h>
59 #endif
60 
61 /* O_BINARY is not always defined */
62 #ifndef O_BINARY
63 #define O_BINARY    0x0
64 #endif
65 
66 #define DB_CONSOLE_OUTPUT            0x02
67 #define ACPI_DB_REDIRECTABLE_OUTPUT  0x01
68 
69 /*
70  * Global variables.  Defined in main.c only, externed in all other files
71  */
72 
73 #ifdef _DECLARE_GLOBALS
74 #define EXTERN
75 #define INIT_GLOBAL(a,b)        a=b
76 #else
77 #define EXTERN                  extern
78 #define INIT_GLOBAL(a,b)        a
79 #endif
80 
81 
82 /* Globals */
83 
84 EXTERN BOOLEAN              INIT_GLOBAL (Gbl_TerseMode, FALSE);
85 EXTERN FILE                 INIT_GLOBAL (*AcpiGbl_DebugFile, NULL);
86 
87 
88 /* Prototypes */
89 
90 int
91 AbCompareAmlFiles (
92     char                    *File1Path,
93     char                    *File2Path);
94 
95 int
96 AbExtractAmlFile (
97     char                    *TableSig,
98     char                    *File1Path,
99     char                    *File2Path);
100 
101 int
102 AbDumpAmlFile (
103     char                    *File1Path,
104     char                    *File2Path);
105 
106 void
107 AbComputeChecksum (
108     char                    *File1Path);
109 
110 void
111 AbDisplayHeader (
112     char                    *File1Path);
113 
114