Imported Upstream version 3.2.0
[debian/amanda] / perl / Amanda / Cmdline.c
index 1badc660b7d9a420726f720b44578384e08594a4..bc9ea2e3fa5b02db0370896ff23fe77bd7979e7d 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.33
+ * Version 1.3.39
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,8 +8,12 @@
  * interface file instead. 
  * ----------------------------------------------------------------------------- */
 
+#include "../config/config.h"
+
+
 #define SWIGPERL
 #define SWIG_CASTRANK_MODE
+
 /* -----------------------------------------------------------------------------
  *  This section contains generic SWIG labels for method/variable
  *  declarations/attributes, and other compiler dependent labels.
 # endif
 #endif
 
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
 #ifndef SWIGUNUSEDPARM
 # ifdef __cplusplus
 #   define SWIGUNUSEDPARM(p)
 /* -----------------------------------------------------------------------------
  * swigrun.swg
  *
- * This file contains generic CAPI SWIG runtime support for pointer
+ * This file contains generic C API SWIG runtime support for pointer
  * type checking.
  * ----------------------------------------------------------------------------- */
 
 /* This should only be incremented when either the layout of swig_type_info changes,
    or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "3"
+#define SWIG_RUNTIME_VERSION "4"
 
 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 #ifdef SWIG_TYPE_TABLE
 
 /*
   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
-  creating a static or dynamic library from the swig runtime code.
-  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
   
-  But only do this if is strictly necessary, ie, if you have problems
-  with your compiler or so.
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
 */
 
 #ifndef SWIGRUNTIME
 
 /* Flags for pointer conversions */
 #define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
 
 /* Flags for new pointer objects */
 #define SWIG_POINTER_OWN           0x1
 /* 
    Flags/methods for returning states.
    
-   The swig conversion methods, as ConvertPtr, return and integer 
+   The SWIG conversion methods, as ConvertPtr, return and integer 
    that tells if the conversion was successful or not. And if not,
    an error code can be returned (see swigerrors.swg for the codes).
    
    Use the following macros/flags to set or process the returning
    states.
    
-   In old swig versions, you usually write code as:
+   In old versions of SWIG, code such as the following was usually written:
 
      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
        // success code
        //fail code
      }
 
-   Now you can be more explicit as:
+   Now you can be more explicit:
 
     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
     if (SWIG_IsOK(res)) {
       // fail code
     }
 
-   that seems to be the same, but now you can also do
+   which is the same really, but now you can also do
 
     Type *ptr;
     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
     
    I.e., now SWIG_ConvertPtr can return new objects and you can
    identify the case and take care of the deallocation. Of course that
-   requires also to SWIG_ConvertPtr to return new result values, as
+   also requires SWIG_ConvertPtr to return new result values, such as
 
       int SWIG_ConvertPtr(obj, ptr,...) {         
         if (<obj is ok>) {                            
 
    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
-   swig errors code.
+   SWIG errors code.
 
    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
    allows to return the 'cast rank', for example, if you have this
       fooi(1)   // cast rank '0'
 
    just use the SWIG_AddCast()/SWIG_CheckState()
+*/
 
-
- */
 #define SWIG_OK                    (0) 
 #define SWIG_ERROR                 (-1)
 #define SWIG_IsOK(r)               (r >= 0)
 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
-
 /* Cast-Rank Mode */
 #if defined(SWIG_CASTRANK_MODE)
 #  ifndef SWIG_TypeRank
@@ -289,18 +298,16 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
 #endif
 
 
-
-
 #include <string.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef void *(*swig_converter_func)(void *);
+typedef void *(*swig_converter_func)(void *, int *);
 typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
-/* Structure to store inforomation on one type */
+/* Structure to store information on one type */
 typedef struct swig_type_info {
   const char             *name;                        /* mangled name of this type */
   const char             *str;                 /* human readable name of this type */
@@ -387,48 +394,66 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
 }
 
 
-/* think of this as a c++ template<> or a scheme macro */
-#define SWIG_TypeCheck_Template(comparison, ty)         \
-  if (ty) {                                             \
-    swig_cast_info *iter = ty->cast;                    \
-    while (iter) {                                      \
-      if (comparison) {                                 \
-        if (iter == ty->cast) return iter;              \
-        /* Move iter to the top of the linked list */   \
-        iter->prev->next = iter->next;                  \
-        if (iter->next)                                 \
-          iter->next->prev = iter->prev;                \
-        iter->next = ty->cast;                          \
-        iter->prev = 0;                                 \
-        if (ty->cast) ty->cast->prev = iter;            \
-        ty->cast = iter;                                \
-        return iter;                                    \
-      }                                                 \
-      iter = iter->next;                                \
-    }                                                   \
-  }                                                     \
-  return 0
-
 /*
   Check the typename
 */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-/* Same as previous function, except strcmp is replaced with a pointer comparison */
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
 SWIGRUNTIME swig_cast_info *
-SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
-  SWIG_TypeCheck_Template(iter->type == from, into);
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
 /*
   Cast a pointer up an inheritance hierarchy
 */
 SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
 /* 
@@ -1059,13 +1084,32 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) {
   }
 }
 
+/* Identical to SWIG_TypeCheck, except for strcmp comparison */
 SWIGRUNTIME swig_cast_info *
 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
-  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
-                           || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) ||
+            (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
 }
 
-
 /* Function for getting a pointer value */
 
 SWIGRUNTIME int
@@ -1119,7 +1163,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *
     if (!tc) {
       return SWIG_ERROR;
     }
-    *ptr = SWIG_TypeCast(tc,voidptr);
+    {
+      int newmemory = 0;
+      *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
+      assert(!newmemory); /* newmemory handling not yet implemented */
+    }
   } else {
     *ptr = voidptr;
   }
@@ -1294,7 +1342,7 @@ SWIG_Perl_GetModule(void) {
 
   /* first check if pointer already created */
   if (!type_pointer) {
-    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
+    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
     if (pointer && SvOK(pointer)) {
       type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
     }
@@ -1308,7 +1356,7 @@ SWIG_Perl_SetModule(swig_module_info *module) {
   SV *pointer;
 
   /* create a new pointer */
-  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
+  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
   sv_setiv(pointer, PTR2IV(module));
 }
 
@@ -1409,6 +1457,12 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef open
   #undef open
 #endif
+#ifdef readdir
+  #undef readdir
+#endif
+#ifdef bind
+  #undef bind
+#endif
 
 
 
@@ -1423,15 +1477,17 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 
 /* -------- TYPES TABLE (BEGIN) -------- */
 
-#define SWIGTYPE_p_char swig_types[0]
-#define SWIGTYPE_p_double swig_types[1]
-#define SWIGTYPE_p_dumpspec_t swig_types[2]
-#define SWIGTYPE_p_float swig_types[3]
-#define SWIGTYPE_p_int swig_types[4]
-#define SWIGTYPE_p_p_char swig_types[5]
-#define SWIGTYPE_p_unsigned_char swig_types[6]
-static swig_type_info *swig_types[8];
-static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
+#define SWIGTYPE_p_GSList swig_types[0]
+#define SWIGTYPE_p_char swig_types[1]
+#define SWIGTYPE_p_double swig_types[2]
+#define SWIGTYPE_p_dumpfile_t swig_types[3]
+#define SWIGTYPE_p_dumpspec_t swig_types[4]
+#define SWIGTYPE_p_float swig_types[5]
+#define SWIGTYPE_p_int swig_types[6]
+#define SWIGTYPE_p_p_char swig_types[7]
+#define SWIGTYPE_p_unsigned_char swig_types[8]
+static swig_type_info *swig_types[10];
+static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
@@ -1442,7 +1498,7 @@ static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0};
 #define SWIG_name   "Amanda::Cmdlinec::boot_Amanda__Cmdline"
 #define SWIG_prefix "Amanda::Cmdlinec::"
 
-#define SWIGVERSION 0x010333 
+#define SWIGVERSION 0x010339 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -1473,8 +1529,16 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
 #include "amglue.h"
 
 
+#include "cmdline.h"
+
+
+typedef GSList amglue_dumpspec_list;
+
+
 #include <glib.h>
+#include "amanda.h"
 #include "cmdline.h"
+#include "fileheader.h"
 
 
 SWIGINTERNINLINE SV *
@@ -1513,6 +1577,11 @@ SWIG_pchar_descriptor(void)
 SWIGINTERN int
 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
 {
+  if (SvMAGICAL(obj)) {
+     SV *tmp = sv_newmortal();
+     SvSetSV(tmp, obj);
+     obj = tmp;
+  }
   if (SvPOK(obj)) {
     STRLEN len = 0;
     char *cstr = SvPV(obj, len); 
@@ -1547,8 +1616,8 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
 
 
 
-SWIGINTERN dumpspec_t *new_dumpspec_t(char *host,char *disk,char *datestamp,char *level){
-           return dumpspec_new(host, disk, datestamp, level);
+SWIGINTERN dumpspec_t *new_dumpspec_t(char *host,char *disk,char *datestamp,char *level,char *write_timestamp){
+           return dumpspec_new(host, disk, datestamp, level, write_timestamp);
        }
 SWIGINTERN void delete_dumpspec_t(dumpspec_t *self){
            dumpspec_free(self);
@@ -1700,13 +1769,50 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
   return res;
 }
 
+
+gboolean header_matches_dumpspecs(dumpfile_t *dumpfile, amglue_dumpspec_list *dumpspecs) {
+    char level_str[100];
+
+    /* ignore anything that's not a (split) dumpfile */
+    if(dumpfile->type != F_DUMPFILE && dumpfile->type != F_SPLIT_DUMPFILE)
+       return FALSE;
+
+    g_snprintf(level_str, sizeof(level_str), "%d", dumpfile->dumplevel);
+
+    while (dumpspecs) {
+       dumpspec_t *ds = (dumpspec_t *)dumpspecs->data;
+       dumpspecs = g_slist_next(dumpspecs);
+
+       if (ds->host && *ds->host
+           && !match_host(ds->host, dumpfile->name))
+           continue;
+
+       if (ds->disk && *ds->disk
+           && !match_disk(ds->disk, dumpfile->disk))
+           continue;
+
+       if (ds->datestamp && *ds->datestamp
+           && !match_datestamp(ds->datestamp, dumpfile->datestamp))
+           continue;
+
+       if (ds->level && *ds->level
+           && !match_level(ds->level, level_str))
+           continue;
+
+       /* passed all the checks, so it's a match */
+       return TRUE;
+    }
+
+    return FALSE;
+}
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #ifdef PERL_OBJECT
-#define MAGIC_CLASS _wrap_Amanda::Cmdline_var::
-class _wrap_Amanda::Cmdline_var : public CPerlObj {
+#define MAGIC_CLASS _wrap_Amanda__Cmdline_var::
+class _wrap_Amanda__Cmdline_var : public CPerlObj {
 public:
 #else
 #define MAGIC_CLASS
@@ -1732,10 +1838,10 @@ extern "C" {
 XS(_wrap_dumpspec_t_host_get) {
   {
     dumpspec_t *arg1 = (dumpspec_t *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -1760,10 +1866,10 @@ XS(_wrap_dumpspec_t_host_get) {
 XS(_wrap_dumpspec_t_disk_get) {
   {
     dumpspec_t *arg1 = (dumpspec_t *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -1788,10 +1894,10 @@ XS(_wrap_dumpspec_t_disk_get) {
 XS(_wrap_dumpspec_t_datestamp_get) {
   {
     dumpspec_t *arg1 = (dumpspec_t *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -1816,10 +1922,10 @@ XS(_wrap_dumpspec_t_datestamp_get) {
 XS(_wrap_dumpspec_t_level_get) {
   {
     dumpspec_t *arg1 = (dumpspec_t *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -1841,13 +1947,41 @@ XS(_wrap_dumpspec_t_level_get) {
 }
 
 
+XS(_wrap_dumpspec_t_write_timestamp_get) {
+  {
+    dumpspec_t *arg1 = (dumpspec_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: dumpspec_t_write_timestamp_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_write_timestamp_get" "', argument " "1"" of type '" "dumpspec_t *""'"); 
+    }
+    arg1 = (dumpspec_t *)(argp1);
+    result = (char *) ((arg1)->write_timestamp);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_new_dumpspec_t) {
   {
     char *arg1 = (char *) 0 ;
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) 0 ;
     char *arg4 = (char *) 0 ;
-    dumpspec_t *result = 0 ;
+    char *arg5 = (char *) 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
@@ -1860,11 +1994,15 @@ XS(_wrap_new_dumpspec_t) {
     int res4 ;
     char *buf4 = 0 ;
     int alloc4 = 0 ;
+    int res5 ;
+    char *buf5 = 0 ;
+    int alloc5 = 0 ;
     int argvi = 0;
+    dumpspec_t *result = 0 ;
     dXSARGS;
     
-    if ((items < 4) || (items > 4)) {
-      SWIG_croak("Usage: new_dumpspec_t(host,disk,datestamp,level);");
+    if ((items < 5) || (items > 5)) {
+      SWIG_croak("Usage: new_dumpspec_t(host,disk,datestamp,level,write_timestamp);");
     }
     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
     if (!SWIG_IsOK(res1)) {
@@ -1886,18 +2024,25 @@ XS(_wrap_new_dumpspec_t) {
       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_dumpspec_t" "', argument " "4"" of type '" "char *""'");
     }
     arg4 = (char *)(buf4);
-    result = (dumpspec_t *)new_dumpspec_t(arg1,arg2,arg3,arg4);
+    res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
+    if (!SWIG_IsOK(res5)) {
+      SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_dumpspec_t" "', argument " "5"" of type '" "char *""'");
+    }
+    arg5 = (char *)(buf5);
+    result = (dumpspec_t *)new_dumpspec_t(arg1,arg2,arg3,arg4,arg5);
     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpspec_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
     XSRETURN(argvi);
   fail:
     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+    if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
     SWIG_croak_null();
   }
 }
@@ -1920,8 +2065,7 @@ XS(_wrap_delete_dumpspec_t) {
     }
     arg1 = (dumpspec_t *)(argp1);
     delete_dumpspec_t(arg1);
-    
-    
+    ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
   fail:
@@ -1934,10 +2078,10 @@ XS(_wrap_delete_dumpspec_t) {
 XS(_wrap_dumpspec_t_format) {
   {
     dumpspec_t *arg1 = (dumpspec_t *) 0 ;
-    char *result = 0 ;
     void *argp1 = 0 ;
     int res1 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 1) || (items > 1)) {
@@ -1966,7 +2110,6 @@ XS(_wrap_format_dumpspec_components) {
     char *arg2 = (char *) 0 ;
     char *arg3 = (char *) 0 ;
     char *arg4 = (char *) 0 ;
-    char *result = 0 ;
     int res1 ;
     char *buf1 = 0 ;
     int alloc1 = 0 ;
@@ -1980,6 +2123,7 @@ XS(_wrap_format_dumpspec_components) {
     char *buf4 = 0 ;
     int alloc4 = 0 ;
     int argvi = 0;
+    char *result = 0 ;
     dXSARGS;
     
     if ((items < 4) || (items > 4)) {
@@ -2027,8 +2171,8 @@ XS(_wrap_parse_dumpspecs) {
     int arg1 ;
     char **arg2 = (char **) 0 ;
     int arg3 ;
-    GSList *result = 0 ;
     int argvi = 0;
+    amglue_dumpspec_list *result = 0 ;
     dXSARGS;
     
     if ((items < 2) || (items > 2)) {
@@ -2066,7 +2210,7 @@ XS(_wrap_parse_dumpspecs) {
         g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
       }
     }
-    result = (GSList *)cmdline_parse_dumpspecs(arg1,arg2,arg3);
+    result = (amglue_dumpspec_list *)cmdline_parse_dumpspecs(arg1,arg2,arg3);
     {
       if (result) {
         GSList *iter;
@@ -2099,11 +2243,78 @@ XS(_wrap_parse_dumpspecs) {
 }
 
 
+XS(_wrap_header_matches_dumpspecs) {
+  {
+    dumpfile_t *arg1 = (dumpfile_t *) 0 ;
+    amglue_dumpspec_list *arg2 = (amglue_dumpspec_list *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    gboolean result;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: header_matches_dumpspecs(dumpfile,dumpspecs);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpfile_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "header_matches_dumpspecs" "', argument " "1"" of type '" "dumpfile_t *""'"); 
+    }
+    arg1 = (dumpfile_t *)(argp1);
+    {
+      AV *av;
+      int len;
+      int i;
+      
+      if (!SvROK(ST(1)) || SvTYPE(SvRV(ST(1))) != SVt_PVAV) {
+        SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs");
+      }
+      av = (AV *)SvRV(ST(1));
+      
+      len = av_len(av)+1;
+      arg2 = NULL;
+      for (i = 0; i < len; i++) {
+        dumpspec_t *ds = NULL;
+        SV **elt = av_fetch(av, i, 0);
+        if (elt)
+        SWIG_ConvertPtr(*elt, (void **)&ds, SWIGTYPE_p_dumpspec_t, 0);
+        if (!ds)
+        SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs");
+        arg2 = g_slist_append(arg2, ds);
+      }
+    }
+    result = (gboolean)header_matches_dumpspecs(arg1,arg2);
+    {
+      if (result)
+      ST(argvi) = &PL_sv_yes;
+      else
+      ST(argvi) = &PL_sv_no;
+      argvi++;
+    }
+    
+    {
+      /* Free the GSList, but not its contents (which are still owned by SWIG) */
+      g_slist_free(arg2);
+    }
+    XSRETURN(argvi);
+  fail:
+    
+    {
+      /* Free the GSList, but not its contents (which are still owned by SWIG) */
+      g_slist_free(arg2);
+    }
+    SWIG_croak_null();
+  }
+}
+
+
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
+static swig_type_info _swigt__p_GSList = {"_p_GSList", "amglue_dumpspec_list *|GSList *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0};
 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_int = {"_p_int", "int *|gboolean *|cmdline_parse_dumpspecs_flags *", 0, 0, (void*)0, 0};
@@ -2111,8 +2322,10 @@ static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0
 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
 
 static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_GSList,
   &_swigt__p_char,
   &_swigt__p_double,
+  &_swigt__p_dumpfile_t,
   &_swigt__p_dumpspec_t,
   &_swigt__p_float,
   &_swigt__p_int,
@@ -2120,8 +2333,10 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_unsigned_char,
 };
 
+static swig_cast_info _swigc__p_GSList[] = {  {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dumpfile_t[] = {  {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_dumpspec_t[] = {  {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
@@ -2129,8 +2344,10 @@ static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0
 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
 
 static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_GSList,
   _swigc__p_char,
   _swigc__p_double,
+  _swigc__p_dumpfile_t,
   _swigc__p_dumpspec_t,
   _swigc__p_float,
   _swigc__p_int,
@@ -2155,11 +2372,13 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Cmdlinec::dumpspec_t_disk_get", _wrap_dumpspec_t_disk_get},
 {"Amanda::Cmdlinec::dumpspec_t_datestamp_get", _wrap_dumpspec_t_datestamp_get},
 {"Amanda::Cmdlinec::dumpspec_t_level_get", _wrap_dumpspec_t_level_get},
+{"Amanda::Cmdlinec::dumpspec_t_write_timestamp_get", _wrap_dumpspec_t_write_timestamp_get},
 {"Amanda::Cmdlinec::new_dumpspec_t", _wrap_new_dumpspec_t},
 {"Amanda::Cmdlinec::delete_dumpspec_t", _wrap_delete_dumpspec_t},
 {"Amanda::Cmdlinec::dumpspec_t_format", _wrap_dumpspec_t_format},
 {"Amanda::Cmdlinec::format_dumpspec_components", _wrap_format_dumpspec_components},
 {"Amanda::Cmdlinec::parse_dumpspecs", _wrap_parse_dumpspecs},
+{"Amanda::Cmdlinec::header_matches_dumpspecs", _wrap_header_matches_dumpspecs},
 {0,0}
 };
 /* -----------------------------------------------------------------------------
@@ -2219,7 +2438,7 @@ SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
   swig_module_info *module_head, *iter;
-  int found;
+  int found, init;
   
   clientdata = clientdata;
   
@@ -2229,6 +2448,9 @@ SWIG_InitializeModule(void *clientdata) {
     swig_module.type_initial = swig_type_initial;
     swig_module.cast_initial = swig_cast_initial;
     swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
   }
   
   /* Try and load any already created modules */
@@ -2257,6 +2479,12 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
   
+  /* When multiple interpeters are used, a module could have already been initialized in
+       a different interpreter, but not yet have a pointer in this interpreter.
+       In this case, we do not want to continue adding types... everything should be
+       set up already */
+  if (init == 0) return;
+  
   /* Now work on filling in swig_module.types */
 #ifdef SWIGRUNTIME_DEBUG
   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
@@ -2410,7 +2638,7 @@ XS(SWIG_init) {
   /* Install variables */
   for (i = 0; swig_variables[i].name; i++) {
     SV *sv;
-    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
+    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
     if (swig_variables[i].type) {
       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
     } else {
@@ -2422,7 +2650,7 @@ XS(SWIG_init) {
   /* Install constant */
   for (i = 0; swig_constants[i].type; i++) {
     SV *sv;
-    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
+    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
     switch(swig_constants[i].type) {
     case SWIG_INT:
       sv_setiv(sv, (IV) swig_constants[i].lvalue);
@@ -2446,18 +2674,18 @@ XS(SWIG_init) {
   }
   
   SWIG_TypeClientData(SWIGTYPE_p_dumpspec_t, (void*) "Amanda::Cmdline::dumpspec_t");
-  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_DATESTAMP", TRUE | 0x2);
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_DATESTAMP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_PARSE_DATESTAMP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_LEVEL", TRUE | 0x2);
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_LEVEL", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_PARSE_LEVEL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
-  /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do {
-    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_EMPTY_TO_WILDCARD", TRUE | 0x2);
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_EMPTY_TO_WILDCARD", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_EMPTY_TO_WILDCARD)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;