RTEMS  5.1
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
extern-dd.h
1 /*-
2  * Copyright (c) 1991, 1993, 1994
3  * The Regents of the University of California. All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Keith Muller of the University of California, San Diego and Lance
7  * Visser of Convex Computer Corporation.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  * 4. Neither the name of the University nor the names of its contributors
18  * may be used to endorse or promote products derived from this software
19  * without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * @(#)extern.h 8.3 (Berkeley) 4/2/94
34  * $FreeBSD: src/bin/dd/extern.h,v 1.15 2004/08/15 19:10:05 rwatson Exp $
35  */
36 
37 #ifndef _EXTERN_DD_H_
38 #define _EXTERN_DD_H_
39 
40 #include <setjmp.h>
41 
42 typedef struct rtems_shell_dd_globals_t {
43  IO in, out; /* input/output state */
44  STAT st; /* statistics */
45  void (*cfunc)(struct rtems_shell_dd_globals_t* globals); /* conversion function */
46  uintmax_t cpy_cnt; /* # of blocks to copy */
47  u_int ddflags; /* conversion options */
48  size_t cbsz; /* conversion block size */
49  uintmax_t files_cnt; /* # of files to copy */
50  const u_char *ctab; /* conversion table */
51  char fill_char; /* Character to fill with if defined */
52  u_char casetab[256];
53  int exit_code;
54  jmp_buf exit_jmp;
56 
57 #define in globals->in
58 #define out globals->out
59 #define st globals->st
60 #define cfunc globals->cfunc
61 #define cpy_cnt globals->cpy_cnt
62 #define ddflags globals->ddflags
63 #define cbsz globals->cbsz
64 #define files_cnt globals->files_cnt
65 #define casetab globals->casetab
66 #define ctab globals->ctab
67 #define fill_char globals->fill_char
68 #define exit_jump &(globals->exit_jmp)
69 
70 #define block rtems_shell_dd_block
71 #define block_close rtems_shell_dd_block_close
72 #define dd_out rtems_shell_dd_dd_out
73 #define def rtems_shell_dd_def
74 #define def_close rtems_shell_dd_def_close
75 #define jcl rtems_shell_dd_jcl
76 #define pos_in rtems_shell_dd_pos_in
77 #define pos_out rtems_shell_dd_pos_out
78 #define summary rtems_shell_dd_summary
79 #define summaryx rtems_shell_dd_summaryx
80 #define terminate rtems_shell_dd_terminate
81 #define unblock rtems_shell_dd_unblock
82 #define unblock_close rtems_shell_dd_unblock_close
83 
84 void block(rtems_shell_dd_globals* );
85 void block_close(rtems_shell_dd_globals* );
86 void dd_out(rtems_shell_dd_globals* , int);
87 void def(rtems_shell_dd_globals* globals);
88 void def_close(rtems_shell_dd_globals* );
89 void jcl(rtems_shell_dd_globals* , char **);
90 void pos_in(rtems_shell_dd_globals* );
91 void pos_out(rtems_shell_dd_globals* );
92 void summary(rtems_shell_dd_globals* );
93 void summaryx(rtems_shell_dd_globals* , int);
94 void terminate(int);
95 void unblock(rtems_shell_dd_globals* globals);
96 void unblock_close(rtems_shell_dd_globals* globals);
97 
98 extern const u_char a2e_32V[256], a2e_POSIX[256];
99 extern const u_char e2a_32V[256], e2a_POSIX[256];
100 extern const u_char a2ibm_32V[256], a2ibm_POSIX[256];
101 
102 void rtems_shell_dd_exit(rtems_shell_dd_globals* globals, int code);
103 
104 #define exit(ec) rtems_shell_dd_exit(globals, ec)
105 
106 #endif /* !_EXTERN_H_ */
Definition: extern-dd.h:42
Definition: dd.h:45
Definition: dd.h:66
Definition: inftrees.h:24