Imported Upstream version 3.2.1
[debian/amanda] / common-src / util.h
index 8c7ea449a2866a39ba57d4e105bab3fa4a9211e9..a0a98e417e780335002a65f4a4db9338db2c3888 100644 (file)
@@ -80,9 +80,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 +337,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 <readline/readline.h>
-#    ifdef HAVE_READLINE_HISTORY_H
-#      include <readline/history.h>
-#    endif
-#  else
-#    ifdef HAVE_READLINE_H
-#      include <readline.h>
-#      ifdef HAVE_HISTORY_H
-#        include <history.h>
-#      endif
-#    endif
-#  endif
-#else
-
-char * readline(const char *prompt);
-void   add_history(const char *line);
-
-#endif
+#  elif defined(HAVE_READLINE_H)
+#    include <readline.h>
+#  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 <readline/history.h>
+#  elif defined(HAVE_HISTORY_H)
+#    include <history.h>
+#  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 *);