home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / c / cpio11as.zip / GLOBAL.C < prev    next >
C/C++ Source or Header  |  1992-02-22  |  4KB  |  136 lines

  1. /* global.c - global variables and initial values for cpio.
  2.    Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 1, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /* MS-DOS port (c) 1990 by Thorsten Ohl, ohl@gnu.ai.mit.edu
  19.    This port is also distributed under the terms of the
  20.    GNU General Public License as published by the
  21.    Free Software Foundation.
  22.  
  23.    Please note that this file is not identical to the
  24.    original GNU release, you should have received this
  25.    code as patch to the official release.
  26.  
  27.    $Header: e:/gnu/cpio/RCS/global.c 1.1.0.2 90/09/23 23:11:09 tho Exp $
  28.  */
  29.  
  30. #include "cpio.h"
  31. #include "dstring.h"
  32.  
  33. #ifdef MSDOS
  34. #include "extern.h"
  35. #endif
  36.  
  37. /* If TRUE, reset access times after reading files (-a). */
  38. int reset_time_flag = FALSE;
  39.  
  40. /* Block size value, initially 512.  -B sets to 5120. */
  41. int io_block_size = 512;
  42.  
  43. /* If TRUE, recognize binary header format for copy in (-b). */
  44. int binary_flag = FALSE;
  45.  
  46. /* If TRUE, use ASCII header format for copy out
  47.    and recognize ASCII header format for copy in (-c).  */
  48. int portability_flag = FALSE;
  49.  
  50. /* If TRUE, create directories as needed. (-d with -i or -p) */
  51. int create_dir_flag = FALSE;
  52.  
  53. /* If TRUE, interactively rename files. (-r) */
  54. int rename_flag = FALSE;
  55.  
  56. /* If TRUE, print a table of contents of input. (-t) */
  57. int table_flag = FALSE;
  58.  
  59. /* If TRUE, copy unconditionally (older replaces newer). (-u) */
  60. int unconditional_flag = FALSE;
  61.  
  62. /* If TRUE, list the files processed, or ls -l style output with -t. (-v) */
  63. int verbose_flag = FALSE;
  64.  
  65. /* If TRUE, link files whenever possible.  Used with -p option. (-l) */
  66. int link_flag = FALSE;
  67.  
  68. /* If TRUE, retain previous file modification time. (-m) */
  69. int retain_time_flag = FALSE;
  70.  
  71. /* With -i; if TRUE, copy only files that match any of the given patterns;
  72.    if FALSE, copy only files that do not match any of the patterns. (-f) */
  73. int copy_matching_files = TRUE;
  74.  
  75. /* With -itv; if TRUE, list numeric uid and gid instead of translating them
  76.    into names. */
  77. int numeric_uid = FALSE;
  78.  
  79. /* Input and output buffers. */
  80. char *input_buffer, *output_buffer;
  81.  
  82. /* Current locations in `input_buffer' and `output_buffer'. */
  83. char *in_buff, *out_buff;
  84.  
  85. /* Current number of bytes stored at `input_buff' and `output_buff'. */
  86. LONG input_size, output_size;
  87.  
  88. /* Total number of bytes read and written for all files. */
  89. LONG input_bytes, output_bytes;
  90.  
  91. /* Saving of argument values for later reference. */
  92. char *directory_name;
  93. char **save_patterns;
  94. int num_patterns;
  95.  
  96. /* TRUE if input (cpio -i) or output (cpio -o) is a device node. */
  97. #ifdef MSDOS            /* shut up the compiler */
  98. int input_is_special = FALSE;
  99. int output_is_special = FALSE;
  100. #else
  101. char input_is_special = FALSE;
  102. char output_is_special = FALSE;
  103. #endif
  104.  
  105. /* TRUE if lseek works on the input. */
  106. #ifdef MSDOS            /* shut up the compiler */
  107. int input_is_seekable = FALSE;
  108. #else
  109. char input_is_seekable = FALSE;
  110. #endif
  111.  
  112. /* TRUE if lseek works on the output. */
  113. #ifdef MSDOS            /* shut up the compiler */
  114. int output_is_seekable = FALSE;
  115. #else
  116. char output_is_seekable = FALSE;
  117. #endif
  118.  
  119. /* The name this program was run with. */
  120. char *program_name;
  121.  
  122. /* A pointer to either lstat or stat, depending on whether
  123.    dereferencing of symlinks is done for input files.  */
  124. #ifdef MSDOS
  125. int (*xstat) (char *name, struct stat *statb);
  126. #else
  127. int (*xstat) ();
  128. #endif
  129.  
  130. /* Which copy operation to perform. (-i, -o, -p) */
  131. #ifdef MSDOS
  132. void (*copy_function) (void) = 0;
  133. #else
  134. void (*copy_function) () = 0;
  135. #endif
  136.