X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Futil.h;h=0e35bb8ac05f8c9f3dd5ab2cdd469c4a4efe943e;hb=691567b16c13087b31ee4c2b6d038e57872fae82;hp=8c7ea449a2866a39ba57d4e105bab3fa4a9211e9;hpb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;p=debian%2Famanda diff --git a/common-src/util.h b/common-src/util.h index 8c7ea44..0e35bb8 100644 --- a/common-src/util.h +++ b/common-src/util.h @@ -1,6 +1,7 @@ /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1999 University of Maryland at College Park + * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved. * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -30,7 +31,7 @@ #define UTIL_H #include "amanda.h" -#include "sl.h" +#include "am_sl.h" #include #include @@ -80,9 +81,11 @@ char * construct_timestamp(time_t *t); * always adds "" around the string */ #define quote_string(str) quote_string_maybe((str), 0) #define quote_string_always(str) quote_string_maybe((str), 1) +#define len_quote_string(str) len_quote_string_maybe((str), 0); /*@only@*//*@null@*/char *quote_string_maybe(const char *str, gboolean always); /*@only@*//*@null@*/char *unquote_string(const char *str); +/*@only@*//*@null@*/int len_quote_string_maybe(const char *str, gboolean always); /* Split a string into space-delimited words, obeying quoting as created by * quote_string. To keep compatibility with the old split(), this has the @@ -335,26 +338,34 @@ pcontext_t get_pcontext(void); * or prototypes some simple stub functions that are used instead. */ -#ifdef HAVE_READLINE -# ifdef HAVE_READLINE_READLINE_H +#ifdef HAVE_LIBREADLINE +# if defined(HAVE_READLINE_READLINE_H) # include -# ifdef HAVE_READLINE_HISTORY_H -# include -# endif -# else -# ifdef HAVE_READLINE_H -# include -# ifdef HAVE_HISTORY_H -# include -# endif -# endif -# endif -#else - -char * readline(const char *prompt); -void add_history(const char *line); - -#endif +# elif defined(HAVE_READLINE_H) +# include +# else /* !defined(HAVE_READLINE_H) */ +extern char *readline (); +# endif /* !defined(HAVE_READLINE_H) */ + /* char *cmdline = NULL; */ +#else /* !defined(HAVE_LIBREADLINE) */ + /* use our own readline */ +char * readline(const char *prompt); +#endif /* HAVE_LIBREADLINE */ + +#ifdef HAVE_READLINE_HISTORY +# if defined(HAVE_READLINE_HISTORY_H) +# include +# elif defined(HAVE_HISTORY_H) +# include +# else /* !defined(HAVE_HISTORY_H) */ +extern void add_history (); +extern int write_history (); +extern int read_history (); +# endif /* defined(HAVE_READLINE_HISTORY_H) */ +#else /* !defined(HAVE_READLINE_HISTORY) */ + /* use our own add_history */ +void add_history(const char *line); +#endif /* HAVE_READLINE_HISTORY */ char *base64_decode_alloc_string(char *); @@ -381,4 +392,9 @@ void property_add_to_argv(GPtrArray *argv_ptr, GHashTable *proplist); */ void debug_executing(GPtrArray *argv_ptr); +/* execute the program and get the first line from stdout ot stderr */ +char *get_first_line(GPtrArray *argv_ptr); + +gboolean make_amanda_tmpdir(void); + #endif /* UTIL_H */