Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:19

0001 /*-
0002  * Copyright (c) 1991, 1993, 1994
0003  *  The Regents of the University of California.  All rights reserved.
0004  *
0005  * This code is derived from software contributed to Berkeley by
0006  * Keith Muller of the University of California, San Diego and Lance
0007  * Visser of Convex Computer Corporation.
0008  *
0009  * Redistribution and use in source and binary forms, with or without
0010  * modification, are permitted provided that the following conditions
0011  * are met:
0012  * 1. Redistributions of source code must retain the above copyright
0013  *    notice, this list of conditions and the following disclaimer.
0014  * 2. Redistributions in binary form must reproduce the above copyright
0015  *    notice, this list of conditions and the following disclaimer in the
0016  *    documentation and/or other materials provided with the distribution.
0017  * 4. Neither the name of the University nor the names of its contributors
0018  *    may be used to endorse or promote products derived from this software
0019  *    without specific prior written permission.
0020  *
0021  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
0022  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0024  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
0025  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0026  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0027  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0028  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0029  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0030  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0031  * SUCH DAMAGE.
0032  *
0033  *  @(#)extern.h    8.3 (Berkeley) 4/2/94
0034  * $FreeBSD: src/bin/dd/extern.h,v 1.15 2004/08/15 19:10:05 rwatson Exp $
0035  */
0036 
0037 #ifndef _EXTERN_DD_H_
0038 #define _EXTERN_DD_H_
0039 
0040 #include <setjmp.h>
0041 
0042 typedef struct rtems_shell_dd_globals_t {
0043   rtems_shell_dd_IO in, out;        /* input/output state */
0044   rtems_shell_dd_STAT   st;         /* statistics */
0045   void  (*cfunc)(struct rtems_shell_dd_globals_t* globals);     /* conversion function */
0046   uintmax_t cpy_cnt;        /* # of blocks to copy */
0047   u_int ddflags;        /* conversion options */
0048   size_t    cbsz;           /* conversion block size */
0049   uintmax_t files_cnt;  /* # of files to copy */
0050   const u_char *ctab;       /* conversion table */
0051   char  fill_char;      /* Character to fill with if defined */
0052   u_char casetab[256];
0053   int exit_code;
0054   jmp_buf exit_jmp;
0055 } rtems_shell_dd_globals;
0056 
0057 #define in            globals->in
0058 #define out           globals->out
0059 #define st            globals->st
0060 #define cfunc         globals->cfunc
0061 #define cpy_cnt       globals->cpy_cnt
0062 #define ddflags       globals->ddflags
0063 #define cbsz          globals->cbsz
0064 #define files_cnt     globals->files_cnt
0065 #define casetab       globals->casetab
0066 #define ctab          globals->ctab
0067 #define fill_char     globals->fill_char
0068 #define exit_jump     &(globals->exit_jmp)
0069 
0070 #define block         rtems_shell_dd_block
0071 #define block_close   rtems_shell_dd_block_close
0072 #define dd_out        rtems_shell_dd_dd_out
0073 #define def           rtems_shell_dd_def
0074 #define def_close     rtems_shell_dd_def_close
0075 #define jcl           rtems_shell_dd_jcl
0076 #define pos_in        rtems_shell_dd_pos_in
0077 #define pos_out       rtems_shell_dd_pos_out
0078 #define summary       rtems_shell_dd_summary
0079 #define summaryx      rtems_shell_dd_summaryx
0080 #define terminate     rtems_shell_dd_terminate
0081 #define unblock       rtems_shell_dd_unblock
0082 #define unblock_close rtems_shell_dd_unblock_close
0083 
0084 void block(rtems_shell_dd_globals* );
0085 void block_close(rtems_shell_dd_globals* );
0086 void dd_out(rtems_shell_dd_globals* , int);
0087 void def(rtems_shell_dd_globals* globals);
0088 void def_close(rtems_shell_dd_globals* );
0089 void jcl(rtems_shell_dd_globals* , char **);
0090 void pos_in(rtems_shell_dd_globals* );
0091 void pos_out(rtems_shell_dd_globals* );
0092 void summary(rtems_shell_dd_globals* );
0093 void summaryx(rtems_shell_dd_globals* , int);
0094 void terminate(int);
0095 void unblock(rtems_shell_dd_globals* globals);
0096 void unblock_close(rtems_shell_dd_globals* globals);
0097 
0098 extern const u_char a2e_32V[256], a2e_POSIX[256];
0099 extern const u_char e2a_32V[256], e2a_POSIX[256];
0100 extern const u_char a2ibm_32V[256], a2ibm_POSIX[256];
0101 
0102 void rtems_shell_dd_exit(rtems_shell_dd_globals* globals, int code);
0103 
0104 #define exit(ec) rtems_shell_dd_exit(globals, ec)
0105 
0106 #endif /* !_EXTERN_H_ */