Imported Upstream version 3.3.1
[debian/amanda] / perl / Amanda / Util.swg
index 2043b44122b87fddc0dcbae06cb76c9a0d88131d..e325a9e0a918bad8ac0e5ed4bb549f55dc52d3f4 100644 (file)
@@ -209,6 +209,21 @@ sub skip_quoted_string {
     return ($quoted_string, $remainder);
 }
 
+sub split_quoted_string_friendly {
+    my $str = shift;
+    my @result;
+
+    chomp $str;
+    $str =~ s/^\s+//;
+    while ($str) {
+       (my $elt, $str) = skip_quoted_string($str);
+       push @result, unquote_string($elt);
+       $str =~ s/^\s+// if $str;
+    }
+
+    return @result;
+}
+
 %}
 
 amglue_export_ok(slurp);
@@ -330,7 +345,8 @@ GPtrArray *expand_braced_alternates(char *);
 %newobject collapse_braced_alternates;
 char *collapse_braced_alternates(GPtrArray *source);
 gchar **split_quoted_strings(const gchar *string);
-amglue_export_tag(quoting, quote_string unquote_string skip_quoted_string sanitise_filename split_quoted_strings);
+amglue_export_tag(quoting, quote_string unquote_string skip_quoted_string
+               sanitise_filename split_quoted_strings split_quoted_strings_friendly);
 amglue_export_tag(alternates, expand_braced_alternates collapse_braced_alternates);
 
 %perlcode %{
@@ -436,7 +452,10 @@ typedef struct file_lock {
        }
 
        int lock();
+       int lock_wr();
+       int lock_rd();
        int unlock();
+       int locked();
 
        %typemap(in) (const char *data, size_t len) {
            $1 = SvPV($input, $2);
@@ -614,6 +633,16 @@ sub unmarshal_tapespec {
 
 %}
 
+amglue_export_ok(
+    match_host match_disk match_datestamp match_level
+);
+
+gboolean match_host(char *pat, char *value);
+gboolean match_disk(char *pat, char *value);
+gboolean match_datestamp(char *pat, char *value);
+gboolean match_level(char *pat, char *value);
+
+
 /* -------------------------------------------------------------------------
  * Functions below this line are only meant to be called within this module;
  * do not call them externally. */