xref: /freebsd/stand/common/readin.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*fbcf3b4fSSimon J. Gerraty /*-
2*fbcf3b4fSSimon J. Gerraty  * Copyright (c) 2020, Juniper Networks, Inc.
3*fbcf3b4fSSimon J. Gerraty  *
4*fbcf3b4fSSimon J. Gerraty  * Redistribution and use in source and binary forms, with or without
5*fbcf3b4fSSimon J. Gerraty  * modification, are permitted provided that the following conditions
6*fbcf3b4fSSimon J. Gerraty  * are met:
7*fbcf3b4fSSimon J. Gerraty  * 1. Redistributions of source code must retain the above copyright
8*fbcf3b4fSSimon J. Gerraty  *    notice, this list of conditions and the following disclaimer.
9*fbcf3b4fSSimon J. Gerraty  * 2. Redistributions in binary form must reproduce the above copyright
10*fbcf3b4fSSimon J. Gerraty  *    notice, this list of conditions and the following disclaimer in the
11*fbcf3b4fSSimon J. Gerraty  *    documentation and/or other materials provided with the distribution.
12*fbcf3b4fSSimon J. Gerraty  *
13*fbcf3b4fSSimon J. Gerraty  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14*fbcf3b4fSSimon J. Gerraty  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15*fbcf3b4fSSimon J. Gerraty  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16*fbcf3b4fSSimon J. Gerraty  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17*fbcf3b4fSSimon J. Gerraty  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18*fbcf3b4fSSimon J. Gerraty  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19*fbcf3b4fSSimon J. Gerraty  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20*fbcf3b4fSSimon J. Gerraty  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21*fbcf3b4fSSimon J. Gerraty  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22*fbcf3b4fSSimon J. Gerraty  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23*fbcf3b4fSSimon J. Gerraty  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24*fbcf3b4fSSimon J. Gerraty  */
25*fbcf3b4fSSimon J. Gerraty #ifndef _READIN_H_
26*fbcf3b4fSSimon J. Gerraty #define	_READIN_H_
27*fbcf3b4fSSimon J. Gerraty 
28*fbcf3b4fSSimon J. Gerraty #ifdef LOADER_VERIEXEC
29*fbcf3b4fSSimon J. Gerraty #include <verify_file.h>
30*fbcf3b4fSSimon J. Gerraty #endif
31*fbcf3b4fSSimon J. Gerraty #ifdef LOADER_VERIEXEC_VECTX
32*fbcf3b4fSSimon J. Gerraty typedef struct vectx * readin_handle_t;
33*fbcf3b4fSSimon J. Gerraty #define VECTX_READ vectx_read
34*fbcf3b4fSSimon J. Gerraty #define VECTX_LSEEK vectx_lseek
35*fbcf3b4fSSimon J. Gerraty #else
36*fbcf3b4fSSimon J. Gerraty typedef int readin_handle_t;
37*fbcf3b4fSSimon J. Gerraty #define VECTX_READ read
38*fbcf3b4fSSimon J. Gerraty #define VECTX_LSEEK lseek
39*fbcf3b4fSSimon J. Gerraty #endif
40*fbcf3b4fSSimon J. Gerraty 
41*fbcf3b4fSSimon J. Gerraty #endif	/* !_READIN_H_ */
42