[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/18] str: New function ss_realloc().
From: |
Ben Pfaff |
Subject: |
[PATCH 05/18] str: New function ss_realloc(). |
Date: |
Sat, 19 Mar 2011 17:09:51 -0700 |
---
src/libpspp/str.c | 6 ++++++
src/libpspp/str.h | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/libpspp/str.c b/src/libpspp/str.c
index 7b67722..25e2cfd 100644
--- a/src/libpspp/str.c
+++ b/src/libpspp/str.c
@@ -341,6 +341,12 @@ ss_alloc_uninit (struct substring *new, size_t cnt)
new->length = cnt;
}
+void
+ss_realloc (struct substring *ss, size_t size)
+{
+ ss->string = xrealloc (ss->string, size);
+}
+
/* Makes a pool_alloc_unaligned()'d copy of the contents of OLD
in POOL, and stores it in NEW. */
void
diff --git a/src/libpspp/str.h b/src/libpspp/str.h
index ddfd2f8..c691f9f 100644
--- a/src/libpspp/str.h
+++ b/src/libpspp/str.h
@@ -85,6 +85,7 @@ struct substring ss_tail (struct substring, size_t);
struct pool;
void ss_alloc_substring (struct substring *, struct substring);
void ss_alloc_uninit (struct substring *, size_t);
+void ss_realloc (struct substring *, size_t);
void ss_alloc_substring_pool (struct substring *, struct substring,
struct pool *);
void ss_alloc_uninit_pool (struct substring *, size_t, struct pool *);
--
1.7.2.3
- [PATCH 00/18] rewrite PSPP lexer, Ben Pfaff, 2011/03/19
- [PATCH 01/18] data-reader: Remove unreachable "return" statements., Ben Pfaff, 2011/03/19
- [PATCH 07/18] str: New functions for checking for and removing string suffixes., Ben Pfaff, 2011/03/19
- [PATCH 10/18] i18n: New function recode_string_len()., Ben Pfaff, 2011/03/19
- [PATCH 09/18] i18n: New function uc_name()., Ben Pfaff, 2011/03/19
- [PATCH 14/18] encoding-guesser: New library to guess the encoding of a text file., Ben Pfaff, 2011/03/19
- [PATCH 04/18] output: New function text_item_create_nocopy()., Ben Pfaff, 2011/03/19
- [PATCH 05/18] str: New function ss_realloc().,
Ben Pfaff <=
- [PATCH 13/18] i18n: New functions and data structure for obtaining encoding info., Ben Pfaff, 2011/03/19
- [PATCH 06/18] str: Rename ss_chomp() to ss_chomp_byte(), ds_chomp() to ds_chomp_byte()., Ben Pfaff, 2011/03/19
- [PATCH 02/18] file-name: Do not make output files line-buffered in fn_open()., Ben Pfaff, 2011/03/19
- [PATCH 12/18] identifier: Rename token_type_to_string() and make a new version., Ben Pfaff, 2011/03/19
- [PATCH 08/18] hash-functions: New function hash_case_bytes()., Ben Pfaff, 2011/03/19
- [PATCH 11/18] i18n: New functions for truncating strings in an arbitrary encoding., Ben Pfaff, 2011/03/19
- [PATCH 17/18] scan: New library for high-level PSPP syntax lexical analysis., Ben Pfaff, 2011/03/19
- [PATCH 15/18] u8-istream: New library for reading a text file and recoding to UTF-8., Ben Pfaff, 2011/03/19
- [PATCH 16/18] segment: New library for low-level phase of lexical syntax analysis., Ben Pfaff, 2011/03/19
- [PATCH 03/18] sys-file-reader: Refactor to clean up character encoding support., Ben Pfaff, 2011/03/19