PageRenderTime 51ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/amanda/tags/amanda252p1/client-src/sendbackup.h

#
C Header | 90 lines | 35 code | 10 blank | 45 comment | 0 complexity | c0c37df390eff1314cd825264ec04cfc MD5 | raw file
  1. /*
  2. * Amanda, The Advanced Maryland Automatic Network Disk Archiver
  3. * Copyright (c) 1991-1998 University of Maryland at College Park
  4. * All Rights Reserved.
  5. *
  6. * Permission to use, copy, modify, distribute, and sell this software and its
  7. * documentation for any purpose is hereby granted without fee, provided that
  8. * the above copyright notice appear in all copies and that both that
  9. * copyright notice and this permission notice appear in supporting
  10. * documentation, and that the name of U.M. not be used in advertising or
  11. * publicity pertaining to distribution of the software without specific,
  12. * written prior permission. U.M. makes no representations about the
  13. * suitability of this software for any purpose. It is provided "as is"
  14. * without express or implied warranty.
  15. *
  16. * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
  18. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  21. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22. *
  23. * Authors: the Amanda Development Team. Its members are listed in a
  24. * file named AUTHORS, in the root directory of this distribution.
  25. */
  26. /*
  27. * $Id: sendbackup.h,v 1.20 2006/07/25 18:10:07 martinea Exp $
  28. *
  29. * a few common decls for the sendbackup-* sources
  30. */
  31. #ifndef SENDBACKUP_H
  32. #define SENDBACKUP_H
  33. #include "amanda.h"
  34. #include "pipespawn.h"
  35. #include "client_util.h"
  36. #include "amandad.h"
  37. void info_tapeheader(void);
  38. void start_index(int createindex, int input, int mesg,
  39. int index, char *cmd);
  40. /*
  41. * Dump output lines are scanned for two types of regex matches.
  42. *
  43. * First, there are some cases, unfortunately, where dump detects an
  44. * error but does not return an error code. We would like to bring these
  45. * errors to the attention of the operators anyway.
  46. *
  47. * Second, we attempt to determine what dump thinks its output size is.
  48. * This is cheaper than putting a filter between dump and compress just
  49. * to determine the output size. The re_size table contains regexes to
  50. * match the size output by various vendors' dump programs. Some vendors
  51. * output the number in Kbytes, some in 512-byte blocks. Whenever an
  52. * entry in re_size matches, the first integer in the dump line is
  53. * multiplied by the scale field to get the dump size.
  54. */
  55. typedef enum {
  56. DMP_NORMAL, DMP_STRANGE, DMP_SIZE, DMP_ERROR
  57. } dmpline_t;
  58. typedef struct regex_s {
  59. char *regex;
  60. int srcline;
  61. int scale; /* only used for size lines */
  62. int field;
  63. dmpline_t typ;
  64. } amregex_t;
  65. #define AM_NORMAL_RE(re) {(re), __LINE__, 0, 0, DMP_NORMAL}
  66. #define AM_STRANGE_RE(re) {(re), __LINE__, 0, 0, DMP_STRANGE}
  67. #define AM_SIZE_RE(re,s,f) {(re), __LINE__, (s), (f), DMP_SIZE}
  68. #define AM_ERROR_RE(re) {(re), __LINE__, 0, 0, DMP_ERROR}
  69. extern pid_t comppid, dumppid, encpid, tarpid;
  70. extern pid_t indexpid;
  71. extern option_t *options;
  72. extern g_option_t *g_options;
  73. typedef struct backup_program_s {
  74. char *name, *backup_name, *restore_name;
  75. amregex_t *re_table;
  76. void (*start_backup)(char *host, char *disk, char *amdevice, int level, char *dumpdate, int dataf, int mesgf, int indexf);
  77. void (*end_backup)(int goterror);
  78. } backup_program_t;
  79. extern backup_program_t *programs[], *program;
  80. #endif /* !SENDBACKUP_H */