Code

Merge branch 'db/vcs-svn-incremental' into svn-fe
[git.git] / vcs-svn / string_pool.c
index 8af8d54d6ef41a2e84e500bd0d1a5523e59f8a32..23a9d46522038af0e1e6420a77245b1eb9aa8b3b 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "git-compat-util.h"
+#include "quote.h"
 #include "trp.h"
 #include "obj_pool.h"
 #include "string_pool.h"
@@ -65,7 +66,7 @@ uint32_t pool_tok_r(char *str, const char *delim, char **saveptr)
        return token ? pool_intern(token) : ~0;
 }
 
-void pool_print_seq(uint32_t len, uint32_t *seq, char delim, FILE *stream)
+void pool_print_seq(uint32_t len, const uint32_t *seq, char delim, FILE *stream)
 {
        uint32_t i;
        for (i = 0; i < len && ~seq[i]; i++) {
@@ -75,6 +76,16 @@ void pool_print_seq(uint32_t len, uint32_t *seq, char delim, FILE *stream)
        }
 }
 
+void pool_print_seq_q(uint32_t len, const uint32_t *seq, char delim, FILE *stream)
+{
+       uint32_t i;
+       for (i = 0; i < len && ~seq[i]; i++) {
+               quote_c_style(pool_fetch(seq[i]), NULL, stream, 1);
+               if (i < len - 1 && ~seq[i + 1])
+                       fputc(delim, stream);
+       }
+}
+
 uint32_t pool_tok_seq(uint32_t sz, uint32_t *seq, const char *delim, char *str)
 {
        char *context = NULL;