diff options
author | Max Kellermann <max@duempel.org> | 2009-03-17 20:51:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-17 20:51:33 +0100 |
commit | 67e65a7959be0e3dee2fd2023a2c23217c50c1d8 (patch) | |
tree | a824445996a227099337272c5dc6ee7ebf19e1de /src/page.c | |
parent | 47bbb73ee1247a02413acfb66f5e4b7c3a5bc833 (diff) | |
download | mpd-67e65a7959be0e3dee2fd2023a2c23217c50c1d8.tar.gz mpd-67e65a7959be0e3dee2fd2023a2c23217c50c1d8.tar.xz mpd-67e65a7959be0e3dee2fd2023a2c23217c50c1d8.zip |
page: added page_new_concat()
Diffstat (limited to '')
-rw-r--r-- | src/page.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/page.c b/src/page.c index a4f52ae4a..5ea03cd02 100644 --- a/src/page.c +++ b/src/page.c @@ -51,6 +51,17 @@ page_new_copy(const void *data, size_t size) return page; } +struct page * +page_new_concat(const struct page *a, const struct page *b) +{ + struct page *page = page_new(a->size + b->size); + + memcpy(page->data, a->data, a->size); + memcpy(page->data + a->size, b->data, b->size); + + return page; +} + void page_ref(struct page *page) { |